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.

DarkBASIC Discussion / Increasing frames per second

Author
Message
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 24th Jan 2004 14:00
Hi guys!

I'm building a 3d RTS game... Everything works fine (for now) but the FPS rate drops more and more. My game is working with a matrix of 64*64 tiles, that eats power i know... but i can't use x files because if you build a building in my game the ground is flattened... thats easy with a matrix, but you can't do it with a directx file . Maybe there are other ways to free up some speed. If you know some things plz let me know.

Ow yeah one thing... i cant change the camera range (its 5000 now) because that screws the sight of the rts camera...

Juzt a dude who likez progging - Me loves RTS games
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 24th Jan 2004 22:13
try hiding objects that are off screen
you could do something like this (you will have to change it a bit tho)


that just says if the object is not on screen then hide it, then you could make one that unhides them

Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 25th Jan 2004 12:00
Does that really help that much??? Thanx m8!

Juzt a dude who likez progging - Me loves RTS games
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 26th Jan 2004 05:08
i dono how much it helps, but i hear that it helps...a lot of a little, is a lot. so if you do a whole bunch to help your FPS just a little, will eventually show

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Jan 2004 11:18
Hiding objects that you can't see help a LOT.

Also, throughout your code, make sure you are continually checking flags... ie,

if it's moving,
...if it's coliding.
......do something.
...EndIf
EndIf

That way, you aren't checking/doing things that don't need to be done ( you don't need to check for collisions with a stationary object etc ).


Quote: "but i can't use x files because if you build a building in my game the ground is flattened... thats easy with a matrix, but you can't do it with a directx file "


You can do that, just use memblocks to get a mesh, edit the points, then recreate the object.

But, you then have to figure out your own get ground height function.


Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 26th Jan 2004 17:02
I can make that get ground height, no match 4 me But i tried to change the mesh points, but i screwed everything up... Snippets?

Juzt a dude who likez progging - Me loves RTS games
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Jan 2004 17:53
Have a look in the Code Base for "Vertex Manipulation", someone posted some code for memblock vertex manipulation ( mesh manipulation ). It's not the easiest to understand, but once you know what you're doing, It's simple.

Hope I Helped..
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 28th Jan 2004 04:01
Yeah, hiding objects that are not on the screen can help a lot.

I took the matrix out of my game (it is now two ghosted plains, one with a repeating texture, the other with a very small texture stretched out) and it sped it up quite a bit, escpecially with the bigger matrices. I didn't have to do vertex manipulation, but I am sure that you can figure it out if you try.

A couple other things that speed up games:
-use lower resolution textures when you don't need a higher one. Try decreasing the size of your textures until you notice pixelation on your objects, then stop.
-Make options to turn off special effects and lower the screen resolution, it helps a lot
-Change the camera fov, it will fix the fish-eye effects on the camera, and display a few less polygons, speeding it up. If in Classic, change it to 1.0, if in Pro, change it to 50
-Check the models that you are using for extra polygons. I checked a few of my older models recently and cut the number of polygons on them in half, it sped it up a lot.

If I think of any more, I will post them.

Good Luck

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 28th Jan 2004 18:57
Looks useful

Juzt a dude who likez progging - Me loves RTS games
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 28th Jan 2004 20:04
Here is some code for hiding and showing objects that are or aren't on the screen:



Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
Debbie McDowell
21
Years of Service
User Offline
Joined: 14th Oct 2003
Location: Florida
Posted: 28th Jan 2004 20:56 Edited at: 28th Jan 2004 20:58
I would assume you have set up like this

sync on
sync rate 0

it goes in that order or it will go right back to 30 fps or less.
Visual range and fogging as well as what others have mentioned can
affect your frame rates too.

PS Hi Jess
It is very good to see you here my friend
I am finally home from the hospitol and trying to get used to all the time to myself to actually get things done.

I couldnt help but make comment about you in the DB PRO forum
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 28th Jan 2004 21:42
syncrate 0 is default or am i just dumb?

Juzt a dude who likez progging - Me loves RTS games
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 28th Jan 2004 22:54
depending on your system settings (if you have sync enabled or not in directx), you can make a huge difference to the game speed by enabling sync rate 0, if your dx waits for a sync then your max fps speed is whatever the monitor is set too, if you have the sync disabled then it will be the same as setting the sync rate to zero, just try setting sync to zero or go into advanced settings and check you have the "wait for vertical sync" set to either "always off" or "application preference" (this is in XP).

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD (using icewave hd coolers ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800Pro 128mb.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 29th Jan 2004 11:13
A little method I worked on for a while ( it took me a while to work it out and convert my code ) was to only sync every two loops.

This allows you to do math calculations all in the first loop, and set up all sorts of variables, then in the next loop ( before the sync ) you move all your objects and check for collisions etc, then store some more variables ready for use in your next loop where the math is done, then you sync it.

It's alot like the solution for the 2D on 3D problem you had in your other post, except you apply that method to your entire code.

I managed to effectively double my FPS ( as I was only syncing once every two loops ) and it made for a much smoother game.

Although, it is extremely difficult to convert code into this format, and I suggest against it, you're better off just remembering this for the next time, so that you can impliment it them.

Jess.

PS, Hey Debbie


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Travis
21
Years of Service
User Offline
Joined: 9th Nov 2003
Location: West Aust.
Posted: 29th Jan 2004 15:18
very cool idea

i wouldnt mind using that in my game cause its gunna get pretty slow
but im just thinking what implications it might have?....
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 29th Jan 2004 18:26
@ Mentor - Tanx 4 explaining

@ Jess - Oof! My game is hard to build now, but maybe i can do it

Juzt a dude who likez progging - Me loves RTS games

Login to post a reply

Server time is: 2025-05-22 12:10:47
Your offset time is: 2025-05-22 12:10:47