It is currently Wed Dec 13, 2017 11:25 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Mar 31, 2014 1:11 pm 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
Update: Unfortunately I've stopped working on this game. Attached is the last version of the source.

Looking for a NES version of Flappy Bird?
Flappy Block from Sly Dog Studios
Family Bird from sayonari
"flappy.nes" from Nioreh

----
Flight Minigames is intended to be a collection of 8 6 similar "one button games" for the multicart project where you control the vertical movement of the sprite to avoid obstacles approaching horizontally. Planned modes include clones of the mechanics of The Helicopter Game, Balloon Fight and Flappy Bird.

The most important lesson I learned during competition period is that gradual air resistance feels much better then speed caps. Also fixed point numbers with more then Q16.16 precision is overkill.

I'm not sure what lesson I learned for v0.2, maybe that system stack can be used for saving bytes in ROM.

List of things needed to be done has been moved into a TODO.txt file.


Attachments:
File comment: Flight Minigames v0.2 source
2014-05-29_flight-minigames-v0.2.zip [70.6 KiB]
Downloaded 257 times


Last edited by JRoatch on Wed Aug 06, 2014 1:36 pm, edited 5 times in total.
Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Mon Mar 31, 2014 2:06 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19342
Location: NE Indiana, USA (NTSC)
Balloon Fight uses a denominator of 256 (8 subpixel bits) for positions and velocities.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Mon Mar 31, 2014 2:41 pm 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
Right, G in Balloon Fight is $00.06 per ntsc frame (about 84.7px/s^2) with a speed cap of about 75.1px/s.

I'm not sure exactly what's going on with the upward thrust, but looks like it either adds (on top of G) $00.12 per frame or $00.78 for a single flap.

If only I was able to watch ram values for flappy bird.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Fri Apr 18, 2014 8:35 pm 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
It's been awhile since I last posted but I got somebody with a copy of flappy bird on a rooted tablet to let me screen record some gameplay.

After a bit of video frame slicing and counting pixels I came up with these numbers. Unlike other prior work by Frank Noschese, I'm setting the width of the bird (from tail to beak) to 1 meter.

Bird width: 1 m (reference meter)
Field height: 10.7872 m
Gravity: 29.9426 m/s^2
Speed after flap: 8.6320 m/s
Speed cap: 14.0957 m/s
Horizontal scroll: 3.5493 m/s

Reading the linked article again, I somehow totally missed the video downloads before doing the experiments myself.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Sat Apr 26, 2014 8:50 am 
Offline
Formerly WhatULive4
User avatar

Joined: Fri Oct 30, 2009 4:43 am
Posts: 339
Do you have the most recent build? I think the one you linked too might be an older version.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Sat Apr 26, 2014 12:11 pm 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
The most recent published build is v0.1. Sorry if being under "Older versions" and with a label of "incomplete" is confusing. It should match the version I sent you last in email as they both should have a md5sum of 3f0d3ca924f8c1e2bcd20d1c7a2ca144.

The progress of v0.2 (with 2 complete games) has been slow.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Sat Apr 26, 2014 2:55 pm 
Offline
Formerly WhatULive4
User avatar

Joined: Fri Oct 30, 2009 4:43 am
Posts: 339
Ok, I just can't get to a menu like it shows in your screenshot at the top. I'm just trying to get some screenshots for the website.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Thu May 08, 2014 9:09 am 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
I pretty much did nothing in the month of April, and it seems like the only thing I did this week was rewrite the core adder and converted all fixed point numbers from a 6 byte 16.32 format to a 4 byte 9.23 format.

I want to ask for help, but it's hard to formulate how or what one can help with.

Also this is probably the one piece of code that the cpu will spend a good bulk of it's time on.
Code:
;;
; multi purpose multi byte operation
; [API sniped but will be described in full source]
bignum_op:
-
  lda (temp+0), y
  eor temp+5    ; a value of $ff will make this a subtraction
  adc (temp+2), y
  sta (temp+0), y
  iny
  dec temp+4
  bne -
  rts


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Thu May 08, 2014 10:40 am 
Offline
User avatar

Joined: Sun Jan 02, 2011 11:50 am
Posts: 522
I think I am understanding your code. Maybe a bit faster, assuming temp+5 is either 0 or FFh

Code:
 
  ; is it negative?
  bit temp+5
  bpl positive
  ; negative:
  sec
  ldx temp+4
-
  lda (temp+0), y
  sbc (temp+2), y
  sta (temp+0), y
  iny
  dex
  bne -
  beq exit
positive:
  clc
  ldx temp+4
-
  lda (temp+0), y
  adc  (temp+2), y
  sta (temp+0), y
  iny
  dex
  bne -
exit:
  rts


Store x back to temp+4 if needed.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Thu May 08, 2014 10:52 am 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
I attempting to go the extreme side of the size/speed trade off, aiming for small size. So I thought it was cool when I saw a way to pack addition and subtraction in the same subroutine loop, and with the same loop I'm clearing bytes of memory, which would allow for copying bytes and negating.

Maybe I just need to stop spending all my time on size optimization...


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Thu May 08, 2014 11:26 am 
Offline
User avatar

Joined: Sun Jan 02, 2011 11:50 am
Posts: 522
Unless you are approaching the limits of your chosen mapper, personally wouldn't worry too much about size, unless that is part of the challenge. Even if you need some simple bankswitching, it's 2014; memory is relatively cheap. Also, regarding that routine - if your values are going to be multiples of two bytes always, you could partially unroll it into two lda/adc/sta steps.

Edit: Maybe ignore that last part about unrolling more, may not work with this code.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Thu May 08, 2014 1:59 pm 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
One thing I know I will have difficulty with, and have yet to address, is sound engine and musical composition.

My first thought was to use famitone2 and place the entire famitone page in zeropage to reduce the opcode size (my target ROM size is 4 or 8 KiB). I also though about somehow using temple's sound engine, but I'm not clear about the pros and cons of each. In any-case I've got 128 zeropage bytes reserved for sound, and I hope I can get the music code and data to fit in the 2.5KiB ROM space left.

Then of course I believe I lack the musical composition skills anyway.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Thu May 08, 2014 4:27 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19342
Location: NE Indiana, USA (NTSC)
My sound engine should comfortably fit into your ZP budget, and as for ROM, this 3.8K NSF containing the entire soundtrack of Concentration Room, Thwaite, Zap Ruder, and an old falling block game should show how ROM-efficient it can get while delivering competent triangle drums and semi-pitched hi-hats. If you want, I can package it with a manual, and I might even have time to compose some happy flappy tunes for you.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Thu May 08, 2014 5:28 pm 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
A package with a manual would be nice, even if I ultimately don't use it. Just don't end up using up too much time meant for RHDE.


Top
 Profile  
 
 Post subject: Re: Flight Minigames
PostPosted: Wed May 21, 2014 2:04 pm 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
So famitone2 may not be ideal to stuff entirely into zeropage. I just counted, according to the var definitions, the number of RAM bytes used for music and one sound effect stream. It's 140 bytes.
I don't know how the sound effect data is formated, but I think it's like a raw list of APU commands or something.

I think should start looking into tepples sound engine. I believe it's pretty much music.s sound.s and musicseq.* in RHDE.

I do like the 64 note range of famitone2 and my edit that allows different tempo and pitch setups. I'm hoping that would be easy to port over those features.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group