Skip to main content

Crate atmosim

Crate atmosim 

Source

Modules§

config
Handles game config. If you want to add new variable, put it into GameConfig struct, then put its Wizden (or whatever server uses it) value into GameConfig’s Default implementation Oh, and if the variable you add can be transformed for performance, add it into ConfigCache and its Default impl. Though do it wisely as extra memory usage can degrade performance. Finally, if you want to create/edit a preset, just create/edit its function in impl GameConfig.
effects
C# reaction effects implementation. If you want to add more, just add more functions, put a serializable definition into enum and pair them in the dispatch function. Try to keep those as close to the game as possible for readadility. This includes also hardconding most values the game hardcodes but excludes compiler warnings, hardcoded values are for whatever reason changed on one server, and to some degree, even performance. If there’s a simple if that always evaluates to one value (which SS14 coders really love), just leave if there. Whatever. It isn’t worth your time proving is is indeed always true. It’s fine to skip what’s already in YML though, which for some reasons these people also love.
gases
Handles gas types. If you want to add more gases, just put them into Gas enum and add its default properties into impl Default for GasProperties
maxcap
This handles simulation of specifically tank explosion logic (not gas reactions). You probably don’t want to touch this unless they’ve changed this logic or you’re fixing a bug.
optimizer
Handles the search of the best maxcap by offloading it to argmin framework. You probably only want to touch this if there’s a bug, or you want to change the algorythm Also 65% of code here is just converting normal data to matrixes and back. I hate it.
prelude
reactions
Reaction logic and gas reaction PROTOTYPE definitions. For C# side of reacions, check effects.rs If you want to add new reaction, simply add it to impl GasReactionPrototype

Structs§

Atmosim
The atmosim engine, stores all the global variables, reaction logic, but explicitly doesn’t own the current simulation state (gas mixtures)