๐Ÿ’พ Archived View for bbs.geminispace.org โ€บ u โ€บ stack โ€บ 21326 captured on 2024-12-17 at 15:55:02. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Comment by ๐Ÿš€ stack

Re: "Write an NES game..."

In: s/Bucket-List

Moving right along. Created the playfield. (LaGrange will stretch the pic, so it is a bit odd looking, but it's good, trust me).

โ€” /u/stack/image/352.png

Since you have to make everything out of a fixed set of tiles and palettes, this is really fiddly. The tools are sucky -- I imagined in 40 years it would be a little easier...

On the positive note, it is not a mockup -- it loads on the emulator, and the objects are real sprites. Nothing moves yet, but still, not a bad start.

๐Ÿš€ stack [OP/mod]

Oct 30 ยท 7 weeks ago

7 Later Comments โ†“

๐Ÿฆ‚ zzo38 ยท Oct 30 at 02:44:

I use Mednafen as the NES/Famicom emulator and also many others. I could not install Wine, due to package manager conflicts, but can also run programs in DOS and others.

I would also want to see, if someone make up (FOSS) Pokemon battle simulator with NES/Famicom, even with 2 players. The team can be edited by keyboard and saved/loaded by a tape, and then players will have to select the command without knowing what command will be selected by opponent.

โ˜ฏ๏ธ dragfyre ยท Oct 30 at 12:51:

this is awesome.

๐Ÿš€ stack [OP/mod] ยท Nov 06 at 21:54:

A couple of all-nighters, and I can drive the Wummel around and shoot.

The targs (enemy arrow-like things) are not yet doing anything. But I do have a generic collision detector, so I just have to come up with some simple AI for them to decide on directions.

Also, the spectar smuggler, scoring, and overall game managment...

๐Ÿš€ stack [OP/mod] ยท Nov 09 at 19:26:

My ADHD has been atrocious and I've been unable to motivate myself lately. I suppose the stupid elections were a steady load of all kinds of dread. But that is just an excuse. I would sit down, look at the all-too-complicated logic for the Wummel, think about how I should really replace it with a lookup table, procrastinate some more, play a game of farkle and go sit in the bathtub.

๐Ÿš€ stack [OP/mod] ยท Nov 09 at 23:10:

Tons of ugly logic which looks at the current direction, speed, position, and the controller, and figures out what the next direction and speed should be -- maybe 150 instructions with spaghetti logic and a few small lookup tables... replaced.

A neat 64-byte lookup table - and a handful of instructions to look up and update next state.

Why was it so hard? Fiddling with a 5-dimensional table that yields 3 bits is painful and error-prone. The problem is that once you figure it out, you realize that you want to change how the lookup works because it saves many instructions, but there is no tool that lets you symbolically manipulate and reorder a table that works. So you wind up doing awful cut-paste of bits, knowing there will be hard-to-catch errors...

I almost cranked up Common Lisp to write a generic state machine builder which lets you generate tables any way you want once the data is in... But stopped myself for now. Maybe next project.

๐Ÿš€ stack [OP/mod] ยท Nov 10 at 03:30:

OK, this is incredibly fun!

6502-fu is coming back to me. I am ripping through my code, cleaning and optimizing. It's amazing what you can do when you start thinking that way.

For instance I had a subroutine which checked if the Wummel is at an intersection. It looked decent, maybe 10-12 lines of assembly, maybe 25 cycles. But, another 6 cycles each to call and to return! Inlining it saves 12 cycles. Then, only positions divisible by 8 can maybe be intersections. 7 out of 8 times a moving Wummel can quickly rule out an intersection. Optimizing the fast check to 7 cycles, while the longer case takes 22 cycles averages out to 8.875 cycles per check -- much faster than a call/return that does nothing!

And that's just a simple optimization. The real fun is realizing that by restructuring code, or lookup tables, or whatever -- you can cut the code by an order of magnitude! I just did that in the Wummel control code. And that is just pure joy.

I feel like my brain was built for this. I love every second of it. Doing it on modern machines is silly (I can't help myself anyway, most of what I write on x86 is under 20 kilobytes).

๐Ÿš€ stack [OP/mod] ยท Dec 06 at 15:24:

Haven't updated for a while, as I took off to NYC for a bit...

Last session I got pretty much everything moving, and collision detection working. A bit messy still.

I also don't know where to begin with sound fx. Seems that libraritis started already back in NES days, and there are no guides on how to make sounds -- everyone uses some sort of interrupt-driven library...

will get back to it soon...

Original Post

๐ŸŒ’ s/Bucket-List

Write an NES game... โ€” I've done a bit of 6502 programming, and as a teen, wrote some game code snippets on an Atari800 and an Apple ][... By the time the NES came out I was busy dropping out of high school, hanging out with the wrong people, etc. Eventually jumped back into coding 68K machines, and entirely missed the NES until my kids started gaming. I've always looked at it enviously, as the NES represented the high point of 8-bit game machines, possibly all game machines, beautifully...

๐Ÿ’ฌ stack [mod] ยท 12 comments ยท 6 likes ยท Oct 27 ยท 7 weeks ago