
all help is appreciated :)
Moderators: MR.D, Moderators
Code: Select all
r = rand();
if r > 0.75
go_up()
else if r > 0.5
go_down()
else if r > 0.25
go_left()
else
go_right()
Code: Select all
rts/Sim/Units/UnitLoader.cpp:276:
unit->model = modelParser->Load3DO((ud->model.modelpath).c_str(),ud->canfly?0.5f:1,side);
//this a hack to make aircrafts less likely to collide and get hit by nontracking weapons
rts/ExternalAI/AICallback.cpp:1063:
S3DOModel* mdl = modelParser->Load3DO(ud->model.modelpath,ud->canfly?0.5f:1,0);
rts/ExternalAI/AICallback.cpp:1070:
S3DOModel* mdl = modelParser->Load3DO(ud->model.modelpath,ud->canfly?0.5f:1,0);
collision detection not pathfindingAF wrote:Its in AI Wisdom 3 IIRC.
You take weight in the direction you want to go and follow it. You then exert counter weights on nearby objects to encourage them to move away from you.
This sort of system is lightweight, fast, proven, scalable, and nice and simple, and it'd do wonders for some of the pathfinding qurks we have.
I was thinking of implementing an fbi tag to scale 3do hitspheres. Easy enough to do, on the whole, but what's going in AICallback.cpp?trepan wrote:The related code (as far as I can tell)
P.S. The line numbers are based on taspring_0.74b3Code: Select all
rts/Sim/Units/UnitLoader.cpp:276: unit->model = modelParser->Load3DO((ud->model.modelpath).c_str(),ud->canfly?0.5f:1,side); //this a hack to make aircrafts less likely to collide and get hit by nontracking weapons rts/ExternalAI/AICallback.cpp:1063: S3DOModel* mdl = modelParser->Load3DO(ud->model.modelpath,ud->canfly?0.5f:1,0); rts/ExternalAI/AICallback.cpp:1070: S3DOModel* mdl = modelParser->Load3DO(ud->model.modelpath,ud->canfly?0.5f:1,0);