Saucer - PB4 Game test

Advanced game related topics
lethalpolux
Enthusiast
Enthusiast
Posts: 171
Joined: Sun Jun 08, 2003 10:50 pm
Location: France
Contact:

Post by lethalpolux »

I like It! it's cool!
150 fps too... ( PIV 2.8 Intel graphics integrated 1Go RAM )

Good Work!
Pol.
Intel Core2Duo 6600 - 3Gb DDR2 - Geforce8800Gts - Vista Home Premium 32bits
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

Post by moogle »

150 fps. Athlon XP 2700 1 GB ram
Image
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

amd64 3000 gforce 6600gt 150 fps
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Re: Saucer - PB4 Game test

Post by dagcrack »

If you went with multi-threading, you'll probably get better results.

Things that would kill your perf on a 2D game:

1) the fillrate. for example, the more you draw, the more you must process. (Have a fallback method, if the FPS' go under XX, start lowering the graphics quality... For example, the particle emmiters, etc).

2) bits per pixel! (same as before, the more colors you use, the more memory you're "wasting"). So if you can, stick with 8bpp (at least on low end systems you'll notice a heuge speed increase, since theres much less data to move, its faster).

Hope that helps. Go with multi-threading, it wont bite!.


Thread 0 (main program thread) .. Have it run at about 10fps, at there you will just check the window's events and minimal things such as that (also check if the window is active, else, fall into a sleepy loop until its active).

Thread 1 :
Graphics rendering (no limit on speed here, also set maxfps to 1000 if you want. For keeping things smooth a frame tweening system would do, instead of limiting your framerate -both do a great job though-).

Thread 2 :
I/O (20fps would do, but depends on what you need for your game).

Notice: if you're going to pause your game (say you went out of focus and the game went into pause/sleep/idle mode) You will have to pause your threads as well!. Have a struct where you share info among the threads, this will help you.

Usualy you should have a struct with main program data.. This is, window sizes, desktop sizes, window handle, quit variable, thread variables, etc. (quit variable, this is quit=1 then you quit the threads, dont forget it, clean code makes wonders, dont rely on "automatic ending" that PB would give you, if your thread is doing something, chances are it wont quit until its done).

-
About the BPP... This also depends if you're using PNGs with an alpha channel or not ...

! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Tested your "game" on ancient hardware (seems that you wanted this kind of tests?).

P2Xeon 350mhz | NVvantaXL : 35FPS constant

*gets wet wip out*

One thing I noticed, against the 150fps that I was getting here.. You're not using frame tweening.

*slaps hard*

You're moving based on fixed floating point values! This is wrong!. When designing a game, if you really want to make things work smooth on any framerate, you must move by time / tweening and not by framerate.

*slaps harder and puts the wip away*


Hope you get this nailed for the next release. Its got some fun potential, just take care on the perf here.. dont go too wild until you've got the perf issues solved!.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
vanleth
User
User
Posts: 79
Joined: Sat Jun 28, 2003 4:39 am
Location: Denmark - Valby

Post by vanleth »

dagcrack wrote:You're moving based on fixed floating point values! This is wrong!. When designing a game, if you really want to make things work smooth on any framerate, you must move by time / tweening and not by framerate.

*slaps harder and puts the wip away*


Hope you get this nailed for the next release. Its got some fun potential, just take care on the perf here.. dont go too wild until you've got the perf issues solved!.
Thanks for the constructive suggestions Dagcrack.
Got it adjusted to time based movement now, and made some other tweaks. And you are right, better get the basics perfect before moving on. Hope to come with the improvements in a week or so.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

I'll be glad to test on the crappy system when you've got a new build ready ;)
You see now the benefits of keeping old hardware ? :)

It's very good for development to have several systems, when possible.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
vanleth
User
User
Posts: 79
Joined: Sat Jun 28, 2003 4:39 am
Location: Denmark - Valby

Post by vanleth »

dagcrack wrote:I'll be glad to test on the crappy system when you've got a new build ready ;)
You see now the benefits of keeping old hardware ? :)

It's very good for development to have several systems, when possible.
lol yea so true, it feels like testing in the darkness without a wonderfull slow PC.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: Saucer - PB4 Game test

Post by NoahPhense »

That's tight! ...
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Got 226 FPS, Intel Pent IV 3.2 Ghz - 4 Gb ram - ATI 800 series vid card

I spent about 30 minutes playing it.
newart
User
User
Posts: 34
Joined: Sat Feb 12, 2005 1:59 am
Location: Russia, SPb

Post by newart »

20 fps

Athlon 1.4/Riva TNT2 32mb/Win XP
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

Post by SoulReaper »

can anyone supply a small sample of time / tweening as i am still left wonderering how this can be done to some effect... :?

any info would be welcome :)

can it be used in 3d as well as 2d :?:

Regards
Kevin :wink:
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

148 FPS on:

Celeron 2.2
768MB 2100 SIMM
ATI Mobile 9000


Notes: The game is taking shape nicely!
Intrigued - Registered PureBasic, lifetime updates user
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

SoulReaper wrote:can anyone supply a small sample of time / tweening as i am still left wonderering how this can be done to some effect... :?

any info would be welcome :)

can it be used in 3d as well as 2d :?:

Regards
Kevin :wink:
It's mostly the same thing.

What you're doing is first of all moving entities or sprites by time means and not by fixed values like 0.01 directly, I believe this is easy to understand, now, it might be harder to implement for some people.

If you move by time, as you know, even though its been said that "time can be stretched" (I believe so, not the case -mostly- so lets not go offtopic here!) - Time is constantly moving and it will move the same here than on your office. Anyway, the time we are refering here is the elapsed milliseconds since your PC booted up. You can go the GetTickCount() way or use your own timer system based on a high res timer.

We'll refer to this as delta-time movement (or delta timing if you want) from now on, just to make things "more clear"...

So, I posted a class and an example here:
http://www.purebasic.fr/english/viewtopic.php?p=136648

I hope it helps.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

Post by SoulReaper »

Thankyou very much Dagcrack for your answer on this subject :wink:

Time flys when ur having fun as einstein would say :twisted:

Regards
Kevin
Post Reply