• entries
    116
  • comments
    115
  • views
    104845

Ludicrous speed

Sign in to follow this  

269 views

I worked on the game code yesterday. The collision tests were taking too much time (the game update was taking up to 8 ms while the player was moving) so I tried to improve this. And of course, I found something I was doing wrong: to go through my lists, I can do a sequential access to nodes (GetFirst/GetNext) or a "direct" access (GetNode(number)). And to check the static objects in the collision test I was using GetNode(number), which is a lot slower. The update is now taking less than 3 ms. The frame time dropped from 13 ms to 8 ms. I am sure there are other places where I did this, I will have to check my code in order to improve scalability. Maybe I will add a space partitioning structure to handle a lot more objects... I will see.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now