Page 1 of 1

Collision Sphere Problem

Posted: 28 Jan 2007, 05:21
by Relinquished
If anyone cares to help, I'm having problems with the collision sphere, just look for yourself:

Image

all help is appreciated :)

Posted: 28 Jan 2007, 05:34
by smoth
spring dicks with the spheres on aircraft. I have asked several times that the devs change it.

Posted: 28 Jan 2007, 10:35
by SJ
Its because aircrafts collided too much with each other midair and where hit too easily by lasers etc. So spring halfs the collision sphere for all air units since 0.5b or so.

Posted: 28 Jan 2007, 10:39
by smoth
Is the collision still an issue? I was thinking of doubling the hitspheres to counter that but if you gents are going to change it I didn't want to make that mistake.

Posted: 28 Jan 2007, 13:14
by AF
Would a proper steering behaviour not fix the issue of collisions?

The sort of sterring that could steer 600 monsters on a gameboy classic with no lag would do very well here.

Posted: 28 Jan 2007, 14:44
by Relinquished
So doubling the sphere would work? Just because right now that plane isn't getting shot down in-game (actually none of them are) because the sphere is too small

Posted: 28 Jan 2007, 14:46
by Kloot
The sort of steering that did this, you mean:

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()

Posted: 28 Jan 2007, 20:47
by KDR_11k
This stupid behaviour should be removed, if the planes are too large it's the duty of the modder to correct that.

Posted: 28 Jan 2007, 20:58
by trepan
The related code (as far as I can tell)

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);
P.S. The line numbers are based on taspring_0.74b3

Posted: 29 Jan 2007, 04:00
by AF
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.

Posted: 29 Jan 2007, 15:59
by iamacup
AF 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.
collision detection not pathfinding :P

Posted: 29 Jan 2007, 17:56
by AF
It is pathfinding on a very basic level. For one its a very poor collision detection routien because there are conditions where it would overlap units onto eachother if cramped together.

It was used as pathfinding in consoles in the early days, a weight would be placed on the object moving to pull it towards a goal position and it would maneuver around other objects which exerted counter weights. It works best when guided by a more generlised pathfinding system to place multiple goals.

Posted: 04 Feb 2007, 22:39
by FLOZi
trepan wrote:The related code (as far as I can tell)

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);
P.S. The line numbers are based on taspring_0.74b3
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?

edit: nvm, easily fixed the way i did the tag