[MOD] Asteroid collision fix

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

[MOD] Asteroid collision fix

Post by Rubini » Wed, 22. Feb 17, 04:35

Hi mates,

This tiny mod fix that annoying asteroid collision that made our capships boost trips looks like a pool table. This annoying bug, that had already fixed in old XR versions , was reintroduced in XR 4.0 and also leads to capships long and erratic trips inside asteroid belts. XR4.0 compatible, not yet tested on XR4.10.

link:
https://www.dropbox.com/s/w9owlkgzgindy ... .1.7z?dl=0

Good boosting capships travels!
Rubini.
Last edited by Rubini on Wed, 22. Feb 17, 06:00, edited 2 times in total.

Senner
Posts: 216
Joined: Sun, 15. Aug 10, 15:12

Post by Senner » Wed, 22. Feb 17, 05:18

So does this mean that you fixed something that Egosoft could not?

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Wed, 22. Feb 17, 05:34

Senner wrote:So does this mean that you fixed something that Egosoft could not?
No, seems that they have a better and perhaps definitive fix now for 4.10RC1.
Anyhow the above link have a mistake, I will reupload it.:oops:

Senner
Posts: 216
Joined: Sun, 15. Aug 10, 15:12

Post by Senner » Wed, 22. Feb 17, 05:50

Yes but ramming into asteroids just seems so unrealistic. It must be because they could not come up with an algorithm that enabled the ships to steer around them.

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Wed, 22. Feb 17, 06:09

Senner wrote:Yes but ramming into asteroids just seems so unrealistic. It must be because they could not come up with an algorithm that enabled the ships to steer around them.
Yes, its my opinion too. What i made is just restore the same behavior as before XR4.0. So, its not a miraculous algorithm, even because I dunno if a real collision avoidance can be made on XR engine. Then again, capships will just pass into the asteroids when boosting (when taking a close external or bridge look).

XR4.0 added two main problems to this issue: the collision itself that brings that pool table feeling - and the bad side effect - sometimes the capships just took hours to travel from a zone to another because it becomes lost on the pool ball effect.

We know that 4.10 is at the door...its a pity that this fix as made too late, but its here.

Well, the link is update. Here at my end capships can now travel again normally into the asteroid fields.

Edited: another already knowing workaround was just to do all zoom out when looking for a capship boosting into asteroid fields...seems that a lod control disables the collison too...but its an annoying solution, if you forgot to zoom all out or just zoom in again...kabum!! And all immersion is lost.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Wed, 22. Feb 17, 06:43

so in short you disable the collision detection for capships while boosting right?
well, with that approach it would also make sense to switch off collision avoidance, because with 4.10 the Ships will slow-boad around the Asteroids which can also take a wille (not as much as he billiard caused by the combined inertia change from several Collisions though)


i personally found an imo even better solution:

Code: Select all

  <interrupts>
    <handler comment="Exploding Rocks">
      <conditions>
        <event_object_collided object="this.ship"/>
        <check_value value="this.ship.isboostactive"/>
        <check_value value="event.param.isclass.asteroid"/>
      </conditions>
      <actions>
        <destroy_object object="event.param" explosion="true"/>
      </actions>
    </handler>
  </interrupts>
this way the Inertia is still applied, but only for one collsision per Asteroid, not several. so only the second or third collision in sequence will throw the Ship off course, and not as much. Also you get nice Fireworks ^^ Fell free to use it - i have n intention to integrate this Snippet from my Nav Scripts into the Vanilla Scripts[/code]
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Wed, 22. Feb 17, 07:21

Hi Uni!

It works like a charm!

Anyhow i dont disabled the collision detection at all, see:

Code: Select all

<disable_collision_response object="this.ship" />
<set_avoid_collisions object="this.ship" enabled="false" />
Just the response to the collisions was disabled. Also the avoidance. This means that the ship knows that it is colliding and just dont changes its patch.
So, your suggestion works very well with this approach. I even tried it with this one:

Code: Select all

<destroy_object object="event.param" explosion="false"/>
Then you cant even see the ships passing thought some asteroids anymore. Well, its hard to say what version is better! :wink:

User avatar
ezra-r
Posts: 3420
Joined: Fri, 14. Oct 05, 21:04
x4

Post by ezra-r » Sat, 4. Mar 17, 22:33

Awesome work, community again fixing Ego's screwups, that's so nice.

--

There are some upper-lower case mismatches that will make this incompatible with Linux, as a friendly suggestion you may want to equalize the whole thing.

swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti » Thu, 23. Mar 17, 21:22

Usually its ships bounching off when they hit a roid...

How cool would it be to see the asteroids launch off into oblivions when they get rammed? :D
Totally moronic but i would sooooo use that over any other.

Huge thx for this. I've given up on waiting EGO to fix anything anymore.

User avatar
ezra-r
Posts: 3420
Joined: Fri, 14. Oct 05, 21:04
x4

Post by ezra-r » Fri, 24. Mar 17, 08:52

that would be more credible, cap ships would be more like ice breakers moving/breaking everything aside in their path (if they can't seem to navigate correctly around them)
Last edited by ezra-r on Fri, 24. Mar 17, 14:20, edited 1 time in total.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Fri, 24. Mar 17, 12:55

in that case you need a bigger Ship. because the "mass" of each Object seems to be based on its size (recently boosted a bit through Toride with a Balor, and that ship was regularly bounced back a few kms, but for Suls or Rahanas the behavior with my "Asteroid-Blow-Up"-Interrupt resulted in far less bouncing, and an Arawn just plows through seemingly without effect)
i also assume that the bounce-back in Vanilla was applied multiple times per Ship ( before the change with blowing up the Asteroids on first contact), resulting in an unnecesarily huge bounce. but that doesnt matter anymore, i heard EGO is using my variant with blowing up Astros during Boost in 4.10 RC2 - not sure if other measueres are also used (i think in RC1 they were slow-boating around Astros) or if its currently the only one.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
ezra-r
Posts: 3420
Joined: Fri, 14. Oct 05, 21:04
x4

Post by ezra-r » Fri, 24. Mar 17, 14:22

UniTrader wrote:...i heard EGO is using my variant with blowing up Astros during Boost in 4.10 RC2....
Good news, now to test..

Post Reply

Return to “X Rebirth - Scripts and Modding”