Multi-character Drawing Support
Added 2020-09-14 10:25:18 +0000 UTCThe character drawing code is some of the oldest and most core code in Lab Rats 2. It has been iterated on multiple times to add new functionality, but one thing has stayed constant: it was designed to display a single character to the screen at a time. In retrospect I should have taken the time when I first wrote the display code to support multiple characters from the start, but the next best time to do it is now!
The first step to solving a problem is to lay out what the problem is. In this case the problem is that some scenes involve multiple characters, and these characters are often suppose to be taking simultaneous actions. Due to the single character restriction only one person can be shown at a time, meaning there are either lots and lots of switches between characters (which can be tedious to code and to play through) or forcing the player to pick a single character to look at and ignoring everything else going on. This will be even more of a problem when threesomes (and other types of multi-character interactions) are introduced.
The solution is obviously to start showing multiple characters at once, but there are some important goals I also want to achieve. The first is one of simplicity: I want any changes to the draw system to allow for the exact same single character behavior that exists right now. The vast majority of events will only involve a single character, so I want to avoid any extra work there. Second, I want the way multiple characters are displayed to carry extra information. Specifically I want to be able to use the multi-character display to draw attention to information like who is talking, or who is being described by the narration. Third, I want multi-character scenes to have no major performance drawbacks. I will need to do some testing, but this might involve having only the "primary" character animated, while the rest are static. Finally, I want the new display code to handle an arbitrary number of characters on screen. In practice two character scenes are going to be most common and super high character counts may be impractical, but if I'm putting in the time I might as well make it something that will be usable for every event imaginable.
My design will have all of the character images lined up, starting from the right side of the screen (where characters currently display) and then spacing them out to the left. Events with multiple characters will have a "primary" character, who is usually the active speaker or the topic of narration. The "primary" will appear full size and at the front of the stack. All other characters will be placed behind and shrunk slightly. As you move further left and right along the stack characters will be shrunk slightly more, to give a wedge appearance with the primary at the front. Character order in this stack will be consistent throughout a scene to help the player keep track of who is who.
To implement this design I will be adding a new display class. This class will be used in any event that has multiple characters, and will be responsible for drawing each character in the appropriate position in the character stack as well as tracking who is the primary speaker. This display class will also be able to keep track of existing characters and move them/resize them around instead of redrawing them any time a change is made to a different character in the character stack. This should keep the extra performance impact of multiple characters low.
So that's the plan. I've prototypes a few bits of the new system, so now I need to tie it all together and get it running smoothly. Once that's done I will be going through all of the existing events and updating any events that involve multiple characters to use the new system. After that I'll evaluate how much time left I have before the v0.33 release and see what else I can add!
Comments
[code] I'm sorry, but an uncaught exception occurred. While running game code: File "game/script.rpy", line 10240, in script call call talk_person(picked_option) from _call_talk_person File "game/script.rpy", line 10358, 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 10353, in script call $ _return.call_action(the_person) File "game/game_roles/role_sister.rpy", line 355, in script call call sister_instathot_label_mom(the_person, mom) from _call_sister_instathot_label_mom File "game/game_roles/role_sister.rpy", line 844, in script if the_sister.judge_outfit(insta_outfit_sister) and not the_sister.wardrobe.has_outfit_with_name(insta_outftit_mom.name): File "game/game_roles/role_sister.rpy", line 844, in if the_sister.judge_outfit(insta_outfit_sister) and not the_sister.wardrobe.has_outfit_with_name(insta_outftit_mom.name): NameError: name 'insta_outftit_mom' is not defined Windows-8-6.2.9200 Ren'Py 7.3.5.606 Lab Rats 2 - Down to Business v0.32.0 [/code]
Dreamdayer
2020-09-17 20:35:32 +0000 UTCI got an error when finishing up the 1st time Lily & Mom model together:
Dreamdayer
2020-09-17 20:32:51 +0000 UTCIf you tell Jennifer to act slutty in her 2nd interview and end up slapping her ass, she turns to you and says "Mom, try and take this seriously.'
Dreamdayer
2020-09-17 19:13:16 +0000 UTCOr maybe make the bouncing/animation optional? Have it be a setting in the menu?
Aaror
2020-09-17 03:06:07 +0000 UTCOne thing I'd like to see, is if you could stop the bouncing images if you add multiple girls to the screen at the same time. It seems like a 5 - 10 second delay on my computer every single time a girl gets loaded up, and it wasn't that way before the bouncing was added.
Perversity
2020-09-16 03:28:03 +0000 UTCWhen Jennifer asks you about her upcoming promotion and gets you to pick out a set of clothes, when you're complimenting her after, the game uses the wrong reference for her. "It looks great your mother."
Dreamdayer
2020-09-16 02:46:07 +0000 UTCSounds interesting, anyway; here's a potential bug that I'm not 100% sure is related to v0.32.2, but was reported on the Zone. File: game/command_descriptions.rpy, line 30. "Save as an underwear set." if new_outfit.is_suitable_underwear_set(): AttributeError: 'RevertableList' object has no attribute 'is_suitable_underwear_set' From looking at the label outift_master_manager it looks like perhaps the list check doesn't re-assign _return to the actual clothing Object, although I don't have time to properly look into it myself right now.
2020-09-14 18:57:57 +0000 UTCLove to see the implementation details you share when new features are introduced
execplan
2020-09-14 12:49:48 +0000 UTC