Live 2D Tech Demo - This isn't v0.51.1!
Added 2022-04-06 22:12:25 +0000 UTCThis isn't v0.51.1 (come back in a couple of days for that!), but it is a Ren'py file with some cool stuff to show off. This is a tiny tech demo to show off the key character display functionality I need for LR2 that I have gotten working with Live2D. Want to jump in? Download it now!
PC: LR2_Live2D_Tech_Demo-PC
Mac: LR2_Live2D_Tech_Demo-Mac
So what's this tech demo all about? For a long time I've been keeping an eye on Live2D (best known for being the software for creating 2D v-tuber avatars). I've taken a few experimental stabs at it, and each time I came away interested but ultimately unconvinced I could make it work.
Has that changed this time? Yes! Ren'py has had official Live2D support for a few months, and that means most of the major growing pains have been worked out. I was also able to spend a much more significant amount of time just fiddling with the software and getting it to work (This, plus Elden Ring, is the reason my productivity for LR2 has been lower than normal). That time experimenting has paid off, and I was able to figure out a clear workflow going from raw images to full in-game model.
There are a few core features in LR2 that I needed to make sure would be possible in the Live2D system:
- Swapping/Removing Clothing Items: This was fairly simple. Each clothing item will have a parameter to toggle it's Opacity; when it is worn it will be made visible, otherwise it will be hidden.
- Clothing Colouring: Ren'py's implementation of Live2D accepts any Displayable for the model texture, which means I was able to start everything as greyscale and tint it in real time. The textures for each clothing item will be broken into their own file (rather than collected into one large atlas, which is the default Live2D behaviour) so it is simple to grab and modify them.
- Clothing Opacity Control: This ended up being more complex than I anticipated, but I got it working well enough in the end. Full opacity and 0% opacity were simple, but when clothing is only partly visible there can be visible seams wherever parts self-overlap (like arm joins or if an item's breasts are separate from the body itself.) The solution was some clever masking inside of Live2D, but either it or Ren'py doesn't have it's implementation perfect. Sometimes there is a 1 pixel seam that can be spotted.
- Clothing Patterns: Similar to clothing colouring, I was able to support this by masking the starting textures.
- Multiple Character Display: By default Ren'py's implementation of Live2D assumes each model will be shown on screen one at a time. I want to be able to show multiple characters at the same time, so I needed to fix that. I was able to make a few small tweaks so each instance of a model generates it's own cache of textures and parameters and I can display as many models as I want at once.
- Performance: Obviously all of this needed to be possible without dragging everything to a crawl. I will need to keep an eye on this as I add more clothing items, but it seems like performance is acceptable (and is likely going to be far better than the current system!)
Why go through all of this trouble? Here's a quick list of the benefits I expect the new system to have:
- Reduced Image Library Size: Right now each LR2 clothing item has hundreds of images associated to it. Each image corresponds to a combination of body type, breast size, and pose. 10 breast sizes x 10 poses x 4 body types = 400 images. Each pattern needs the same number of images, so add another 400 for each of those. The end result was a giant library that I needed to write code to manage, and that is so massive it's impossible for me to make manual edits. Live2D reduces that to a couple of images (maybe even just 1!) per pose that are then warped in real time to achieve the different breast sizes and body types. The warping is consistent between different clothing items (as long as they have roughly similar geometry), so the work to set them up can be easily reused.
- Improved Parameter Ranges: Breast size in LR2 is split up into 10 different sizes, which corresponds to a specific set of images for that size. The Live2D system allows me to turn those 10 discrete steps into a large range. Breast size can then slide up and down that range fluidly, without needing to fit neatly into specific boxes! Body type is a similar situation. In theory I can now add parameters for things like waist thickness, butt size, and other body shape parameters and have ALL of them be controllable with serum effects. Pregnancy status could even be set to a parameter that increases slowly over 9 months (with visible effects depending on serums applied!). Lastly, it would finally be feasible to support extreme body proportions: super large tits, really large butts, girls who look extra pregnant, and so on.
- Animation (and maybe Physics): Live2D comes with a whole suite of animation and motion tools that make it possible to add proper, interesting animations to LR2. This would be lightyears ahead of the current 2D image warping I have implemented. It doesn't look like Ren'py has implemented Live2D's physics controls, but I think I could do that myself if there was interest in it. That would let me add proper jiggle physics, hopefully making every character portrait feel even more lively and interesting.
- Human Editable Images: Related to the reduced image size, a Live2D based system would use a massively reduced number of images. That means it becomes possible to make direct edits to those images. That could be touchups (anyone else still annoyed by how many clothing items have clipping issues? Yeah, me too!), but it could also include doing an art pass and stylizing everything! Patterns in particular benefit from this. It would be possible to make new patterns by pulling them into Photoshop and editing them directly.
- Shareable, Moddable content: I haven't been able to share any of my Daz automation stuff because it relies on access to copyrighted assets. Lacking those assets makes it impossible to generate your own image sets, so you can't add new clothing items or poses. The Live2D system has few enough images that it is possible to get close enough with your own renders and tweak them in Photoshop. I can also release the Live2D model files, so everyone in the community will have access to the same tools I do for adding content!
This tech demo is real quick-and-dirty, but it represents me passing all of the major hurdles, and I hope it shows off some of the potential in the new system. I've included all of the code and Live2D files for anyone who wants to play around with those as well!
The next major step would be rewriting my Daz automation scripts to output images more suitable for Live2D's systems. After that I will have to pull everything into Live2D and rig everything up. I'm expecting those changes and would take up an entire update cycle. Once v0.51.1 is out I'll put out a poll and see what the community thinks about it vs. adding new content using existing systems.
Comments
Just played the demo, I think it’s fantastic and such a great look too. Would be well worth the wait xxx
Star88
2022-04-24 16:03:45 +0000 UTCLove the idea of slapping tits and spanking. Was a big fan of Akabur's games where you can get really rough with the girls and make their black makeup run. Would make office corruption much more fun and punishments.
Ankh of Life
2022-04-18 06:59:49 +0000 UTCIt absolutely should be. In theory that should be as easy as adding new clothing items.
Vren
2022-04-09 17:08:14 +0000 UTCwill it be possible to make tattoos or change skin color ?
2022-04-08 16:35:45 +0000 UTC@NuTrix, the ability to add some proper slim-thick girls is absolutely one of my motivations :P
Vren
2022-04-08 11:39:30 +0000 UTCAnd we could have tiny waists..
NuTrix
2022-04-08 11:31:30 +0000 UTCBrilliant work. I enjoyed the demo. You keep doing amazing things.
romal
2022-04-08 01:21:03 +0000 UTCFantastic! It might also be time to consider moving graphics to center screen
2022-04-07 23:16:28 +0000 UTCThis is awesome! Especially as this means we could have ass expansion, which is something I've wanted for awhile. Otherwise, it sounds like this is both better looking AND better optimized, which is a massive win-win for the game.
Killer300
2022-04-07 20:13:37 +0000 UTCI'm crying, i've waiting this moment for a long time
2022-04-07 17:19:41 +0000 UTCVery cool demo, background didn't load though so it was against a black background (which made the black hair option virtually invisible.) Still, seems like a big step in the right direction for outfits & optimisations. Looking forward to future updates, the physics demo was fun ^_^
Dreamdayer
2022-04-07 17:13:43 +0000 UTCYou had me at "boob slapping". Interesting stuff with the ready scaling and coloring. There are definitely features worth adding to the game. Nice work!
NuTrix
2022-04-07 13:33:59 +0000 UTCThe reduced image library size is probably the biggest boon in this listing. Obviously the individual file sizes are *tiny*, but each separate entry is another hit to Ren'py's inefficient processing logic. Thus, anything which reduces the load on Ren'py's engine is an automatic plus.
Schattenjäger
2022-04-07 10:53:41 +0000 UTC