Tuesday, June 6, 2017

Blaster MetroidVania

Well, I've been working on the next game, but not saying much.  Mostly because the majority of my free time involves working on fixing things in my new house, or getting ready for the arrival of a new baby in a couple weeks.  So when I do manage to squeeze in some development, I don't have time to say much about it.

That said, I've found someone to collaborate with on the next game, so things are moving forward!  We're doing a metroidvania-style Blaster Master-inspired adventure.

First things first, while Frankengraphics is working on some preliminary art, I'm trying to get a scrolling engine working.  Which on the NES, is a beast.  The nametables (the chunk of video memory that tells the graphics chip which background tiles to draw where) work somewhat similarly to how they worked on the GBA, but with a few things that make the whole thing more complicated, the primary ones being a slow processor, and a slow and unwieldy method for accessing video memory.

The biggest hassle is doing the math to keep track of what address corresponds to what location on the screen, once the screen starts scrolling around.  I won't go into detail now (I'm too tired -- see this post from Spacey McRacey which talks about some of it), but it's math that's simple until you have to do it quickly on a primitive 6502.

All that to say, getting a multidirectional scrolling engine working isn't quick work.

Tonight, I got fed up with trying to debug my function that renders a new column of tiles when scrolling left or right, and decided it was time to add some on-screen debugging.  Usually with any project, there's a point where I get fed up enough to write some decent on-screen debugging features, and that time is now.  The trick is, because I'm trying to debug background tile rendering, I need to make my debugging tools use sprites instead.  So while normally a text system on the nes is rendered using background tiles (because the nes can only render 8 sprites per scanline), I'm going to display it using sprites for now.  Which means no matter how badly I goof up the background layout, I should be (in theory) able to see debug information on the screen as sprites.

I haven't gotten very far with the debugging system yet.  Mainly because I don't have any sprite code at all yet, so I need to start from zero.  That was tonight's goal: get some basic functions set up for rendering general sprites.  Then next time I can add some debug functions that dump data to the screen.

Ok, bedtime.  I realize this post has been pretty rambly and incoherent.  I guess that means I'm tired.

Monday, May 1, 2017

Sixer problems

Well, once again the folks at AtariAge are smart.

The usual cause of this problem is accidentally reading from a write-only register.  On many systems, this will return the address you are trying to read from, but some will give garbage.  But it's an easy mistake to miss:

lda #13 ; loads the value 13 into the accumulator
lda 13  ; loads the value at memory location 13 into the accumulator
; (which actually is a write-only register, so on some systems will accidentally load 13 into the register, but others will load garbage)

There's actually a setting in Stella (the emulator) that lets you force it to return garbage when reading from these registers, so by setting that flag, I can reproduce the problem that happens on the sixers.  And knowing what sort of typo to look for, I can probably sort this out relatively quickly.

Sunday, April 30, 2017

Atari Anguna: bugs on a sixer

First, a brief bit of Atari history:  The original Atari 2600s had 6 switches on the front -- the power, B/W, Select, Reset, and one difficulty switch per player.  Later models moved the difficulty switches to the back.  All the Atari versions now have goofy names that the collectors call them.  The original "heavy sixers" were bigger and heavier than the "light sixers" but both are sixers (having the 6 switches).  You could also have a 4-switch "woody" (that still sported the awesome late 70's wood-grain), or the darker "vader".  Or poor saps like me have the cheap little re-released Junior.

Well, I had only tested Anguna on my Junior, and a 4-switch woody (and in the Stella emulator).  It worked fine, so I figured we were good (theoretically, all the models are supposed to work the same).

Well, I just found out that that's not the case.  The main character doesn't animate correctly on the sixers.  I'm not completely sure what to do about it -- how do I debug a problem that only shows up on hardware I don't have?

Current possibilities, from least to most painful:

  1. Somebody on the AtariAge forums has a guess about a possible difference in the hardware, and I can just go fix it (this would be a long shot)
  2. Get a sixer.  That means either buying one (maybe $50 if I'm lucky) or borrowing one.
  3. Make changes. Email them to someone with a sixer. Wait for report. Try again.
Ugh.

Saturday, April 22, 2017

Why retro games?

Recently my friend Bryan asked the question "Have you written before about what motivates you to create retro games?"

I've somewhat hinted at it a few years ago, but there's a few reasons:

Nostalgia is one piece of it. I grew up playing Atari and NES, and so the idea of being able to make a quality game for the system I grew up with is really fun.  As a kid, I wondered what it was like to make games for these systems, and spent hours sketching game designs on paper.  It's fun to finally get to do what I dreamed about back then. (I've wanted to make a NES game ever since the system first came out. After 30 years of preparation, I finally feel like I can pull it off!)

Another factor is the challenge, and how different it is from my day-to-day work programming.  I like programming, but the change of being so close to the hardware is a nice change..  The problems are somewhat similar to what I might solve at work, but really different in actual code.  And learning how new (old) video game systems work is not only a fun challenge, but also interesting from a history/nostalgia persepctive. (ie "oh, THAT'S how and why they did that on that game!").  Add in some crazy limitations (only 76 processor cycles per scanline!?) and you have a good fun technical challenge.

Really, the biggest reason, though, might be about the community involved.  For modern platforms (PCs, phone games, etc), the indie market is incredibly flooded right now. There are tons and tons of games being created all the time.  While there are a few crazy success stories like flappy bird, the vast majority of indie games don't really ever get noticed.  So you either pick a goal of just trying to be financially profitable (which requires more commitment than I'm willing to make right now, and a team of artists, musicians, etc), or just be happy making a goofy little game for the fun of it (which is what I did with Robo-Ninja).

In the case of Robo-Ninja, about 3000 people installed it.  Other than my friends, I got about one message about it, a couple of store ratings (some 1 star, some 3-5 stars), and that's about it.  I had fun making it, I enjoyed hearing from my friends that played it, but it just felt lonely, like I was riding a big crowded subway car alone in a big city.

In contrast, when I started making Anguna for Gameboy Advance 12 years ago, the GBA was just at the end of its commercial life, so it wasn't about retro gaming: it was just about the fun of making a homebrew game for a video game console.  What surprised me was hearing people talk about it. I'd get emails from people asking about it, reviews appeared on some websites, and there was a community of people to talk about it with.

Atari Anguna was also started just for the fun of it, but upon finishing,  people on the AtariAge forums expressed an interest in the game.  Realistically, it was a lot fewer than the 3000 that had downloaded Robo-Ninja. But it was a lot more fun and rewarding, having a small number of people be vocally interested, as opposed to a few thousand nameless installs.

The height of this was at last year's Portland Retro Games Expo when I got to chat with other Atari and NES developers, many of whom had made games I had played, and a number of whom had played and enjoyed Anguna.

So really, it's not just about the "retro" aspect of retro games, although that's part of it.  It's also about knowing that people play and enjoy my games, and getting to talk to them about it.  Right now that means retro gaming is the fun niche where I can make a cool game without a big team, have a ton of fun doing it, and hear about people enjoying it.  

Oh yeah, and retro games are hip right now.  I'ts fun to be doing something hip.

But who knows, I've always been a bit non-committal in my hobby projects. Maybe I'll suddenly decide I want to try something else in a couple years once I finish this game....

Tuesday, April 18, 2017

Starting the next game

Now that Spacey McRacey is done, it's time to move on to the next game: a large adventure game for the NES.

I've had two ideas in mind for awhile, either my Blaster Master-style metroidvania game that I've talked about before, or another Anguna sequel.  After asking around to see if I could find any artists interested in working with me, I found someone that's interested in doing the Blaster Masteresque game.  So that's where we're starting.

First steps involve picking some technology.  On the Atari, unless you were going for some crazy advanced cartridge with a co-processor on board (which was really rare back in the day -- I think Pitfall 2 was the only commercial game that did this), all the cartridges boards are pretty similar, other than ROM size and the exact method of bankswitching to map all that ROM to the limited address space of the Atari.  (Ok, some also had some RAM on board. But still, there wasn't all that much that was different).

NES cartridges are a different story. The NES was designed for the cartridges to have a bit more control, so there's a lot more variance depending on what cartridge hardware you're going to pick.  And certain types of cartridge hardware are more expensive to produce on actual cartridges than others.  So I need to pick a cartridge mapper type.  I've been doing some experimentation -- there's a new one out called the Cheapocabra that's both cheap and powerful.  The only downsides are the fact that not all the emulators support it yet, and it has no expansion RAM.   So I'm still trying to decide for sure.

The other question is whether I stick with pure 6502 assembly, or do a mix of assembly and C.  I've been doing some experiments with writing the core game logic in C, and dropping to assembly for the bits that need to have better performance, and it seems to be working reasonably well, so I think I'm going to start with that.

Next steps are to start thinking about a scrolling engine and internal level data representations.

Wednesday, April 5, 2017

Testing on hardware

Everytime I title a post like that, it's never good news.

We moved across town, which primarily means that I've spent more time fixing up an old house (to sell) and a new house (to live in) than I have programming for fun.  But I also had space to set up a nice desk space for writing/testing my games, including my NES and Atari attached to an old little tube TV (thanks, Jake!)



After hours of frustrating with faulty Compact Flash cards (remember those?), I finally got my PowerPak working, so now I can test my game on the real Nintendo! (as well as play all my NES games without fighting with dirty contacts every time!)

Well, as usual, it didn't go well at first.  Spacey McRacey was a jumbled mess of flickering as it scrolled. It bounced all over the place.

With some advice from the fine folks at nesdev.com, I had a number of things to try, but none of them worked.  BUT simplifying things by disabling my split-screen scrolling (the status bar at the top is locked into place by having a scroll split at it), and everything worked.

So I went back and tightened up the timing of my split screen scroll.  The NES PPU has some weird quirks, where underlying registers change automatically during rendering, so it's quite possible that I was taking too long, and things changed out from under me in the middle of setting up my split-screen scroll.  So optimizing the timing of the scroll actually ended up solving the issue.  WHEW, that only took about an hour (which is about 4 hours less than the time I've spent so far trying to fix the bad wiring in my house that fried my TV and desktop computer)

There's still one new issue that appeared on hardware that I need to fix, with the title screen getting corrupted, but I think I know what's going on there.

And here I thought I was done. Oops.

Friday, February 24, 2017

NESDev Results and more

Well, Spacey McRacey got 14th place out of 18 games.  Which is really about where it belonged; there were some really high-quality entries for this competition!   They're now in the process of trying to figure out how to build the competition multi-cart, which you'll be able to eventually buy, with all these games on it.

In other news, we're finally getting close to the Atari Age release of Atari Anguna. It's taken awhile to get all the boxes/manuals/etc printed, but it's almost there!

And I've got a partner lined up for my next game, which will hopefully finally be my dream of a Blaster Master-inspired metroidvania for NES.  Well see.

Blaster MetroidVania

Well, I've been working on the next game, but not saying much.  Mostly because the majority of my free time involves working on fixing t...