I am building a turnbased gridbased strategy 2d game.
I have one base TroopClass that holds all data.
I have one base Terrain class that holds data for terrain, like which type of terrain [forrest, hill, plain].
I have one script that handles combat and one that handles movement for troops.
Now the TroopClass got an enum variable MovementType that can be walking, tracked, wheels or flying.
This must affect how much movement cost and combat modifyers.
Now the question is, if we consider only combat, where do i place information on what modfiers apply to which terrain?
As i see it i got three options.
1. Create a table in TroopClass that says which combat modifyer to apply to which terrain.
2. Create a table in TerrainClass that says which combat modifyer to apply to which MovementType.
3. Create a table in the relevant dimension, the combat script, that says which modifyer apply given MovementType and Terrain.
I have had the convention of having all "real" data in the base classes [TroopClass, TerrainClass], but this is the first "variable" that is truly "relative" in the seance that the output is determined by two different classes.
I personally am in favor of the third option seance the data could be considers gameplay aspect related and not pure "data". But i store other information such as MovementType, Initiative, weapons and other "real" data in the TroopClass so i am a bit split here.
I thought it might be an interesting design discussion, give me your thoughts!