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 / What makes a Game Slower/Faster?

Author
Message
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 13th Oct 2009 20:47
Hi again! I was wondering, what code/practices makes the code slower (So I don't do them/So I can fix them) and what code/practices makes the code faster (So I can add them in). My Game is an FPS so there is always some action going on. I also wish to make it multiplayer with Raknet. Anyone have any ideas to make it faster? (So far there isn't code to show but I just want to know what can slow down a game and what makes it faster)

LOL
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 13th Oct 2009 21:55 Edited at: 13th Oct 2009 21:55
Well there are generally ALOT of ways to achieve the same goal and generally the shortest may or may not be the best.

calling functions more than once in a loop is one thing that will slow down code execution with usually no benefit(In some cases it may be necessary)

memory allocation is another. say for instance you have a char cExample[2046]; if you know that the char will NEVER be closed to filled, its best to allocate the array to a smaller value. Although doing something like this may not really show if there is just one , even though it is bad practice to do so, when you get into bigger , more advanced programs(such as a game) it will make a difference.

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
Essal
18
Years of Service
User Offline
Joined: 15th Jan 2006
Location: inside your webcam, watching YOU.
Posted: 15th Oct 2009 16:44
Are we talking about the speed of the game or the speed of the coding process?

to help make the loading time of the game shorter, use .x files for as much of your 3D as you can. .3ds files makes it slower.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 15th Oct 2009 16:49
to be more precise... use BINARY .X not ASCII .X
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th Oct 2009 17:22
Instead of .x you should use .dbo which is a mirror of the internal object structs, GDK can save these using dbSaveObject().

Login to post a reply

Server time is: 2024-11-20 13:23:42
Your offset time is: 2024-11-20 13:23:42