Battlezone Universe

Battlezone Universe => Battlezone 2 => Maps and Modding => Topic started by: BNG Da BZ Fool on February 20, 2008, 10:58:10 PM

Title: Can the AI units negotiate things like a spiral ramps?
Post by: BNG Da BZ Fool on February 20, 2008, 10:58:10 PM
I made several of them by extruding along a helix path from a ramp object and I wanted to know if it will be worth making such props or if it's just a waste of time. Would using the standard ramp odf be sufficient to get the ai to use my spiral ramp? PS: If anybody can use the ramps let me know and I'll ul them on filefront so that they can be dl'ed. They'll more then likely be untextured, but if anybody request it I'll apply a simple cement texture to make them more appealing. PS: I have a ton of semi complete x model props available, but need to zip and ul the file to file front if anybody can use the stuff let me know...BNG
(http://static1.filefront.com/images/personal/l/lppena/106799/zikphaewes.thumb500.jpg)
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: bigbadbogie on February 20, 2008, 11:21:03 PM
hehe - good luck :evil:
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Red Devil on February 20, 2008, 11:49:34 PM
That's pretty cool.  It'd probably work if it was defined as terrain.  Besides, the AI can be a little screwy at times, so it might fit right in.  :-)
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: bigbadbogie on February 21, 2008, 12:06:23 AM
but how is it going to scale the ramp?? it would need an ai path that goes around in a circle 4 times
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Avatar on February 21, 2008, 01:06:48 AM
My understanding is that the AI is pretty much clueless about height...  they live in a 2D world...

So my guess is that it won't be as nice as they cruise right up the ramp.  Going down I'm sure they'd just jump down the middle, but up would be tough...

Still, to my knowledge it's never been done.  That means you HAVE to try it...   :)

-Av-
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: CmptrWz on February 21, 2008, 01:22:08 AM
Bet you could get them to go up ONE spiral with multiple objects and appropriate tunnel defs, but after that they would think they were done.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: bigbadbogie on February 21, 2008, 01:23:49 AM
what i meant by 4 times was that the ship would go around in a circle 4 times.

to the ai it would just be going around in a circle, but the ship would actually be following the ramp to the top
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: BNG Da BZ Fool on February 21, 2008, 01:36:08 AM
I made the sides a bit raised on the left and right shoulders so they couldn't easily fall off the edges, but wasn't really sure whether they could be coax to start up or down the spiral to reach a nav beacon placed between the ramp and the nav beacon itself. I know the ai can cross bridges to get to a nav beacon but the ramp would need placement next to a piece of raised terrain like a cliff and placed directly next to it. I can also change the incline angle to be less steep if that would help the ai climb the ramp more easily too. PS: I can also extend the end part with a straight piece that could be added to extend the upper part for quite some distance as well, or construct a building that could be attached to form somekind of fortress structure or other useful prop. I'll have to try it and see what happens and post again if anything good results...BNG

Obtw, I believe incline angle is currently set to 15 degree.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: bigbadbogie on February 21, 2008, 02:34:31 AM
i dont think that it matters what angle you set it to...just so long as the ships can get up it
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Avatar on February 21, 2008, 02:17:20 PM
What Wiz said would probably work...  basically it'd be a series of tunnels all connected together, with the AI thinking:

"Go N one square in Tunnel 1"
"Go W one square in Tunnel 2"
"Go S one square in Tunnel 3"
...

That sort of thing.  That would mean making one tunnel object that was half of the spiral and connecting them to each other.  Imagine making a similar spiral out of the stock ramp tunnel objects... it'd be a lot wider but the AI should be able to use it.

I'd rather see an 'up' and a 'down', and use the ShieldTower object.  Any AI entering the thing would just swooooosh on through and be spit out the other end.  :)

-Av-
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: BNG Da BZ Fool on February 21, 2008, 05:22:07 PM
Bummer, the ai apparently don't have the brains to even attempt to climb my spiral ramps. I tried both terrain and tunnel odfs, but to no avail. Human pilots can negociate the ramp but with some difficulty as well, i.e., a lot wall bumping and falling off the edges of the ramp. Oh well, chalk one up for just another pretty piece of eye candy to decorate the lonely lanscape of BZ land...BNG
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Avatar on February 21, 2008, 05:33:52 PM
A single odf for the entire spiral won't work, it'd have to be split up into segments, each one being half of one spiral level.  Your image would end up 5 and 1/2 tunnels...  the same way a full bridge is made up of two ends and some segments.

Each piece would be 180 degrees of one level of the spiral, basically:  (pardon my trashy text graphics)

(top view)
_____________________
I                                I
I      _____________     I
I      I                   I     I

From the side they'd be a ramp...  the AI would see them more like a staircase that cuts back on itself... otherwise you'd have to do quarters  like:

____________
I
I      ________
I      I
I      I

This would be four pieces per level, or 11 for the figure you show.

See?

-Av-
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: BNG Da BZ Fool on February 21, 2008, 06:23:56 PM
Tanks for the suggestion. I'll give it a try first halves then quarters and try the ai out on these again. Seems like making the stuff is the easy part; getting it to work right is a whole nother en-chi-lada. Just need to adjust the controls to produce 90 or 180 extruded pieces. The odf I used was pbtun03 with a single tunnel count. I may also try the 2 for the ib bridge strut and segment odfs to see what happens. As a simple test I made a simple straight bridge type placed it between a mote type terrain lowered thingy got on one end of the bridge placed an fvscout and fvtitan on the other end and commanded them to move toward my positon and the results were this. The scout dived into the mote thingy and got stuck but the titan crossed the bridge just fine to join me on the other side. What are some of the other odfs I cann experiment with to possible get the spiral ramp to work better? Tanks BNG
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Zero Angel on February 21, 2008, 06:35:11 PM
Oh man, if you want to do anything with a spiral tunnel, good luck!

Might want to read my tunnel guide (http://zeroangel.overminddl1.com/reference/tunnel.php) if you want to make 'tunnel' entries in your ODF that your AI will go through.

I once made a building called a 2-story building called a 'command nexus'. The ODF required a whopping 16 tunnel entries. And AI soldiers could enter and leave it through its doors, but weren't so good at going back and forth between the first and second floors.

Usually if you ran to the second floor, they would be waiting on the first floor and immediately start attacking you when you entered the stairwell.  :-D

(http://zeroangel.overminddl1.com/misc_images/ccent-tunnel.jpg)
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Red Spot on February 21, 2008, 07:01:15 PM
Imo you could this working just fine ... using a good model with good collision boxes and a good set of tunnel .odf's ..
Though I cant help feel you're beter of not using it, as it is the AI already has some issues with staying inside tunnels already and I dont think you can (almost) completelly remove the exidental bumping out of the tunnel ..

You can easilly make a sort of similair thing with terrain though, than connect the top with a plain bridge to an other part of the map, would have the same effect .. get up a ramp, spiral around a lot, to get there where you can get to an other part of the map ..
(its that I've seem to have misplaced all my BZ2-work else I could have shown you a map where I did exactly that .. the whole map was filled with huge spirals with at some pools on top others bridges to the other 1/2 of the map ..)


G
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: mrtwosheds on February 21, 2008, 08:03:33 PM
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.

Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: OvermindDL1 on February 21, 2008, 08: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.

(http://www.overminddl1.com/image_scripts/image_sig.php?type=ODL1signitures&image/sig.gif)
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: anomaly on February 22, 2008, 12:43:40 AM
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, 08: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.

(http://www.overminddl1.com/image_scripts/image_sig.php?type=ODL1signitures&image/sig.gif)
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?
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Zero Angel on February 22, 2008, 12:53:46 AM
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...
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: bigbadbogie on February 22, 2008, 12:57:22 AM
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
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: anomaly on February 22, 2008, 01:08:40 AM
Quote from: Zero Angel on February 22, 2008, 12:53:46 AM
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.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: BNG Da BZ Fool on February 22, 2008, 03:17:30 AM
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.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: bigbadbogie on February 22, 2008, 03:59:25 AM
it needs a base plate or ownsTerrain = 1

base plate is best
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: BNG Da BZ Fool on February 24, 2008, 11:55:00 PM
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?   
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: darkwarrior on March 02, 2008, 11:59:56 AM
If if this doesnt work for AIs, it is a good technigue for getting players up to higher heights.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Zero Angel on March 02, 2008, 02:05:53 PM
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 (http://zeroangel.overminddl1.com/reference/tunnel.php)

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
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Red Devil on March 02, 2008, 07:55:24 PM
In BF2: Special Forces, they have a working elevator that allows you to take a shortcut which I thought might be nice to implement.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Zero Angel on March 02, 2008, 08:33:56 PM
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*
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Spawn on March 02, 2008, 08:36:58 PM
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.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Nielk1 on March 02, 2008, 08:48:48 PM
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.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Zero Angel on March 02, 2008, 09:48:21 PM
Hmm, tried for 20 minutes, all sorts of things, but couldnt duplicate it.

Then I thought of another idea
(http://zeroangel.overminddl1.com/misc_images/tunnel-elevator.jpg)

But now that I think about it, its kind of useless for most purposes.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Spawn on March 02, 2008, 10:02:39 PM
It would be much easier to do that with a sheildwall, now that they work.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Zero Angel on March 02, 2008, 10:08:13 PM
Do they work on public 3? And if they do, then tell me more! I have no idea what shieldwall does. Can they project in a single direction? Or do they project in all directions like m-curtain?
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Nielk1 on March 02, 2008, 10:31:34 PM
The shieldtower creates a square magnetic plane the forces in the direction the building faces. The quare is diamater by diameter in size and its center is 1/2 diamater above the dummyroot.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Spawn on March 02, 2008, 11:44:54 PM
I think there was one included in the pak as an example, and thanks to nielk to correcting me on the name.
It should also be in the modlog, but I cant find that anywhere currently.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: BNG Da BZ Fool on March 03, 2008, 12:55:10 AM
Tanks ZA, I visited your site and started to read up on the tunnel guide, and it was very informative for me to try things out on. The minimun number of segments is 3 in gsl, but I can adjust the radius setting quite a bit larger, and I'll try extruding with another method into a climbing ramp with 90 degree angles with say a 20 degree incline as well. Another possibility would be to adjust the rotation setting to essentially make the ramp straight along the swept path instead of asideways curve as is the default resulting in a sloped ramp which the ai should better be able to negotiate(http://static1.filefront.com/images/personal/l/lppena/106799/hmayixrobv.thumb500.jpg)
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: bigbadbogie on March 03, 2008, 01:52:10 AM
on the subject of bridge segs - why does the isdf bridge need 2 tunnels?? shouldnt it just need 1 that is up and down???
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Nielk1 on March 03, 2008, 02:02:20 AM
The top and the bottom BBB.

You can go over the bridge or you can go under it in the perpindicual direction.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Spawn on March 03, 2008, 02:45:56 AM
Unless you tell the ai somehow it doesn't know that a building can be navigated around/past.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: bigbadbogie on March 03, 2008, 02:59:52 AM
ah - makes sense now
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: CmptrWz on March 04, 2008, 02:11:04 AM
For the record on shieldtowers (as I researched quite a bit on them) - the effect has a forward and back, is a box, but not a cube. It does not have to be over the model generating it, or even centered on it, it can in fact project quite a ways AWAY from the model.

At one point I made a model I could put off of the map that projected a shield straight across the map through which no ordnance could travel, but ships were able to pass through at will.

Effects, on the other hand, I had issues getting to work. But I suck with effects.

My favorite trick with them, however, were my expressway tunnels.

I think Greenheart was going to use them on a couple of maps that were going to go into PB4, so that there would be examples of how shieldtowers could be used.

Here, have a couple of odfs (http://www.bstcon.com/pushtunnel.zip). I would put the expressway then the brakes. Coming out of the expressway tunnel without the brakes......lets just not do that, ok?
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Nielk1 on March 04, 2008, 03:40:00 AM
The only way I could find to really affect the position and orientation of a magnetic plane was to have it tapped on.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Zero Angel on March 06, 2008, 02:17:23 PM
I have completed the elevator thanks to Greenheart making the tunnel model for me. I found out that M-Curtain-like fields are better at pushing the ships off of the lift - if placed correctly they can even force the player down the shaft when he is entering from the other side. Which means, by luck, my elevator works for both directions!

My prototype doesnt work on assault tanks yet (they usually just hover a few cm off the ground)
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: Zero Angel on March 06, 2008, 02:24:35 PM
Just tried CmptrWz's expressway ODFs. These things are awesome, and should be added to 1.3's default asset pool. The first time I tried it, I placed without the brakes and flew across the map a few times, the second time I placed braking segment and it worked perfectly.

I created a mine-based boost pad while working on my elevator, but the shieldtower idea is much better.

I can definitely see how these same principles could be useful in an elevator. I have an idea in my head for a 2-way elevator that works for assault tanks (using the shieldtower design), but it requires a much more complex model.
Title: Re: Can the AI units negotiate things like a spiral ramps?
Post by: CmptrWz on March 07, 2008, 04:02:57 AM
Somewhere I had modified models from Lizard too. GH might have copies, I don't recall. Still haven't bothered to check if GH included copies in 1.3 for the next public beta.......

Hell. Let me check.

...

Yep, looks like he has them in there, in the MPI Suprise Map. Even has the stuff Lizard did up to make them look like there is something to be doing it to ya. So PB4 should have them stock.

As for two-way elevators, you need two ODFs, one shieldtower for each direction. I had ODF riggings for two-way tunnels at one point, but walkers collided in the middle, decided it would be easier to just have two side by side.