
Chris's 2021 Modding Guide P2 For AI War 2: Practical Faction Basics
Published at : September 29, 2021
00:00 Intro
00:42 The three types of data: World, Factions, Squads
00:55 World data are one-to-many, and are all singletons
01:32 Faction data requires one-to-one BaseInfo and DeepInfo for every faction
02:10 Using certain factions as singleton pattern for your own sanity
06:15 The Macrophage as an example of a complex multi-faction code relationship
07:40 Enforcing subclass informativeness on yourself or others
08:19 Discussing clarity of code CPU cost in new framework, and those goals for your own code
11:45 Looking at MissingFaction as a basic example for factions
12:32 Looking at ExternalFactionBaseInfoRoot, which is optional but advised to inherit from.
14:33 Why code file organization matters SO much, especially when working with others
15:20 Serialized fields and the nature of them in these classes
16:39 Rather critical: the specific valid uses of non-serialized data in BaseInfo
18:30 DeepInfo does not run on the client; the true implications of that.
19:06 Specifically how to fill nonserialized fields on BaseInfo classes.
20:12 You can have a Stage3 simulation in BaseInfo, and why to do that; implications for bandwidth
24:15 Pooling. Everything you need to know, why is solves memory leaks, and how it will bite you if you do it wrong.
25:22 Looking at pooling properly in the Dark Spire BaseInfo class, and setting initial values.
26:40: How to make absolutely sure you're handling every field properly for pooling, using visual studio.
29:32 What triggers a pooling cleanup pass on factions and world objects
30:25 Looking at the rest of the MissingFaction BaseInfo structure
31:29 The super early way to get data set up before UI, or anything else looks at your faction BaseInfo
34:15 Loading settings from players, still super early. And how we avoid extra long frames via randomness.
38:24 Optional methods you can overload, that are frequently used. Astro Trains as example
40:48 Discussion of AttachedFaction and making use of that.
41:35 Exploring faction DeepInfo, starting with the UniqueName required for them.
43:30 UniqueNames and the details of how this affects faction long-range-planning timing intervals; how to avoid cross threading issue via this.
45:20 Initialization of DeepInfo, and capturing a reference to BaseInfo right away. Huge performance gains from caching like this.
49:14 Cleaning up on DeepInfo for factions (for pooling).
49:45 Run intervals for DeepInfo long-range-planning logic, and how to choose a sensible one that runs on toasters but still has smart AI.
00:42 The three types of data: World, Factions, Squads
00:55 World data are one-to-many, and are all singletons
01:32 Faction data requires one-to-one BaseInfo and DeepInfo for every faction
02:10 Using certain factions as singleton pattern for your own sanity
06:15 The Macrophage as an example of a complex multi-faction code relationship
07:40 Enforcing subclass informativeness on yourself or others
08:19 Discussing clarity of code CPU cost in new framework, and those goals for your own code
11:45 Looking at MissingFaction as a basic example for factions
12:32 Looking at ExternalFactionBaseInfoRoot, which is optional but advised to inherit from.
14:33 Why code file organization matters SO much, especially when working with others
15:20 Serialized fields and the nature of them in these classes
16:39 Rather critical: the specific valid uses of non-serialized data in BaseInfo
18:30 DeepInfo does not run on the client; the true implications of that.
19:06 Specifically how to fill nonserialized fields on BaseInfo classes.
20:12 You can have a Stage3 simulation in BaseInfo, and why to do that; implications for bandwidth
24:15 Pooling. Everything you need to know, why is solves memory leaks, and how it will bite you if you do it wrong.
25:22 Looking at pooling properly in the Dark Spire BaseInfo class, and setting initial values.
26:40: How to make absolutely sure you're handling every field properly for pooling, using visual studio.
29:32 What triggers a pooling cleanup pass on factions and world objects
30:25 Looking at the rest of the MissingFaction BaseInfo structure
31:29 The super early way to get data set up before UI, or anything else looks at your faction BaseInfo
34:15 Loading settings from players, still super early. And how we avoid extra long frames via randomness.
38:24 Optional methods you can overload, that are frequently used. Astro Trains as example
40:48 Discussion of AttachedFaction and making use of that.
41:35 Exploring faction DeepInfo, starting with the UniqueName required for them.
43:30 UniqueNames and the details of how this affects faction long-range-planning timing intervals; how to avoid cross threading issue via this.
45:20 Initialization of DeepInfo, and capturing a reference to BaseInfo right away. Huge performance gains from caching like this.
49:14 Cleaning up on DeepInfo for factions (for pooling).
49:45 Run intervals for DeepInfo long-range-planning logic, and how to choose a sensible one that runs on toasters but still has smart AI.

Chris'sModdingGuide