C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
34 stars 9 forks source link

Architectural refactoring #264

Open WildWeazel opened 2 years ago

WildWeazel commented 2 years ago

This is a big one. Following #261 refactor the code to follow the proposed layered architecture: cleanly separate Godot scripts, game logic, data types, C7 & Civ3 file IO, and anything else so that each layer depends only on the one(s) below it. See also #132

QuintillusCFC commented 2 years ago

One of the things that has occasionally come up, and is a bit awkward currently, is the AI, and AI data. Right now, the AI behavior is in C7Engine, but the data classes that stored AI data (which can thus be persisted across a save game, important if we want the AI to have long-term planning) live in C7GameData. This is consistent with wanting C7GameData to contain what can be written out, but means the AI is somewhat split.

There may be a better way to do this, especially one that considers the potential for pluggable AI components, including those that may include data written as part of the save file. That's a longer-term thing I want to consider (but before that there are things like teaching the AI how to arbitrate among potential strategies). Still, it's something that there's been some pushback on (mainly suggesting putting the data in with the C7Engine). I haven't seen pushback with what I'd consider a better alternative being put forward at the same time. But FYI, while I support the general separation of concerns, I see why the AI split in particular has garnered a few PR questions.