abraker95 / tanks

2D arcade top-view shooting game
1 stars 0 forks source link

CPU usage debug info #44

Closed ghost closed 9 years ago

ghost commented 9 years ago

We need a debugging tool for cpu usage. Something like a task manager where we see in percentage how much each system uses.

I just noticed now that the physics system was using a lot of computations. Now that I fixed it, it went from 10 -> 900 fps ( insane! ) with an 1024 entities pool.

ghost commented 9 years ago

Making a benchmarking tool is not a bad idea. Something to display how many percent of cpu the individual systems are taking as well as how much memory is being used by which set of components.

On Tue, Dec 16, 2014 at 4:37 PM, Sherushe notifications@github.com wrote:

We need a debugging tool for cpu usage. Something like a task manager where we see in percentage how much each system uses.

  • input system ( 2% )
  • ui system ( 5% )
  • physics system ( 30% ) etc...

I just noticed now that the physics system was using a lot of computations. Now that I fixed it, it went from 10 -> 900 fps ( insane! ) with an 1024 entities pool.

— Reply to this email directly or view it on GitHub https://github.com/Sherushe/tanks/issues/44.

ghost commented 9 years ago

I have noticed a weird crash after trying to run the game several hours after I pushed dealing with the Update function in the CPU Manager. It's something with the label pointer, but not sure how. I had the thing working several hours back. The memory probably got cleared during that time, I think Windows was just reusing memory block from the previous runs.

ghost commented 9 years ago

By the way, even though the Render System was not shown in the debug info I estimated it to these values when turning off every other system.

Render System:

ghost commented 9 years ago

Oops should have posted here not in the main disscussion so:

Great everything compiles and work.

Just 2 things we could improve in the future:

Average the elapsed times so it's not flickering too much Elapsed time for the rendering system would be nice

ghost commented 9 years ago

It is getting the elapse time for the Render System, but since it's rendering before it is displayed, it's not shown. I will look for a fix.

On Thu, Jan 1, 2015 at 5:53 PM, Sherushe notifications@github.com wrote:

Oops should have posted here not in the main disscussion so:

Great everything compiles and work.

Just 2 things we could improve in the future:

Average the elapsed times so it's not flickering too much Elapsed time for the rendering system would be nice

— Reply to this email directly or view it on GitHub https://github.com/Sherushe/tanks/issues/44#issuecomment-68501218.

ghost commented 9 years ago

Important note: The framelimiter has an effect on the render system runtime Also I think averaging might be unneeded. If you want to see the values at a certain time, dragging the window pauses the application, allowing you to see the values at that instance.

ghost commented 9 years ago

I see. We should put the framelimiter in the release version then. If we can't see the elapsed time in the rendering system it's a problem.

Ok I didn't think of dragging the window. In the future, we should average values though. If the values are oscillating too much, taking a value at a point in time doesn't give a good idea.

ghost commented 9 years ago

I found very strange behavior. Have the tanks shoot each other until their health is in the red zone. Then have both tanks keep shooting bullets into blank space. Take a look at the FPS and the Physics System. What is even more bizarre to me is that the FPS sometimes is low even when the Physics System's CPU time is less than 500 us.

The average lowest seems to be ~70 FPS, but I had mine drop to 30 FPS for a second on one occasion.

ghost commented 9 years ago

it's probably the collisions checking. It has almost no optimizations whatsoever.

For the strange numbers, it's just one frame maybe. Sometimes it does jump for no reason, because of background processes.

Btw if you don't do it, I'll fix the flickering. I don't really see the point to keep it unreadeable like that. and picking a value at one frame is not very meaningful.

ghost commented 9 years ago

I don't want say I won't do it, but I don't want to say I will do it soon either. The the frame limiter had the same treatment, now that I think about it.

On Fri, Jan 16, 2015 at 7:13 AM, Sherushe notifications@github.com wrote:

it's probably the collisions checking. It has almost no optimizations whatsoever.

For the strange numbers, it's just one frame maybe. Sometimes it does jump for no reason, because of background processes.

Btw if you don't do it, I'll fix the flickering. I don't really see the point to keep it unreadeable like that. and picking a value at one frame is not very meaningful.

— Reply to this email directly or view it on GitHub https://github.com/Sherushe/tanks/issues/44#issuecomment-70245711.

ghost commented 9 years ago

Everything here is done.