Entry Thread - Karate Kick

Entry Thread - Karate Kick
by on (#188225)
Well, here's my dinky entry, which I suppose is my first actual NES game. I would have liked to put something more together, but I had a lot going on towards the end of the competition timeline, so here we are.

Fun fact: about half the ROM space is DPCM samples, and some of that is direct PCM used for one sound where I wanted a specific frequency response.

Code:
Karate Kick
By Michael Moffitt
------------------

This is a port of a little game I made for iOS about five years ago under the
same name. It is a very simple arcade-style game that gets progressively more
difficult as time passes. The player controls a karate master (who only kicks?)
in the center of a dojo, defending against many identical goons who seek a
challenge.

Fortunately, your karate master is so skilled that if he is even looking at an
opponent, the opponent is sure to fall. All you must do is use the d-pad to
turn the karate master towards an incoming enemy. If he's facing the enemy,
he will be victorious. Do not allow an enemy to strike the master's sides or
back.

This entry was thrown together rather hastily, developed mostly on two long
plane flights, as the original entry grew too large and would have no place
on the mluti-card.

The code is available at https://github.com/mikejmoffitt/kkick



Attachment:
kkick.nes [40.02 KiB]
Downloaded 361 times


Attachment:
Screenshot from 2017-02-01 10-17-30.png
Screenshot from 2017-02-01 10-17-30.png [ 6.7 KiB | Viewed 10114 times ]

Attachment:
Screenshot from 2017-02-01 10-18-00.png
Screenshot from 2017-02-01 10-18-00.png [ 9.21 KiB | Viewed 10114 times ]
Re: Entry Thread - Karate Kick
by on (#188226)
:)

The CHR layout is curious. What led you to organize it that way with such irregular gaps?
Re: Entry Thread - Karate Kick
by on (#188227)
I like it a lot. Once it picks up speed it really evokes that feeling of flow where you're not really thinking of anything and your movements are subconscious.

Image

First score: 352
I'll probably put this on my Wii and actually play it once in awhile.
Re: Entry Thread - Karate Kick
by on (#188228)
rainwarrior wrote:
:)

The CHR layout is curious. What led you to organize it that way with such irregular gaps?


For the BG section, I more or less draw the backdrop in the CHR directly, then removed duplicate tiles. Later on as I made more things, I just threw them in the gaps when I needed to.

For the sprites, I would draw a single character graphic, then chop it up and shift sections around to save tiles, or remove tiles that were duplicates with other frames. You can actually see a few of the original iOS game's sprites in the lower-right. I marked unused tiles with X graphics so I'd know what is clearly available versus part of a sprite.
Re: Entry Thread - Karate Kick
by on (#188253)
I really like the visual style. Plays great too!
Re: Entry Thread - Karate Kick
by on (#189930)
I noticed that B580-F2FF is EA-filled. Is there anything you can cut to free up about 640 bytes to fit it into NROM-128? That might let us add more Category 2 stuff.
Re: Entry Thread - Karate Kick
by on (#190244)
tepples wrote:
I noticed that B580-F2FF is EA-filled. Is there anything you can cut to free up about 640 bytes to fit it into NROM-128? That might let us add more Category 2 stuff.

It's not fitting in NROM-128 without removing the sound samples, which isn't worth doing. Given until the end of March, I'd like to tidy it up a little and add a little polish, so the free space may be better justified.
Re: Entry Thread - Karate Kick
by on (#192836)
This applies to both the first compo version and the latest version posted in the compilation thread

If you hold Start while the game boots (either by holding start from the action 53 menu or by console Reset as a standalone ROM) the game will begin with *no* baddies coming at you at all. This bug is dependent on some uninitialized RAM value, so first start Brick Breaker or something to reliably trigger it.
Re: Entry Thread - Karate Kick
by on (#192954)
Uh oh, thanks for letting me know. I'll add a short delay to prevent starting the game immediately.

Please let me know if this fixes it.
Re: Entry Thread - Karate Kick
by on (#192956)
Quote:
This is a port of a little game I made for iOS about five years ago

Inspired by Warioware: Twisted?
Re: Entry Thread - Karate Kick
by on (#192958)
Myask wrote:
Quote:
This is a port of a little game I made for iOS about five years ago

Inspired by Warioware: Twisted?

Sorry, haven't played it.
Re: Entry Thread - Karate Kick
by on (#192959)
I also noticed this game seems to have some uninitialized RAM problems or something. Just putting it on a plain NROM board, the title screen was randomly messed up, partly scrolled off the screen and/or with wrong colors. But sometimes it was fine. And I saw the wrong colors carry over into the game itself at least one time.
Re: Entry Thread - Karate Kick
by on (#192961)
Memblers wrote:
I also noticed this game seems to have some uninitialized RAM problems or something. Just putting it on a plain NROM board, the title screen was randomly messed up, partly scrolled off the screen and/or with wrong colors. But sometimes it was fine. And I saw the wrong colors carry over into the game itself at least one time.

Strange. The first thing it does is initialize all RAM.

The game is open here, if anyone wants to have a look and identify an obvious problem with my init:

https://github.com/mikejmoffitt/kkick
Re: Entry Thread - Karate Kick
by on (#192962)
mikejmoffitt wrote:
Myask wrote:
Quote:
This is a port of a little game I made for iOS about five years ago

Inspired by Warioware: Twisted?

Sorry, haven't played it.

https://youtu.be/kTlRy3pdVaw?t=390 few videos of the game…and the one I could find is no good at this particular minigame. (Then again, there are, apparently, a record number of subgames in Twisted.)
Code:
@waitvbl1:
   lda #$80
   bit PPUSTATUS
   bne @waitvbl1

could be
Code:
@waitvbl1:
   bit PPUSTATUS
   bpl @waitvbl1

and
Code:
@clrmem:
   sta $000, x
   sta $100, x
   ; Reserving $200 for OAM display list
   sta $300, x
   sta $400, x
   sta $500, x
   sta $600, x

isn't clearing $700-$7ff, on a short inspection.
Code:
.macro ppu_load_scroll cam_x, cam_y
   bit PPUSTATUS
   lda cam_x
   sta PPUSCROLL
   lda cam_y
   sta PPUSCROLL
   ; Clamp scroll values
   lda xscroll+1
   and #%00000001
   sta xscroll+1
   lda yscroll+1
   and #%00000001
   sta yscroll+1

   lda ppuctrl_config
   ora xscroll+1         ; Bring in X scroll coarse bit
   ora yscroll+1         ; Y scroll coarse bit
   sta PPUCTRL           ; Re-enable NMI
.endmacro

Found one bug: This macro is putting both nametable selects on bit 0, which is wrong.
Re: Entry Thread - Karate Kick
by on (#192964)
Fixed those small bugs. Let me know if that helps anything.
Attachment:
kkick.nes [40.02 KiB]
Downloaded 329 times
Re: Entry Thread - Karate Kick
by on (#193379)
Sorry I didn't respond earlier this week.
I tested this on a build of FCEUX that has random memory initialization, saw something off and then looked at the github source.

Code:
   txa            ; X still = 0; clear A with this
   lda $55
@clrmem:
   sta $000, x
   sta $100, x
...


The line 85 lda $55 hastily inserted from commit "Quick nearly done" seems wrong. From instruction before it you seem to want to clear all memory to $00. Also because a "#" is missing means that whole memory range gets written with whatever was the contents of RAM location $55, and not a literal #$55.

If you feel it'll be better for us just to nop that out, it's compiled at b162~b163.
Re: Entry Thread - Karate Kick
by on (#193387)
For now, I'll add this to Karate Kick's entry in the config file:
Code:
; This patch NOPs out a stray load from zero page in RAM clearing
patch=B162=EAEA
Re: Entry Thread - Karate Kick
by on (#193521)
Oh gosh, that must have been intended to be an
Code:
LDA $5555
"psuedo-breakpoint" to trigger FCEUX's debugger. Thanks for catching that.
Re: Entry Thread - Karate Kick
by on (#193603)
Better to get into habit of using BIT $5555 (or one of the unofficial NOPs) for less effects on CPU state.
Re: Entry Thread - Karate Kick
by on (#195948)
Tried. PowerPak says bad header…
Quote:
4E 45 53 1A 02 01 01 00 00 00 FF FF FF FF FF FF

…why are bytes A-F FF? I can fix that, let's see how it works…
Re: Entry Thread - Karate Kick
by on (#195953)
キック」not 「キッく」、Don't mix katakana and hiragana in a word, generally.

188 on ver 1, trying latest…

328, so over 256 works. But I can't read green on orange for the hud at all in this version.

Are they intentionally coming to the music on the B segment of the theme?
Re: Entry Thread - Karate Kick
by on (#196179)
Myask wrote:
キック」not 「キッく」、Don't mix katakana and hiragana in a word, generally.

188 on ver 1, trying latest…

328, so over 256 works. But I can't read green on orange for the hud at all in this version.

Are they intentionally coming to the music on the B segment of the theme?


Ah shit, what a newbie mistake! I'll see if I can throw in a little CHR fix before the cart release. Thanks for pointing that out.

I don't know what you mean green on orange. The HUD is white.

As for the music, any synchronization is just luck. The version of the game in this thread is pretty old and defunct - you'll want to try the more up to date version from the A53 thread.

I've uploaded the Kana fix here, and it'll be a more up to date version of the game as well.
Re: Entry Thread - Karate Kick
by on (#196188)
the 17 apr version yields this on Powerpak (but not on my somewhat-old FCEUX/Mednafen, those still have black.)

edit: your iNES header still has $FF in bytes 10-16₁₀ and it shouldn't; PowerPak won't accept it that way. Our wiki recommends "reject" as what emulators should do to such ROMs (or masking off those bytes). Fix that!

also, new version still will come up orange, though now for once I managed to get it to come up with a black BG. Intermittent bug. Also, resetting can make the title screen bounce up and down.

Your current CHR fix looks like a katakana ke(ケ) perhaps as well as ku (ク); remove that rightmost pixel, I think.

ed2: tryng a more times to get orange bG on emu now I see it's intermittent…not getting it. But am getting bouncy-screen on both transitions. I suspect this is from re-enabling rendering mid-frame with scroll set to 0,0? I'm not yet a guru.
Re: Entry Thread - Karate Kick
by on (#197774)
Late revision with fixed iNES header and katakana tweak.