Home   Help Search Login Register  

Author Topic: Movepoint AI Scripts (AI navigates thru buildings, rooftops, fixed positions)  (Read 3397 times)

0 Members and 1 Guest are viewing this topic.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Movepoint AI Scripts

These scripts are a bit raw, but working well enough now to get some feedback from you wise OFP scripting dudes. 

Purpose:

These scripts allow the mission designer to define a series of positions in buildings (or outside) that a group of units will move through. This includes rooftops that OFP AI currently cannot navigate on.   With these scripts you can:

- Send a group of units into a building, up stairs, on to the roof, and onto the next building, down the stairs and out.
- Send a group of units into a series of positions to defend, like roof top sniper positions, windows, etc.  Basically a "Fixed Position" script, except the units moved there naturally (via scripts), rather than being statically SETPOSed into desired positions.
- Each position is defined as a "Movepoint" with properties of Position, Direction to Face, Stance (Up, Down, Crouch).
- Paths are defined as simply a series of Movepoints (an array).

Note: One limitation of OFP Waypoints is that the units must maintain Formation, which doesn't work in confined spaces.  These scripts help overcome this limitation.

The Potential...

There is potential here for the community to build a library of movepoints and paths for every Building, in every Town, on every Island.  Mission Designers can then combine the movepoints into whatever paths make sense for their individual missions.  Look at how Movepoints are defined in the INIT.SQS, and you will see how we could build up such a library...

Enough hype...here's the Demo...

Sorry for requiring addons, but Lybia island has interconnected buildings with great rooftops, which show this off well.  Plus I needed the Ladders from Editor Update 102 (by Gunslinger).  Addons Required:

Libya island:            http://ofp.gamepark.cz/index.php?showthis=2542
Editor Update 102:  http://files.filefront.com/DMALIBYACOMPLETErar/;4863312;;/fileinfo.html

The demo mission is attached.  Move it to your Users missions directory, and run it from the editor.

Known Issues

  • Units will stick to movepoint paths and not deviate, except if wounded and commanded to seek a medic, or medic commanded to support a wounded unit.  I do not know how to solve this yet, so removed medics from demo.
  • If units cannot stand, they hold up movement for the group.  My workaround for now is to heal the unit enough so he can stand and continue through path.
  • Accelerating time causes units to clip through walls and fall off buildings.  Don't use it.

Possible Future Improvements
  • Integrate with Blanco/BDFY's cover scripts.
  • Add "cycle" option, so units can repeat movepoints (i.e., sentry walking rooftop perimeter).
  • Add "Pause/Resume" feature so units moving through series of movepoints can stop midway, then resume moving along their path.
  • Add "Forward/Reverse" feature.  Right now scripts only move forward through series of Movepoints.  Note:  Reverse is tricky as some Scripted movepoints are "one way" only currently (i.e. climbing a ladder up, or using switchmove commands to navigate across a rooftop).
  • Add "Close Ranks" feaure, so when a unit gets killed, the trailing units move up to fill the vacant position.
  • Add "Reinforce" feature.  When using movepoints to deploy to staggered defensive positions, as units are killed, it would be nice to move up a unit from a reinforcment group to fill the vacant position.
  • Add quiet "movement chatter", such as leader saying random stuff such as "move up", "Lets go", "advance", etc.  And trailing units responding with "roger", "moving", "in position", "on my way", "clear", etc.  The current "Go Go Go", and "Forward" is too loud and annoying, and just there for debugging purposes (audio cue as to when leader moving to next movepoint).[\li]
The ultimate future enhancement...

This would take some work, but seems doable...  There are a finite number of Building Object Types on an island.  Within a building object type, there is a finite number of positions that designers would normally be interested in:  Entrances, windows, doorways, Ledges facing out, Roof top edges and corners, ladders, stairs, etc.  Once we have identified the most desirable movepoints (and paths) for a building object type, we could calculate the relative positions of the movepoints in relation to the position and azimuth of an individual building instantiation.  Instead of defining movepoints for every building instantiation, we define them relatively for every Building Object Type.  But that is too ambitious right now...let's see if this idea has any appeal to you people first.

Scenarios not tested yet:

I haven't tried the scenario where player is leader or member of a group that is executing a movepoint script.  I also have not tried this in multi-player.  So you may not want to waste your time on these particular scenarios until I've tested them myself.

Give the demo a whirl and let me know what you think.

Thanks alot.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline bdfy85

  • Contributing Member
  • **
I don't have Libya island to test your script, but one idea I was trying to implement recently ( not finished due to lack of rime ) is simple positioning units in biulding positions.
1. Find nearestBuilding
2. Find how many positions are there. (using buildingPos command)
3. Distribute units in positions and execute cover scripts. (the stage I'm stack on)
No library for buildings needed. Works everywhere.
AFAIK if there're correct path LODs in the model units will go through building to positions correctly. So what your script is making ?
Liberation Mod scripts&balance

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Good question.  What you say works for position predefined in map. And the random movement movement to different positions is fine too.  So if thats all you need in a particular mission that is cool.

What's different about these scripts is:

1. It works on rooftops, where LOD paths not defined.
2. You can order positions into an array, thereby making a specific path units will follow.
3. It allows units in a group to move through a path, without their Formation screwing up where they go. The order also reduces chances of bumping each other which often causes them to clip through walls.
4. A path can take units into one building, climb a ladder to roof, jump from roof to a second building, and exit that second building.
5. By setting up positions as "movepoints", you can assign properties (parameters) to each movepoint to control how long a unit will occupy that position before moving to next movepoint, what direction to face, what stance to take (UP, DOWN, CROUCH).   Property driving this behavior simplifies usage, as designer wouldn't have to hardcode this into special scripts each time.

For those buildings that have good predefined positions, I would use those to jump start the library... 

I know Nogova has some good building positions.  The Lybia towns are bigger and more interesting for urban fights, but the buildings only have a couple predefined positions each...
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline bdfy85

  • Contributing Member
  • **
As far as I see upgrading biuldings with correct Road|path LOD's is better solution...
I hope your script is good too, but AFAIS  a lot of effort for creatingh library is needed.
Liberation Mod scripts&balance

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
The library is less the point.  The scripts allow you to route units through a series of positions, without formations.  In tight places, formations screw up ai navigation. 

Better defined buildings just makes it easier to define the movepoint positions (I'm all for that).  These scripts then allow you to string together a list of movepoints for the units to snake through (or a list of fixed positions to man).

Hopefully someone will try them out... :)
« Last Edit: 04 Sep 2006, 04:12:24 by johnnyboy »
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline six6six

  • Members
  • *
Does anyone have a copy of this script?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Emmmm, try the first post ... attached .rar file.


Planck
I know a little about a lot, and a lot about a little.

Offline schuler

  • Contributing Member
  • **
hi johnnyboy, do you need Libya island for this script to work. it would be nice and easy to test if it was in Eden. some addons/Islands work better then others.
Quote
Sorry for requiring addons, but Lybia island has interconnected buildings with great rooftops, which show this off well.
some Islands it seem you and your men can get stuck in buildings and walls ect.
it would be nice to see how it works in other Islands as a script, and to test.
cheers schuler  ;)
Semper Fi

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Hi guys,

I stopped working on this for OFP a long time ago.  I don't even have ofp installed on my computer now.

However, I have improved it a little to work for ARMA, but I haven't felt it was clean enough yet to post.

I will try and put together an arma demo by July or August, if time allows.

However, you should be able to make your own demo by downloading the scripts, and defining your own movepoints in the init.sqs for  an eden building.  How to set up your own movepoints is pretty well documented in the demo code attached to first post.

jb


El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...