Skip navigation
NintendoAge
Welcome, Guest! Please Login or Join
Loading...

Tech Talk nes-starter-kit - A Quickstart guide for NES homebrew (WIP) Adventure game starter kit + editing guide, written in C

Apr 22, 2018 at 6:42:29 PM
cppchriscpp (1)

(Chris ) < Cherub >
Posts: 20 - Joined: 04/03/2016
New Hampshire
Profile
I've been playing around with this for a few months, so it's time to get some eyes on it beyond mine, and see if it's actually useful to anyone.

nes starter kit

Since I went to MAGFest this year, I've been kind of obsessed with the idea of making retro development easier. The people I met made me realize that a lot of people want to get started, but aren't sure how. While there are a lot of good options out there already, I realized there just might be a space for a code-based starter kit. So, I made one!

nes-starter-kit is an attempt to make NES homebrew more accessible. It is presented as an intentionally short zelda-esque NES game, combined with a guide to update/change/replace every part of it. (Click above to play the game!) All changes can be done in C - no lower-level coding is required. 
* The game uses neslib and some custom extensions written in 6502 assembly, which should cover your needs without modification. If you want to tweak these or write some code in assembly, there is some guidance in the 5th section for this. 

This is still very much a work-in-progress. The game is functional - it has collisions, enemies, and a way to win/lose. There are plenty of features that could be added, and I have a couple queued up, but I want to leave a lot up to creators.

Features: 

  • Keeps things simple; nothing beyond basic programming knowledge is needed (Can you get through the first few chapters of a C tutorial? If so, I want this to work for you!)
  • No restrictions on music - anything you create in Famitracker should work
  • Optional IDE integration (VS Code) - syntax highlighting for you code, and a key combination to build and run your game
  • Works on NES console; compatible with PowerPak and INL MMC1 cartridges
  • Use it for whatever you want: all code is MIT licensed, and graphics/music/sounds are Public Domain. (This means you can freely use this for anything, including commercial products)

Known Caveats:

  • Some chapters probably still assume too much technical knowledge (If you run into problems, let me know!)
  • Engine performance could get slow when features are added. I don't know if I've quite found the balance between performance and ease-of-use yet.
  • Uses an older version of cc65, other tools. All are provided for download, so it should work consistently at least
  • Map editing in Tiled is mildly annoying due to limitations with layers
  • It's not NESMaker; some code is still required  

The guide is broken into 5 sections, and is about 25% complete. My current plan is to focus on this for a while, sneaking in some new code changes when I get tired of writing.

Let me know what you think if you decide to check it out! Is this something you would use?
Github PRs/issues/etc also always welcome.

Online Guide

nes-starter-kit on Github

Download example rom


Have fun!

-------------------------
Hi! I'm a quirky retro dev person.. here's some stuff I've done:
Adventure game starter kit (NES)
nesnet http library (NES)
Squishy the Turtle (GB)
Retro Puzzle Maker (NES/web)
Everything else


Edited: 06/01/2018 at 07:37 PM by cppchriscpp

Apr 22, 2018 at 7:01:35 PM
Vectrex28 (130)
avatar
(CD-i Kraid) < Master Higgins >
Posts: 7789 - Joined: 07/28/2012
Switzerland
Profile
Getting a 404 when I click that pic  
Sounds pretty fun and maybe more useful for people that seriously want to make an NES game than a certain other program whose name I won't mention :^)

-------------------------
"Energy Tanks, Missiles, Power Bombs... You want it? It's yours my friend! As long as you have enough credits!"



Edited: 04/22/2018 at 07:02 PM by Vectrex28

Apr 22, 2018 at 7:09:31 PM
cppchriscpp (1)

(Chris ) < Cherub >
Posts: 20 - Joined: 04/03/2016
New Hampshire
Profile
Oops, I forgot to make the page public! Fixed now; thank you!

-------------------------
Hi! I'm a quirky retro dev person.. here's some stuff I've done:
Adventure game starter kit (NES)
nesnet http library (NES)
Squishy the Turtle (GB)
Retro Puzzle Maker (NES/web)
Everything else

May 31, 2018 at 6:31:20 PM
lancuster (0)
avatar
< Eggplant Wizard >
Posts: 227 - Joined: 08/15/2015
Profile
Hey. You incorrectly indicated CHR size.
In addition, I'm looking for a way to add your game to CaD Editor, but apart from the levels, I couldn't find anything else. Maybe you'll tell me where in your game are the bits of the palette and the description of the blocks?

-------------------------
My NES hacks on Romhacking.net
>>Oldschool Beta-tester<< - Testing NES roms for bugs
My latest ROM-hack: http://vintage.nintendoage.com/fo...
Newest (ready) hacks: "Mario Has A Very Bad Days!", "Good or Bad?" (Tank 1990 Hack) (pm me for details)
I added level settings for 102 games into CaD Editor!

May 31, 2018 at 7:13:19 PM
cppchriscpp (1)

(Chris ) < Cherub >
Posts: 20 - Joined: 04/03/2016
New Hampshire
Profile
Hello,

For the chr thing - I'm assuming you mean the size I stated in the "Making a Real NES Cartridge" chapter? Thanks for pointing that out; that would cause a real problem for people trying to use INL cartridges! (If there's another discrepancy let me know, too - I tried to find others but all config/headers/etc seem to show 32x8 = 256kb)

I'll bump that down to 128 a little later today.

Update: After digging in I realized that my headers were in fact wrong, and the rom was kinda messed up as a result. Thank you so much for pointing that out!

I appreciate the thought of adding this to CaD editor, but are you sure it's a good idea to add it to that tool? I've never used it before but it seems like it's mostly a rom hacking tool, right? The point of this project is to provide the tools to "do it yourself" - it actually builds levels based on Tiled output files, and changes to the raw binary would likely be a bit harder to support. This project is also fairly active and addresses of things will change often. Finally, I'm not sure if this is an issue, but if people fork this to make their own games they will likely each need their own configuration. I guess I'm a little afraid having nes-starter-kit in the tool might cause confusion for users of CaD.

At any rate, I'm not one to hide information, so I'll try to answer you as best I can:
- Palettes are loaded by the assembly code here: https://github.com/cppchriscpp/ne... (the .pal files are just small binary files nesst knows how to load) -- this gets loaded in crt0.asm, here: https://github.com/cppchriscpp/ne... -- not sure what address this would end up at. It would probably be stable for a while, but I do update crt0.asm from time-to-time which would change the address.
- By block descriptions, I guess you're looking for which tiles are solid vs not. It's actually hard-coded for simplicity (though users could change this). The first 3 rows of 16x16 metatiles are walkable, and have no collision. The next 3 rows are solid. There's no further description; tiles can't do damage or anything of the sort - all other collisions are done with sprites. Sprites are defined here: https://github.com/cppchriscpp/ne... (Which will almost definitely move around on you and change, I'm afraid)

I hope that helps, and thanks again for the note on chr size.

Next Day Update: I added an online version of the guide using Jekyll. It's much nicer to look at; check it out!

-------------------------
Hi! I'm a quirky retro dev person.. here's some stuff I've done:
Adventure game starter kit (NES)
nesnet http library (NES)
Squishy the Turtle (GB)
Retro Puzzle Maker (NES/web)
Everything else


Edited: 06/01/2018 at 07:39 PM by cppchriscpp

Jun 3, 2018 at 5:55:38 PM
lancuster (0)
avatar
< Eggplant Wizard >
Posts: 227 - Joined: 08/15/2015
Profile
Wow, this is cool! I thought it was just a demo, but it turned out that it was also a programming tutorial (I'm just not familiar with programming).
I probably translate your guide into Russian, if you don't mind.  

-------------------------
My NES hacks on Romhacking.net
>>Oldschool Beta-tester<< - Testing NES roms for bugs
My latest ROM-hack: http://vintage.nintendoage.com/fo...
Newest (ready) hacks: "Mario Has A Very Bad Days!", "Good or Bad?" (Tank 1990 Hack) (pm me for details)
I added level settings for 102 games into CaD Editor!

Jun 3, 2018 at 8:08:58 PM
cppchriscpp (1)

(Chris ) < Cherub >
Posts: 20 - Joined: 04/03/2016
New Hampshire
Profile
That would be awesome; go for it!

I will warn you that the readme is probably still going to change quite a bit, but most of the guide chapters should be somewhat complete.

-------------------------
Hi! I'm a quirky retro dev person.. here's some stuff I've done:
Adventure game starter kit (NES)
nesnet http library (NES)
Squishy the Turtle (GB)
Retro Puzzle Maker (NES/web)
Everything else

Jun 14, 2018 at 5:18:00 AM
lancuster (0)
avatar
< Eggplant Wizard >
Posts: 227 - Joined: 08/15/2015
Profile
Tell me in the instructions how to implement the shooting and how to assign lifebar for enemies?

-------------------------
My NES hacks on Romhacking.net
>>Oldschool Beta-tester<< - Testing NES roms for bugs
My latest ROM-hack: http://vintage.nintendoage.com/fo...
Newest (ready) hacks: "Mario Has A Very Bad Days!", "Good or Bad?" (Tank 1990 Hack) (pm me for details)
I added level settings for 102 games into CaD Editor!

Jun 14, 2018 at 6:36:40 AM
cppchriscpp (1)

(Chris ) < Cherub >
Posts: 20 - Joined: 04/03/2016
New Hampshire
Profile
Hello,

There is no chapter directly written about shooting- I am currently planning to write one about non-projectile weapons in section 3. (Title is something like "giving the player a sword".) After that is written, perhaps it will make sense to add another chapter for that. I will think about it.

I don't currently plan on showing a visible life bar for enemies; this is not something I see as a common use case. Hopefully after going through the other chapters, the guide will leave you with some ideas on how you could implement that yourself, but I am not planning to walk the player through it in a chapter. (If you simply mean enemies that can take more than 1 hit, that will fit into the weapons chapter most likely. Your message was a bit unclear; sorry!)

-------------------------
Hi! I'm a quirky retro dev person.. here's some stuff I've done:
Adventure game starter kit (NES)
nesnet http library (NES)
Squishy the Turtle (GB)
Retro Puzzle Maker (NES/web)
Everything else

Jun 20, 2018 at 4:45:01 AM
spawncalibur (6)
avatar
< Eggplant Wizard >
Posts: 325 - Joined: 10/10/2016
Michigan
Profile
This is great! The nice thing about this is that its using MMC1 mapper! Something I can actually use to make real repros with if I ever do sense I know how to do all that stuff. I have some programing experience but not in C. Ill give it a go though.

-------------------------
FS: NES Repros
http://nintendoage.com/forum/messageview.cfm?catid=6&threadi...
WTB/FT: Kabuki Quantum Fighter/Batman cart/Sega Genesis system Starting from scratch again. NES, SNES, N64  

Jun 20, 2018 at 12:43:13 PM
cppchriscpp (1)

(Chris ) < Cherub >
Posts: 20 - Joined: 04/03/2016
New Hampshire
Profile
Have fun!

In an unrelated update, I finally got a scrolling animation transition between screens, similar to the original Legend of Zelda. This makes games look way more slick. (There's also a way to disable this in `main.c` if anyone doesn't like this feature)

I also updated the documentation site to not play the game until you click, since the music on loading the page was kinda off-putting. I plan on working on a few more chapters soon. (Thinking about the "giving the main character a sword" chapter next)

-------------------------
Hi! I'm a quirky retro dev person.. here's some stuff I've done:
Adventure game starter kit (NES)
nesnet http library (NES)
Squishy the Turtle (GB)
Retro Puzzle Maker (NES/web)
Everything else