New answers tagged

1

Have you considered a 2D array? Visual representation: Faction -> | A | B | C | | | | | | V | | | | ---------------------------------- A thinks... | --- | 15% | 89% | ---------------------------------- B thinks... | 12% | --- | 40% | ---------------------------------- C thinks... | 92% ...


1

You could keep the factions in a dictionary inside your scenario/map/level instance, using ("groupA", "groupB") tuples as keys to store the relations between groups. In case relations are always symmetrical/bilateral (I'm an ally for my allies, an enemy for my enemies), you could subclass dict and change it in a way that sorted tuples would be used to ...


1

The Singleton pattern is sometimes(!) by some(!) people considered an anti-pattern because it takes measures to make it impossible for more than one object of the class to exist and also provides access to that object from everywhere turning it into a global variable in disguise. This does not mean that it is bad when you have an object where you usually ...


1

Thinking of something like ROTK series, every scenario has a starting date and would benefit from holding the game time as one of its attributes, considering that many of its methods would need to access it. Also, if you think of saving/loading a game, the time should belong to the scenario on the data file - a scenario would then represent the whole game ...


0

If you don't need to process something every single turn/year for every character (though you might do for other reasons) you could just store the birthdate of each character, then when you need to know or display the age, subtract this from the current date. This lets you know the age of every character without having to constantly process and update all of ...



Top 50 recent answers are included