FlappyFB (single source... added NintendoDS Versions)

User projects written in or related to FreeBASIC.
Mysoft
Posts: 836
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: FlappyFB (single source... no resource required)

Post by Mysoft »

dodicat wrote:It certainly is a knack, putting a good game into a post.
I normally run posts with -exx switch.
I get:


Aborting due to runtime error 6 (out of bounds array access) at line 721 of C:\D
ocuments and Settings\USER\Desktop\FreeBASIC\FBIde0.4.6r4\FBIDETEMP.bas::DRAWBIR
D()

Press any key to continue . . .

I'm sure it is easily fixed though!
yeah, fixed already, thanks :) weird that i had knew the behavior, i fixed for the first loop in there and forgot for the second haha :)
Mysoft
Posts: 836
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: FlappyFB (single source... no resource required)

Post by Mysoft »

Lachie Dazdarian wrote:OMG, this place still exists...
hehehe you should reply that on games.freebasic not here :P
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FlappyFB (single source... no resource required)

Post by dodicat »

anonymous1337.

Well, I guess I lost the humour this time.

It's not your fault I know, It's the Winter blues. All your rotten weather is making it's way across the pond, bit by miserable bit.
I watch ABC News, it's definitely yours.
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: FlappyFB (single source... no resource required)

Post by St_W »

The precompiled application for Windows provided by you effectively does not work: If the window has keyboard focus it hangs and seems to ignore most keyboard input. If the windows does not have keyboard focus the animations work fluently, however it's not playable without input of course.

It seems that you did something wrong when compiling the source code or made some modifications to the source code you posted here before compiling, because when I compile the source code myself everything works.
Maybe some faulty old FB compiler version?
Mysoft
Posts: 836
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: FlappyFB (single source... no resource required)

Post by Mysoft »

St_W wrote:The precompiled application for Windows provided by you effectively does not work: If the window has keyboard focus it hangs and seems to ignore most keyboard input. If the windows does not have keyboard focus the animations work fluently, however it's not playable without input of course.

It seems that you did something wrong when compiling the source code or made some modifications to the source code you posted here before compiling, because when I compile the source code myself everything works.
Maybe some faulty old FB compiler version?
they both work here... on XP sp3, on my core2quad... but in any case...

you tried both of them? because the aa4x is pretty heavy... and they are indeed compiled using a slight different source... so if anything hangs, is the "vsync without 100% cpu", that may not be working there.... or maybe since it's compiled using -gen gcc, GCC did used some SSE or whatever, that isnt avaliable there? (sorry about that!) i should have mentioned :)

one thing that it can be tested in such case... is that you can press F2 to change sync mode... :) (but i need to update those binaries anyway)
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: FlappyFB (single source... no resource required)

Post by St_W »

Mysoft wrote:they both work here... on XP sp3, on my core2quad... but in any case...

you tried both of them? because the aa4x is pretty heavy... and they are indeed compiled using a slight different source... so if anything hangs, is the "vsync without 100% cpu", that may not be working there.... or maybe since it's compiled using -gen gcc, GCC did used some SSE or whatever, that isnt avaliable there? (sorry about that!) i should have mentioned :)

one thing that it can be tested in such case... is that you can press F2 to change sync mode... :) (but i need to update those binaries anyway)
Win 8.1 x64 on a core2duo here. I tried only the first one (the version without aa4x suffix).

It seems you're right with your assumption that vsync may be the problem. pressing F2 does indeed fix the problem.
mode 0: game works nearly fluently at 120 fps
mode 1: game hangs at 60 fps (in reality it rather looks like 2 fps)
mode 2: game works fluently at 60 fps
mode 3: game runs fluently on 495 fps
mode 4: game hangs a little bit at 4300 fps and CPU load is at its peak
Mysoft
Posts: 836
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: FlappyFB (single source... no resource required)

Post by Mysoft »

heh....

mode 1... does a CPU vsync loop, in realtime priority + switchtothread()
seem that windows 8 changed behavior on how switchtothread works...
so it's NOT switching to other threads... cause similar problem as we had
on freebasic without the "high priority" flag... also it probabily doesnt help
that dx7 is emulated on win8 and i use it to get the current scanline
this vsync method was better (more stable) than normal screensync
and worked really nice on single-core CPU's (thanks win8 for ruining it!)
but at least now i know :P
Lachie Dazdarian
Posts: 2338
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Re: FlappyFB (single source... no resource required)

Post by Lachie Dazdarian »

Grr...I can't make it more than 2 points! What is wrong with me?

Anyway, great conversion. I only wish you tweaked the physics and collision a bit. Then again, maybe the game is beloved so much because of its botched gameplay.
Mysoft
Posts: 836
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: FlappyFB (single source... no resource required)

Post by Mysoft »

Lachie Dazdarian wrote:Grr...I can't make it more than 2 points! What is wrong with me?

Anyway, great conversion. I only wish you tweaked the physics and collision a bit. Then again, maybe the game is beloved so much because of its botched gameplay.
yeah, i guess everyone wants to try a little more... they had to create the Flappy Bird Recovery center :P
anyway, right now i finished some improvements, over the initial single-file source... now it can:
1) use an OpenGL render... (perfect vsync!) (still software rendered)
2) it support server/client that allows one to play while the other watch (prelude to the multiplayer)
3) it shows a slowmotion replay when you hit (optionally hehe)
4) it automatically records replays of the last attempt and keep the replay of the best score...

but i dunno how far i should make it... just have some fun with concepts :P
BobPaw
Posts: 41
Joined: Dec 13, 2014 2:03
Location: Texas, USA

Re: FlappyFB (single source... no resource required)

Post by BobPaw »

On line 1136, you said case case, only one is needed.
Mysoft
Posts: 836
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: FlappyFB (single source... no resource required)

Post by Mysoft »

BobPaw wrote:On line 1136, you said case case, only one is needed.
lol, indeed, bad fix to the "Double Click" problem... that's what i get for fixing code directly on the forum ehehhe :P... fixed btw :>
Mysoft
Posts: 836
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: FlappyFB (single source... no resource required)

Post by Mysoft »

i have added two extras versions... compiled for Nintendo DS, they have some improvements over the single file version
like "replay", all that exists on the full version i will be releasing at some other time...

Nintendo DS single rotated screen
Nintendo DS dual screen dynamic camera

http://i.imgur.com/qAV15xz.jpg

Image
sgaba
Posts: 31
Joined: Aug 15, 2005 19:18
Location: Czech Republic

Re: FlappyFB (single source... added NintendoDS Versions)

Post by sgaba »

How did you do make binary for Nintendo DS? I have Nintendo DSi Xl and it is very interesting for me. Do you have some backend for Freebasic or is all game code ported to another language?
Jonge
Posts: 130
Joined: Jul 17, 2012 17:51
Location: Norway
Contact:

Re: FlappyFB (single source... no resource required)

Post by Jonge »

Mysoft wrote:heh....

mode 1... does a CPU vsync loop, in realtime priority + switchtothread()
seem that windows 8 changed behavior on how switchtothread works...
so it's NOT switching to other threads... cause similar problem as we had
on freebasic without the "high priority" flag... also it probabily doesnt help
that dx7 is emulated on win8 and i use it to get the current scanline
this vsync method was better (more stable) than normal screensync
and worked really nice on single-core CPU's (thanks win8 for ruining it!)
but at least now i know :P
I had a similar prolem when moving a project to my new Win8 machine, the code had worked before on xp and Vista, but when run on Win8 the screen refreshing was very slow(about once every 10sec). My code was still running at normal speed, and my fps counter was reporting a normal 30fps. The problem was a "Sleep 1,1" inside the ScreenLock/Unlock block.
msdos622wasfun
Posts: 21
Joined: Sep 25, 2011 1:54
Location: Michigan, USA
Contact:

Re: FlappyFB (single source... added NintendoDS Versions)

Post by msdos622wasfun »

Really well done. :-)
Post Reply