Making NES Kung-Fu

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tutorial: How to make a game!

Post by CunningFellow »

What needs to happen is someone has to say

"Gauntlet is way too hard to do for the uzebox. There is no way you could pull that off cunning"
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tutorial: How to make a game!

Post by D3thAdd3r »

pssh you couldn't do it, don't even pretend.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tutorial: How to make a game!

Post by uze6666 »

never played it but...meh
;)
<sidetrack>Gauntlet stores the entire level in NES vram and I think thats the only practical way to do it. That way you dont have to keep track of individual enemies which we dont have ram for. Unfortunately they store it in vram as 64x60 tiles, and I think we need the whole 8 bits per tile, which comes to 3840 so we don't have ram for that either :( I spent a day theorizing and attempting to find a way to make it work but I couldn't see any that retains original behavior. If there is a way to do it, it's definitely not for rookies!</sidetrack>
Interesting, I didn't realize that. But indeed that makes perfect sense, since some levels would just wrap horizontally. But again, no need to make a perfect port to be fun, Paul McPhee proved it so many times with his great - err, awesome- ports. :D

Anyhow, back to Kung-fu: one of the very first game I got for my NES! Thought not so sure we have enough ram for a decent amount of enemies? Though stranglers guys are always packed together so they would share a lot of ramtiles. And perhaps with a new sprites rotation algorithm, the inevitable flickering could be tolerable. That or use that fixed 8 color mode discussed in the past, that would double the ram tiles available. Thought it uses only the primitive colors and well kinda sucks for games that you know used more colors. Would look like this basically:
kungfu-8.png
kungfu-8.png (1.93 KiB) Viewed 4186 times
In any cases, that could be another *very cool* Uzebox game I'd be interested in contributing.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Tutorial: How to make a game!

Post by CunningFellow »

D3thAdd3r wrote:pssh you couldn't do it, don't even pretend.
"Game-On" is what I think they say :)

Remind me to have a go at it when I finish Tempest.
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tutorial: How to make a game!

Post by D3thAdd3r »

Alec I think I missed the 8 color idea and how that would work but sounds very useful. That screenshot you made looks great to my eye, surprising that is only 8 colors. I don't think we need anything but stock mode 3 for it though, with a bit of sprite rotation and "partitioned sprites". The guys who run at you are always aligned on Y-axis and are only 11 pixels wide. So if we split the mega sprite apart like here most of the time he wont be taking extra ram tiles(and are usually grouped up like you say). The defeated guys dropping are worst case but just draw them on frames when you have the ram tiles, they don't matter much.
Attachments
kungfuramtiles.png
kungfuramtiles.png (6.18 KiB) Viewed 4149 times
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tutorial: How to make a game!

Post by uze6666 »

Being lazy, I tried to rip the NES patterns from an emulator and to my suprise, I got that:
kunfgutiles.png
kunfgutiles.png (7.92 KiB) Viewed 4131 times
If you look closely, you'll notice many sprites are somewhat repeated with X/Y offsets (like Thomas head). Then looking at the nametable I realized that during gameplay, Thomas is actually made of background tiles and become sprites only when dying and climbing the stairs! Only two little stripes actually scrolls, the ceiling and floor.

So if we were to use the same technique, obviously multiple scroll sections are needed for the video mode.
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tutorial: How to make a game!

Post by D3thAdd3r »

uze6666 wrote:Thomas is actually made of background tiles
Very interesting, I did not know that but it makes perfect sense. That game should be flickering like mad because of 8 sprites per line limit, but saving just 2 makes the difference;cool! Well obviously I didn't do my research before recommending it as a candidate...didn't even check out what it does with the ppu...I do stuff like that. So I am not sure what this means but here is an idea of what we can do(with 38 ram tiles and 40 sprites). This already uses partitioned sprite optimization which made a pretty good difference, but a little more would have been nice.

Keep in mind here that Thomas is tile based in this test. When they all come to the edge and a few are close together I think we are seeing a realistic idea of how much flicker to expect when 4 guys are on screen. I now believe that Thomas must be tile based or sprites significantly shrunk for this to work well, and like you say Alec need scrolling sections probably. Any other thoughts on a different way of doing things?
Attachments
Hopefully this picture explains what partitioned sprites are
Hopefully this picture explains what partitioned sprites are
kungfusprites.png (1.33 KiB) Viewed 4100 times
kungfutest.hex
(145.21 KiB) Downloaded 218 times
kungfuscreen.png
kungfuscreen.png (14.77 KiB) Viewed 4102 times
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Tutorial: How to make a game!

Post by D3thAdd3r »

BTW I know you're thinking "38 ram tiles with scrolling?!" yeah that's a bit extreme but it doesn't look much worse with 35 and we only need 24-25 actual tiles high visible. I made that with no scrolling because I hacked this into Lolo quick. I did have an idea that I think(with my caffeine crashing brain) will work to use vram wasted on alignment for ram tiles--subject for a different thread.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tutorial: How to make a game!

Post by uze6666 »

:P Hey, pretty good to see those partitionned sprites makes it possible to use full color mode 3! We can always cut the 4th guy off. Im trying to thinking of some of hacks to mode 3 to use less ram based on the game's particularities. For instance, in the top section , there's 7-8 tile lines that are either blank or always the same. Thats a nice 4 ramtiles that could be allocated during game play.

Another thing I noticed. In the fourth floor, moths comes out of square traps which are made of sprites since they scroll independently of Thomas. But they have to be drawn *behind*, so mode 3 needs some sort of sprite priority vs the background feature to be added. That would also cover the case where he passes behind the ceiling when climbing stairs.

So mode 3 needs at least two critical features: multiple scroll sections and sprite priority. Oh and most probably sprite palettes...Lee you did something on that I recall...
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Tutorial: How to make a game!

Post by uze6666 »

Thinking a bit more about it, with a custom mode derived of mode 3, the whole top section of the screen Down to below the first red beam can take no more than about 25 bytes of vram. So about 10 lines or 320 bytes or 5 ramtiles. Sure the video mode will take more flash though.
Post Reply