Smart Area Reclaim
Moderator: Moderators
Re: Smart Area Reclaim
i think that reclaim queue goes wrong, it makes zigzag when i put unit reclaim an area, so it doesnt try to find the next nearest, it takes nearest from the middle spot
Re: Smart Area Reclaim
aegis wrote:todo:
- optimized reclaim sorting (don't zigzag)
Re: Smart Area Reclaim
I have an idea for a quick algorithm to do so and will upload a new version soon
a fully definitive algorithm based on closeness of features would require many iterations unless I'm missing something
a fully definitive algorithm based on closeness of features would require many iterations unless I'm missing something
Re: Smart Area Reclaim
maybe make it call a function every time it has reclaimed one ? like the normal reclaim does now, i think.
so uh, i think this should be implemented in spring engine.
so uh, i think this should be implemented in spring engine.
Re: Smart Area Reclaim
I'm pretty sure I can't check every time it finishes a reclaim in a widget without polling (which I want to avoid)
but what I'm doing now should work
but what I'm doing now should work
Re: Smart Area Reclaim
optimal algorithm is the online traveling salesman problem (as if the "standard" TSP wasn't hard enough), don't bother.
Re: Smart Area Reclaim
its better when it doesnt do it THAT optimal :)
easier to predict where they go when they just takes nearest every time they reclaim some other.
if i had just one reclaimer, then that optimal way would be best.
and i doubt it would work well anyways, since the features can be reclaimed before some optimal reclaimer reaches that feature
so it would just kind of fuck up anyways...
easier to predict where they go when they just takes nearest every time they reclaim some other.
if i had just one reclaimer, then that optimal way would be best.
and i doubt it would work well anyways, since the features can be reclaimed before some optimal reclaimer reaches that feature

Re: Smart Area Reclaim
almost done with a better algorithm

edit: I noticed the bottom left quadrant was reversed. it's fixed now but I'm too lazy to upload a new screenshot
if you can't tell, it's reclaiming every tree in range of the tower around in a circle
since the distance doesn't matter for nano speed, this is the fastest possible way to reclaim a circle of trees :)
(new update: stationary units don't try to reclaim features outside of their range)
I need to update it for mobile cons, then I will release

edit: I noticed the bottom left quadrant was reversed. it's fixed now but I'm too lazy to upload a new screenshot
if you can't tell, it's reclaiming every tree in range of the tower around in a circle
since the distance doesn't matter for nano speed, this is the fastest possible way to reclaim a circle of trees :)
(new update: stationary units don't try to reclaim features outside of their range)
I need to update it for mobile cons, then I will release
Re: Smart Area Reclaim
It wouldnt make more sense to make the movement circular?


Re: Smart Area Reclaim
not in the sense you are thinking
it's already using a circle
your idea would make it constantly turn the nano turret
it's already using a circle
your idea would make it constantly turn the nano turret
Re: Smart Area Reclaim
sounds like a usefull widget. Will try it once u finish it.
Re: Smart Area Reclaim
that is still zigzag? why cant you make it work as it works by default?
Re: Smart Area Reclaim
Because the default is horribly inefficient compared to aegis' way of doing it. At least for nano turrets, don't know how well it applies to normal cons..
Read aegis' posts again carefully, I think you're misunderstanding something.
Read aegis' posts again carefully, I think you're misunderstanding something.
Re: Smart Area Reclaim
i just looked at the pic he posted, and its zigzag, unless im fucking blind.
hold on, NANOTURRETS? who the fuck reclaims trees with nanoturrets. we use rez bots >_>
NOBODY goes in middle of map and build nanotower there and then reclaim trees.
hold on, NANOTURRETS? who the fuck reclaims trees with nanoturrets. we use rez bots >_>
NOBODY goes in middle of map and build nanotower there and then reclaim trees.
Last edited by TradeMark on 18 Aug 2008, 16:49, edited 2 times in total.
Re: Smart Area Reclaim
You *are* fucking blind. It's a nano turret, it stays static, and it reclaims everything in a circle. It just does so in an order in which it minimizes time spent rotating (which is time wasted).
Re: Smart Area Reclaim
Didnt look carefull enough on the pic.aegis wrote:not in the sense you are thinking
it's already using a circle
your idea would make it constantly turn the nano turret
I was thinking of cons or the commander.
When inside the designated reclaim zone a unit can reclaim in a circular movement centered at its location.
If the unit is outside the relcaim zone the circular movement can begin from the entry point into the zone by the unit.
(for nano turrets its of course not good since they dont waste time moving)
in any case its not THAT important as long as you nanpo and the enemy's work the same.
Re: Smart Area Reclaim
bonus points for simulated annealing solution.
- TheFatController
- Balanced Annihilation Developer
- Posts: 1177
- Joined: 10 Dec 2006, 18:46
Re: Smart Area Reclaim
Wouldn't sending that many commands (assuming its a loop with GiveOrderToUnit(unitID, CMD.RECLIAM, featureID, {"shift"}) be pretty spammy with netcode etc?
I'd build an optimized list eg:
reclaimList[unitID] = {sortedlistoffeatures}
Then set the unit to reclaim the first first feature and cycle through the rest of the list every time UnitIdle was called until it ran out of features or received a player command.
You could then go a step further and do stuff like remove features from the queue if an enemy fixed defense was spotted in range of them.
I'd build an optimized list eg:
reclaimList[unitID] = {sortedlistoffeatures}
Then set the unit to reclaim the first first feature and cycle through the rest of the list every time UnitIdle was called until it ran out of features or received a player command.
You could then go a step further and do stuff like remove features from the queue if an enemy fixed defense was spotted in range of them.