Flappy Bird: What I Did for the Pandora Version


ekianjo

Hardcore Member
Joined
May 7, 2012
Messages
8,261
Location
神戸市、日本 (Japan)
A quick write-up about the modifications I did on the original code to make it work nicely on Pandora, and how I added a few features as well such as C4A support.

This may be useful for porters and beginner coders alike out there, so I thought it may be worth sharing.



Continue Reading ->>>

flappypromo.png
 
Last edited by a moderator:
Wow, nice article, very informative. I like the technical explanation of things. While still staying light on the topic. That's hard to do.
 
Last edited by a moderator:
It is nice, that you included C4A support, but maybe you should ask the user, whether (s)he wants to submit the C4A score? With flappy bird you generate very much scores and submits EVERY. So in fact you spam the whole c4a page...
 
It is nice, that you included C4A support, but maybe you should ask the user, whether (s)he wants to submit the C4A score? With flappy bird you generate very much scores and submits EVERY. So in fact you spam the whole c4a page...
No, it does not submit every score. It only submits the higher scores you make. Ie if you do 5, 10 and then 8; it only submits 5 and 10.

Then, I checked with Skeezix and he said it does not matter how many scores are submitted, since he has anti spam measures on the server side (it filters by name for a single score anyway).

So, no issues.
 
It is nice, that you included C4A support, but maybe you should ask the user, whether (s)he wants to submit the C4A score? With flappy bird you generate very much scores and submits EVERY. So in fact you spam the whole c4a page...
 No, it does not submit every score. It only submits the higher scores you make. Ie if you do 5, 10 and then 8; it only submits 5 and 10.

Then, I checked with Skeezix and he said it does not matter how many scores are submitted, since he has anti spam measures on the server side (it filters by name for a single score anyway).

So, no issues.
Still a LOT of submits from you. Even with your method. If I score 5, 10 and 8, why do you submit 5 and 10, why not only 10 in the very end?
 
Still a LOT of submits from you. Even with your method. If I score 5, 10 and 8, why do you submit 5 and 10, why not only 10 in the very end?
Look; I checked with Skeezix before doing so, and he said he had no problems with it. As far as I know it's his server, so if he had an issue he would tell me. Please message him if you think that's outrageous :)

On top of that the reason why I proceed like that is that, in case you have played the game, you'd notice it fetches the latest high scores from C4A as you play, and therefore your current best score could already be displayed there even before you go and proceed to the next one.
 
Still a LOT of submits from you. Even with your method. If I score 5, 10 and 8, why do you submit 5 and 10, why not only 10 in the very end?
 Look; I checked with Skeezix before doing so, and he said he had no problems with it. As far as I know it's his server, so if he had an issue he would tell me. Please message him if you think that's outrageous :)
Look; That wasn't my point. Every hase game generates more network traffic, uses more CPU and stores more in a database than all flappy bird submits togehter. My point is, that this page http://c4a.openpandora.org/ is crowded with your game scores, which is fine, it is in fact the most played game atm. Nevertheless, you could reduce your footprint at this page. :)
On top of that the reason why I proceed like that is that, in case you have played the game,
I have. Highscore 3 points (as seeable at the c4a page :p
you'd notice it fetches the latest high scores from C4A as you play, and therefore your current best score could already be displayed there even before you go and proceed to the next one.
Hm, okay. But unlikely, with a >200 points highscore...
 
If you decide not to submit any highscore as soon as its been reached you'll automatically risk to lose it in the end as the game may fail or you might run out of battery or such unless you implement some mechanism to store highscores locally to be parsed with each game run, risking to open another door for cheaters (but who cares actually).


It would in fact make sense to submit the reached highscores after each game session, i.e. after the player decided to return to the main menu or quit the game.
 
Something else, which I can't test atm:

What happens if I make a new highscore without wifi connection, e.g. in the Bus, exit the game and restart it later again. Is this score C4A-wise lost?

Because I improved my previous highscore by 67% and it would be a shame, if it would be lost!
 
Last edited by a moderator:
What happens if I make a new highscore without wifi connection, e.g. in the Bus, exit the game and restart it later again. Is this score C4A-wise lost?
Like (all) C4A supporting games, offline scores are usually not supported. Technically it's feasible, but there is the security issue: if you store the score somewhere until next time you go online, it's easy to find the file and modify it to cheat. Of course, there are many other issues with C4A in terms of security holes, but that one is so obvious anyone could easily cheat.  
 
Only read the article now, it talks about using the GPU while the game isn't using GPU at all - doublebuffering is achieved by flipping buffers in the display controller.
 
Something else, which I can't test atm:


What happens if I make a new highscore without wifi connection, e.g. in the Bus, exit the game and restart it later again. Is this score C4A-wise lost?


Because I improved my previous highscore by 67% and it would be a shame, if it would be lost!
You already figured out how to submit highscores yourself. What keeps you from doing it? Lack of network coverage during a bus ride?
Whats your point?
 
... but that one is so obvious anyone could easily cheat.
Because this :
./sc push flappybird 9001
is so hard to find out...
Well definitely harder than modifying a text file.

Only read the article now, it talks about using the GPU while the game isn't using GPU at all - doublebuffering is achieved by flipping buffers in the display controller.
Using hardware surface in python has nothing to do with the GPU?
 
What happens if I make a new highscore without wifi connection, e.g. in the Bus, exit the game and restart it later again. Is this score C4A-wise lost?
 Like (all) C4A supporting games, offline scores are usually not supported. Technically it's feasible, but there is the security issue: if you store the score somewhere until next time you go online, it's easy to find the file and modify it to cheat. Of course, there are many other issues with C4A in terms of security holes, but that one is so obvious anyone could easily cheat.
Do you really think, I would nag about such a thing, if I wouldn't do it better? :p So, to correct you:

I do cache offline scores. In fact I first implement the well known local highscore and afterwards I implement submitting of these score via C4A if it isn't submitted atm. ;)

I save them in binary files (not human readable, why do you assume I cache it as text file? This is more complex in C than just saving the pure data!).

Of course, you could cheat this with a hex editor. But if you are smart enough for a hex editor, you could just call the spaghetti client on your own... ;)
 
Back
Top