• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

Can the AI units negotiate things like a spiral ramps?

Started by BNG Da BZ Fool, February 20, 2008, 03:58:10 PM

Previous topic - Next topic

mrtwosheds

Not a hope in hell, forget it. Even if you managed to get the AI to do one rotation I would be very impressed, after the first it would get stuck attempting to get to the exit. Maybe with a script instructing a unit to go to multiple path points as well, but even then I can't see the AI managing to drive around it well enough.


OvermindDL1

#16
Getting any AI in any game to go up something like that is incredibly difficult.  They have to be pretty much 3d-aware (BZ2 ai is not) and there need to be 'pathpoints' place all going up it.  To dynamically find a way up is very computationally expensive otherwise.


anomaly

Isn't there a problem with collision boxes and placing multiple objects above each other?  I thought if you placed one building above another, the collision box would only register for one of them.  Can't remember where I read that, though.

I still think this is possible though, but it might be easier if you make the ramp with 90 degree turns.

Quote from: OvermindDL1 on February 21, 2008, 01:13:55 PM
Getting any AI in any game to go up something like that is incredibly difficult.  They have to be pretty much 3d-aware (BZ2 ai is not) and there need to be 'pathpoints' place all going up it.  To dynamically find a way up is very computationally expensive otherwise.


Do the pathpoints even have a height coordinate?  If not, then why can't the ai simply be told to move around in several circle before reaching its destination?

Zero Angel

#18
Well, i've noticed on a tapped building of mine, if the tap is destroyed and rebuilt it cause the collision on the building to go all screwy. But that is because the tap partially goes into the collision box of the building.

QuoteDo the pathpoints even have a height coordinate?  If not, then why can't the ai simply be told to move around in several circle before reaching its destination?
I am not a programmer (unless you think that some basic PHP counts), but sometimes I can think in psuedo-code. And are you nuts?! I just cant think of even suitable psuedo-code to explain that. You would have to define a center and a radius, and then you'd have to define a protocol for the AI to circle (how many revolutions) then have the AI keep track of how far along in the spiral it is so it doesnt get lost somewhere in the middle with no orientation on how to get in or out. I dunno, maybe a real programmer can clarify...
QuoteAwareness, Teamwork, Discipline
Constantly apply these principles, and you will succeed in a lot of things, especially BZ2 team strat.
{bac}Zero Angel
Victory through superior aggression

bigbadbogie

the only way that this spiral will ever come close to working with ai is if you try my method of the path point circles
Others would merely say it was good humour.


My BZ2 mods:

QF2: Essence to a Thief - Development is underway.

Fleshstorm 2: The Harvest - Released on the 6th of November 2009. Got to www.bz2md.com for details.

QF Mod - My first mod, finished over a year ago. It can be found on BZ2MD.com

anomaly

Quote from: Zero Angel on February 21, 2008, 05:53:46 PM
I am not a programmer, but sometimes I can think in psuedo-code. And are you nuts?! I just cant think of even suitable psuedo-code to explain that. You would have to define a center and a radius, and then you'd have to define a protocol for the AI to circle (how many revolutions) then have the AI keep track of how far along in the spiral it is so it doesnt get lost somewhere in the middle with no orientation on how to get in or out. I dunno, maybe a real programmer can clarify...
Sorry, I really don't know much about pathpoints myself, so I guess I shouldn't be talking.  But, I assumed they worked by the ai simply moving from one point to the next in a chain of linked points.  And I wasn't thinking of doing a circle but more of a series of linked squares (for a simple ramp with square corners) with points at each corner.  What BBB said above.

BNG Da BZ Fool

I tried the terrain.odf generated by the bz2 export utility but when I went to climb the ramp I went straight through it as if it were transparent. Do I need need to add some entries in the odf to make it solid like a colision thingy or ownsterrain statement? Although I tend to agree with those that say that it really isn't possible due to limitation with ai in general. It just seems like we try things because we're just not well informed about such limitations like some others who undersand the game physics better. Like I acknowledged earlier the spiral ramp just appears to be useful as a simple prop. I'm still experimenting with the ideas mentioned earlier and focusing on doing and then seeing what the results will be.
When I'm not in hot water with the community I'm usually making models for BZII. I've made a few models for other peeps. BNG.

bigbadbogie

it needs a base plate or ownsTerrain = 1

base plate is best
Others would merely say it was good humour.


My BZ2 mods:

QF2: Essence to a Thief - Development is underway.

Fleshstorm 2: The Harvest - Released on the 6th of November 2009. Got to www.bz2md.com for details.

QF Mod - My first mod, finished over a year ago. It can be found on BZ2MD.com

BNG Da BZ Fool

Base plate? Would I add an object like a plane object to the base of the spiral ramp thingy? Are there any example xsi files in the data pack that I could study to help me understand the physics parts of the ways that the ai interact with the 3d environment, i.e., the maps they live on and the objects they interact with.

Eeeew, I was thinking maybe I can try making the ramp super wide so they could peek-n-poke their way up the ramp like I see them doing when trying to climb a steep slope; most eventually make it up the grade after a prolonged struggle. Or try changing the spiral to an s type ramp maybe?   
When I'm not in hot water with the community I'm usually making models for BZII. I've made a few models for other peeps. BNG.

darkwarrior

If if this doesnt work for AIs, it is a good technigue for getting players up to higher heights.

Zero Angel

#25
How the AI paths thru/around buildings is determined by these factors (in order of preference, higher priorities go at the top):

- If the building has bldedge and tunnel entries defined in its ODF, it will prefer to use these for pathing
- Else, If the building has a collisionRadius defined, then the AI will try to avoid that radius
- Else, the AI will completely try to avoid the building (it might go inside of the building's base plate but only for a few meters)
- Guntowers are treated more like vehicles then most buildings.

BNG, plese refer to my Tunnels Guide

For the spiral idea.

It IS possible to do something like this, BUT it will only realistically work in certain types of situations. A little info:

- When you create buildings, and want AI to path through them in a specific way, you must define tunnel entries for them inside of the building's ODF.
- Tunnel entries rely on a grid system to work, and this grid system is extremely course. For example, an ISDF powergenerator has only a 4x4 grid. Big buildings like recycler buildings are on an 8x8 grid.
- The AI is not very smart when it comes to navigating through tunnels, but it does an acceptable job in most cases. Because for objects where tunnel entries are set up, are typically bridges. And the AI is typically ordered from point A (on land) to point B (across the bridge, on land).
- AI has no spatial vertical awareness. The pathing engine is quite 2D. What you see on shift-F9 view, is basically what the AI sees.

Therefore
- If you're gonna create a spiral staircase. Try to make sure that its not round, but rather, square (or rectangular) so...
- That it lines up with BZ2's grid system. If it does not line up with the grid system, expect your soldiers to (a) phase through the building (b) get stuck on a random part of the building or (c) fall off the stairs. Which will get your soldiers stuck, since they have no vertical/spatial awareness -- and still think they are on the second part of the spiral when in fact they just fell to the ground or some other scenario.
- And that there is an 'endpoint' to it somewhere. So the AI will follow the spirally path of the tunnel, instead of being confused while inside of it. (remember, the AI doesnt have full 3D awareness when pathing), and giving AI 'orders' to go into convoluted tunnel setups is unpredictable.

In other words, AI will only use the spiral staircase if its the quickest way to get from point A (on land) to point B (on land, not inside of a building)

Most important thing to understand how pathing works is SHIFT-F9 view! Click on point A, then click point B, and the resulting set of lines tells you if the AI will try to climb your cliff or go around it, use your bridges, or take the long way -- etc.

Experiment for yourself. Its quite intuitive, and you'll learn it more easily through experimentation then by reading my long winded essays.   :-P
QuoteAwareness, Teamwork, Discipline
Constantly apply these principles, and you will succeed in a lot of things, especially BZ2 team strat.
{bac}Zero Angel
Victory through superior aggression

Red Devil

In BF2: Special Forces, they have a working elevator that allows you to take a shortcut which I thought might be nice to implement.
What box???

Zero Angel

#27
I've noticed a glitch, at least in 1.2 where certain buildings (like mbruine3) will cause the player to rise into the air infinitely high under certain random, unresearched conditions, until the user steps off of the invisible non-existent platform.

If I could find a way to duplicate and exploit that flaw, it might work to a modder's advantage.  :-)

I think I might have an idea on the conditions that cause the bug.

*fires up the editor*
QuoteAwareness, Teamwork, Discipline
Constantly apply these principles, and you will succeed in a lot of things, especially BZ2 team strat.
{bac}Zero Angel
Victory through superior aggression

Spawn

I asked TV about it once, he said it was a model error, so you could probably copy the collision from the broken object in threed.  It's in one of the fedm maps, the giant teleporter thing that looked like it was from the movie contact.

Nielk1

I got it to happen by using a T shaped collision.

Aculy it was more of a spinning T so I guess a Short Fat Cylinder over a skinny tall one. Whenever you went under the overhaning colission, you would rise up yo be ontop of it.

Click on the image...