December 22, 2024, 08:15:54

Author Topic: Changing BOUNDS  (Read 10432 times)

Offline Justaman16493

  • Recruit
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Changing BOUNDS
« on: January 31, 2011, 08:29:00 »
Hey everyone, while i was creating missions for my mod Star Wars Eternal Conflicts i noticed something odd and rather annoying, ships move around other ships at a large distance from each other which is becoming a big problem, i found out that this barrier is a ships BOUNDS, i have checked every other mod and they do not have this problem, i checked every ini file for anything that could represent BOUNDS and iv tried looking in modding guides etc but there is nothing, so my question is how can i edit BOUNDS? 

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Changing BOUNDS
« Reply #1 on: January 31, 2011, 11:59:30 »
Sadly I don't even know if it's possible. The game seems to automatically create a bounding sphere around each model and uses that sphere for collision avoidance - all ships, including fighters, will desperately try to avoid entering the bounding sphere of another ship to avoid direct collision.

This is especially a problem for really large ships, as their bounding sphere might actually end up being bigger than some weapons' range. This makes these weapons essentially useless, since nothing will ever enter their range. This also makes it difficult for attacking ships, e.g. fighters/bombers with low-range weaponry, which might not be able to get close enough to actually use their weapons.

I believe this sphere is being calculated automatically, so I don't think we can edit it. It's most certainly not saved in the model file itself, at least.

Offline Justaman16493

  • Recruit
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: Changing BOUNDS
« Reply #2 on: January 31, 2011, 12:48:34 »
i am unsure of how im going to be able to work around this, yes alot of my ships like for example a SSD are beyond large and are the accurate size camparisons to other ships and for these ships the weapons dont even get close to the bounds when infact they should be the opposite way around with the weapons having a much greater distance than the bounds, off the top of my head the only ways to get around this are to make the weapons have extremly long ranges or to maybe shrink all ship models but even then the problem most likely will occur still, hopefully you, me or someone else might stumble upon the solution, thank you Arparso for the very quick reply and although you could not give me a solution thank you for your help

Offline Justaman16493

  • Recruit
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: Changing BOUNDS
« Reply #3 on: January 31, 2011, 13:28:37 »
i just tried to add the new model of the executor ssd to the previous version and overwrote the old model, in the old version i didnt have as much of a problem with bounds so i thought that it was worth a try and it appears that the model is the problem because the new Executor is much larger than the old one and also the bounds are much further out than the previous one, but surely there is more to it than just that the ship is larger, the gap between the back of the ship to the bounds barrier is still much larger than it should be, the distance between the back and the bounds barrier on the old one is alot shorter but isnt in "arms reach" of eachother like it should be aswell, to put into perspective of how much of a defference there is i would say that almost the whole ship of the larger version SSD could fit in the gap and on the old one only around 1/10 could fit in the gap or not even that much

EDIT - ok so i managed to make the gap alot smaller on the new ship but still there is an annoying gap which can now fit only 1/4 of the ship inside, for the moment this will have to do, i was able to change it because with all the models for the new version of the mod i made the centre of the ship to be at the back which allowed me to size the ships to the right length and ingame the middle of the ship was still the middle, the bound must of been trying to calculate the size of the ship and including the other side of the centre which made the bound sphere twice as large as it should be, if you use lightwave you might understand what i mean if not then this is a defferent way of saying it - in lightwave the ship was on the left side of the centre marker on a side on view with the ship facing left leaving the right side with nothing so it decided that the nothing side of the centre is the same length as the other side of the centre therefore making the bounds in nexus confused and using that side with nothing to add to the radius of the bounds, i still wish that the bounds were more like how the shields cover the ship though
« Last Edit: January 31, 2011, 14:09:21 by Justaman16493 »

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Changing BOUNDS
« Reply #4 on: January 31, 2011, 14:34:17 »
Yes, I believe the bounding sphere's center is always at the center of the model's coordinate space (at coordinates (0,0,0) in Lightwave). The radius of the sphere will be calculated such, that the sphere will be big enough to include the point/vertex farthest away from the center (plus some margin for safety measures).

If you model is not properly centered around (0,0,0) in Lightwave, this'll produce a much larger radius and thus a much larger bounding sphere.

... at least that's what I think happens behind the scenes. Haven't really tested it, but it'd make the most sense computationally-wise and also considering your descriptions of what you're seeing with your models.

So as a rule of thumb you should always strive to position your larger models' as close to (0,0,0) as possible, to keep the sphere's radius as small as possible. This might make for some odd-looking maneuvers if your ship is turning to change course, though. Depends on how well the perceived center of mass of your model correlates with the (0,0,0) center of coordinate space.

Offline Justaman16493

  • Recruit
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: Changing BOUNDS
« Reply #5 on: January 31, 2011, 17:37:44 »
iv centred all my models now and it fixed the problem, i can even have 2 of the largest ships fight eachother without making the weapon range drastically long, as i said thanks for your help even though i ended up fixing the problem myself :)

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Changing BOUNDS
« Reply #6 on: January 31, 2011, 18:39:26 »
Glad you got it fixed.

Ah and welcome to the forums, btw :)

Offline Justaman16493

  • Recruit
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: Changing BOUNDS
« Reply #7 on: February 01, 2011, 04:11:45 »
thank you, i should have joined this forum a long time ago