Memory Bug Hunting, Dialogue Writing
Added 2021-03-06 10:36:17 +0000 UTCSince the release of v0.38.0 I've been busy with two major things: bug fixing and dialogue writing. The most recent version of LR2 introduced a new texting framework and display, but it's still in need of some solid content. I've been writing new text-specific flirt options to address that shortage, and this new content should make it into v0.38.1. I've also updated the texting system to use a list of Actions instead of being a hard-coded menu, which makes much more expandable by modders.
Of course no patron release would be complete without a host of bugs to track down and fix. One bug in particular has been haunting me for a few months, but was low on my priority list because it wasn't directly causing crashes or blocking progress. It was a memory bug, and it was causing some players to experience crashes during some scenes. A helpful patron dug into the code and tracked down the precise memory object that was ballooning in size, and with that information I was able to fix the problem.
The culprit ended up being tied to the animation system. When a character is drawn a secondary thread is created to prepare a Render object, which is the most time consuming part of the drawing procedure. This Render was placed into a temporary list and grabbed when the main thread was available to draw to the screen. These Render objects were never actually being removed from the temporary list though, only overwritten when the same character was drawn a second time.
The result is a ballooning memory footprint, proportional to the number of people that had been drawn that day. A catch-all memory clear at the end of the day would fix the problem, but large companies could reach an absurd level of memory use. How absurd? My test scenario created and displayed 10 characters and then did a memory profile. The result was a full 1.5 gigs of allocated memory for the Render objects, vs 0.3 gigs of actual cached images! Glad to have that problem take care of once and for all!
Now I need to finish up some personality specific dialogue for v0.38.1, which is just a couple short days away! Back to work with me!
Comments
I'm sorry, but an uncaught exception occurred. While running game code: File "game/script.rpy", line 11253, in script call call talk_person(picked_option) from _call_talk_person File "game/script.rpy", line 11375, in script call call talk_person(the_person) from _call_talk_person_1 #If we're in the same place and time hasn't advanced keep talking to them until we stop talking on purpose. File "game/script.rpy", line 11372, in script call $ _return.call_action() File "game/chat_actions.rpy", line 975, in script call call fuck_person(the_person, private = should_be_private, start_position = standing_grope, start_object = None, skip_intro = True) from _call_fuck_person_43 # Enter the sex system, starting from this point. File "game/sex_mechanics.rpy", line 229, in script call call sex_description(the_person, position_choice, object_choice, private = private, report_log = report_log) from _call_sex_description File "game/sex_mechanics.rpy", line 508, in script call $ the_position.call_scene(the_person, mc.location, the_object) File "game/sex_positions/standing_massage.rpy", line 73, in script "[the_girl.title] spreads her legs for you, and you rub her crotch through her [the_item.name]." File "game/script.rpy", line 11253, in script call call talk_person(picked_option) from _call_talk_person File "game/script.rpy", line 11375, in script call call talk_person(the_person) from _call_talk_person_1 #If we're in the same place and time hasn't advanced keep talking to them until we stop talking on purpose. File "game/script.rpy", line 11372, in script call $ _return.call_action() File "game/chat_actions.rpy", line 975, in script call call fuck_person(the_person, private = should_be_private, start_position = standing_grope, start_object = None, skip_intro = True) from _call_fuck_person_43 # Enter the sex system, starting from this point. File "game/sex_mechanics.rpy", line 229, in script call call sex_description(the_person, position_choice, object_choice, private = private, report_log = report_log) from _call_sex_description File "game/sex_mechanics.rpy", line 508, in script call $ the_position.call_scene(the_person, mc.location, the_object) File "game/sex_positions/standing_massage.rpy", line 73, in script "[the_girl.title] spreads her legs for you, and you rub her crotch through her [the_item.name]." File "game/script.rpy", line 58, in take_animation_screenshot del prepared_animation_render[draw_layer][the_person.character_number] #Clear the render, we don't need to track it any more. Without this image renders build up over the course of the day, consuming massive amounts of memory. KeyError: 16 -- Full Traceback ------------------------------------------------------------ Full traceback: File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\bootstrap.py", line 316, in bootstrap renpy.main.main() File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\main.py", line 578, in main run(restart) File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\main.py", line 143, in run renpy.execution.run_context(True) File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\execution.py", line 908, in run_context context.run() File "game/script.rpy", line 11253, in script call call talk_person(picked_option) from _call_talk_person File "game/script.rpy", line 11375, in script call call talk_person(the_person) from _call_talk_person_1 #If we're in the same place and time hasn't advanced keep talking to them until we stop talking on purpose. File "game/script.rpy", line 11372, in script call $ _return.call_action() File "game/chat_actions.rpy", line 975, in script call call fuck_person(the_person, private = should_be_private, start_position = standing_grope, start_object = None, skip_intro = True) from _call_fuck_person_43 # Enter the sex system, starting from this point. File "game/sex_mechanics.rpy", line 229, in script call call sex_description(the_person, position_choice, object_choice, private = private, report_log = report_log) from _call_sex_description File "game/sex_mechanics.rpy", line 508, in script call $ the_position.call_scene(the_person, mc.location, the_object) File "game/sex_positions/standing_massage.rpy", line 73, in script "[the_girl.title] spreads her legs for you, and you rub her crotch through her [the_item.name]." File "game/script.rpy", line 11253, in script call call talk_person(picked_option) from _call_talk_person File "game/script.rpy", line 11375, in script call call talk_person(the_person) from _call_talk_person_1 #If we're in the same place and time hasn't advanced keep talking to them until we stop talking on purpose. File "game/script.rpy", line 11372, in script call $ _return.call_action() File "game/chat_actions.rpy", line 975, in script call call fuck_person(the_person, private = should_be_private, start_position = standing_grope, start_object = None, skip_intro = True) from _call_fuck_person_43 # Enter the sex system, starting from this point. File "game/sex_mechanics.rpy", line 229, in script call call sex_description(the_person, position_choice, object_choice, private = private, report_log = report_log) from _call_sex_description File "game/sex_mechanics.rpy", line 508, in script call $ the_position.call_scene(the_person, mc.location, the_object) File "game/sex_positions/standing_massage.rpy", line 73, in script "[the_girl.title] spreads her legs for you, and you rub her crotch through her [the_item.name]." File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\ast.py", line 718, in execute renpy.exports.say(who, what, *args, **kwargs) File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\exports.py", line 1345, in say who(what, *args, **kwargs) File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\character.py", line 1142, in __call__ self.do_display(who, what, cb_args=self.cb_args, **display_args) File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\character.py", line 842, in do_display **display_args) File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\character.py", line 591, in display_say rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward) File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\ui.py", line 297, in interact rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs) File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\display\core.py", line 2702, in interact repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs) File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\display\core.py", line 2932, in interact_core i() File "game/script.rpy", line 58, in take_animation_screenshot del prepared_animation_render[draw_layer][the_person.character_number] #Clear the render, we don't need to track it any more. Without this image renders build up over the course of the day, consuming massive amounts of memory. File "D:\System\Independent Game\Lab_Rats_2-v0.38.1-pc\renpy\python.py", line 731, in do_mutation return method(self, *args, **kwargs) KeyError: 16 Windows-8-6.2.9200 Ren'Py 7.3.5.606 Lab Rats 2 - Down to Business v0.38.1 Wed Mar 17 17:24:14 2021
2021-03-17 09:25:16 +0000 UTCHello there, After "Groping" and then selecting "Keep Going" when it would trigger the sex scene I always get the following error. Tested with Mom, Sis and Stephanie I'm sorry, but an uncaught exception occurred. While running game code: File "game/script.rpy", line 11220, in script call $ talk_action.call_action(picked_option) File "game/crises/limited_time_events.rpy", line 1940, in script call call talk_person(the_person) from _call_talk_person_16 File "game/script.rpy", line 11375, in script call call talk_person(the_person) from _call_talk_person_1 #If we're in the same place and time hasn't advanced keep talking to them until we stop talking on purpose. File "game/script.rpy", line 11372, in script call $ _return.call_action() File "game/chat_actions.rpy", line 975, in script call call fuck_person(the_person, private = should_be_private, start_position = standing_grope, start_object = None, skip_intro = True) from _call_fuck_person_43 # Enter the sex system, starting from this point. File "game/sex_mechanics.rpy", line 229, in script call call sex_description(the_person, position_choice, object_choice, private = private, report_log = report_log) from _call_sex_description File "game/sex_mechanics.rpy", line 508, in script call $ the_position.call_scene(the_person, mc.location, the_object) File "game/sex_positions/standing_massage.rpy", line 61, in script "You paw at [the_girl.possessive_title]'s small tits over her clothing." File "game/script.rpy", line 11220, in script call $ talk_action.call_action(picked_option) File "game/crises/limited_time_events.rpy", line 1940, in script call call talk_person(the_person) from _call_talk_person_16 File "game/script.rpy", line 11375, in script call call talk_person(the_person) from _call_talk_person_1 #If we're in the same place and time hasn't advanced keep talking to them until we stop talking on purpose. File "game/script.rpy", line 11372, in script call $ _return.call_action() File "game/chat_actions.rpy", line 975, in script call call fuck_person(the_person, private = should_be_private, start_position = standing_grope, start_object = None, skip_intro = True) from _call_fuck_person_43 # Enter the sex system, starting from this point. File "game/sex_mechanics.rpy", line 229, in script call call sex_description(the_person, position_choice, object_choice, private = private, report_log = report_log) from _call_sex_description File "game/sex_mechanics.rpy", line 508, in script call $ the_position.call_scene(the_person, mc.location, the_object) File "game/sex_positions/standing_massage.rpy", line 61, in script "You paw at [the_girl.possessive_title]'s small tits over her clothing." File "game/script.rpy", line 58, in take_animation_screenshot del prepared_animation_render[draw_layer][the_person.character_number] #Clear the render, we don't need to track it any more. Without this image renders build up over the course of the day, consuming massive amounts of memory. KeyError: 16 -- Full Traceback ------------------------------------------------------------ Full traceback: File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\bootstrap.py", line 316, in bootstrap renpy.main.main() File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\main.py", line 578, in main run(restart) File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\main.py", line 143, in run renpy.execution.run_context(True) File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\execution.py", line 908, in run_context context.run() File "game/script.rpy", line 11220, in script call $ talk_action.call_action(picked_option) File "game/crises/limited_time_events.rpy", line 1940, in script call call talk_person(the_person) from _call_talk_person_16 File "game/script.rpy", line 11375, in script call call talk_person(the_person) from _call_talk_person_1 #If we're in the same place and time hasn't advanced keep talking to them until we stop talking on purpose. File "game/script.rpy", line 11372, in script call $ _return.call_action() File "game/chat_actions.rpy", line 975, in script call call fuck_person(the_person, private = should_be_private, start_position = standing_grope, start_object = None, skip_intro = True) from _call_fuck_person_43 # Enter the sex system, starting from this point. File "game/sex_mechanics.rpy", line 229, in script call call sex_description(the_person, position_choice, object_choice, private = private, report_log = report_log) from _call_sex_description File "game/sex_mechanics.rpy", line 508, in script call $ the_position.call_scene(the_person, mc.location, the_object) File "game/sex_positions/standing_massage.rpy", line 61, in script "You paw at [the_girl.possessive_title]'s small tits over her clothing." File "game/script.rpy", line 11220, in script call $ talk_action.call_action(picked_option) File "game/crises/limited_time_events.rpy", line 1940, in script call call talk_person(the_person) from _call_talk_person_16 File "game/script.rpy", line 11375, in script call call talk_person(the_person) from _call_talk_person_1 #If we're in the same place and time hasn't advanced keep talking to them until we stop talking on purpose. File "game/script.rpy", line 11372, in script call $ _return.call_action() File "game/chat_actions.rpy", line 975, in script call call fuck_person(the_person, private = should_be_private, start_position = standing_grope, start_object = None, skip_intro = True) from _call_fuck_person_43 # Enter the sex system, starting from this point. File "game/sex_mechanics.rpy", line 229, in script call call sex_description(the_person, position_choice, object_choice, private = private, report_log = report_log) from _call_sex_description File "game/sex_mechanics.rpy", line 508, in script call $ the_position.call_scene(the_person, mc.location, the_object) File "game/sex_positions/standing_massage.rpy", line 61, in script "You paw at [the_girl.possessive_title]'s small tits over her clothing." File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\ast.py", line 718, in execute renpy.exports.say(who, what, *args, **kwargs) File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\exports.py", line 1345, in say who(what, *args, **kwargs) File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\character.py", line 1142, in __call__ self.do_display(who, what, cb_args=self.cb_args, **display_args) File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\character.py", line 842, in do_display **display_args) File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\character.py", line 591, in display_say rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward) File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\ui.py", line 297, in interact rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs) File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\display\core.py", line 2702, in interact repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs) File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\display\core.py", line 2932, in interact_core i() File "game/script.rpy", line 58, in take_animation_screenshot del prepared_animation_render[draw_layer][the_person.character_number] #Clear the render, we don't need to track it any more. Without this image renders build up over the course of the day, consuming massive amounts of memory. File "D:\USBbackup\Lab_Rats_2\Lab_Rats_2-v0.38.1-pc\renpy\python.py", line 731, in do_mutation return method(self, *args, **kwargs) KeyError: 16 Windows-8-6.2.9200 Ren'Py 7.3.5.606 Lab Rats 2 - Down to Business v0.38.1 Tue Mar 09 09:32:58 2021
2021-03-09 08:37:46 +0000 UTCUpon making any comment to Lilly's instapik: While running game code: File "game/script.rpy", line 11299, in script call call browse_internet() from _call_browse_internet File "game/internet.rpy", line 154, in script call $ the_action.call_action() File "game/game_roles/role_insta.rpy", line 76, in script call call view_insta(picked_option) from _call_view_insta File "game/game_roles/role_insta.rpy", line 152, in script call call instapic_comment_loop(the_person, posted_today) from _call_instapic_comment_loop File "game/game_roles/role_insta.rpy", line 179, in script call $ the_choice.call_action(the_person) File "game/game_roles/role_insta.rpy", line 202, in script call call instapic_comment_loop(the_person, posted_today = False) from _call_instapic_comment_loop_1 File "game/game_roles/role_insta.rpy", line 179, in script call $ the_choice.call_action(the_person) File "game/game_roles/role_insta.rpy", line 202, in script call call instapic_comment_loop(the_person, posted_today = False) from _call_instapic_comment_loop_1 File "game/game_roles/role_insta.rpy", line 176, in script call screen main_choice_display(display_list) File "renpy/common/000statements.rpy", line 531, in execute_call_screen store._return = renpy.call_screen(name, *args, **kwargs) File "game/script.rpy", line 4647, in __cmp__ if type(other) is Action: TypeError: 'unicode' object is not callable -- Full Traceback ------------------------------------------------------------ Full traceback: File "game/script.rpy", line 11299, in script call call browse_internet() from _call_browse_internet File "game/internet.rpy", line 154, in script call $ the_action.call_action() File "game/game_roles/role_insta.rpy", line 76, in script call call view_insta(picked_option) from _call_view_insta File "game/game_roles/role_insta.rpy", line 152, in script call call instapic_comment_loop(the_person, posted_today) from _call_instapic_comment_loop File "game/game_roles/role_insta.rpy", line 179, in script call $ the_choice.call_action(the_person) File "game/game_roles/role_insta.rpy", line 202, in script call call instapic_comment_loop(the_person, posted_today = False) from _call_instapic_comment_loop_1 File "game/game_roles/role_insta.rpy", line 179, in script call $ the_choice.call_action(the_person) File "game/game_roles/role_insta.rpy", line 202, in script call call instapic_comment_loop(the_person, posted_today = False) from _call_instapic_comment_loop_1 File "game/game_roles/role_insta.rpy", line 176, in script call screen main_choice_display(display_list) File "D:\Lab_Rats_2-v0.38.1-pc\Lab_Rats_2-v0.38.1-pc\renpy\ast.py", line 1962, in execute self.call("execute") File "D:\Lab_Rats_2-v0.38.1-pc\Lab_Rats_2-v0.38.1-pc\renpy\ast.py", line 1950, in call return renpy.statements.call(method, parsed, *args, **kwargs) File "D:\Lab_Rats_2-v0.38.1-pc\Lab_Rats_2-v0.38.1-pc\renpy\statements.py", line 277, in call return method(parsed, *args, **kwargs) File "renpy/common/000statements.rpy", line 531, in execute_call_screen store._return = renpy.call_screen(name, *args, **kwargs) File "D:\Lab_Rats_2-v0.38.1-pc\Lab_Rats_2-v0.38.1-pc\renpy\exports.py", line 2900, in call_screen show_screen(_screen_name, _transient=True, *args, **kwargs) File "D:\Lab_Rats_2-v0.38.1-pc\Lab_Rats_2-v0.38.1-pc\renpy\display\screen.py", line 1135, in show_screen d.cache = cache_get(screen, _args, kwargs) File "D:\Lab_Rats_2-v0.38.1-pc\Lab_Rats_2-v0.38.1-pc\renpy\display\screen.py", line 181, in cache_get if sc.args == args and sc.args == kwargs: File "game/script.rpy", line 4647, in __cmp__ if type(other) is Action: TypeError: 'unicode' object is not callable
NuTrix
2021-03-08 16:21:40 +0000 UTCThat would definitely explain why hiring multiple people on the same day in a large company was causing me issues. Cheers to seeing the back of that.
Dreamdayer
2021-03-08 12:19:09 +0000 UTCI am glad that the problem with memory bugs was completely solved by you. Great job!
VitAnyaNaked
2021-03-06 17:44:12 +0000 UTC