Mmushy

Active Member
May 5, 2020
778
999
I should also note that on my latest run through where the threeway triggered at week 25, I had Rowan at 23 and Alexia at 27 corruption. That's in spite of trying to keep things somewhat tame on the temptation side. The devs should at the very least raise the checks from 20 to 30 or I will be forced to keep ripping the trigger checks out of my downloads.
I used the console to drop Alexia's and Rowan's corruption down to 15 and Greyhide's events triggered.
Unfortunately I can't remember what I had them at.
Lol any suggestions on a good corruption value for them?
 

phupdup

Well-Known Member
Oct 24, 2019
1,391
1,087
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.
 

phupdup

Well-Known Member
Oct 24, 2019
1,391
1,087
If you've seen Alexia's medium corruption event where she frigs herself and eats the fruit from the tree, you can put her back at 35. I've had Rowan sitting at around 23 for a good while.

If you want them to share Lurial when she walks in on them having fun, I think Alexia needs to be at 50 or more before she stops being shitty about things and goes along with it.

I used the console to drop Alexia's and Rowan's corruption down to 15 and Greyhide's events triggered.
Unfortunately I can't remember what I had them at.
Lol any suggestions on a good corruption value for them?
 
  • Like
Reactions: Mmushy

introvtx

Active Member
May 6, 2017
568
746
I just managed to build the chamber with this updated nasim_intro event file.
Niceee! Thank you so much!

Looks like Orc camp events are a bit bugged.
Yeah IIRC there are like 3 orc camp in total that takes you to Orciad instead regular orc recruit event, and if I'm not mistaken there are also like 2 villages (I'm pretty sure) and 1 abbey (could be wrong for this one) that doesn't trigger any event. unfortunately, I don't remember their locations.

I've been playing a new walkthrough using a revamped, clean implementation of the Building framework for the castle.
I have to re-play from the beginning if I use these right? I already have all research and buildings. Will there be like something new that wasn't available before that is worth a restart to an average Joe like me that wouldn't know what to test? (other than the fixes you've done) :oops:

Though again, thank you for the awesome work you've done! You deserve it at the least ;)
 

phupdup

Well-Known Member
Oct 24, 2019
1,391
1,087
You want to do a new playthrough since "rowan intro.rpy" is the script for the prologue. That shows how long that code has been around to screw everything up :LOL:

Niceee! Thank you so much!


Yeah IIRC there are like 3 orc camp in total that takes you to Orciad instead regular orc recruit event, and if I'm not mistaken there are also like 2 villages (I'm pretty sure) and 1 abbey (could be wrong for this one) that doesn't trigger any event. unfortunately, I don't remember their locations.


I have to re-play from the beginning if I use these right? I already have all research and buildings. Will there be like something new that wasn't available before that is worth a restart to an average Joe like me that wouldn't know what to test? (other than the fixes you've done) :oops:

Though again, thank you for the awesome work you've done! You deserve it at the least ;)
 
  • Like
Reactions: introvtx

phupdup

Well-Known Member
Oct 24, 2019
1,391
1,087
During my test playthrough, I noticed smelting never come up for available research. I think in the past it used to be dependent on Ordering Chaos and/or Military Tactics being completed, but now it looks like the devs intended it to become available when the level 1 forge is built. However they blew the logic on the req_met method for it so that it never becomes available. It's possible they may have been planning on tying it to new researches for Excavation and Advanced Excavation that are currently disabled and probably meant to impact the iron production from mines. There's also "The Riddle of Steel" disabled in there which is probably for a planned level 3 forge. So maybe they were in the middle of editing when the code freeze happened for this latest release. At any rate:

Code:
    class Smelting(Research):
        uid = 'smelting'
        name = 'Smelting'
        category = 'metalwork'
        cost = 100
        unlocks = 'Level 2 forge'

        def req_met(self):
            return castle.buildings['forge'] == 1

        def on_complete(self):
            castle.buildings['forge'].max_lvl = 2
becomes

Code:
    class Smelting(Research):
        uid = 'smelting'
        name = 'Smelting'
        category = 'metalwork'
        cost = 100
        unlocks = 'Level 2 forge'

        def req_met(self):
            return castle.buildings['forge'].lvl == 1

        def on_complete(self):
            castle.buildings['forge'].max_lvl = 2
I've attached a core/research.rpy which has this along with the Dark Subterfuge fix I posted earlier.
 
  • Like
Reactions: Einarr the Red

zetsupetsu

Active Member
Dec 22, 2019
934
1,928
Is there no cg for the Alexia x Sil scene yet? I triggered it but it seems to be regular black screen for me.
 

phupdup

Well-Known Member
Oct 24, 2019
1,391
1,087
I'm at week 64 on the walktrhough with my new Building framework and have all buildings and upgrades done with the exception of a single one: the lvl 2 upgrade for the Arena. I had just finished the last research that was still available (Basic Summoning) since its completion does nothing when the summoning chamber building is set to not be able to build. I think in the past, the devs had only enabled this thing as a convenient debug location to manually trigger events they wanted to test.

Looking into the prereq for lvl2 arena shows it depending on Military Logistics. However, I've already researched that so the devs must have been up to something in core/research.rpy to mess this up.

Code:
    class MilitaryLogistics(Research):
        uid = 'military_logistics'
        name = 'Military Logistics'
        category = 'military'
        cost = 100
        requires = 'Military tactics'
        unlocks = 'Level 3 barracks.'

        def req_met(self):
            return castle.researches['ordering_chaos'].completed and (castle.buildings['barracks'].lvl >= 2 or castle.buildings['arena'].lvl >= 1)

        def on_complete(self):
            castle.buildings['barracks'].max_lvl = 3
The prereqs documented for the lvl 2 barracks and lvl 1 arena both say that the Ordering Chaos research must be completed. So the req_met method for Logistics says that this must have been completed and that at least one of the two buildings/upgrades must be built before Military Logistics is available to research. That seems reasonable, but notice that the on_complete only bumps the max_lvl for the Barracks and does nothing for the arena as was apparently advertised. Problem...

Right after Logistics is the entry for Military Recreation and guess what we find:

Code:
    class MilitaryRecreation(Research):
        uid = 'military_recreation'
        name = 'Military Recreation'
        category = 'military'
        cost = 100
        requires = 'Military tactics'
        unlocks = 'Level 2 arena.'

        def req_met(self):
            return castle.researches['military_tactics'].completed

        def on_complete(self):
            castle.buildings['arena'].max_lvl = 2
So it's actually this research that bumps the arena instead. I'll need to go back into my new buildings framework to fix the prereq listing for lvl 2 Arena, but that's a documentation problem. The coding problem is that at week 64 with everything possible researched, Rowan was never given the option to research Recreation. It depends on Military Tactics.

Code:
    class MilitaryTactics(Research):
        uid = 'military_tactics'
        name = 'Military Tactics'
        category = 'military'
        cost = 40
        unlocks = 'Level 2 barracks.'

        def on_complete(self):
            castle.buildings['barracks'].max_lvl = 2
This also was never made available for research even though its lack of a req_met method would have made it immediately available to begin research the first time Rowan steps into the library to meet Cliohna at week 4. It's whole Raison D'etre is to make the level 2 barracks available, but at some point, the devs decided to have that rely on Ordering Chaos:

Code:
    class OrderingChaos(Research):
        uid = "ordering_chaos"
        name = "Ordering Chaos"
        category = "military"
        cost = 50
        unlocks = 'Level 2 Barracks and Level 1 Arena'

        def on_complete(self):
            castle.buildings['barracks'].max_lvl = 2
            castle.buildings['arena'].max_lvl = 1
            castle.military += 1
That's a bit of a mess, but why does Military Tactics never show up to be researched when there's apparently nothing to stop it from appearing using the normal system for research dependencies? Without it being done, Military Recreation is cock blocked. One system wide grep for military_tactics later shows the real culprit is in screens/researches_screen.rpy:

Code:
# controls for researches
screen researches_screen(force_choose_research=False, finished_research=None):
    # uid of selected research
    default sel_rs = None

.
.
.

        text 'Available researches' style 'room_listbox_caption'
        hbox:
            pos (55, 130)
            spacing 20
            ysize 556
            # list of researches
            frame:
                background 'listbox_border'
                xpadding 3
                ypadding 3
                vpgrid:
                    cols 1
                    xsize 400
                    mousewheel True
                    scrollbars 'vertical'
                    spacing 1
                    for rs in sorted(castle.researches.values(), key=lambda r: r.category):
                        # show research only if it can be researched
                        if rs.uid not in ["military_tactics", "world_and_the_war"] and rs.req_met():
Why in Kharos' name are there specific checks in the iterator to drop Military Tactics and "World and the War" from the displayed research list? It's a pretty arbitrary spot to be doing things like this in a file apart from the main file for research code. That rs.req_met() check should be the only thing here. The method returning False would drop an item for consideration.

This was obviously an attempt to remove showing things for researching that are now about as useful as an ashtray on a motorbike. I think the reason why these two ended up here was because they were starting game research items that never had a req_met override method written for them to return False. The prototype class Research defines this method to return True by default. So they could have done something like this over in core/research.rpy instead:

Code:
   class WorldAndTheWar(Research):
        uid = 'world_and_the_war'
        name = 'World and the War'
        category = 'history'
        cost = 40
        unlocks = 'Background info, choices in events.'
going to

Code:
   class WorldAndTheWar(Research):
        uid = 'world_and_the_war'
        name = 'World and the War'
        category = 'history'
        cost = 40
        unlocks = 'Background info, choices in events.'

   def req_met(self):
      return False           #obsolete/borked/Motorbike ashtray
Indeed, here's a followup to "World and the War" that has also been declared to be a motorbike ashtray. It already had a req_met overrride so the code maintainer just added a return False statement to it.

Code:
    class HistoryOfRosaria(Research):
        uid = 'history_of_rosaria'
        name = 'History of Rosaria'
        category = 'history'
        cost = 50
        requires = 'World and the war, visit Rosaria'
        unlocks = 'Background info, resources in realm, choices in events.'

        def req_met(self):
            # "visit Rosaria" check is automatic because the game starts there
            #TODO
            return False
            return castle.researches['world_and_the_war'].completed
Getting back to why we can't have a lvl 2 Arena upgrade built. The devs obviously shot themselves in the foot by making Military Tactics obsolete without adjusting the req_met method of Military Recreation. This:

Code:
    class MilitaryRecreation(Research):
        uid = 'military_recreation'
        name = 'Military Recreation'
        category = 'military'
        cost = 100
        requires = 'Military tactics'
        unlocks = 'Level 2 arena.'

        def req_met(self):
            return castle.researches['military_tactics'].completed

        def on_complete(self):
            castle.buildings['arena'].max_lvl = 2
should either become:

Code:
    class MilitaryRecreation(Research):
        uid = 'military_recreation'
        name = 'Military Recreation'
        category = 'military'
        cost = 100
        requires = 'Military tactics'
        unlocks = 'Level 2 arena.'

        def req_met(self):
            return castle.researches['military_logistics'].completed

        def on_complete(self):
            castle.buildings['arena'].max_lvl = 2
or possibly

Code:
    class MilitaryRecreation(Research):
        uid = 'military_recreation'
        name = 'Military Recreation'
        category = 'military'
        cost = 100
        requires = 'Military tactics'
        unlocks = 'Level 2 arena.'

        def req_met(self):
            return castle.researches['ordering_chaos'].completed and castle.buildings['arena'].lvl > 0

        def on_complete(self):
            castle.buildings['arena'].max_lvl = 2
The former implies more turns have passed since it takes time to research, we have barracks at level 2 or greater and are dealing with more orcs recruited that are now causing a morale problem. The latter may be more a scenario of maximizing morale by building arena upgrades before we necessarily have tons of orcs underfoot. It may be useful for those life choices Rowan makes that end up crushing morale more.
 

phupdup

Well-Known Member
Oct 24, 2019
1,391
1,087
One thing about getting the Nasim chamber built is that it causes a little bit of a continuity error with Nasim and the event where Rowan comes to him to ask about a treatment for Alexia. This would obviously be the point where the dialog would branch if the chamber is found and the two talk about maybe using it. Instead there's only a dialog about Skordred "losing" it on the blueprints and then the first treatment scene being done in Nasim's library cubicle.
 

Rein

Active Member
Game Developer
May 8, 2017
759
2,714
Instead there's only a dialog about Skordred "losing" it on the blueprints and then the first treatment scene being done in Nasim's library cubicle.
Hm, bugged then. There are lines for the chamber being built on triggering the event.

Ah well, we'll fix it next release.
 

spacemix

Member
Dec 30, 2020
300
496
Does anyone know where this scene is? Is it when Rowan "fakes" a more severe punishment for Alexia after she is outed for helping Heleyna escape?
You don't have permission to view the spoiler content. Log in or register now.
 
4.00 star(s) 162 Votes