eronoobos / BABAR-The-Shardifant

Balanced Annihilation & Balanced Annilhation Reloaded configuration for Shard
2 stars 1 forks source link

pathfinding #73

Open eronoobos opened 8 years ago

eronoobos commented 8 years ago

Rather than addressing issues I started adding A* pathfinding, so that for example raiders can choose paths to their target that avoid defenses. Bugs are hard; new features are fun.

Right now the basics work for raiders (but I don't want to push changes because it's pretty rough), which I adapted from the worm's pathfinding in https://github.com/eronoobos/cattle-and-loveplay . It includes deferred pathfinding, so that cpu spikes are not an issue.

Once raiders are working well, I think I'll have scouts and attackers do the same.

In the LuaAI, It would be much better to use the engine's pathfinder for terrain, and somehow augment it with the AI's threat map. But I'm not sure how to do that. Deforming the engine's path would result in a path with points on potentially bad terrain.

eronoobos commented 8 years ago

https://github.com/eronoobos/BABAR-The-Shardifant/tree/pathological driving myself nuts, just like the raiders are with these changes

pandaro commented 8 years ago

hard to fallow this complex add-on but happy to see a so good idea in the pit. I see you take the a-star from somewhere u made it? is free software?in theory im able to write an a-star by my self, but maybe is my opportunity to learn how to write a well done one. good job, i will push something in the weekend

eronoobos commented 8 years ago

https://github.com/eronoobos/BABAR-The-Shardifant/commit/cacfd01ae4a0d715cc5a1a0e0192b17f18b7bcf3 (and its parents)

raiderbehaviour now only activates when it has a path to target, which works out alright because the fallback behaviour is scoutbehaviour, which does a bit or raiding on its way. adding pathfinding to raiders is a tradeoff: they are a bit slower to find and move to their targets, but they don't get confused by large areas of enemy defense on their way to their targets.

a happy side effect of my overhaul of raiderbehaviour is that air raiders are far more effective now