Jump to content

New game uploaded: Flappy X16


Recommended Posts

Flappy X16

View File

FlappyX16 is a complete port of the original 2013 iOS Flappy Bird game by .GEARS Studios, using my own assets from scratch.

While the main reason I made this game was to get experience in C programming for X16 using a real multi-file Makefile project, I also wanted to produce a completely finished, polished game for the X16 community to enjoy. I've learned a lot about using the various subsystems of the Commander X16.

Features:

  • Four selectible difficulty levels of play
  • Fun, addictive gameplay - Always "just one more" point to earn
  • Keyboard and joystick support
  • FM sound effects
  • Bright 4bpp graphics
  • Secret "Dark Souls" difficulty level

I have not yet tested the final version using SD card images, and will update the download file if I need to patch the game. Also, my project support R39 but I have not built that against the latest versions of the master repo on Github. I will upload an R39-compatible version once I update my copy of R39 and test the build.

I've really enjoyed making this game, and I hope the community enjoys playing it. It's a VERY addictive game. Trust me, I've spent HOURS just playing it when I should be adding features / fixing up my code


 

Link to comment
Share on other sites

This is odd - when I run my program on the emulator, Keyboard input works correctly. On Try It Now, it registers the first keypress to start the game, but then won't register any further keypresses.

I'm sure it's my program and not the web emulator - anyone got any thoughts? I just call kbhit() once per frame and set the controller state based on that...

Link to comment
Share on other sites

7 hours ago, SlithyMatt said:

Why don't you just use the joystick API? It will automatically map to the keyboard if no controller is connected

Well, I was having some trouble figuring out the cc65 joystick routines, and they didn't have a built-in fastcall to GETJOY so I decided to roll my own by reading the memory locations where GETJOY puts the results anyway. I've got #define for R38 and R39 and both work just fine. Strangely enough, I did try to load the location where it stores the "fallback" pseudo-joystick keyboard functionality, but for some reason, it is coming up as "detected" even when i don't attach a joystick.

Oh well - The kbd does work for me in tandem with joysticks, and I've got bigger fish to fry, like implementing the sound engine and a couple of SFX.

(See next post for YouTube link)

Link to comment
Share on other sites

I decided to narrate this one with voice for a change. It was spur-of-the-moment, so don't expect some high production value, but maybe with some preparation, I'll do an episode discussing the code a little... Anyway, here it is with a couple of SFX implemented. There will be PCM sfx as well when all is said and done.

  • Like 2
Link to comment
Share on other sites

Posted (edited)

I’ve thought the same many times. The original didn’t scroll the BG so I decided to go with a bitmap BG too.

id need to re-draw the edges of the clouds and bushes because they don’t tessellate as drawn.
 

But I do love me some parallax scrollin’ 

I think the best thing to do would be to make the image as a 32x32 tile map (narrower than the bitmap) and just use Aseprite to smooth the transition. That way I wouldn’t need to update the BG tiles as it scrolls.

Hmmmmmmmm 

Edited by ZeroByte
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I wonder why the webemu only accepts the first keypress event.... It runs slow in the webemu anyway, but it would at least be nice to have it truly previewable. Works just fine in the PC-based emulator.

Hmph.

Link to comment
Share on other sites

Eureka! Fixed the kbd bug on the TRY IT NOW webemu.

As expected, it wasn't the emu, it was me. My build environment always puts -joy1 SNES on the command line. When the web emulator launches, it doesn't attach any joystic, and a branch of my input code was being hit that was never actually hit on my own system. I've debugged it, and now the game is finally PLAYABLE on the TRY IT NOW screen.

 

  • Like 1
Link to comment
Share on other sites

Good job on this game! Plays well, and nice graphics!
I'm a complete newbie to flappy bird. So it's a very steep learning curve for a game that requires presses of a single button 😄 After like 20-25mins of trying, I can say I'd call it "Exponential Decay Simulator". 1/3 of the tries get past the first obstacle, 1/9 past the second, 1/27 past the third, well, and then the sampling gets pretty inaccurate 😄

  • Thanks 1
Link to comment
Share on other sites

11 hours ago, kliepatsch said:

can say I'd call it "Exponential Decay Simulator".

Hahaha - that's amazingly funny. Thanks for the feedback. As it stands, the forced delays / taps required to cycle through the gameover sequence aren't correct and feel a little jarring - I'm gonna tweak those, but last night's mission was "fix the damned keyboard routines." Glad to hear that you find that it plays well. I spent quite a while tweaking the parameters to get it like this. I'm a stickler for details.

Link to comment
Share on other sites

Like you say in the description, the physics make it even harder than the original Flappy Bird. You need to be able to slow down the falling. It's like gravity is about 50% too strong. Also, the original FB was kind enough to make the first few gaps a little wider.

  • Like 1
Link to comment
Share on other sites

Posted (edited)
3 hours ago, SlithyMatt said:

Also, the original FB was kind enough to make the first few gaps a little wider.

It definitely didn't do that. I've watched very much footage of original iOS Flappy Bird to replicate it as faithfully as possible.
 

3 hours ago, SlithyMatt said:

t's like gravity is about 50% too strong.

I know what you mean. The main problem is that if I reduce gravity then the opposite problem occurs: it's too hard not to smack your head on the top pipe. Ideally, the gap would be about 8px wider, but I'm using 16x16 tiles right now. I've told myself several times that I need to change that, but I just haven't felt like going through refactoring that much code and graphics assets. It'd be worth it in the end, but I've always had more pressing things like un-implemented features to contend with.

I'm facing certain challenges in tweaking the physics, stemming from some design choices.

  • My current "collision" check method breaks if I vary the horizontal spacing of the pipes - I should just check screen tiles, whereas instead I'm cycling a queue of the gaps' Ymin Ymax values and applying them at certain values of the scroll register. I need to just check screen tile values instead so that's not a problem anymore.
  • The tiles are 16x16 which severely limits how many vertical placements exist for a pipe gap (only 8 valid heights) and also limits the vertical sizing options for the gaps. I should probably re-do my tiles in 8x8 mode and double the vertical resolution for gap sizing / placement, and of course, update the drawing routines. The end result would be a screen that looks identical, but allows for more fine-tuned placement of the pipes.
  • My "subpixel" behaviors are chaotic - for instance, gravity / Vy act as a sort of "fixed point" value, but the bird Y position is a hard screen X Y value, where I should probably just switch to using subpixel screen locations as well - it would give me much more granular control over the affects of gravity and thrust. Yet the pipes' scroll value is "subpixel" (I use 2 bits of subpixel placement to give more granular scroll speed control).
  • The bird movement is updated every frame, and if I were to refactor the code a little to allow for gravity and movement to only happen on even frames, then the game could be slowed down considerably.

In the end, all of these factors intertwine with each other, and it's only going to be some messing around that lets me find the right mix. I think my next step on this front is probably going to be to make joystick controls that let me vary the parameters in real time, with the current values output in hex so I can just play with them live until it feels right. Then just write down the values I ended up with and set them in the #defines. If I can manage to slow the game down w/o having to overhaul these things, then that's going to be what I choose to do, because in the end, this project has been more about getting some experience with C projects - using makefiles, using multi-file projects, organizing everything in a way that makes sense, etc. Having said that, though, I -do- want to produce as well-polished of a game as I can, so now that things are roughly in their final states, flow-wise, I should be able to start focusing on the gameplay tweaking some more.

My ultimate "anchor point" in all of this is the cadence of the pipe gap clearings... i.e. the cadence of the "ding" sound as you successfully clear pipes. Whatever tweaks I make to the physics should result in roughly one pipe gap per second, as that's the rate the original game threw them at you.

 

p.s. - My record on this is something like 32.

Edited by ZeroByte
added P.S.
  • Like 1
Link to comment
Share on other sites

I need some feedback from some volunteer play-testers. I've gotten good enough at the previous game settings that this version is insanely easy to me, so I don't think I can be a good judge anymore of the difficulty factor. I've attached what I think might be "normal" difficulty mode now, but I think it's too easy.

What kind of scores can you achieve, and do you think this is too easy to bear the name "Flappy Bird?"

flappyx16.zip

Link to comment
Share on other sites

Posted (edited)

In that version, it definitely isn't as much of a challange anymore, to get past the first obstacle! In 15-20 mins of playing, in the end I regularly got past 10-20 pipes. My high score was 27.

I went back to version 1.1 and tried again. I have definitely improved over yesterday. I raised my highscore to 5, and was able to get 4 multiple times in a row! 😄 But still, the first obstacle was where I got stuck most frequently. I think I suck at this type of games, but it is simple and enjoyable, and I think training pays off.

I would definitely include the 1.1 degree of difficulty, because it is a nice challenge. I remember the satisfaction when I first got past the first obstacle. Life could be so simple 😄

Edit: By including it I mean that an easier mode should also be included.

Edited by kliepatsch
  • Thanks 1
Link to comment
Share on other sites

5 hours ago, kliepatsch said:

Edit: By including it I mean that an easier mode should also be included.

Thanks for the feedback. I came to a similar conclusion last night as well: “Why not have selectable difficulty?”

So last night’s coding session was me moving the game parameters out of #defines into runtime variables and putting the hooks into the loop for selecting between them.

I also had to refactor some code to support variable gap sizes in the pipes, as that’s one of the parameters I tweaked. Fortunately the randomized still feels like it has enough variety with a gap size of 4, so I won’t need to redo everything in 8x8 tiles. Whew.

I WILL need to create a full font for text on the title screen and implement some raster line IRQ code to allow me to have a non-scrolling tile region for the “select difficulty” menu tho. That or else use the copious sprites to draw short amounts of text.

Link to comment
Share on other sites

Posted (edited)
On 5/12/2021 at 6:30 AM, ZeroByte said:

I know what you mean. The main problem is that if I reduce gravity then the opposite problem occurs: it's too hard not to smack your head on the top pipe.

Then have settable wind resistance, which reduces the speed of movements both up and down.

The cute thing about settable wind resistance is you can have a bird that looks more or less fluffy for the different levels.

There is a maximum playable wind resistance, of course, since it also increases the minimum time for a given vertical traverse, so if set too high, the bird cannot make it between pipe openings that are too far apart.

Edited by BruceMcF
Link to comment
Share on other sites

Wind resistance is a much more complex feature than gravity. It varies on the square of speed, and essentially cancels or enhances the effectiveness of other forces.

in last night’s tweaking session I recalled (in a facepalm moment honestly) that if I reduce gravity and thrust together, it will produce the same trajectory but slower, which is how I was able to reduce the difficulty without too much hassle.

im happy to say that my “normal” difficulty settings now produce the same floaty yet rapid fall behavior as the original, and that I was able to make the pipe gaps wide enough to accommodate this.

I think I’ll make another dev vlog on the game where I demonstrate the parameter tweaking and their effects on the game.

  • Like 1
Link to comment
Share on other sites

4 hours ago, ZeroByte said:

Wind resistance is a much more complex feature than gravity. It varies on the square of speed, and essentially cancels or enhances the effectiveness of other forces.

in last night’s tweaking session I recalled (in a facepalm moment honestly) that if I reduce gravity and thrust together, it will produce the same trajectory but slower, which is how I was able to reduce the difficulty without too much hassle.

You can still make the bird fluffier the easier the settings get, and sleeker the hard the difficulties get, even if it's not PROPERLY wind resistance changing.

Link to comment
Share on other sites

I decided to post a video update to YouTube discussing the latest things I've added to the game. It now has selectable difficulty. I am not going to push an update to the software library at this time, though, because I want to get the difficulty selection to be visible on the screen - but thanks to you guys here in the community, I decided that this would be a good feature to add, even though the original was just "you get what you get and you don't throw a fit."

P.S. - I -know- my mic sucks. I'll get a better one if I decide to keep making narrated videos on YT.

  • Like 2
Link to comment
Share on other sites

Request For Feedback:
I'm considering two different possible screen layouts for the title screen, showing the difficulty selection. In either case, the currently-selected level number is flashing to indicate that it's selected. Furthermore, there's a hidden 5th difficulty level "Dark Souls" - When Dark Souls is chosen on the existing layout (the full menu version) - Dark Souls slides up from the bottom, and it slides back off-screen if you select something else. In my mock-up version, it wouldn't bother doing that - I'd just make none of the numbers flash, but "Dark Souls" would be shown below as the difficulty level.
 

  • Which one looks better to you?
  • Does either / both / neither version give you the intuitive cue that pressing keyboard 1-4 is how to select difficulty?
  • In whatever case, pressing select on the controller will cycle through the difficulties as if you had pressed a key (skipping Dark Souls unless you do the "unlock" input)
  • Would this interface add confusion in the sense that pressing ANYTHING else is what starts the game?

The full-menu version is what's currently implemented, but I'm not completely happy with it, so I decided to do a mock-up of what my other idea is, and get feedback from the community as to which is more eye appealing and/or makes intuitive sense as to what you're expected to do.

Bear in mind that this all has to be done with sprites / graphics, as the one and only tilemap is devoted to the scrolling pipes/ground, and it would require implementing a raster IRQ to bring an area of writable text display up - so adding things like "press ANYTHING to begin" is not a simple task....
 

 

FB-bg-clear.png

FB-titlescreen.png

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use