Rystic
Turtle Wizard
This topic is dedicated to the effort of optimizing the python (eliminating unnecessary checks, generating fewer random numbers, etc). Sometimes, Fall Further runs a bit slow. Here, we can brainstorm different ways to make the code more efficient.
Here are a few ideas of my own:
1) Call Golem-Promotion function when Barnaxus promotes, not every turn.
Reasoning: Fantastic drag on speed, especially when Barnaxus is only promoted roughly 5-15 per game. One check per promoted unit is substantially less than checking each Luchuirp unit at the beginning of every turn.
2)For the Khazad, make multiple palaces with "Counts as Vault(X) in every city".
Reasoning: This eliminates cycling through every city each turn.
3)Units getting haunted lands promotions should check with UnitMove, and not every turn.
Reasoning: Stops double-checking. There's no reason a unit that already has haunted-lands promotions should be looked at again.
4) Reformat Lizardman conversion. Have a 10% per turn that conversion will happen, and multiply probabilities of conversion by 10 (eg Swamp is 1% --> 10%)
Reasoning: A lot less random number generation per turn with the same probability something will convert (1 event with 1.5% = 2 events with 10% and 15%). This will lead to "clumping", so that terrain converts more in chucks. Overall, it should be a good choice efficiency-wise.
5) Let deep jungles remain, even if unowned.
Reasoning: This removes an entire check per plot, could save hundreds of checks per turn on a larger map.
6) For deep jungles, check whenever a Lizardman city expands or is founded, instead of each turn.
Reasoning: Saves a good number of checks on large maps. Also, jungles will convert to deep jungle the turn you obtain them!
7) Convert road to trail automatically in Lizardman territory.
Reasoning: This will eliminate a random number check.
8) Wetlands should be replaced with Marsh.
Reasoning: A marsh is a wetland.
9) Make a button to toggle the information gathering (eg, "X will grow to size 10 next turn")
Reasoning: This feature is a drag on speed. Does a bunch of checks that have no effect on gameplay. If toggled, it would count be 1 bool check per turn.
These are just a few ideas I came up with off the bat. Any feedback is welcome.
Here are a few ideas of my own:
1) Call Golem-Promotion function when Barnaxus promotes, not every turn.
Reasoning: Fantastic drag on speed, especially when Barnaxus is only promoted roughly 5-15 per game. One check per promoted unit is substantially less than checking each Luchuirp unit at the beginning of every turn.
2)For the Khazad, make multiple palaces with "Counts as Vault(X) in every city".
Reasoning: This eliminates cycling through every city each turn.
3)Units getting haunted lands promotions should check with UnitMove, and not every turn.
Reasoning: Stops double-checking. There's no reason a unit that already has haunted-lands promotions should be looked at again.
4) Reformat Lizardman conversion. Have a 10% per turn that conversion will happen, and multiply probabilities of conversion by 10 (eg Swamp is 1% --> 10%)
Reasoning: A lot less random number generation per turn with the same probability something will convert (1 event with 1.5% = 2 events with 10% and 15%). This will lead to "clumping", so that terrain converts more in chucks. Overall, it should be a good choice efficiency-wise.
5) Let deep jungles remain, even if unowned.
Reasoning: This removes an entire check per plot, could save hundreds of checks per turn on a larger map.
6) For deep jungles, check whenever a Lizardman city expands or is founded, instead of each turn.
Reasoning: Saves a good number of checks on large maps. Also, jungles will convert to deep jungle the turn you obtain them!
7) Convert road to trail automatically in Lizardman territory.
Reasoning: This will eliminate a random number check.
8) Wetlands should be replaced with Marsh.
Reasoning: A marsh is a wetland.
9) Make a button to toggle the information gathering (eg, "X will grow to size 10 next turn")
Reasoning: This feature is a drag on speed. Does a bunch of checks that have no effect on gameplay. If toggled, it would count be 1 bool check per turn.
These are just a few ideas I came up with off the bat. Any feedback is welcome.