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.