1(game-module "ww2-adv"
2  (title "WWII Strategic Level")
3  (version "1.1")
4  (blurb "Base module for strategic level WWII games. Uses armies and fleets as smallest units.")
5  (picture-name "tank-column")
6  (variants (world-seen true) (see-all false) (sequential false)
7   ("Last Alliance Wins" last-alliance-wins true
8     (true (scorekeeper (do last-alliance-wins)))))
9)
10
11;;; Types.
12
13(unit-type infantry (image-name "inf")
14  (help "a primarily foot-powered army"))
15(unit-type armor (image-name "armor")
16  (help "a primarily mechanized and armored army"))
17
18(define ground-types (infantry armor))
19
20(unit-type air-force (name "air force") (image-name "4e") (char "f")
21  (help "ground support capability"))
22(unit-type bomber
23  (help "strategic bombing capability"))
24(unit-type interceptor (image-name "1e") (char "p")
25  (help "anti-bomber capability"))
26
27(define air-types (air-force bomber interceptor))
28
29(unit-type convoy (image-name "ap")
30  (help "transportation capability"))
31(unit-type fleet (image-name "bb") (char "F")
32  (help "naval combat capability"))
33(unit-type cv-fleet (name "carrier fleet") (image-name "cv") (char "C")
34  (help "seaborne aircraft base"))
35(unit-type sub-fleet (name "sub fleet") (image-name "sub")
36  (help "submarine wolfpack, deadly to convoys"))
37(unit-type asw-fleet (name "ASW fleet") (image-name "dd") (char "D")
38  (help "submarine killers"))
39
40(define ship-types (convoy fleet cv-fleet sub-fleet asw-fleet))
41
42(unit-type base (image-name "airbase") (char "/")
43  (help ""))
44(unit-type town (image-name "town20")
45  (help ""))
46(unit-type city (image-name "city19")
47  (help "major cities only"))
48(unit-type capital (image-name "city20")
49  (help "capital of a country or region"))
50
51(define place-types (base town city capital))
52
53(define builders         (town city capital))
54
55(material-type oil
56  (help "motive power for units"))
57(material-type planes
58  (help "combat power for air units"))
59
60(terrain-type sea (char ".")
61  (help "deep water"))
62(terrain-type shallows (char ",")
63  (help "shallow coastal water and lakes"))
64(terrain-type swamp (char "="))
65(terrain-type desert (char "~")
66  (help "dry open terrain"))
67(terrain-type land (image-name "plains") (char "+")
68  (help "open flat or rolling country"))
69(terrain-type forest (char "%"))
70(terrain-type mountains (char "^"))
71(terrain-type ice (char "_"))
72(terrain-type neutral (image-name "gray") (char "-"))
73(terrain-type river (char "<")
74  (subtype border) (subtype-x river-x))
75(terrain-type beach (char "|")
76  (subtype border))
77(terrain-type road (char ">")
78  (subtype connection) (subtype-x road-x))
79(terrain-type mud (image-name "brown")
80  (subtype coating))
81(terrain-type snow (image-name "ice")
82  (subtype coating))
83
84(add (sea shallows) liquid true)
85
86(define sea-t* (sea shallows))
87
88(define land-t* (desert land forest mountains))
89
90;;; Static relationships.
91
92(table vanishes-on
93  (ground-types sea-t* true)
94  (ground-types ice true)
95  (ship-types land-t* true)
96  (ship-types ice true)
97  (place-types sea-t* true)
98  (place-types ice true)
99  (u* neutral true)
100  )
101
102;;; Unit-unit capacities.
103
104(table unit-size-as-occupant
105  ;; Disable occupancy by default.
106  (u* u* 99)
107  (ground-types (convoy fleet) 1)
108  (ground-types place-types 10)
109  (air-types (convoy fleet cv-fleet) 1)
110  (air-types place-types 1)
111  (ship-types place-types 1)
112  )
113
114(add (convoy fleet cv-fleet) capacity (2 1 2))
115
116(add place-types capacity 40)
117
118;;; Unit-terrain capacities.
119
120(table unit-size-in-terrain
121  (u* t* 1)
122  (ground-types t* 50)
123  (place-types t* 100)
124  )
125
126(add t* capacity 100)
127
128;;; Unit-material capacities.
129
130(table unit-storage-x
131  ;; This requires the units to stay close to supply centers.
132  (ground-types oil (1 5))
133  ;; Ships typically carry enough for six months at sea.
134  (ship-types oil 30)
135  (place-types oil (500 1000 2000 2000))
136  (air-types planes (1000 500 1000))
137  )
138
139;;; Vision.
140
141(set terrain-seen true)
142
143;;; Reporters and civilians are always reporting on activities
144;;; at fixed places.
145
146(add place-types see-always true)
147
148;; The wolfpacks and the subkillers spread out when hunting.
149
150(add (sub-fleet asw-fleet) vision-range 2)
151
152;; Air units all do daily patrols and thus have their eyes
153;; on everything happening around them.
154
155(add air-types vision-range 4)
156
157;;; Actions.
158
159(add u* acp-per-turn 1)
160
161(add ground-types acp-per-turn (4 5))
162
163(add air-types acp-per-turn 96)
164
165(add ship-types acp-per-turn 48)
166
167(add base acp-per-turn 0)
168
169(add ground-types free-acp (1 2))
170
171;;; Movement.
172
173(add place-types speed 0)
174
175(table mp-to-enter-terrain
176  (ground-types sea-t* 99)
177  (ground-types beach -99)
178  (ground-types mud 1)
179  (ground-types snow 2)
180  (ship-types land-t* 99)
181  ((fleet cv-fleet) shallows 2)
182  (u* ice 99)
183  (air-types ice 1)
184  (u* neutral 99)
185)
186
187(table mp-to-leave-terrain
188  (ground-types sea-t* 99)
189  )
190
191;;; Transports will get you to the edge of the cell, but the
192;;; passengers have to cross any borders on their own.
193
194(table ferry-on-entry
195  (convoy ground-types over-own)
196  )
197
198(table ferry-on-departure
199;  (convoy ground-types over-own)
200  (convoy ground-types over-nothing)
201  )
202
203(table material-to-move
204  (u* oil 1)
205  )
206
207(table consumption-per-move
208  (armor oil 1)
209  )
210
211(table control-range
212  (ground-types t* 0)
213  (place-types t* 0)
214  )
215
216;;; Construction.
217
218(table can-toolup-for
219  (builders u* true)
220  )
221
222(table acp-to-toolup
223  (builders u* 1)
224  )
225
226(table tp-to-build
227  (builders infantry 6)
228  (builders armor 24)
229  (builders air-types 24)
230  (builders ship-types 36)
231  )
232
233(table tp-max
234  (builders infantry 6)
235  (builders armor 24)
236  (builders air-types 24)
237  (builders ship-types 36)
238  )
239
240(add ground-types cp (6 9))
241(add air-types cp 12)
242(add ship-types cp 6)
243(add base cp 1)
244
245(table acp-to-create
246  (builders ground-types 1)
247  (builders air-types 1)
248  (builders ship-types 1)
249  (ground-types base 1)
250  )
251
252(table can-create
253  (builders ground-types 1)
254  (builders air-types 1)
255  (builders ship-types 1)
256  (ground-types base 1)
257  )
258
259(table cp-on-creation
260  (builders ground-types 1)
261  (builders air-types 1)
262  (builders ship-types 1)
263  (ground-types base 1)
264  )
265
266(table can-build
267  (builders ground-types 1)
268  (builders air-types 1)
269  (builders ship-types 1)
270  )
271
272(table acp-to-build
273  (builders ground-types 1)
274  (builders air-types 1)
275  (builders ship-types 1)
276  )
277
278(table cp-per-build
279  (builders ground-types 1)
280  (builders air-types 1)
281  (builders ship-types 1)
282  )
283
284(table supply-on-creation
285  (u* oil 1)
286  (air-types planes (20 10 20))
287  )
288
289;;; Repair.
290
291(add ground-types hp-recovery (1.00 0.50))
292
293(table auto-repair
294  (place-types ground-types 1.00)
295  )
296
297(table auto-repair-range
298  ;; Replacements can easily get to nearby units.
299  (u* ground-types 1)
300  )
301
302;;; Production.
303
304(table base-production
305  (place-types oil 5)
306  ;; Bases are supply depots only.
307  (base oil 0)
308  ((city capital) planes 10)
309  )
310
311(table base-consumption
312  (ground-types oil 1)
313  (ship-types oil 5)
314  (air-types oil (15 40 15))
315  )
316
317(table hp-per-starve
318  (ground-types oil 1.00)
319  (ship-types oil 1.00)
320  (air-types oil 1.00)
321  )
322
323(table consumption-as-occupant
324  (ground-types oil 1)
325  (air-types oil 1)
326  )
327
328;;; Combat.
329
330(add ground-types hp-max (9 6))
331
332(add air-types hp-max 3)
333
334(add ship-types hp-max 9)
335
336(add place-types hp-max (3 36 48 48))
337
338(table acp-to-attack
339  (u* u* 1)
340  ;; Limit the amount of combat in a month.
341  (infantry u* 4)
342  (armor u* 3)
343  ;; Ships can always foil attacks by staying out to sea.
344  (ground-types ship-types 0)
345  ;; Ship combat uses up a week's worth of movement.
346  (ship-types u* 12)
347  ;; Convoys are not combat units.
348  (convoy u* 0)
349  ;; Subs are only useful against surface ships.
350  (sub-fleet u* 0)
351  (sub-fleet ship-types 12)
352  (sub-fleet sub-fleet 0)
353  ;; Airplanes don't engage in hand-to-hand.
354  (air-types u* 0)
355  ;; Places can't attack anything by themselves.
356  (place-types u* 0)
357  )
358
359;; Air units attack by "firing" (ie raids).
360
361(add air-types acp-to-fire 24)
362
363(add air-types range (3 8 3))
364
365(table withdraw-chance-per-attack
366  (infantry ground-types (20 10))
367  (armor    ground-types (30 20))
368  )
369
370(table acp-for-retreat
371  ;; Ground units can always retreat.
372  (ground-types ground-types 1)
373  )
374
375(table hit-chance
376  (u* u* 50)
377  (infantry ground-types (50 40))
378  (armor    ground-types (70 60))
379  ;; Ships are hard to shoot at from shore, but a counterattack
380  ;; might connect.
381  (ground-types ship-types 10)
382  (fleet convoy 95)
383  ;; Convoys are not combat units, but do have a couple escorts.
384  (convoy u* 5)
385  ;; Subs are only useful against surface ships.
386  (sub-fleet u* 0)
387  (sub-fleet ship-types 50)
388  (sub-fleet sub-fleet 0)
389  ;; Subs can generally sink *something* in a convoy.
390  (sub-fleet convoy 75)
391  ;; ASW is effective once it finds the subs.
392  (asw-fleet sub-fleet 80)
393  (place-types infantry 20)
394  (place-types armor 10)
395  )
396
397(table damage
398  (u* u* 1)
399  ;; A fleet of surface ships can do a lot of damage.
400  (fleet u* 2d3+1)
401  ;; Subs are only useful against surface ships.
402  (sub-fleet u* 0)
403  (sub-fleet ship-types 1)
404  (sub-fleet sub-fleet 0)
405  ;; Subs can devastate a convoy.
406  (sub-fleet convoy 2d4+1)
407  ;; ASW can take a chunk out of a sub fleet.
408  (asw-fleet sub-fleet 2d4+3)
409  )
410
411(table hp-min
412  ;; Places can never be entirely destroyed.
413  (u* place-types 1)
414  ;; Naval bombardment can hurt, but not kill ground units.
415  (ship-types ground-types 5)
416  )
417
418(table capture-chance
419  ;; Armor can be captured and made use of.
420  (ground-types armor 20)
421  ;; (Ground units are not going to catch planes in the air
422  ;; or ships at sea, so can only capture them if in cities.)
423  ;; Cities offer basically zippo resistance to armies.
424  (ground-types place-types 90)
425  ;; Battle fleets can capture cargo ships and such.
426  ((fleet cv-fleet asw-fleet) convoy 90)
427  )
428
429(table protection
430  ;; Ground units protect cities.
431  (ground-types place-types 50)
432  ((air-force interceptor) place-types 80)
433  (place-types ground-types 50)
434  )
435
436(table occupant-combat
437  ;; Air units cannot fight while being transported on convoys.
438  (air-types convoy 0)
439  )
440
441(table material-to-attack
442  ;; Out-of-supply forces can defend but not initiate attacks.
443  (ground-types oil 1)
444  )
445
446(table material-to-fire
447  (air-types planes (100 50 100))
448  )
449
450(table consumption-per-fire
451  (air-types oil 50)
452  (air-types planes 10)
453  )
454
455(table hit-by
456  ;; This reflect plane losses due to AA.
457  (ground-types planes 1)
458  (ship-types planes (1 3 4 0 2))
459  (place-types planes (1 2 5 10))
460  )
461
462;;; Backdrop.
463
464(table out-length
465  ;; Net consumers of supply should never give any up automatically.
466  (ground-types m* -1)
467  ;; Cities and towns can share things around.
468  (place-types m* 3)
469  )
470
471(table in-length
472  ;; Supply to ground units can go several hexes away.
473  (ground-types m* 3)
474  ;; Cities and bases can get their supplies from some distance away.
475  (place-types m* 10)
476  (base m* 5)
477  )
478
479;;; Temperature characteristics of terrain.
480
481(add t* temperature-min -20)
482(add (sea shallows) temperature-min 4)
483(add desert temperature-min 0)
484
485(add t* temperature-max 30)
486(add desert temperature-max 40)
487(add mountains temperature-max 20)
488(add ice temperature-max 0)
489
490(add t* temperature-average 20)
491(add mountains temperature-average 10)
492(add ice temperature-average -10)
493
494(add land temperature-variability 5)
495
496(table coating-depth-max
497  ((mud snow) t* 1)
498  ((mud snow) (sea shallows neutral) 0)
499  ;; Mountains are rocky, don't really have a "mud season".
500  (mud mountains 0)
501  )
502
503;; If a side loses, its combat units vanish, but not its cities.
504
505(add place-types lost-vanish-chance 0)
506
507(set initial-date "Sep 1939")
508
509;; Need this to be month 9.
510
511(set initial-year-part 8)
512
513;;; The world.
514
515(world 360 (year-length 12))
516
517;;; Sides.
518
519(set sides-max 10)
520
521(include "ng-asian")
522(include "ng-european")
523(include "ng-english")
524(include "ng-german")
525(include "ng-american")
526(include "ng-chinese")
527(include "ng-japanese")
528(include "ng-italian")
529
530(set side-library '(
531  ((name "USA") (adjective "American") (emblem-name "flag-usa") (unit-namers (place-types "american-place-names")))
532  ((name "UK") (adjective "British") (emblem-name "flag-uk") (unit-namers (place-types "english-place-names")))
533  ((name "USSR") (adjective "Soviet") (emblem-name "flag-ussr") (unit-namers (place-types "russian-place-names")))
534  ((name "France") (adjective "French") (emblem-name "flag-france") (unit-namers (place-types "french-place-names")))
535  ((name "Germany") (adjective "German") (emblem-name "flag-swastika") (unit-namers (place-types "german-place-names")))
536  ((name "Italy") (adjective "Italian") (emblem-name "flag-italy") (unit-namers (place-types "italian-place-names")))
537  ((name "Japan") (adjective "Japanese") (emblem-name "flag-japan") (unit-namers (place-types "japanese-place-names")))
538  ((name "China") (adjective "Chinese") (emblem-name "flag-china-old") (unit-namers (place-types "chinese-place-names")))
539  ((name "Spain") (noun "Spaniard") (adjective "Spanish") (emblem-name "flag-spain") (unit-namers (place-types "spanish-place-names")))
540  ((name "Turkey") (adjective "Turkish") (emblem-name "flag-turkey") (unit-namers (place-types "turkish-place-names")))
541  ))
542
543(set calendar '(usual month))
544
545(set season-names
546  ;; 0 is January, 3 is April, 6 is July, 9 is October
547  ((0 2 "winter") (3 5 "spring") (6 8 "summer") (9 11 "autumn")))
548
549;;; Random setup parameters (for testing).
550
551(add t* alt-percentile-min   0)
552(add t* alt-percentile-max   0)
553(add (sea land) alt-percentile-min ( 0  70))
554(add (sea land) alt-percentile-max (70 100))
555(add t* wet-percentile-min   0)
556(add t* wet-percentile-max 100)
557
558;;; River generation.
559
560(add (land forest mountains) river-chance (10.00 25.00 25.00))
561
562(set river-sink-terrain shallows)
563
564;;; Road generation.
565
566(table road-into-chance
567  (t* land 100)
568  (land (desert forest mountains) (50 40 20))
569  )
570
571(set edge-terrain ice)
572
573(set country-radius-min 4)
574
575(add ground-types start-with (4 1))
576(add place-types start-with 3)
577(add capital start-with 1)
578
579;(add (sea land) country-terrain-min (4 4))
580
581(table favored-terrain
582  (u* t* 0)
583  (ground-types land 100)
584  (air-types land 100)
585  (ship-types sea 100)
586  (place-types land 100)
587  )
588
589(add land country-people-chance 100)
590
591(table unit-initial-supply
592  (u* oil 9999)
593  (air-types planes 9999)
594  )
595
596(game-module (design-notes
597  "The basic idea of this game is to model the grand strategy of the WWII era."
598  "Scale is 1 deg or 90-100km/hex, 1 month/turn."
599  ""
600  "At this scale the details of maneuver become less important than managing"
601  "production and logistics."
602  ""
603  "Land units are infantry and armor armies, basically the same except that armor"
604  "is more highly mechanized.  Units are about corps-sized."
605  ""
606  "Air forces represent strategic bombing, etc abilities."
607  ""
608  "Convoys are primarily transport ships with some protection."
609  ""
610  "Fleets are battleship/cruiser fleets, while carrier fleets have a long-range"
611  "strike capability due to their aircraft."
612  "Submarine fleets represent a large number of subs operating over a wide area."
613  ""
614  "City production is very hard to change."
615  ))
616