UzeSnake game - Understanding the 'under the hood mechanics'

Use this forum to share and discuss Uzebox games and demos.
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by mapes »

I used the NSF file and converted the first level to a midi file, then using anvil, 'repaired' it to clean it up. It sounds ok in game (not as great as the midi), but crashes when the song ends.

How do you know what the ending 'tick' is when setting the loop using midiconv?

I thought I might get it out of the 'debug' option, but that still made the game crash.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by Artcfox »

mapes wrote: Sat Feb 18, 2023 5:33 pm I used the NSF file and converted the first level to a midi file, then using anvil, 'repaired' it to clean it up. It sounds ok in game (not as great as the midi), but crashes when the song ends.

How do you know what the ending 'tick' is when setting the loop using midiconv?

I thought I might get it out of the 'debug' option, but that still made the game crash.
With Rosegarden, I show it at 16:08 in the video: https://youtu.be/sf4cVNM_tdo?list=PLmw_ ... 5Dsk&t=964
I look for the end measure with the notes.
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by D3thAdd3r »

Matt has a great video there so not much to add on that.

In Anvil, for whatever reason, I deleted start/end markers(and anything besides note on/off basically, most songs are fine mono volume, or use patch changes) and always calculated the start/ends manually as arguments into midiconv. If you happen to have a note right before the end, use the start time plus the duration for a starting point as a tick argument. I'd usually have to try a couple variations to get a loop how I wanted. Otherwise basically math. Not saying this is the way to do it, but in Anvil I had issues before I did it that way.

I turn down the sensitivity on nsf2midi until it detects just note on/off events, but all other "flourishes" were gone. Lots less to delete in the event editor then, you need to check all events on all channels. Those flourishes arent really note events in the NES data(not always anyway) and will be recreated by patches on Uzebox side. The best luck I ever had was inputing the most sterile sounding ever MIDIs into midiconv. For patches, wave choice, tremolo+other proportions, and timing of attack/decay are(IMO in that order) the biggest difference.

Most common crash is calling a bad patch number, but if a loop point puts the song player in an unlucky address, it would also likely crash(perhaps interpreting a bogus note on, or something else).
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by Artcfox »

Lee, how do you create patches that match what the NSF sounds like?

I keep reading about the attack, decay, and envelope, and I understand the objective result of what those do, but I'm totally at a loss with the subjective part of making it sound pleasing, and especially with making it match a known sound.
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by mapes »

I appreciate everyone's help on this project. But I've hit the moment where I realized the 'fun' has turned into 'frustrating' in the music department... It also doesn't help that I am coming up on some deadlines.

So, I've decided to use songs and patches that always work without a hitch.

Here's the final version (with the NSMB music) that I will be demoing at the school fair in Uzebox JAMMA fashion (in free play mode of course)
snake2.uze
(35.07 KiB) Downloaded 79 times
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by Artcfox »

mapes wrote: Sat Feb 18, 2023 11:49 pm I appreciate everyone's help on this project. But I've hit the moment where I realized the 'fun' has turned into 'frustrating' in the music department... It also doesn't help that I am coming up on some deadlines.

So, I've decided to use songs and patches that always work without a hitch.

Here's the final version (with the NSMB music) that I will be demoing at the school fair in Uzebox JAMMA fashion (in free play mode of course)

snake2.uze
Yeah, it sucks when things go from fun to frustrating.

It sounds and plays nice! I'm glad you got it finished in time. :)
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by mapes »

I wanted to post how the STEM fair went.

Alot of kids had big eyes when I said I programmed the entire game and showed them all of the code in 6 pages. I told them that they could do this too, but then most walked away.

They wanted to try the game, but I ran into a few issues I didn't compensate for.

1. Kids are short and have a tough time reaching the controls

2. Kids don't know what to do... Or how it works, they thrash on the joystick.

3. I remember playing Snake in elementary school, but Snake is not a game they ever played.

4. The controls in the game for detecting input need refining. A diagonal direction could instantly kill you be cause the game thinks you double backed into yourself. While the game prevents you from doing a 180, if you hold backwards and a 90 degree turn, it could register the turn and then a 2nd turn making a 180 in the process.

5. The arcade machine was a germ spreading machine! So many sick kids touching those controls. I had to clean them periodically.

At the very end, I switched it up to Arcade Megatris since it was pretty much over, but then a few kids saw that and were like WHAT IS THIS GAME?

Unfortunately I forgot to take pictures because I had a pretty steady line for 90 minutes. But it may show up on the newspaper since photographers were there.

Again, appreciate everyone's help and input in this game.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by Artcfox »

Very cool!

I wonder if a direction-lock on the physical joystick (like the original Donkey Kong) would help. It also seems crazy that people could have not seen or heard of the game Snake. I'm glas to have helped, it sounds like it was a fun time! :-)
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by CunningFellow »

The youth of today....

That is what happens when you grow up with hand me down I Phone 3s rather than hand me down Nokia 3110
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: UzeSnake game - Understanding the 'under the hood mechanics'

Post by mapes »

On Saturday with some free time on my hands I tried to start a mode 3 version of the the snakes game using the files Artcfox posted, but I couldn't get it to import or get anything to work using AVR studio.

So I tried to adapt another existing mode 3 project with an APS file that I can compile (UzeAmp) as a starting base... Freshly compiled and unedited, it works just fine.

But after editing... While I can get it to compile, currently it gives me a blank screen and is crashing. Looks like I'll be doing 'baby steps' again to get it stable and update from there.

Curious, is there a 'hello world' demo for mode 3 with an AVR studio project file (.aps) sitting in the forum or wiki that I'm not finding?

It would be a much better starting point for me and really help me out.
Post Reply