In other news, I did some play testing yesterday and found that Evidyon was only running at about 15 FPS on my machine--a far cry from the solid 60 that I used to get. Since I'm not doing anything incredibly graphically intensive, I figured something had to be wrong. I did some digging and found this:
- Code: Select all
PROFILER: total app time 49.97
8.16% - renderActors, renderMap, updateSpecialEffects, updateProjectiles, updateMap, readNetwork
>>>> 78.60% - updateActors <<<<
(... misc ...)
Updating the actors animations was taking SEVENTY EIGHT PERCENT of the computer's processing time! Wtf?! So I looked into it. Turns out I forgot to limit how frequently the actors were animated--it only needs to happen once per *rendered* frame, and not once per main loop (the main loop does things like reading input, handling network, etc. and executes about 1000 times as much as the rendered frames). As soon as I moved the updates into the main loop:
- Code: Select all
PROFILER: total app time 61.44
80.56% - renderActors, renderMap, updateSpecialEffects, updateProjectiles, updateMap, readNetwork
>>>> 3.60% - updateActors <<<<
(... misc ...)
The game should be MUCH more responsive in the next update