Jump to content
IGNORED

Hello 2600 Homebrewers


Recommended Posts

Hello 2600 Homebrewers,

 

I had a slew of questions just a few days ago, but I'm happy to say
they've all been preempted by the quality of this forum's archives and member blogs. The quality of discourse on this forum is very encouraging. Thank you all.

 

Encouraged, I'm embarking on my first homebrew game. Here are my assumptions so far for this endeavour, feedback is of course welcome:

 

Language: Assembly. I haven't coded for the 6502 in more than forty years,  I'm almost drowning in waves of nostalgia just thinking about it. :)


ROM Size: 4k, "Just right" -- Goldilocks.


Video: Initially NTSC, later I'll attempt PAL and SECAM conversions as a separate learning experience.


Topic: For a first go, I've decided to try my hand at a two-player top-down racer, something similar to Indy 500, but probably sail boats rather than cars.

Not very exciting I know compared to most homebrew offerings, but as a learning experience I prefer to start with the relative simplicity of two player objects updated just once per frame. You've gotta grok before you can run. 


Controls: Joystick(s).


Refinements:

  • Single player vs "AI" mode.
  • Procedurally generated race course (nothing fancy, just the locations of a handful of buoys).
  • Semi-random wind/weather changes.
  • "Wacky races" options.

 

Cheers,

 Mark

  • Like 8
Link to comment
Share on other sites

Good luck. The community will help you out if you decide to post in-progress ROMs and source code. Don't be shy to ask questions; there are many knowledgeable people here who can help out... particularly when it comes time to optimisation and cramming in functionality. Learning '2600 takes time - small steps, and be proud of even the smallest thing; it's a challenge.

  • Like 5
Link to comment
Share on other sites

Thank you for the words of welcome and encouragement Andrew and those who PM'ed me.

 

I'm attempting my first baby-step experiment. The purpose of which is to prove to myself that I can position a sprite precisely on an NTSC 160x192 display. Basically a yellowish placeholder sprite starts a the bottom left of the display and marches each frame (left to right along a row, then wrap to the next, eventually reaching the top right where it wraps back to its starting point.

There's also another brownish placeholder sprite just sits at the lower left corner

doing nothing.

 

I'd appreciate any feedback as to whether this test works to spec (I don't own a physical 2600 yet).

 

Also I'm uncertain if I'm interpreting the Stella's frames-per-second readout correctly. It does reach 60.0 fps (after initialization) but the numbers sometimes shimmer. I'm not sure if the shimmering is an artefact of the emulation, or if I'm not reliably producing 60 fps .

 

Cheers,

 Mark

Match_Race_2600_baby_step_1.bin

Link to comment
Share on other sites

39 minutes ago, The Brew that is True said:

Also I'm uncertain if I'm interpreting the Stella's frames-per-second readout correctly. It does reach 60.0 fps (after initialization) but the numbers sometimes shimmer. I'm not sure if the shimmering is an artefact of the emulation, or if I'm not reliably producing 60 fps .

NTSC is not actually 60 Hz; it's something like 59.97 Hz. In any case, you are producing a 262 scanline frame, consistently, which is correct.

You can place great trust in Stella as an accurate emulator of hardware; if it looks Ok in Stella it's most likely OK on actual hardware. i rarely run my in-progress work on actual hardware, as I have very high confidence in the emulators I use (my main one is Gopher2600).

  • Like 3
Link to comment
Share on other sites

I had the opportunity to take another baby step this morning.

 

As luck would have it I happened onto an excellent Youtube video series on programming the 2600 (the one linked to below covered joystick input in particular). 

 

My proof of concept for this morning is an attempt at turning "sailboat" placeholder sprites using joystick taps. Tap left to turn 45° left, and right to turn 45° right. In this test the sprites aren't moving just spinning in place, in the eventual game the speed of forward movement will depend on the wind and the boat's attitude relative to the wind.

Since I don't yet have a joystick, I only tested this on Stella using keyboard keys mapped to joystick directions. Seems to work, it might not seem like much of course, but I'm having a blast learning the 2600 and revisiting the 6502.

 

 

 

Match_Race_2600_baby_step_2.bin

  • Like 2
Link to comment
Share on other sites

Didn't get a chance to program this morning. I ended up splitting my morning coffee time between learning about points of sail and pinning down the 2600's pixel aspect ratio.

 

Looks like I'll use scanline height as unit distance, with scanline height ≈ 0.6 color clocks for NTSC, and scanline height ≈ 0.5 color clocks for PAL. I assume the SECAM pixel aspect ratio is the same as PAL, but I haven't looked into it yet.

 

Hopefully I'll get some time soon to put together a rudimentary proof of concept of wind-relative movement.

 

As an aside, it just occurred to me that one of my favourite racing boardgames was Circus Maximus. I wonder, has chariot racing been done on the 2600?

 

 

Link to comment
Share on other sites

I spent this morning's coffee time :sleep:precalculating  a tentative set of trajectory scalings.

This set is premised on capping per-frame onscreen boat movement so that I can rely entirely on hardware-based collision detection (boat vs. land, vs. buoys, and vs. the other boat).

If it turns out the cap makes gameplay too slow then I'll need to take a closer look at design tradeoffs vis-à-vis collision detection.

 

 

draft_design_notes_scaling.txt

Link to comment
Share on other sites

27 minutes ago, The Brew that is True said:

Spent my last two morning coffees dealing with the "edge of the world", can't have boats sailing off into oblivion. ?️

 

Some folks believe that if you sail off one edge, you sail right back on the other side without so much as changing direction. It's not called the edge of the world for nothing. The fools!

 

  • Like 2
  • Haha 3
Link to comment
Share on other sites

3 hours ago, Andrew Davie said:
3 hours ago, The Brew that is True said:

Spent my last two morning coffees dealing with the "edge of the world", can't have boats sailing off into oblivion. ?️

 

Some folks believe that if you sail off one edge, you sail right back on the other side without so much as changing direction. It's not called the edge of the world for nothing. The fools!

 

You can't sail off the edge of the world, because there is a wall of ice around the world (as is known in well-informed circles).

 

  • Like 1
  • Haha 3
Link to comment
Share on other sites

Finally, here's baby-step #3, a bare-bones test of wind-relative movement.

 

In the eventual game the wind can change direction, but for this test the wind fixed as Westerly (i.e. it blows from the West towards the East).

Each boat can face in one of 8 compass directions (North .. North-West in increments 45 degrees.).

Tap the joystick left to alter your boats heading one point to port, tap it to the right to alter the boat's heading to starboard.

A boat's current speed varies with its current point of sail (i.e. its heading relative to the wind). A boat in irons (facing directly into the wind) can't advance at all, it can only alter its heading. In this situation slow forward progress into the wind can be made by tacking back and forth across the wind.

Each compass point away from the wind further increases a boats speed.

 

An edge-of-world check should prevent the boats from exiting the screen.


Much is still missing from this test:
- deploying a spinnaker for a further speed boost
- collisions
- islands
- buoys to regulate the race course trajectory
- a visual clue of the wind's current direction
- blanketing the opponent's wind
- "AI" opponent

- replacing the placeholder sprites
- game variants
 

Any feedback is appreciated of course.

Match_Race_2600_baby_step_3.bin

Edited by The Brew that is True
  • Like 2
Link to comment
Share on other sites

This morning I'm experimenting with the playfield registers. My goal is to gauge a practical playfield "line-height". For this experiment the playfield is reflected, the contents of playfield registers are arbitrary (i.e. reset values) and are inverted every 4 scanlines resulting in a migraine-inducing semi-checkerboard pattern.  

 

I assume I'll need to raise the playfield "line-height" to a minimum of 6 scanlines to do anything more sophisticated than this bare-bones playfield experiment while still maintaining single-scanline precision for the movement of the player boats. 

 

Match_Race_2600_baby_step_4.bin

  • Like 1
Link to comment
Share on other sites

This morning's focus is to test the combination of:

  • a single-line kernel for the player boats
  • a four-line kernel for the playfield

 

As before:

  • There's still no collision detection.
  • The wind still doesn't change, it only blows from the West to the East.
  • There are still no buoys on the playfield.
  • Etc...

Match_Race_2600_baby_step_5.bin

  • Like 1
Link to comment
Share on other sites

Haven't made much progress so far this week. This new baby step adds randomly occurring clockwise changes to wind direction. The center island now contains a symbolic wind vane that displays the direction from which the wind currently originates.

 

Next up will probably be collision detection.

Match_Race_2600_baby_step_6.bin

  • Like 2
Link to comment
Share on other sites

This morning I added collision detection (player/player and player/playfield) and a bare-bones collision recovery routine for experimentation. I spent the rest of my time watching the myriad ways boats can get stuck in infinite collision loops. I need to come up with a sensible way of dealing with all these edge cases. :ponder:

Link to comment
Share on other sites

1 hour ago, The Brew that is True said:

This morning I added collision detection (player/player and player/playfield) and a bare-bones collision recovery routine for experimentation. I spent the rest of my time watching the myriad ways boats can get stuck in infinite collision loops. I need to come up with a sensible way of dealing with all these edge cases. :ponder:

Just have both boats lodge a protest to the America's cup committee and have the committee always decide in favour of the American boat. Just like they did in real life ;)

  • Like 2
  • Haha 1
Link to comment
Share on other sites

It dawned on me this morning (in a sudden jolt clarity that only a Monday morning double-espresso can impart) that I'm still using the lower-left "sprite" corner as pivot point, a totally arbitrary and temporary expedient. I double-checked some of my old age-of-sail board wargames, e.g. WS&IM, they all use the bow as the pivot point (while interestingly some of the ancient naval games, triremes and such, use the stern as pivot point). Anyway, I added bow pixel pivoting to my to-do list.

 

Link to comment
Share on other sites

I haven't had spare time to work on the player/playfield and player/player collision recovery. I'm still not clear what would make a good design.

 

I did get a chance to add "bow" pixel pivoting, i.e. when you turn a boat the sprite pivots about its bow (front).

Had fun testing it with the emulation speed to set to 1000%. :ahoy:

 

 

Match_Race_2600_baby_step_7.bin

Edited by The Brew that is True
  • Like 1
Link to comment
Share on other sites

13 hours ago, The Brew that is True said:

I haven't had spare time to work on the player/playfield and player/player collision recovery. I'm still not clear what would make a good design.

 

I did get a chance to add "bow" pixel pivoting, i.e. when you turn a boat the sprite pivots about its bow (front).

Had fun testing it with the emulation speed to set to 1000%. :ahoy:

Looking forward to playing this with Darcy on ZPH when there's collision and scoring as he has his own sailboat, he's going to love it!

 

Here's me at the wheel of Darcy's boat!

 

- James

 

IMG_9183-altered.thumb.jpg.42f163ba58523caa5c1dd0e7a97e521d.jpg

  • Like 2
Link to comment
Share on other sites

45 minutes ago, ZeroPage Homebrew said:

Looking forward to playing this with Darcy on ZPH when there's collision and scoring as he has his own sailboat, he's going to love it!

 

Here's me at the wheel of Darcy's boat!

 

- James

 

IMG_9183-altered.thumb.jpg.42f163ba58523caa5c1dd0e7a97e521d.jpg

That is so cool James! :cool:

 

I very much appreciate the encouragement, and I look forward to you and Darcy giving the eventual game a spin, that gives me a nice milestone to shoot for.

 

I expect it'll be some time before I have anything playable. Spare time is scarce and I have much to learn on all fronts of 2600 development, including getting a feel for what would make for enjoyable gameplay.

 

Cheers

 Mark

  • Like 1
Link to comment
Share on other sites

20 hours ago, The Brew that is True said:

I haven't had spare time to work on the player/playfield and player/player collision recovery. I'm still not clear what would make a good design.

 

Sinking is always an option.

 

you could implement "distance buffers" around each boat, and simply not allow a boat to move if the buffer would cause a collision. That's of course if you're using software collision code - which I would be doing.  So, calculate object position - check collision - if no collision, move object to that position. With a (circular) distance buffer around the boat, you'll always be able to turn around and steer out - admittedly sometimes difficult against prevailing winds. 

 

The concept, anyway, is that there are never collisions, but just collisions that are avoided by disallowing movement before the collision happens.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...