robotfindskitten Port release

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
robotfindskitten Port release
by on (#130751)
Hey folks! Decided to dive into NES development a bit, and started with Shiru's C setup to get my feet wet. I've completed my first project, a port/version of robotfindskitten (it's virtually 100% new code, so I'm not sure "port" fits).

More information about it can be found at . I've submitted it to the site to be listed, but it may not be up there yet. It's available for download at , so feel free to give it a spin. I'm considering adding a two player mode, even though it's not canonical to the game. Or maybe even four player mode?
Re: robotfindskitten Port release
by on (#130777)
Only concern: on NTSC NESes the top and bottom 8-16 scanlines may be concealed by the top and bottom of the screen.

Otherwise, looks like a quite competently done port!
Re: robotfindskitten Port release
by on (#130778)
Hmm, I thought I'd accounted for that (I'm in an NTSC territory myself), but that's a fair point. I'll have to do some more testing and perhaps adjust it. I'll be putting it on a real cartridge, perhaps tonight, so I'll be able to test it on actual hardware. I'll definitely tweak it if it looks like a problem.
Re: robotfindskitten Port release
by on (#130780)
May as well mention a wishlist item while I'm here: how about a proportional font for the NKI text (like what tepples is using for RHDNRHDE) ?
Re: robotfindskitten Port release
by on (#130784)
You're right, it would have been cut off if I'd put it on a cart. Did some comparison with other games and I misunderstood how the emulator was presenting it. I've also corrected a bug with bounds checking that let robot move too far up. Good catch and thanks for the advise; I'm still brand new to this. Saved me having to resolder an eprom!

As for the proportional font, I'll look into it. I probably have the chr space for it - right now half of it is taken up by "beta content" from before I'd finalized my title screen. I was sort of going for the "retro" look, as the original rfk was written for DOS and many of the early ports were for fixed-width consoles. I'm already deviating from the baseline rfk anyway, so there'd be no harm to it.

I've reuploaded a fixed version to the same location. Feel free to update.
Re: robotfindskitten Port release
by on (#130804)
RHDN is either or something to do with Red Hat. RHIDE is Robert Höhne's DJGPP source code editor. RHDE is the furniture arranging game. I know it can sometimes be confusing.

A proportional font needs CHR RAM, so you might start by porting to that. Do you plan on making source code available? Otherwise I might have to start my own RFK port from scratch.
Re: robotfindskitten Port release
by on (#130805)
tepples wrote:
Do you plan on making source code available? Otherwise I might have to start my own RFK port from scratch.

I've submitted it to as an official port, which requires the source to be gpl. So it'll be available there once it's posted. I'm working on getting a q&d webpage up about it; I'll throw the source up there.

Since the C environment is limited to NROM, using CHR-RAM with it would be tricky. Even more reason to dig into proper assembly :D
Re: robotfindskitten Port release
by on (#130807)
Mapper 0 + CHR RAM should work in most emulators, and rewiring an authentic NROM board for it is as straightforward as any other NES repro. That's the configuration that both Ian Bell's tank demo and RHDE use.

Would the villain be Sirhan?
Re: robotfindskitten Port release
by on (#130824)
I'll take a look. I don't have a spare CHR-RAM right now but I'm sure I could find a donor somewhere. I've done a couple MMC3 repros so I'm sure I can handle it.

I've also made a real cartridge of this, and I'm seeing a strange background color problem on the text. I've tried it in a couple different emulators and it doesn't exhibit that problem. I also ran into an invisible NKI, which I haven't seen in the couple hundred rounds I've played on an emulator. Odd. It doesn't seem to correspond to anything I can see. Also makes me miss my CRT.

Re: robotfindskitten Port release
by on (#130825)
Not sure what is causing it, but that's certainly the attribute table getting corrupted for whatever reason.
Re: robotfindskitten Port release
by on (#130954)
I finally got around to packaging up the source and stuck it up at . Also threw up a quick page at . The source could still use a little more cleanup; I made an attempt to at least comment everything but there's a couple vestiges of leftover bits.

I also included the modified neslib.s where I changed out the RNG.
Re: robotfindskitten Port release
by on (#130999)
So anyway, I've read through the RFK RFC, and I found a few points that I don't think are so easy to satisfy on NES. Fortunately, both of these are marked SHOULD because of platform limits that the RFC acknowledges.

11.2. Programmatic Sources

These descriptions SHOULD come from a static, external source in order to facilitate the addition and subtraction of custom non-kitten items without recompilation. Early versions of robotfindskitten used an embedded, hard-coded NKI list. This design is deprecated. There is no standard format for the NKI file, although a user-friendly format (such as plain text) is RECOMMENDED.

Unless something reads NKI descriptions from a text file at $6000-$7FFF, I don't see how to satisfy external editability.

10.2. kitten and Non-kitten Items

The number of non-kitten items SHOULD be configurable before the start of a new simulation.

Due to memory limits associated with the definition of each item (position, color, and identity make 5 bytes) and the PPU's limit on adjacent sprites, I don't see how more than, say, 15 NKIs on an NES-size screen are practical especially with two robots running around.

As an exercise, I spent the past four days implementing my own version of robotfindskitten with a variable width font and 2 robots. It currently fits the "engine", including all code, instructions, and the font, into 4352 bytes ($8000-$90FF), leaving the rest of the ROM for NKI descriptions. (I'm working on getting that down to the symbolic 4096.) And those are compressed with byte pair encoding, which is common in Super NES RPGs, to save about one-third vs. straight 8-bit ASCII. I don't want to release it publicly just yet in order not to steal your thunder.
Re: robotfindskitten Port release
by on (#131002)
tepples wrote:
So anyway, I've read through the RFK RFC,...
I took a double take after reading that sentence. I guess technically it's an expired draft rather then a numbered IETF RFC.
Re: robotfindskitten Port release
by on (#131007)
Huh. Oddly enough I'd missed the RFC in the download list, embarrassingly enough. That might have tweaked the final design, but ah well. NES games were often... adapted for the platform anyway :D

I'd worked a bit on implementing runtime NKI count selection, but I spent a lot of time chasing a bug that caused my KoNKI to flicker above about 30, and by the time I fixed that I forgot about it. I was also thinking about implementing a two-player mode, but I didn't want to take up so much of the screen with text lines. A variable-width font may help that if it can take up less space. I may yet add them, if I get frustrated by my next project (a re-implementation of Dance Fantasy by Fisher Price. I know, silly choice, but it has a lot of memories of my sister and me growing up. It actually has a lot of frames of animation and a somewhat complex dance performance routine. Especially considering the whole thing was in 8k on an Atari 8-bit cartridge. It'll also let me practice my sprite animation and music/sound handling).
Re: robotfindskitten Port release
by on (#131013)
Is this what it might look like?
Re: robotfindskitten Port release
by on (#131021)
Very nice! I was debating whether to use three lines at the top and bottom for robot 1 and robot 2, or splitting them up half and half and using six at the top. The proportional font really compresses the length! The main reason I chose to set it up the way I did (no horizontal line, for example) was to maximize the space for KoNKI
Re: robotfindskitten Port release
by on (#131025)
Got bored tonight and was able to pretty quickly add a variable number of NKIs, from 0 (only kitten is generated. This might vaguely violate the RFC but I like it anyway) to 43. Over this I get some kind of weird corruption where my NKIs move around randomly, especially when touching others or moving robot. I'm guessing I'm stepping outside an array or something and trampling on memory; I'll need to go back over my routines and see where I'm doing that.

I poked around a bit at a two player mode as well, but I'm already bumping up against memory limits. I may not have mastered efficient memory use, plus the impact of C.

I also tweaked it to randomize robot's starting position.

It can be gotten from

rfk-1.png [ 3.45 KiB | Viewed 952 times ]