I've been playing a new walkthrough using a revamped, clean implementation of the Building framework for the castle. I'm up to week 49 now and am satisfied the code is stable and want to make it available to the dev team so that they have plenty of time to "own" it if they so choose.
The reason I did this is I'm an old software dev, sysadmin and software CM person who has seen what happens when a project grows too complicated and needs a rewrite. All of the symptoms are there for SOC: repeated regressions (zero forge capacity anyone?), neglected code coming back to bite you (the Tavern level 2 upgrade), and messy data structures for a class framework strung out among multiple source files. The dev team are stuck other fires and usually loathe to take on tasks that are seemingly thankless. I just happen to be a neutral observer with too much time on my hands who wishes to give back effort instead of money for the game.
I'm attaching the following files with the changes as noted. I hope some of the users with a little software experience and some playthroughs of SOC will also download this and try it with a new playthrough. It will definitely be more readable and tweakable for those who want to do a little twiddling of the dependencies and values.
game/core/buildings.rpy - All castle buildings are formally defined subclasses of a template Building class. Each subclass encapsulates data (capacity, research production, etc) that used to be spread out in data structures among 4 different files (research.rpy, building_screens.rpy, building.rpy and building_descriptions.rpy). It was easy to screw up edits because of this, and building_descriptions.rpy seemed to have been ignored for a couple of years based on the number of missing descriptions for some of the new buildings. The texts/building_descriptions.rpy file can now be deleted since it will no longer be necessary.
game/rowan intro.rpy - The only thing this file does now is instantiate the Castle. It does NOTHING else as far as the buildings are concerned since all of those details are now properly encapsulated.
game/core/castle.rpy - Changes to the _load_buildings method as noted to use the new framework with its simplified iteration loop.
game/core/research.rpy - Changed the on_completion method for the Dark Subterfuge research to bump the max_lvl for the sanctum from 1 to 2. It appears to have been a casualty of the recent research tree revamp since Fiendish Diplomacy was doing the same thing.
events/week_start.rpy - This is where the initial visit to Skordred's workshop happens where Rowan chooses to build either the tavern, dark sanctum or the forge. Changed the code for building cost to use the relevant up_cost property on the subclasses.
screens/building_screen.rpy - commented out data structures that are now encapsulated in buildings.rpy and thus no longer used. Properly use lvl, max_lvl and available attributes to indicate when a building can either be constructed or upgraded in the Workshop providing there's money in the castle.treasury. Everything has a description, and the Prereqs and Perks sections accurately reflect reality.
Hey fam,
I would like to thank you personally for this extensive feedback.We'll be tackling this issue once we get the listed priorities done.