Friday, October 4, 2013

Treasure Run postmortem

As I mentioned the Mini-Ludum Dare last post, it should be no surprise that this fortnight is the postmortem of my efforts.

What Went Right

I love 65xx assembly language. It has been decades (damn, that makes me feel old) since I last used it yet the instruction set is so simple that I was back to programming it with very little effort. This would very likely not be the case for the Pentium line of processors in use today. I have yet to try writing ARM assembly language so that might be nicer. Still, I would recommend that anybody who wants to learn assembly language should probably start with the 6502 so they can learn the core concepts before going on to more modern processors. I know from experience that while the instruction set may not transfer, once you know one assembly language it is very easy to pick up other ones. I suppose one could argue that the Z80 is also fairly easy to learn and it has an instruction set that is closer to the Pentium one but my point would be to learn on a simple chip so you get the core concepts down before trying to take on modern behemoths.

Mixed Blessings

As those of you who read my previous post already know, I discovered that the NES worked quite different from the Commodore 64. The C64 shared memory with the VIC-II and the SID chips. You would simply write to a chunk of memory that the graphic chip accessed (this was flexible allowing you to place screen and tileset memory in which bank you wanted). The downside to this was that the more advanced graphics mode would eat up a lot of your available RAM. With the NES, the PPU has it's own memory which has to be set by going through a small number of port addresses. This is not overly difficult to work with, just different. Instead of copying data from one memory address to another, you simply set the high-low address in the port and then continually write data to another port as the address is automatically incremented for you. The lesson here is simply that different hardware is different.

What Went Wrong

My original game was going to be one large map that would take advantage of the NES scrolling hardware. The problem is that without using a memory manager, the scrolling is limited to only two pages aligned horizontally or vertically. I didn't want to get into memory managers for my first NES game so opted instead for single page maps. I am not sure this is that big of a loss, but I may have to experiment with memory managers in the future and create a larger map. I suppose what I could have done was keep my larger map idea and simply switch screens when the player walked off the edge of the screen but I never thought of that at the time.

Overall, I think learning a new platform and writing a game in assembly language in under a week is not that bad. I actually kind of like the NES so may play around some more with it taking advantage of Memory Managers for proper 4-screen scrolling and learning to use the sound chips. Of course, with so many other things I want to do, this may never happen but we will see.

No comments: