Jump to content





Star Castle Developments

Posted by Thomas Jentzsch, in Atari 17 September 2012 · 10,827 views

Atari 2600 Programming Star Castle

Since Chris is busy with his RL, I will continue his blog entry about Star Castle Developments here.
 
Source code can be found here.
 
Note: There are still some occasional glitches which I have to sort out. And maybe even a crash. So if you find one, please let me know. Especially if you can reproduce it.
 
Attached is the final build from October 2015 and here the (never ending) DONE and TODO list:

; Explanation:
; - = open
; o = partially
; + = done
; ? = debatable
; x = cancelled

; Arcade Differences:
; - 3..6 lives via dip switches
; x extra lives > 100
; + game speed increases with score, segments, time...?
;.. + gamespeed (0..7) now based on score (increases every 2000 points)
; + ring rotation
;.. + not in sync
;.. + direction moves with ring (TODO: check mines on rings, gun gaps)
;.. + speed moves with the ring
;.. + speeds
;.... + increases with score (not castle)
;.... + reverse rotation at constant speed: 4.7s/loop, (1st castle: middle)
;.... + others: 0..1250 pts: 4.7 (outside)/3.2s (inside); ..2500 pts: 3.2/2.35s; then: 2.4/1.9s
;...... own speed range defined
;.. + offsets are transfered with the expanding rings
;.. o hit sparks (TODO: graphics)
; + killing gun and getting killed costs one life
; + shield kick
;.. + ignores previous speed
;.. + gives new speed
;.. + doesn't reposition
; o ships
;.. + facing left at life start
;.. + start position moves up with each new life? (10 positions, 1st one seems random, 2nd one is bottom + 1?)
;.. ? X and Y speed are NOT linked together
;.. o deceleration is linear and lower
;.. + ship decelerates differently in left/down (100%) than in right/up (~50%) direction!!!
;.. + after castle completed, ship continues at current spot in next castle
;.. + ship bounces during explosion
; o mines
;.. + immediate respawn
;.. + spawn position depends on gun direction (dir - 90°)
;.. + spawn independent from ship direction
;.. o hop back and forth on the rings
;.. + higher homing speed at higher scores (as fast as player's ship)
;.. + homing mine movement has some randomness to prevent mine grouping
;.. + homing mine lifetime varies (lifetime counted on ring too, but only 50%)
;.. + slower turning speed in lower castles
;.. o mines hop much faster in arcade in higher levels
;.. - max. one mine per ring segment
;.. + disappear when they hit a ship
;.. + mines on ring do not kill ship
;.. o hit sparks (TODO: graphics)
; + gun
;.. + shots immediately when there is a gap
;.. x projectile moves a bit faster
;.. + projectile disappears when ship is hit
;.. x starts new gun life at last direction
;.. + starts next ship at last direction
;.. + shots whenever there is space, no matter where the player's ship is
;.. + is turning slower, especially initially
; + bullets
;.. + max. 3 at a time
; o sounds
;.. o siren frequency depending on segments (~65..260Hz):
;.... + intermediate screen (highest pitch, slightly higher than 3)
;.... + 36..28: 0 (lowest pitch)
;.... + 27..24: 1 (slightly higher)
;.... + 23..20: 2
;.... + 19..16: 3 (high pitch)
;.... + 15..12: 4 (reset to between 1 and 2)
;.... + 11.. 8..5 (slightly higher, still lower than 2)
;.... +..7.. 4..6 (slightly higher than 3)
;.... +..3......7 (slightly higher = intermediate)
;.. - homing mines sound
;.. + no sound when hitting segment first time
;.. + thrust sound very low
;.. - projectile sound starts with fire sound
;.. - better sound mapping
;.... - channel 0:
;...... + 2. ship explosion (channel 1?)
;...... + 8. siren
;.... - channel 1:
;...... + 1. gun explosion
;...... + 3. projectile
;...... + 6. bullet fire
;...... + 7. ship ring bounce
;...... + 9. thrust
;.... - both:
;...... + 4. mine hits
;...... + 5. sector hits (channel 0?)
;.... - homing mine sound
; + scoring: 10/20/30 points per segment hit (not per segment destroyed)
; + no leading zeroes
;.. + score
;.. + castle
;.. + ships
;.. + highscore
; ? scores are centered
; + digits are slightly wider
; - ...

; Bugs/TODOs:
; + it seems that the gun is correcting direction after finding a gap but before fireing
;.. this leads to shots going through intact sectors
; + increase vertical screen size (TODO: use gained time)
;.. + define extra stars data
;.. + adjust stars in various screens
;.. + center/resize other screens
; + make ring 1 data ordered like ring 0 + 2 data
; + gun needs gaps in all three rings
; o General task management
;.. + allow individual tasks with priority and order
;.. o adjust parameters of tasks (check if they could be skipped)
; + regenerate if middle ring is empty (test arcade).
; + homing mines broken at higher castles (>=6)
; + explosion too slow (check again when CPU time is reduced!)
; + vector angle gives too coarse results
; + occasional glitch when mine is shot
; - bullet sometimes glitches when it hits (could be same problem as with initial mine?)
; + DIR_SEARCH
;.. x gap found a bit too early (counter clockwise)
;.. + no gap found when GUNDIR = 17
; + occasional reversed intermediate castle/ship graphics
; + first mine glitch (only if thrusting or fireing!?)
;.. resulted from following order: 1. x-pos mine; 2. create mine; 3. display mine
; + thrust sound corrupted
; + thrust sound set to lowest possible frequency and made 50% louder
; + siren twice as loud
; ? bullet/ring check may have flaws
; + occasional single pixel glitch on empty ring segments
; + another occasional single pixel glitch at start of new life (reason: odd without even rotate)
; + empty high score initials ... (instead of aaa)
; + difficulty switches fixed at start of game (4 different high score tables)
;.. o make different high socre tables identifialble (colors only so far)
; + stop gun shooting when ship is exploding
; o more ring colors
;.. + 8 different sets
;.. o define colors
; o mine graphics (maybe slower?)
; + thrust sound broken after gun explosion
; + occasional crash!!! (X used in CheckRegenerate)
; + fixed last color mode remembered
; o check PAL colors on real hardware
; o mine explosion graphics? (code done, graphics todo)
; + add "arcade" to the title graphics
; o pulse red part of the title graphics in sync with music
; + (c) 201*3* (fixed "3" font)
; x new ship must not start at blind gun spot (but arcade does too)
; + highlights in small letters M and W and score 4
; + adjusted flashing text on/off ratio
; x vary ship's thrust display frames %10 -> e.g. %101
; + white vertical line before highscore
; - more gun explosion animations
;.. o gain space
;.. o optimize overlapping
;.. - implement new data
; - ...

; Ideas:
; + transfer colors with rings too
;.. + gun changes color too, is that OK?
; - PAL50 timing option
; + smaller ship to allow better manouvering?
;.. + data (ship, ship + flames)
;.. + offset
;.. + reflection
;.. + projectile collision
; + use direction search for mine/bullet ring hits
; x using VDELP0 to move ship smoother vertically (not possible)
; ? reverse display of double hit segments (dotted = complete, full = hit once)
;.. o done, but is it a good idea?
; + increase some difficulties 1000 points earlier (kick chance, gun turning)
; x better do 16 difficulties for those?
; - reduce maximum ring rotatation speed (saves CPU time)
; + rename "Wave" into "Castle"
; ! adjust scanlines
;.. + AA logo
;.. + title
;.. - Melody load
;.. - hishscores
;.. + game
;.. + messages

Attached Files






I found a blind spot, when you start a game, don't move the ship, just rotate 3 times to right and fire, the enemy cannon will never hit you.
  • Report

I found a blind spot, when you start a game, don't move the ship, just rotate 3 times to right and fire, the enemy cannon will never hit you.

Infinity pause?
I just tried Build 72 on real hardware. Got to Level 8, 16,250. Fun!
What to say? It is unbelievable. It is Star Castle on Atari 2600. (Nice adding Arcade and 2013 :thumbsup: )
This is one of the finest 2600 programs of all time. Great work!
  • Report
The blind spots are likely due to the cannon only being able to aim in 32 directions. I don't know if it can fire in between those angles or not.
  • Report

I found a blind spot, when you start a game, don't move the ship, just rotate 3 times to right and fire, the enemy cannon will never hit you.

Those blind spots exists in the arcade version too. The targeting of the gun is not 100% perfect and, like Nathan said, it can only aim in 32 directions. But the mines won't let you rest there for long anyway. :)

And I will make sure that a new ship never starts at a blind spot.
  • Report

Infinity pause?

Try the B/W switch.
  • Report
With a little help from a friend (thanks Ivan!), I have improved the siren sound. You find a new ROM (siren_004.bin) at the 1st post.

The ROM plays the 8 fixed frequency steps (depending on the sectors remaining) of the arcade original and the transitions in between. The current frequency step is displayed as binary code (0..7) by playfield bars. Their color indicates if the frequency is moving up (green), down (red) or stationary (brown). You can change the step by moving the joystick left and right.

Please LMK what you think.
  • Report
Like I said via PM it's perfect to me.
I think you can delete the file starcastfx.bin because it's useless now. ;)
  • Report
Done. I removed some older files and replaced them with the latest builds.
  • Report
You didn't like the smaller ship?
The "siren" really ramps up the tension!
  • Report
The smaller ship is still being worked on.
  • Report
Smaller ship is finished (thanks Nathan!). I have posted new ROMs.

Please give me feedback which ship you prefer.
  • Report
I preffer the old one.
  • Report
I like the old one better, (unless you can make a smaller single line vector one like in Space Rocks).
  • Report
The problem with the Star Castle ship, is 1) it's a 2 line kernel (Space Rocks is 1LK), and 2) the original shape doesn't lend itself well to being "hollowed out" at low resolutions (Asteroids used a nice, simple triangle).

Posted Image

The old one is 7x7 pixels (not counting engine flame). The new one is 6x6. So a lot of the detail was lost. That's a 15% reduction in size. That also means that it's harder for the enemy to hit.

I prefer the look of the old one myself, since it's more in keeping with the arcade game. That said, I think the new one is better scaled to the rest of the game. I need to play them both some more. The real question should be - which one plays better?

Here's the arcade game in action - the castle is pretty huge relative to the player's ship:

  • Report
Just catching up on the rest of this thread (sorry... been busy with other projects).
  • Love the siren_004.bin! Really nails that distinctive sound.
  • I'd like to see an option (somewhere) to enable arcade colors only. The changing and transferring ring colors are nice additions, but from an arcade re-creation standpoint, I'd like to be able to play just using the standard "overlay". :)
  • I'll work up some animated sparks. I had mentioned something like that to Chris, but at the time we were seriously running out of space.
  • I'd like to add a vote for adding "hit sparks" when shooting the rings. I think it would probably be worth the flicker, since it would only need to be maybe 2 frames long. It's very, very short in the arcade game. I'll work up a sprite for it, and hopefully it can be included as a test.
  • Regarding sound effects for the sparks - you can download audio samples of the original arcade game here. Might help in re-creating them.
  • I'd like to revise the player's ship exploding. I've never been completely happy with it. That said - Thomas, can I make that explosion taller? I'd like more room for the debris to trail off (similar to Space Rocks).
  • Is it possible for the enemy ship to be the same color as the inner ring? I know it's actually a mix of two different colors, so I suspect there's not enough time there for the additional color change. But I thought I'd ask. :)
  • Finally, if space is available, I'd really, really like to be able to add a few more frames back into the castle's explosion, to smooth it out a little more. It looks really choppy.
  • Report

The old one is 7x7 pixels (not counting engine flame). The new one is 6x6. So a lot of the detail was lost. That's a 15% reduction in size.

Actually that' not 15% but ~3627% (36/49).

That also means that it's harder for the enemy to hit.

...That said, I think the new one is better scaled to the rest of the game. I need to play them both some more. The real question should be - which one plays better?

That's exactly my intention with the smaller ship. The smaller the ship, the more chances you have to evade the homing mines.

So the question is (like Nathan said): Which plays better?
  • Report
Math was never my strong suit. (Would it be 15% reduction in width?)
  • Report
2nd try, my office laptop crashed during the first one. :(

Love the siren_004.bin! Really nails that distinctive sound.

I really hope it will work and not become annoying over time.

I'd like to see an option (somewhere) to enable arcade colors only. The changing and transferring ring colors are nice additions, but from an arcade re-creation standpoint, I'd like to be able to play just using the standard "overlay". :)

I could increase the number of color options from 3 to 5 (NTSC and PAL), but how can I make that recognizable for the user? Ideas are welcome!

I'd like to add a vote for adding "hit sparks" when shooting the rings. I think it would probably be worth the flicker, since it would only need to be maybe 2 frames long. It's very, very short in the arcade game. I'll work up a sprite for it, and hopefully it can be included as a test.

Definitely. But I suppose it will be only one frame, since the 3 mines flicker at 20Hz. So that's already 3 frames then. Or should we do 6 frames?

Regarding sound effects for the sparks - you can download audio samples of the original arcade game here. Might help in re-creating them.

Thanks, but I have them already. I also found it useful to remove some samples from the zip file, so that you can better record the remaining ones.

I'd like to revise the player's ship exploding. I've never been completely happy with it. That said - Thomas, can I make that explosion taller? I'd like more room for the debris to trail off (similar to Space Rocks).

I am afraid there is no space for anything larger than 8x8 pixel. But you can more that area around a bit, if that helps.

Is it possible for the enemy ship to be the same color as the inner ring? I know it's actually a mix of two different colors, so I suspect there's not enough time there for the additional color change. But I thought I'd ask. :)

You guessed right. :D

Finally, if space is available, I'd really, really like to be able to add a few more frames back into the castle's explosion, to smooth it out a little more. It looks really choppy.

That's pretty tough. Each frame needs up to 200 (data) + 2 (pointer to data) bytes (less with overlapping data or empty areas). The current explosion needs ~2040 bytes in total with 17 frames. So the average is about 120 bytes.

The bank has just 220 bytes left (in 9 pieces, the largest being 100 bytes). So unless you optimize your explosions for overlapping data, I can just squeeze in maybe two or three additional frames.
  • Report

Math was never my strong suit. (Would it be 15% reduction in width?)

Yup. But the area was 7x7 and now is 6x6 (assuming a square object), so the small size is ~73% of the large one and the large size is ~136% of the small one.

To be more precise one could count the average number of pixels enabled (including hollow areas) for both ship sizes. :D
  • Report

I'd like to add a vote for adding "hit sparks" when shooting the rings. I think it would probably be worth the flicker, since it would only need to be maybe 2 frames long. It's very, very short in the arcade game. I'll work up a sprite for it, and hopefully it can be included as a test.

I think a not animated spark played by 3 frames, I mean, due flicker, frame 1 = spark, 2 = ship, 3 = spark, 4 = ship and 5 = spark.

I'd like to revise the player's ship exploding. I've never been completely happy with it. That said - Thomas, can I make that explosion taller? I'd like more room for the debris to trail off (similar to Space Rocks).

How about setting p0 as double wide (can be made outside of kernel) and using missiles and balls for debris? The kernel support up to 6 dots, just setting the mines as single pixel wide going down the player explosion and make the player shoot 3 missiles to up.
  • Report

Search My Blog

Recent Entries

Recent Comments

April 2019

S M T W T F S
 123456
78910111213
14151617181920
212223 24 252627
282930    

Categories

0 user(s) viewing

0 members, 0 guests, 0 anonymous users

Latest Visitors