Error323 / E323AI

An Artificial Intelligence for Spring
http://springrts.com/phpbb/viewtopic.php?f=15&t=19450
9 stars 8 forks source link

Threatmap calculation optimization #46

Open slogic opened 14 years ago

slogic commented 14 years ago

In master branch of Spring EnemyCreated() and EnemyDestoryed() events are fixed so we can switch into even driven mechanism. 1) there is no vector reinitialization each update where can be up to 500 items 2) we can remove or extend restriction of 500 untis to be considered 3) we can provide another threatmap layer for static units, so we can use their precalculated values; also such maps vary seldom 4) we can implement buffer technology to calculate threat per fixed unit chunks, until all units processed. then this buffer becomes active threatmap layer. so we can predict CPU consumption will never raise above some value.

Your ideas are welcome.

Error323 commented 14 years ago

Well I guess the main question is: "Does the threatmap update() come up high in the profiler?" If so then this will be a good investment, if not I don't see the direct need.

slogic commented 14 years ago

As i remember your graph, threatmap is eating more and more CPU closer to middle-end game. Generally there are three logic blocks eating CPU: repathing, tasks & threatmap.