Manipulating DG AI without using AItargets

Talk about your new mod or map here

Moderators: jelco, bert_the_turtle

brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Manipulating DG AI without using AItargets

Postby brice » Sun May 13, 2007 7:24 am

Here's another blog entry from brice. :o This time about how to use extra ports to influence DG AI patterns. I mentioned in the Blender export thread that you can add up to around 80 ports to most buildings. I'll explain a little bit more how and why this is useful. And I'll provide a test level you can watch for yourself.

DGs respond to several different AI inputs. These are prioritized as follows:

1. self preservation
2. occupy nearby open ports
3. goto a gather mode officer
4. follow a goto command from an officer
5. goto an AItarget

Even though ports are shorter range than AItargets, they have a much stronger pull. And the pull of a building can be increased by adding more ports. You can use this effect to gain fine control over DG behavior in battles. AItargets are still needed to provide global guidance, but port buildings can be used to control local tactics. They can also be used to disrupt a player's battle plan since ports will trump any officer commands.

Below are code listings for a map, mission and two shape files. The first shape should be saved as "upgrade_port.shp" in your shapes folder. This will replace the current useless UpgradePort in the editor menu. This test building is simply a small sphere surrounded by 32 ports in two concentric circles. These ports will normally be rendered with copies of controlpad.shp which is huge compared to these port circles. So the second shape listing is a nulled controlpad.shp which you should copy in it's place.

The AI battle is for level 3 green DGs. Initially it seems the reds gain the advantage since they occupy buildings faster, but after several minutes the greens are in ascendancy. After 10 min the greens will be firmly in control, and they will eventually push the reds all the way back to their AIspawnPoint. Both teams are generated from identical AIspawnPoints, so it is the landscape and the port circle placements that cause the behavior. If you swap teams, the same result occurs, in the same direction. There are only two AItargets, one at each AIspawnPoint. The rest of the behavior is governed by the port circles.

You can repurpose the "useless" buildings in the editor menu for this kind of stuff. (Well, except for the Cave which *always* crashes the game, and the Wall which creates defective ports.) Darwinia can handle about 80 "MarkerPort" per building shape file. The limit is somewhere between 80 < n < 100, and the game will crash on startup if you pass it. The marker names don't have to be unique or serial numbered. You can also add a similar number of "MarkerLight" which will blink with the building's team color. MarkerPorts take only their X and Z coordinates from the marker pos: line, and adopt the Y of the landscape. This makes them conform to any terrain. MarkerLights use all three coords in the pos: line.

MarkerPort and MarkerLight are fairly universal, and can be added to most any building. Other lights and effects are available on a building by building basis. Some shape files are very picky about additions -- notably the pentaradial bases of the SolarPanels and SpiritReceivers. Some buildings do their own thing with "MarkerPort" and don't substitute controlpad.shp for each one. There are the the MarkerPort + MarkerStatus pairs of the SolarPanel, etc., and the combined "glow-ports" of the SpawnPoint, etc.

Have fun!

-brice

P.S. incidentally the pentakisdodecahedron "sphere" shape fragment was originally lifted from the corners of the spam cube. You can get this same shape from within Blender as a subdivision 2 icosphere mesh.

Code: Select all

# save as "upgrade_port.shp"
Fragment: pentakisdodecahedron
   ParentName: SceneRoot
   Up: -0.000  1.000  0.000
   Front: -0.000  0.000  1.000
   Pos: -0.000  0.000  0.000
   Positions: 42
      0: -0.657 -1.314 -2.023
      1: -1.063 -2.127 -0.773
      2: -1.809 -1.118 -1.314
      3:  0.406 -2.127 -1.250
      4:  0.691 -1.118 -2.127
      5:  0.000 -2.500 -0.000
      6: -2.127 -1.314 -0.000
      7: -1.063 -2.127  0.773
      8: -1.809 -1.118  1.314
      9:  1.720 -1.314 -1.250
      10:  1.314 -2.127 -0.000
      11:  2.236 -1.118 -0.000
      12:  1.720 -1.314  1.250
      13:  0.406 -2.127  1.250
      14:  0.691 -1.118  2.127
      15: -0.657 -1.314  2.023
      16: -2.378 -0.000 -0.773
      17: -2.378 -0.000  0.773
      18: -2.236  1.118 -0.000
      19:  0.000 -0.000 -2.500
      20: -1.469 -0.000 -2.023
      21: -0.691  1.118 -2.127
      22:  2.378 -0.000 -0.773
      23:  1.469 -0.000 -2.023
      24:  1.809  1.118 -1.314
      25:  1.469 -0.000  2.023
      26:  2.378 -0.000  0.773
      27:  1.809  1.118  1.314
      28: -1.469 -0.000  2.023
      29:  0.000 -0.000  2.500
      30: -0.691  1.118  2.127
      31: -1.720  1.314 -1.250
      32:  0.657  1.314 -2.023
      33:  2.127  1.314 -0.000
      34:  0.657  1.314  2.023
      35: -1.720  1.314  1.250
      36: -0.406  2.127 -1.250
      37: -1.314  2.127 -0.000
      38:  0.000  2.500 -0.000
      39:  1.063  2.127 -0.773
      40:  1.063  2.127  0.773
      41: -0.406  2.127  1.250
   Normals: 0
   Colours: 1
      0: 128 128 128
   Vertices: 42
      0: 0 0
      1: 1 0
      2: 2 0
      3: 3 0
      4: 4 0
      5: 5 0
      6: 6 0
      7: 7 0
      8: 8 0
      9: 9 0
      10: 10 0
      11: 11 0
      12: 12 0
      13: 13 0
      14: 14 0
      15: 15 0
      16: 16 0
      17: 17 0
      18: 18 0
      19: 19 0
      20: 20 0
      21: 21 0
      22: 22 0
      23: 23 0
      24: 24 0
      25: 25 0
      26: 26 0
      27: 27 0
      28: 28 0
      29: 29 0
      30: 30 0
      31: 31 0
      32: 32 0
      33: 33 0
      34: 34 0
      35: 35 0
      36: 36 0
      37: 37 0
      38: 38 0
      39: 39 0
      40: 40 0
      41: 41 0
   Triangles: 80
      0 1 2
      1 0 3
      4 3 0
      3 5 1
      6 2 1
      1 7 6
      8 6 7
      1 5 7
      9 3 4
      3 9 10
      11 10 9
      10 5 3
      12 10 11
      10 12 13
      14 13 12
      13 5 10
      15 13 14
      13 15 7
      8 7 15
      7 5 13
      16 2 6
      6 17 16
      18 16 17
      17 6 8
      19 4 0
      0 20 19
      21 19 20
      20 0 2
      22 11 9
      9 23 22
      24 22 23
      23 9 4
      25 14 12
      12 26 25
      27 25 26
      26 12 11
      28 8 15
      15 29 28
      30 28 29
      29 15 14
      31 16 18
      16 31 20
      21 20 31
      20 2 16
      32 19 21
      19 32 23
      24 23 32
      23 4 19
      33 22 24
      22 33 26
      27 26 33
      26 11 22
      34 25 27
      25 34 29
      30 29 34
      29 14 25
      35 28 30
      28 35 17
      18 17 35
      17 8 28
      36 21 31
      31 37 36
      38 36 37
      37 31 18
      39 24 32
      32 36 39
      38 39 36
      36 32 21
      40 27 33
      33 39 40
      38 40 39
      39 33 24
      41 30 34
      34 40 41
      38 41 40
      40 34 27
      37 18 35
      35 41 37
      38 37 41
      41 35 30
      
Marker: MarkerPort01
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -1.00  0.00  -0.00
   Pos:    16.00  0.00  0.00
   MarkerEnd
Marker: MarkerPort02
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.95  0.00  -0.31
   Pos:    15.22  0.00  4.94
   MarkerEnd
Marker: MarkerPort03
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.81  0.00  -0.59
   Pos:    12.94  0.00  9.40
   MarkerEnd
Marker: MarkerPort04
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.59  0.00  -0.81
   Pos:    9.40  0.00  12.94
   MarkerEnd
Marker: MarkerPort05
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.31  0.00  -0.95
   Pos:    4.94  0.00  15.22
   MarkerEnd
Marker: MarkerPort06
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.00  0.00  -1.00
   Pos:    0.00  0.00  16.00
   MarkerEnd
Marker: MarkerPort07
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.31  0.00  -0.95
   Pos:    -4.94  0.00  15.22
   MarkerEnd
Marker: MarkerPort08
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.59  0.00  -0.81
   Pos:    -9.40  0.00  12.94
   MarkerEnd
Marker: MarkerPort09
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.81  0.00  -0.59
   Pos:    -12.94  0.00  9.40
   MarkerEnd
Marker: MarkerPort10
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.95  0.00  -0.31
   Pos:    -15.22  0.00  4.94
   MarkerEnd
Marker: MarkerPort11
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  1.00  0.00  -0.00
   Pos:    -16.00  0.00  0.00
   MarkerEnd
Marker: MarkerPort12
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.95  0.00  0.31
   Pos:    -15.22  0.00  -4.94
   MarkerEnd
Marker: MarkerPort13
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.81  0.00  0.59
   Pos:    -12.94  0.00  -9.40
   MarkerEnd
Marker: MarkerPort14
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.59  0.00  0.81
   Pos:    -9.40  0.00  -12.94
   MarkerEnd
Marker: MarkerPort15
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.31  0.00  0.95
   Pos:    -4.94  0.00  -15.22
   MarkerEnd
Marker: MarkerPort16
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.00  0.00  1.00
   Pos:    -0.00  0.00  -16.00
   MarkerEnd
Marker: MarkerPort17
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.31  0.00  0.95
   Pos:    4.94  0.00  -15.22
   MarkerEnd
Marker: MarkerPort18
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.59  0.00  0.81
   Pos:    9.40  0.00  -12.94
   MarkerEnd
Marker: MarkerPort19
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.81  0.00  0.59
   Pos:    12.94  0.00  -9.40
   MarkerEnd
Marker: MarkerPort20
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.95  0.00  0.31
   Pos:    15.22  0.00  -4.94
   MarkerEnd

Marker: MarkerPort01
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -1.00  0.00  -0.00
   Pos:    10.00  0.00  0.00
   MarkerEnd
Marker: MarkerPort02
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.87  0.00  -0.50
   Pos:    8.66  0.00  5.00
   MarkerEnd
Marker: MarkerPort03
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.50  0.00  -0.87
   Pos:    5.00  0.00  8.66
   MarkerEnd
Marker: MarkerPort04
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.00  0.00  -1.00
   Pos:    0.00  0.00  10.00
   MarkerEnd
Marker: MarkerPort05
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.50  0.00  -0.87
   Pos:    -5.00  0.00  8.66
   MarkerEnd
Marker: MarkerPort06
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.87  0.00  -0.50
   Pos:    -8.66  0.00  5.00
   MarkerEnd
Marker: MarkerPort07
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  1.00  0.00  -0.00
   Pos:    -10.00  0.00  0.00
   MarkerEnd
Marker: MarkerPort08
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.87  0.00  0.50
   Pos:    -8.66  0.00  -5.00
   MarkerEnd
Marker: MarkerPort09
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.50  0.00  0.87
   Pos:    -5.00  0.00  -8.66
   MarkerEnd
Marker: MarkerPort10
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.00  0.00  1.00
   Pos:    -0.00  0.00  -10.00
   MarkerEnd
Marker: MarkerPort11
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.50  0.00  0.87
   Pos:    5.00  0.00  -8.66
   MarkerEnd
Marker: MarkerPort12
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  -0.87  0.00  0.50
   Pos:    8.66  0.00  -5.00
   MarkerEnd

Code: Select all

# save as "controlpad.shp"
Fragment: empty
   ParentName: sceneroot
      up:     0.00  1.00  0.00
      front:  0.00  0.00  1.00
      pos:    0.00  0.00  0.00
   Positions: 0
   Normals: 0
   Colours: 0
   Vertices: 0
   Triangles: 0

Marker: MarkerStatus
   ParentName: sceneroot
   Depth: 1
   Up:     0.00  1.00  0.00
   Front:  0.00  0.00  1.00
   pos:    0.00  5.00 0.00
   MarkerEnd

Code: Select all

# map file
Landscape_StartDefinition
   worldSizeX 2000
   worldSizeZ 2000
   cellSize 12.00
   outsideHeight -10.00
   landColourFile landscape_default.bmp
   wavesColourFile waves_default.bmp
   waterColourFile water_default.bmp
Landscape_EndDefinition

LandscapeTiles_StartDefinition
   #                            frac  height desired gen         lowland
   # x       y       z    size   dim  scale  height  method seed smooth  guideGrid
   # =============================================================================
        0   0.00     -2   2000  1.00   1.00    200      1 794854   1.00     0
LandscapeTiles_EndDefinition

LandFlattenAreas_StartDefinition
   # x      y       z      size
   # ==========================
LandFlattenAreas_EndDefinition

Lights_StartDefinition
   # x      y      z        r      g      b
   # =========================================
     0.00   0.95   0.30     0.77   0.77   0.77
    -1.00   0.00  -0.08     1.30   1.30   1.30
Lights_EndDefinition

Buildings_StartDefinition
   # Type              id      x       z       tm      rx      rz      isGlobal
   # ==========================================================================
   UpgradePort         2       1465.00 355.00  1       1.00    0.00    0       
   UpgradePort         4       1185.00 345.00  1       1.00    0.00    0       
   UpgradePort         1       1275.00 275.00  1       1.00    0.00    0       
   UpgradePort         6       1275.00 315.00  1       1.00    0.00    0       
   UpgradePort         8       1275.00 345.00  1       1.00    0.00    0       
   UpgradePort         10      1275.00 375.00  1       1.00    0.00    0       
   UpgradePort         12      1275.00 415.00  1       1.00    0.00    0       
   UpgradePort         14      1275.00 445.00  1       1.00    0.00    0       
   UpgradePort         16      1315.00 295.00  1       1.00    0.00    0       
   UpgradePort         18      1315.00 335.00  1       1.00    0.00    0       
   UpgradePort         20      1315.00 375.00  1       1.00    0.00    0       
   UpgradePort         22      1315.00 405.00  1       1.00    0.00    0       
   UpgradePort         24      1315.00 445.00  1       1.00    0.00    0       
   UpgradePort         26      1365.00 465.00  1       1.00    0.00    0       
   UpgradePort         28      1365.00 435.00  1       1.00    0.00    0       
   UpgradePort         30      1365.00 395.00  1       1.00    0.00    0       
   UpgradePort         32      1365.00 365.00  1       1.00    0.00    0       
   UpgradePort         34      1365.00 335.00  1       1.00    0.00    0       
   UpgradePort         36      1365.00 295.00  1       1.00    0.00    0       
   UpgradePort         38      1365.00 255.00  1       1.00    0.00    0       
   UpgradePort         42      1455.00 255.00  1       1.00    0.00    0       
   UpgradePort         43      1045.00 455.00  1       1.00    0.00    0       
   UpgradePort         45      1495.00 455.00  1       1.00    0.00    0       
   UpgradePort         46      1585.00 415.00  1       1.00    0.00    0       
   UpgradePort         47      1545.00 285.00  1       1.00    0.00    0       
   UpgradePort         48      1425.00 175.00  1       1.00    0.00    0       
   UpgradePort         49      1165.00 285.00  1       1.00    0.00    0       
   UpgradePort         50      1115.00 385.00  1       1.00    0.00    0       
   AISpawnPoint        40      1639.15 343.15  0       1.00    0.00    0  -1  12  20  2     
   AISpawnPoint        57      1057.66 267.52  1       1.00    0.00    0  -1  12  20  2     
   AITarget            58      1639.97 345.22  1       1.00    0.00    0       
   AITarget            59      1057.87 261.00  1       1.00    0.00    0       
Buildings_EndDefinition

Code: Select all

# mission file
CameraMounts_StartDefinition
   # Name             Pos                   Front          Up
   # =========================================================================
   start           1906.82  478.69  399.57 -0.68 -0.73 -0.08 -0.73 0.68 -0.08
CameraMounts_EndDefinition

CameraAnimations_StartDefinition
CameraAnimations_EndDefinition

Buildings_StartDefinition
   # Type              id      x       z       tm      rx      rz      isGlobal
   # ==========================================================================
Buildings_EndDefinition

InstantUnits_StartDefinition
   # Type         team    x       z   count  inUnit state   spread  waypointX waypointZ
   # ==================================================================================
   AI               1  1153.2   693.0      1    0      -1   200.0     0.0     0.0
   AI               0  1554.3   681.7      1    0      -1   200.0     0.0     0.0
InstantUnits_EndDefinition

PrimaryObjectives_StartDefinition
   NeverTrue
PrimaryObjectives_EndDefinition
Last edited by brice on Mon May 14, 2007 4:58 am, edited 1 time in total.
martin
level5
level5
Posts: 3210
Joined: Fri Nov 19, 2004 8:37 pm

Postby martin » Sun May 13, 2007 10:01 am

on your list isn't it the other way around for officer gather and goto commands??
GENERATION 22:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Sun May 13, 2007 10:35 am

martin wrote:on your list isn't it the other way around for officer gather and goto commands??


No, but there are details I didn't mention since I wasn't trying to explain DG AI per se. Try this if you doubt the order I listed. Gather a bunch of DGs around two officers. One officer is in gather mode first. Then set the second (very close) officer to send DGs to a far away point. The DGs will stay. Then release the gather mode officer, let the DGs run a little, and reinstate the gather mode officer. If your goto waypoint is far enough away, none of the DGs will ever make it there. Every few seconds they all reevaluate their AI goals based on their curent local situations. You'll see a fraction of the group turn back towards the gathering officer every few seconds.

(BTW, this two-officer method is a good way to avoid DGs stopping in the middle of your goto paths. That problem is caused by some DGs following the intermediate waypoints as you move the cursor. If you use a gathering officer to hold them back, you can finish the goto command without any "over-eager confusion" on the part of the DGs. Unfortunately the gathering officer disrupts everything on the island.)

The priority list I gave is in general only. In practice the distance to any given AI goal is what's most important. A goto mode officer can trump an AItarget only if it is standing right there. Move the officer a little and the DGs will split. Just like how you can setup several goto mode officers at the exit of a radar dish and the exiting DGs will split amongst the waypoints equally if the officers are close together. You also have to consider the ranges for the different AI goals. Gather mode officers have an island-wide effect as long as there is no major water or steep cliffs in the DGs' line of sight. Ports are very local, and so are goto officers. AItargets you already know have a range of 500. And to make everything a little unpredictable, Chris injects some randomness into the DGs decisions all the time.

Play around with it. Don't take my word for it.

One nice thing about using port-circle buildings to control battles is it avoids the surge and retreat mode of AItargets. If there are nearby ports in contention, no DG will run away to another AItarget. I always thought the surge and retreat was a little counterproductive. If you have a long series of AItargets, most of the DGs get caught up cycling between the first ones, and few make it out to the end of the line, even if there is a battlefront out there. With ports on the line, you can force DGs to hold their ground. This doesn't help with long supply chains, but it does help with the actual battles. DGs fight viciously over ports.
martin
level5
level5
Posts: 3210
Joined: Fri Nov 19, 2004 8:37 pm

Postby martin » Sun May 13, 2007 6:31 pm

ah yes, I see what you mean. I meant in the immediate area of the officers but what you say seems to hold.
GENERATION 22:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Mon May 14, 2007 2:31 am

brice wrote:(BTW, this two-officer method is a good way to avoid DGs stopping in the middle of your goto paths. That problem is caused by some DGs following the intermediate waypoints as you move the cursor. If you use a gathering officer to hold them back, you can finish the goto command without any "over-eager confusion" on the part of the DGs. Unfortunately the gathering officer disrupts everything on the island.)

What do you mean "intermediate waypoints?" When I use the goto command, I left-click on the officer, position the cursor where I want my DGs to go, then right-click on that point. No intermediate waypoints needed...

Also, I have never seen a DG turn back to follow a "follow" order when he is following a "goto" order. Can you describe exactly what you are doing?

xander
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Mon May 14, 2007 4:07 am

xander wrote:What do you mean "intermediate waypoints?" When I use the goto command, I left-click on the officer, position the cursor where I want my DGs to go, then right-click on that point. No intermediate waypoints needed...


Wow! I still learn stuff about this game every day! I usually left click on the officer and then EDIT: right click (see?) drag the cursor to the endpoint. This causes the intermediate waypoints. I didn't know I could just right click at the end. Probably clearly spelled out in the help... which of course I figured I didn't need... just mash and figure it out.

xander wrote:Also, I have never seen a DG turn back to follow a "follow" order when he is following a "goto" order. Can you describe exactly what you are doing?


I just tried to reproduce it, and I can't. I do have a vivid memory of seeing DGs peeling off a goto group and heading back towards a follow/gather officer. I can't figure out which of my test levels I was using, so I don't know if there was some environmental effect like a green AI unit, but nothing I've tried reproduces it. So now I'm thinking it might have been those pesky intermediate waypoints I've been inflicting on myself. :oops:

I probably saw the effect and generalized without investigating -- since I was focusing on something else at the time. I do that. I've already posted several examples of jumping to conclusions around these forums. Often enough I'm wrong about details I think I've got right. I'm glad people call me on it.

Anyhow... I know the ports work??
Last edited by brice on Mon May 14, 2007 5:24 pm, edited 2 times in total.
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Mon May 14, 2007 4:51 am

brice wrote:If there are nearby ports in contention, no DG will run away to another AItarget.


Actually this is not 100% true either. The rules are a little more complex.

The engine apparently keeps track of how many DGs are headed towards each open port. Each open port can draw a maximum of roughly 20 DGs (a guestimate). If that many are headed there, the port is considered "closed" and no other DGs will respond, even though it hasn't yet been occupied.

So if you have two open ports and 50 DGs free, then only roughly 40 of them will run for the ports. This leaves 10 DGs free to do anything else, including run for AItargets in range.
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Mon May 14, 2007 4:01 pm

I am also going to change your DG AI priority list around, a bit.
  1. Combat: In combat, DGs approach their target, take a shot, then retreat. They will attempt to retreat from all explosives.
  2. Occupy Ports: If there is a port nearby, a group of DGs will attempt to occupy it.
  3. Officer Orders: DGs will follow officer orders to completion. As the follow order has a much greater range, DGs will appear to prioritize that order. However, set up the following experiment: place an officer in a group of DGs. Have that officer give a goto order very close to where he is standing. Then, create another officer nearby, and give him a follow order. The DGs will be stuck at the end of their goto order, as every time they finish the goto order, there is an officer there to give them another goto order. So it appears that goto is prioritized above follow. However, if DGs are following one officer, they won't follow another officer's goto order. Thus, both orders have the same priority, and it is entirely dependent upon which is given first.
  4. Goto an AITarget: this only applies if there are sufficient DGs in a group to goto the target. One or two DGs will generally not seek out a target.


xander
brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Postby brice » Tue May 15, 2007 6:09 am

brice wrote:Ports are very local, and so are goto officers. AItargets you already know have a range of 500.


...another correction here. Unoccupied ports are local in *most* cases. You usually have to get a follow / gather mode officer to within << ~100 units distance before DGs will break away. But SpawnPoints are special. They have the same calling range as AItargets, without the need for AI Units or AItargets on the map. DGs can smell open SpawnPoint ports 500 units away.

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 5 guests