Prototying Week!
v0.6.0 is out for bug testing right now (thank you to everyone who's left me a bug report so far!). I normally use the time between the public and patron release to prototype features that are either very early in development or that might not make it into the final game, but this week I have a different goal in mind.
For a few versions now a number of people, myself included, have noticed a significant slowdown in LR2 as the game progresses. My goal for this week is to track the cause of that slowdown down and eliminate it, as well as give myself some diagnostic tools for future bug hunting. I'll also be rendering out some new character positions and experimenting with some compression techniques to shrink the game file size if possible.
My current hunch for the slowdown is that somewhere along the character creation process a character is grabbing a copy of the clothing library instead of referencing the static images, and that this is resulting in a massive duplication of data every time a character is created. To test this I will be writing some debugging functions that time how long it takes to create a character, move them around, ect. Then I will see if the time scales up with the total number of people in existence, total number of people interacted with, and so on. Hopefully this will lead me to the root cause of the slowdown.
Comments (7)
0
Fatal error -I'm sorry, but an uncaught exception occurred. While running game code: File "game/script.rpy", line 4406, in script call python: File "game/script.rpy", line 5123, in script call screen serum_design_ui(SerumDesign(),[]) #This will return the final serum design, or None if the player backs out. File "renpy/common/000statements.rpy", line 485, in execute_call_screen store._return = renpy.call_screen(name, *args, **kwargs) File "renpy/common/00action_other.rpy", line 501, in __call__ rv = self.callable(*self.args, **self.kwargs) File "game/script.rpy", line 3127, in remove_trait_recalc trait.status_effects.extend(the_trait.status_effects) MemoryError: -- Full Traceback ------------------------------------------------------------ Full traceback: File "F:\Lab_Rats_2-v0.6.0-pc\renpy\bootstrap.py", line 306, in bootstrap renpy.main.main() File "F:\Lab_Rats_2-v0.6.0-pc\renpy\main.py", line 523, in main run(restart) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\main.py", line 149, in run renpy.execution.run_context(True) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\execution.py", line 835, in run_context context.run() File "game/script.rpy", line 4406, in script call python: File "game/script.rpy", line 5123, in script call screen serum_design_ui(SerumDesign(),[]) #This will return the final serum design, or None if the player backs out. File "F:\Lab_Rats_2-v0.6.0-pc\renpy\ast.py", line 1801, in execute self.call("execute") File "F:\Lab_Rats_2-v0.6.0-pc\renpy\ast.py", line 1789, in call return renpy.statements.call(method, parsed, *args, **kwargs) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\statements.py", line 169, in call return method(parsed, *args, **kwargs) File "renpy/common/000statements.rpy", line 485, in execute_call_screen store._return = renpy.call_screen(name, *args, **kwargs) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\exports.py", line 2655, in call_screen rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\ui.py", line 287, in interact rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\core.py", line 2624, in interact repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\core.py", line 3417, in interact_core rv = root_widget.event(ev, x, y, 0) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\layout.py", line 986, in event rv = i.event(ev, x - xo, y - yo, cst) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\transition.py", line 45, in event return self.new_widget.event(ev, x, y, st) # E1101 File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\layout.py", line 986, in event rv = i.event(ev, x - xo, y - yo, cst) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\layout.py", line 986, in event rv = i.event(ev, x - xo, y - yo, cst) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\screen.py", line 667, in event rv = self.child.event(ev, x, y, st) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\layout.py", line 986, in event rv = i.event(ev, x - xo, y - yo, cst) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\layout.py", line 986, in event rv = i.event(ev, x - xo, y - yo, cst) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\layout.py", line 239, in event rv = d.event(ev, x - xo, y - yo, st) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\layout.py", line 986, in event rv = i.event(ev, x - xo, y - yo, cst) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\behavior.py", line 897, in event return handle_click(self.clicked) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\behavior.py", line 832, in handle_click rv = run(action) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\behavior.py", line 299, in run new_rv = run(i, *args, **kwargs) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\display\behavior.py", line 306, in run return action(*args, **kwargs) File "renpy/common/00action_other.rpy", line 501, in __call__ rv = self.callable(*self.args, **self.kwargs) File "game/script.rpy", line 3127, in remove_trait_recalc trait.status_effects.extend(the_trait.status_effects) File "F:\Lab_Rats_2-v0.6.0-pc\renpy\python.py", line 672, in do_mutation return method(self, *args, **kwargs) MemoryError: Windows-8-6.2.9200 Ren'Py 6.99.14.1.3218 Lab Rats 2 - Down to Business v0.6.0 Sun Jun 24 18:03:12 2018
Looks like there is an error when any of the girls get to loyalty over 130. My game pops up errors when I talk to them and then auto exits the conversation. It also pops up errors when I click the detail information screen.
It's been found and fixed, v0.6.1 will be released on Wednesday and will include a couple major bug fixes.
Study up on algorithms too, they are your bestest of best friends when it comes to performance by far! :p
Just as a data point, for me the slowdown seemed to increase noticeably the more I clicked on menu items, even if I wasn't doing anything that brought in a new character (unless that is happening in a way I can't detect/control). I assumed it was something related either to the shading/textures or the action history.
I think I can agree with that assessment, I also associate the slowdowns with my activity. So, the first place to look at should be the rollback code, IMHO. I suspect it's even saved so that when you load the game, you're back in the slowdown zone.
