|
|
 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
Jawms

Joined: 30 Dec 2010 Posts: 251 on topic Location: Canada

|
Posted: Sun, 12. Jun 11, 01:09 Post subject: Idea: AI Collision Detection |
|
|
Due to reading different posts, I have come to realize the method that the AI uses to detect if an object is near, and how it maneuvers to avoid it.
If my understanding is correct, all objects in the game have a secondary "skin" that is never rendered. When a ship makes contact with this boundary it turns (90 degrees?) and flies till it is no longer inside the outer boundary.
Now this raises issues, especially with faster ships, because they cannot turn fast enough to avoid the object..
My idea is to do away with the boundaries.
How to do that while still detecting objects that are coming? Dont make the obstacle "bigger," make the ship "longer." Using the same concept as the boundaries on the obstacles, a ship could have a "ghost" of itself flying out infront of it. (the distance would have to be calculated/have to vary) If this "ghost" makes contact/a collision event is detected, the ship would turn in a random direction, until the collision is no longer detected. (The "ghost" would have to stretch back to the ship in some way)
What are your thoughts on this? Would it improve anything? Would it be possible to ever do?
_________________
| misterbull wrote: |
Hahaha, it's time to take over the world!  |
Its so beautiful! *wipes tear* |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Vayde

Joined: 06 Feb 2004 Posts: 645 on topic Location: England,UK

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Cycrow Moderator (Script&Mod)


Joined: 15 Nov 2004 Posts: 19851 on topic Location: London

|
Posted: Sun, 12. Jun 11, 01:28 Post subject: |
|
|
u cant get rid of the boundaries, they are there for a reason, all objects have a bounding sphere around them, and its this that is used for collosion detections.
removing theses means u'll need to check for colloisions against the whole object, not just the sphere, which requires considerably more processing power.
also, the "ghost" your talking about pretty much already happens. The engine will compute the position of the ship ahead and check for collosions, this is generally how it works in all games.
The real way to fix it, is using path planning methods, where the ship will compute its path to the destination while avoid the objects, but this requires huge amounts of memory and processing power, so not really viable for a large number of ships.
even so, none of this can be changed with scripting and moding anyways, as its hardcoded
_________________ My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Litcube

Joined: 20 Oct 2006 Posts: 2244 on topic Location: Canada

|
Posted: Sun, 12. Jun 11, 01:59 Post subject: |
|
|
| Cycrow wrote: |
| even so, none of this can be changed with scripting and moding anyways, as its hardcoded |
The bounding spheres can be changed in the .bod file of the ship. I threatened to steal DoubleShadow's Barbies if he didn't implement a bounding box multiplier in the latest DBOX version for those who want to increase everything by x%. DoubleShadow loves his Barbies, thus the feature was implemented.
_________________ My works
Fixed Notoriety Rewards | Missile Rebalance & UI Icons | Phanon Corporation | Revelation | Saturn Complex Hub |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Mizuchi

Joined: 10 Feb 2011
Location: Tokyo, Japan
|
Posted: Sun, 12. Jun 11, 02:01 Post subject: |
|
|
| Litcube wrote: |
| DoubleShadow loves his Barbies, thus the feature was implemented. |
Just to be clear to the Aussies who may be reading: Lit is talking about the dolls.
Please have your Koala army call off their impending invasion of Canada.
_________________
 |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Cycrow Moderator (Script&Mod)


Joined: 15 Nov 2004 Posts: 19851 on topic Location: London

|
Posted: Sun, 12. Jun 11, 02:18 Post subject: |
|
|
| Litcube wrote: |
| Cycrow wrote: |
| even so, none of this can be changed with scripting and moding anyways, as its hardcoded |
The bounding spheres can be changed in the .bod file of the ship. I threatened to steal DoubleShadow's Barbies if he didn't implement a bounding box multiplier in the latest DBOX version for those who want to increase everything by x%. DoubleShadow loves his Barbies, thus the feature was implemented. |
i mean the actual path planning and collosion detection routines cant be changed.
_________________ My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
AkrionXxarr
Joined: 06 Sep 2008 Posts: 295 on topic

|
Posted: Sun, 12. Jun 11, 04:19 Post subject: |
|
|
Thare are a multitude of ways collision avoidance can be achieved, some of which would rely largely on the GPU and not the CPU, but that's not somthing that could be modded and would rather have to be hard coded.
One relatively process friendly method, however (even if not necessarially modable), would be to just add a sort of hemisphere concept to the middle of the ship, facing forwards, and divided into quadrants (perhaps diagonally like this: (X) ). This will serve to detect if a physical model has entered its range of coverage, and how far it is from the center of this 'hemisphere'. It would then instruct the ship to turn accordingly.
For example, say an object begins to enter the edge of the right quadrant. This would instruct the ship to begin turning left at some ratio to the distance from the center. The closer the object is to the center, the harder the ship will turn left.
If an object enters both the right and the top quadrant, this will instruct the ship to turn left at a certain rate and down at a certain rate.
If an object enters the right, top and bottom quadrants, the ship would turn left and up, down, or neither, depending on how the top and bottom distances add up.
If all quadrants are occupied by multiple objects or one large object, a full stop followed by a 180 turn could occur until a quadrant clears up.
This is how I handled path finding in Garrys Mod with the Wire Mod. I'd use a series of range finders and an algorithm to instruct the vehicle to adjust a specific direction based on which range finders were triggered, and at a rate based on the range from the vehicle.
Just some thoughts, anyway.
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
|
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
 |
|
|
|
|
|