I now sort of understand why Cadius uses Saftey Nets.

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

I now sort of understand why Cadius uses Saftey Nets.

Post by Litcube »

There's two different collision issues floating around the forums lately.

1) Faulty autopilot

2) Absence of collision information.


These are two entirely different issues, I've come to discover. The causes for each are:

1) Fault autopilot: Over optimized autopilot code, or lack of implementation of proper autopilot. This cannot be fixed at it's root (hard-code), but can be remedied by certain script packages.

2) Absence of collision information: This is caused by any model compiled by X2BC, as X2BC strips all collision information. With this issue, it wouldn't matter if issue 1) did not exist, as regardless of the efficiency of the autopilot, the game doesn't recognize that there's a physical presence in the game.




Now, I have a question. I tried using X2BCIDE, which looks as thought MoonRaven and DoubleShadow worked together on, yet it doesn't strip collision information. I've tested and verified this, even by decompiling a DS made bob into a DS made BOB, and then compiling it again with X2BCIDE with all information written (those three checkboxes). So it works. Ships do try to avoid.


I'm hearing rumours about possible side effects with X2BCIDE, such as bump map issues. I am not seeing any obvious problems with the models with which I've performed the above information. Am I blind? What should I be looking for in terms of flaws in X2BCIDE made bobs?

Edit: In summary, non rhetorical question: If X2BCIDE puts out collision information, why do we have things like collision objects in mods?
User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden »

I'm not quite sure what you want to say.

I've always compiled models with X2BC and they work collision-avoidance wise, provided you took the necessary steps.
2) Absence of collision information: This is caused by any model compiled by X2BC, as X2BC strips all collision information. With this issue, it wouldn't matter if issue 1) did not exist, as regardless of the efficiency of the autopilot, the game doesn't recognize that there's a physical presence in the game.
The problem is not X2BC. The Problem is DBOX. It does not generate the collision avoidance information that is necessary for .bob to begin with. (coll. avo. tut in my sig) So if you import a vanilla Model in gmax and export it + compile into .bob... it is doomed to be crashed into, so to speak ;)

If it works with bod (i have never tested this myself) then either there is something different in the engine to automatically generate the avoidance from the body itself while its loaded, or generate it in real time (no idea).
Possible negative sideeffects asside, i dont think there is a way to tell the engine to use bod avoidance without the proper line.

Remember that there is some kind of basic avoidance for each and every object. Put a camera dummy into a scene and approach it. The AI avoids it. Even without volume or other sneaky line-voodoo-fu. That doesnt mean this basic avoidance (i've called it 0-avoidance, because its always at the pivot of the object) is large enough to "protect" your object.

Can you be more precise about how you test, what objects, etc? (and upload a file) I could also be wrong of course, atm i think you might have found a blue moon.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

I did read your document; a few times.

I just ran some more tests. Well now I'm unsure of everything, and my original post is outdated.


One of the tests I just did was with a Titan, vanilla. I use a setup script to set playership, titan1, and titan2, on the same axis, but 2KM apart from each other, and immediately set the playship to follow the furthest titan. I can rerun this script several times a minute tied to a hotkey so I can get a feel for the collision information in the ship.

Here's the thing. I opened the titan in 3dsmax, exported it with DBOX2, and compiled it with X2BC.

I ran the test again, and I can't see any difference on how the ships avoid the titan. Either the difference is minute (the difference between your 0 collision theory) or there isn't one (collision is auto generated).



Like I said, I read your document, and it's clearly thought out and detailed, but what I'm trying to do here is provide evidence that this issue exists.

I'm not sure. Perhaps you have a test idea** I can use to clearly demonstrate these theories once and for all so that there's no misinformation. I don't mind writing the scripts or putting together the bods.






** that does not inolve using saftey nets or collision spheres, or XTCs method. It's obvious that the remedy has an effect on avoidance. The issue here, is evidence that there's an issue to begin with.
User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden »

Yeah that's what i meant. Sometimes it seams like "this is it!" ... and then suddenly it doesnt work anymore if you do more testing. Happened to Jeff and me as well while working on this.


I think it would be best to test a ship with only a cockpit cameradummy + the ship body in the scene.
That would exclude all interference from other stuff.

Second - try also with other constellations. i.e. let AI ships attack the changed ship or other methods.

Third - try also with various other ship models (large, medium and small).

I didnt got the thing with X2BCIDE. The IDE is just an IDE version of X2BC isnt it? It uses the X2BC algorithm/exe, it just gives you an UI for the input instead of command line. Writing an IDE is not that difficult if you are into that, iirc LC4Hunter did also write one. So the bob file that comes out should be exactly the same as the cmd-line x2bc version.

****************
[edit]
The 2 methods i've used primarily where:
1 - spawn the target ship and 6 ships around it ( + and - y; + and - x, + and - z). Now let the + follow the - ship of each axis (or vise versa).

2 - spawn the target ship, make it hostile (enemy race so it wont start to move) but give no weapons
let alot of AI ships with only weak arment attack it. This is the best way to "mass scan" the targetship.
You will easily see if AI ships repeatedly crash into it when looking at the sectormap.
Last edited by Killjaeden on Fri, 4. Mar 11, 00:56, edited 1 time in total.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

The bit about the X2BCIDE came from reading around the forums. Someone was saying that X2BCIDE doesn't stip navmesh info from BODs. I think they just don't know about the '--xinfo+" flag, however.
User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden »

Litcube wrote:The bit about the X2BCIDE came from reading around the forums. Someone was saying that X2BCIDE doesn't stip navmesh info from BODs. I think they just don't know about the '--xinfo+" flag, however.
(ive edited the last post, just to be sure you dont miss it ;) )

The question is if the people who told this did know about the navmesh at all (how it works, what it exactly is, etc) and if they really did test it (or just found another blue moon).

I dont know about a "--xinfo+" flag myself either. :?

**
edit again:
It would surprise me if any X2BC IDE is different then normal x2bc. That would be indeed magic. We've asked Doubleshadow if he knows how the avoidance works and he didnt have much more information then we've already had found ourself. So it would surprise me if an x2bc version suddenly produces avoidance data. (Unless he found out himself and made a new version)
Last edited by Killjaeden on Fri, 4. Mar 11, 01:03, edited 1 time in total.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

The "--x3info+" tag with x2bc writes X3 specific info, which is your collision information. From what I gather, it uncomments those lines.



The biggest issue I have on the impact on all this work with the COL objects, or saftey nets, is that they just don't seem to improve things much. With my Bounce script, I ran countless tests, and still had massive casualties using your ships, cadius's ships, vanilla ships, etc., etc. Doesn't matter whose ships I used, I still saw massive casualties.
User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden »

The biggest issue I have on the impact on all this work with the COL objects, or saftey nets, is that they just don't seem to improve things much.
That depends on how you view things. Define "massive casualties".
In my tests i ran on capitalships i let 30-40 AI ships attack. If 3 of them bounce within 5-8minutes of ingame fight then this is acceptable. Because if the avoidance would be larger the AI ships couldn fight the big ship anymore because they would avoid too early.

SETA worsens things, as does an increased shipspeed /decreased rudder.
The autopilot is not really good when it comes to avoiding objects precisely.
its just "oh there is something, lets try turning left"

Ive also seen ships that start to avoid (clearly running avoidance routine but instead of actually turning they rolled for about 500m ... looked ridiculous... and just moments before impact they tried to actually turn away)

And the shape of the avoidance is also pretty imperfect. I think for the XTC Ragnarök the AI couldnt attack the engine section from 6 o'clock position while almost ramming when attacking the side from 9 or 3 o clock. Or something similar like that
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

I'm talking nearly 100% casualties. With vanilla ships, which presumably have all collision information intact.

2 minute example for you, install Bounce and run the test script without bounce enabled. Spawn 4 Phoenix and 200 m5 or m4 fighters. It's a vanilla test. The test script does nothing but spawn and run vanilla attack routines.

Honestly, I'd strongly suggest you to do this, as I really respect your opinion, and yet we have two different world views on this. :) It'll only take you a few minutes.

Science!
User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden »

Spawn 4 Phoenix and 200 m5 or m4 fighters
Sorry but thats plain ridiculous.
That is an artificial worst worst worst case scenario (only more fighters are worse... or 4 M5 and 200 M2 :roll: ). Everyone knows the Autopilot is rather limited.

(I tested it, used your script to spawn the ships but Xenon Heavy centaurs spawned as well o0 and nuked my starting ship... it doesnt need a genious to predict the outcome of your test so i skipped it after that... )

First of all: Numbers have an impact. The more ships there are the slower your performance the less ressources the game has to calculate and update the avoidance.
There is hardly a serious situation where 200 M5 are in one sector... if the player wishes to do so, the player is to blame for ignoring the limited capability of the AI avoidance. Its like trying to trick gravity in real world - working against systemlimits/mechanics is never clever.

Second: Weapons have an impact.
50 proper M3 will trash any capital in a few seconds. XTC, Cmod, Vanilla... doesnt matter. Mars doesnt matter.
It is unlikely that they even do a second approach if all ships arrive roughly at the same time.

Ever tried to stack a solid sphere ontop of another? Its not good for the job. Boxes on the other hand... M5 and M3...

That's why there simply is no point in making the avoidance so that 200 M5 will avoid 1 or 4 m2 to 100% ... Not because of the not-good-for-the-job reason, but because it has negative sideeffects if the avoidance would be adjusted that way. Other ships could not effectively work anymore. Because of the not-for-the-job argument its better to focus on the things that are more likely to actually take place in the game.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
User avatar
Nafensoriel
Posts: 486
Joined: Mon, 3. May 10, 20:30
x4

Post by Nafensoriel »

I actually think litcube's point has merit.. yes in current x3 200 fighters is a bit much but it is still a good area of research for the sake of pure research.
Picture an X game that could use multiple cores.. you now have the processing power to handle more complex avoidance methods but if you can visually achieve the same effect with something like the bounce script for less total resource real estate.. well why not? I'm an efficiency nut and 1% improvement is still 1% improvement. Enough 1%s equal some pretty darn big numbers.

Some things like bounce can also avoid some mental headaches suffered by players in the X universe.. How many of us have watched a ship turn into a brief but pretty puff of light because it just happened to be in the wrong place when we jumped in? You can't really get the same effect with a safety net since well.. in practice a safety net just makes the problem even worse.

In short a safety net only seems acceptable in ideal situations. Sure ideal situations happen more often than not in a video game.. but efficiency is efficiency.
"A Tradition is only as good as it's ability to change." Nael
User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x4

Post by TrixX »

Well it's an interesting issue for sure. Chucking 50 fighters at an M7 or an M2 isn't that rare, usually the big ship gets munched in Vanilla or the fighters get munched if it's had a rebalance. Problem is when you equip the fighters with IRE's and the M2/M7 with nothing and you get 100% fighter deaths from suicidal attack runs that's the problem.

That is replicable with any number of fighters and a ship M6 or larger. It is no matter whether it's XTC or Vanilla, those fighters still suicide. With the collision spheres I used a while back it mitigated the behaviour slightly when put on the ships. At least to the point of not 100% suicides however they end up with interesting side effects such as missiles not being able to target the centre mass of an object instead trying to hit the edge of the sphere surrounding it.
Killjaeden wrote:
Spawn 4 Phoenix and 200 m5 or m4 fighters
Sorry but thats plain ridiculous.
That is an artificial worst worst worst case scenario (only more fighters are worse... or 4 M5 and 200 M2 :roll: ). Everyone knows the Autopilot is rather limited.
It maybe an artificial worst case scenario, but there are situations ingame that can lead to that number in a fight. The game should be able to handle it regardless of whether the autopilot has had a drink or two. I don't like relying on "Everyone Knows" situations either, as to assume that "Everyone's Right" is to just make mistakes in researching the matter.
Killjaeden wrote:First of all: Numbers have an impact. The more ships there are the slower your performance the less ressources the game has to calculate and update the avoidance.
There is hardly a serious situation where 200 M5 are in one sector... if the player wishes to do so, the player is to blame for ignoring the limited capability of the AI avoidance. Its like trying to trick gravity in real world - working against systemlimits/mechanics is never clever.
If there is an M1 with an escort or two plus a fighter collection (M4/3) you can easily see a force number in the 100's. Double that for a confrontation and you are in serious problems with the stock avoidance system. BTW that's not through player intervention. That happens a lot in Hatikvah's Faith...
To blame the player for a shortcoming the engine should be able to cope with isn't exactly the method I'd choose to fix the issue.
Killjaeden wrote:Second: Weapons have an impact.
50 proper M3 will trash any capital in a few seconds. XTC, Cmod, Vanilla... doesnt matter. Mars doesnt matter.
It is unlikely that they even do a second approach if all ships arrive roughly at the same time.
50 M3 in an unbalanced system will trash a capital in seconds. 50 M3 balanced correctly should be targetting M6 to light M7's as technically it would be suicide for them to attack a 2Km capital ship with correct balancing of shields and weapons. Think about it a 2Km ship would have an immense power source to move the damn thing as well as power it's shields. The Fighters would have relatively weak weapons due to their size and much lower power source (if using any semblance of reality for the balance). Currently 50 M3 (Nova) or M3+'s (Eclipse) with vanilla stats will literally destroy a Titan in 2.92s. That to me is very very unbalanced, and one of the main reasons I started modding X3 in the first place. Fighters currently have WAY too much firepower which doesn't seem to have been balanced on the number of hardpoints but more a direct comparison of single weapons.
Killjaeden wrote:Ever tried to stack a solid sphere ontop of another? Its not good for the job. Boxes on the other hand... M5 and M3...
They aren't meant to be stackable, they are meant to flow around each other naturally. Ovals and circles allow that where boxes have issues.
Killjaeden wrote:That's why there simply is no point in making the avoidance so that 200 M5 will avoid 1 or 4 m2 to 100% ... Not because of the not-good-for-the-job reason, but because it has negative sideeffects if the avoidance would be adjusted that way. Other ships could not effectively work anymore. Because of the not-for-the-job argument its better to focus on the things that are more likely to actually take place in the game.
Avoidance of 100% is slightly unrealistic in that scenario, but it's hell of a lot better than 100% suicide, even if the scenario is made smaller, say 30x M3 vs 1x M2 you would hope it's not 100% suicide which currently it is...
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson
User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden »

yes in current x3 200 fighters is a bit much but it is still a good area of research for the sake of pure research.
You can't really get the same effect with a safety net since well..
Sorry, you missed the point. Research is not what is to be achieved with the safety nets of cadius or the collision line i use. Its to have the AI functioning at all in common situations. The Bouncescript can't replace this. It can only improve on it.

And it wont cost less ressources to fake collision then implementing it how it is ment to be (at least close to it)
Picture an X game that could use multiple cores
No. This is X3TC and not an imaginary X-game-to-come

-----
@Trixx
So what do you want to say exactly?
How exactly do you want to fix an engine limitation??
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x4

Post by TrixX »

Killjaeden wrote:@Trixx
So what do you want to say exactly?
How exactly do you want to fix an engine limitation??
You'll see soon enough...
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

----
This does feel like a completely wasted post but... ( :P )
I can't help but feel that TrixX is sitting in his giant chair stroking his black cat going mwuhahahahaha
You'll see soon enough...
---



*on to serious business.
Out of curiosity, does the collision avoidance only work with spheres, or can it use other primitives as well?
I've been wondering about collision avoidance for a while (for non x3 things), and I'm of the opinion that if you used capsules/cylinders for larger objects (mainly capitol ships, I've just completely written off stations as a lost cause...) it should be possible to reduce the collisions.

Naturally, this would require more complex attack run script commands (or as Killjaeden pointed out some-x-game-to-come :P if only)

From my mathsy research capsules have several good properties. (Oddly enough cylinders are slightly more complex then capsules so we will just be using capsules, i.e. cylinder with hemisphere caps on the ends)
  • Relatively simple to calculate. Requires NO trig functions, just standard +-*/
  • Cap ships generally fit more snuggly inside a capsule than a sphere. (Perhaps with the exception of the wide ships, i.e. xenon and.. Paranid They would probably fit better inside right prisms - which are also doable but require trig - well at least AFAIK they need trig but I have not researched right prisms as much as I have capsules)
The problem thou, is that the lack of floats in x3 (and there are also performance related issues, but I'm sure you can use a lazy load, calculate once, hope the ship doesn't move - recalculate every x-ms if it does)

Thou I'm confident that someone could jury rig together a float system with the integers.



-I really should have said this at the top, but my suggestions is rather than trying to leverage the existing engines anti collisions, why not just slap a purely script base (arguably more intelligent system) over the top of it?


-Potential flaws
1. Even if I could work out exact when and where a collisions will occur. How do you escape from it? Specifically, escaping a collisions requires knowing certain factors. What vectors can I escape to? How quickly can I turn to escape impending doom?.
-Possible Solution: "She'll be right". Most fighters can pull a 180 in < 0.5 seconds. M5's can pull a few rotations a second. Rotation seems correlated with speed, (and naturally speed is a factor in time to collision). So working out a time to impact and turning at time > xxx hopefully should work

2. Even if I tell a ship, oh noes, your about to crash turn around now, it may not turn around correctly. (or if it is laggy, it may not turn around at all...)

3. I said this up above but I'll say it again, performance issues.
As this is a script based solution, it will still use both my anti collision, and the engines (doubling the work load)




Any way
Ideas? Thoughts? Comments? Suggestions?
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

@S9ilent: That's almost exactly what Bounce does.


http://forum.egosoft.com/viewtopic.php?p=3504935
User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden »

Out of curiosity, does the collision avoidance only work with spheres, or can it use other primitives as well?
From my observation i came to the conclusion that its an ellipsoid, with a certain shape defined by the collision avoidance line.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

I thought you where just using multiple spheres? as opposed to capsules?
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Oh, sorry. Yes. Multiple spheres alone the spine of the ship. The spheres also completely encompass a ship (nothing sticking out of the bubbles).

I have a friend who has a PhD in Mathematics at the University of British Columbia, and every formula she came up with that offers better resolution to collision items would be far too intensive to run in a script.

The difference between spheres, cylinders, and capsules, in terms of noticeable white-space when the ships turn away, is negligible.
User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x4

Post by TrixX »

s9ilent wrote:----
This does feel like a completely wasted post but... ( :P )
I can't help but feel that TrixX is sitting in his giant chair stroking his black cat going mwuhahahahaha
TrixX wrote:You'll see soon enough...
How did you know I had a black cat :o
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”