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