Asher Posted 1 hour ago Share Posted 1 hour ago Would it be helpful if when the game is paused or the ai is not doing a lot or when it is early on in the game, that it planned the next commands or tasks that it would execute (where to build, etc.), and store it in the ram, then it checks if that command would still work when the time comes to execute, and if so, it does it. The idea is to take some strain of the cpu when you are in a more cpu heavy part of the game with lot of units/structures, by calculating certain things when you aren't doing much. Now, if it is storing it in the ram, and you need more ram for the current stuff, it could just delete the current instructions, or like memory swapping, save it to the disk. I don't even know if it would help, or if it would make it worse. (sorry if this doesn't make sense ) If you are confused, just say so, and I can try to explain it better Link to comment Share on other sites More sharing options...
Asher Posted 1 hour ago Author Share Posted 1 hour ago I was thinking of how an operating system uses extra ram to speed stuff up; "unused RAM is wasted RAM". I was wondering if that could apply to 0ad somehow Link to comment Share on other sites More sharing options...
Genava55 Posted 1 hour ago Share Posted 1 hour ago This won't work for 0AD. The main issue late-game is CPU lag from live pathfinding and unit checks, not a lack of RAM. Precalculating AI plans early on wastes CPU cycles because as soon as a human player moves a single unit, the AI's precomputed plan is invalidated and has to be thrown out anyway. Disk swapping AI instructions would also cause massive frame stuttering. Link to comment Share on other sites More sharing options...
Asher Posted 58 minutes ago Author Share Posted 58 minutes ago 1 minute ago, Genava55 said: This won't work for 0AD. The main issue late-game is CPU lag from live pathfinding and unit checks, not a lack of RAM. Precalculating AI plans early on wastes CPU cycles because as soon as a human player moves a single unit, the AI's precomputed plan is invalidated and has to be thrown out anyway. Disk swapping AI instructions would also cause massive frame stuttering. The purpose was to free cpu space, not ram Link to comment Share on other sites More sharing options...
Genava55 Posted 52 minutes ago Share Posted 52 minutes ago 2 minutes ago, Asher said: The purpose was to free cpu space, not ram Still, precalculating AI decisions early on won't work. Game state changes so fast that plans become completely invalid beyond just a few seconds into the future. That early precomputation does zero to relieve late-game CPU strain, in fact, it does the exact opposite. Constant re-planning wastes processing cycles, massively complexifies the codebase, and drastically increases the risk of CPU throttling right when performance matters most. Link to comment Share on other sites More sharing options...
Asher Posted 49 minutes ago Author Share Posted 49 minutes ago 2 minutes ago, Genava55 said: Still, precalculating AI decisions early on won't work. Game state changes so fast that plans become completely invalid beyond just a few seconds into the future. That early precomputation does zero to relieve late-game CPU strain, in fact, it does the exact opposite. Constant re-planning wastes processing cycles, massively complexifies the codebase, and drastically increases the risk of CPU throttling right when performance matters most. ok Link to comment Share on other sites More sharing options...
Genava55 Posted 46 minutes ago Share Posted 46 minutes ago The biggest part of the problem is calculating pathfinding and collisions between units. That's the main source of problems in all RTS games. And unfortunately, it has to be done in real time. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now