Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / fps reduction with my 3D tile based game

Author
Message
miko
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: Germany
Posted: 6th Nov 2005 23:49
Hi all,

I'm currently working on a tile-based game, trying to realize all in "real" 3D. As for the tiles, I made 3D Objects (Hexagon shaped blocks of different height and color, as for ground level and mountain level, etc).
When drawing the map, instances of those object-types are created and positioned. As the map is getting quite large (currently 40x40 fields; but shall be more), I get quite an amount of polygons (and low fps, naturally). Any tips how to speed up things a bit? Or, maybe, this is a complete wrong approach?

Please find the game (current development state) attached (exe).
If attachments won't work, it is here aswell: [href]www.mikoweb.de/tmp/mfog.zip[/href]

Thanks,
miko

Attachments

Login to view attachments
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 7th Nov 2005 10:35
70 fps here...
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 7th Nov 2005 10:41
I suspect its the text in the bottom left thats doing it - this that being re-displayed each loop ? Using text instead of sprites ?

The other thing, try not to do too much per loop - if needed, use states to determine what should happen at any given time.

One final thing : Users of mice without mouse wheels may have a problem

Come to the third DarkBasic Pro Sci Fi Con - 8 days to go! Moomoo !
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
MiR
20
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 7th Nov 2005 18:59
Isn´t the instance object command dead slow in DGDK? That might have a big affect on speed.

My signature has been erased by me because it's LARGE.
Thank you for the votez!1!
miko
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: Germany
Posted: 8th Nov 2005 15:45
Thank you all for your input.

Yeah, that "mouse without scroll wheel issue" is a good point. I'll review the user interface.

As for the slowdown:
I don't think it is about using text output. While the DSDK routines turned out to be rather slow, I use code from this boards (think it is by Sephnroth) to directly output DirectX Text/Sprites. This works quite good. So, without showing any polygons (only the text fields), I get about 500fps. Once all tiles are in, this slows down to about 70, same value as Morcilla.

Meanwhile, I got fps a bit up by reducing the number of polygons and reducing the things done on a per loop basis (yep, there were some unnecessary calls in there, too).

Um, MiR, if using instances of objects is quite slow, what else could be done? I mean, if I have the same object drawn several times onscreen (to different positions), wouldn't it be overkill to create independent objects for each one?

Again, thanks
miko
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 8th Nov 2005 16:07
If its not text, then possibly your doing too much per game loop or things are being reposition when there is not a need to.

Come to the third DarkBasic Pro Sci Fi Con - 4 days to go! Flooooo !
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 8th Nov 2005 18:05
when you say "when drawing the map, instances of those objects are created and positioned" - do you mean every time it renders? ie, every frame?

If the answer to that is yes then.. stop xD Instance the objects just once when you load the level and then position them all and leave them there, if you can. It will be MUCH faster.

MiR
20
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 8th Nov 2005 19:31 Edited at: 8th Nov 2005 19:31
You can use dbExcludeObjectOn to hide unwanted objects. I hear it´s better than just hiding them. Also mabye loading the objects as static objects would help the fps (dbLoadStaticObjects()). I have no idea if static objects are instanceable though but in theory an instanced static object should render faster than an instanced object right?

My signature has been erased by me because it's LARGE.
Thank you for the votez!1!
miko
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: Germany
Posted: 8th Nov 2005 23:45
Thanks for all that hints. I made a "clean" test program as shown below, so you could see how I did it now.



This one does only show my 1600 field objects and the debug text (see picture attached), and goes up to about 170fps.
After cleaning out some unnecessary calls, the original program (including more text and things) runs at about 130fps now.

This seems as a good point to continue, I think, eh? Enough "fps reserve" to add more features.
Still have to try that dbExcludeObjectOn and dbLoadStaticObjects thingies, tho.

Thank you all.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-03-28 10:00:46
Your offset time is: 2024-03-28 10:00:46