Hey guys,
I don't have a new build for you yet, but I wanted to give you a quick update on what I've been working on. A new build should be available later this month.
So, last month I got a distracted with another project that took a lot longer than expected, but that's over with and I'm now back to working full time on the game.
But in between working on that other project, I was still doing some research regarding game physics. Specifically, the ability for characters to react to touch.
Something I have thought about for a while is that, when I begin implementing more sex animations, which should be the next thing I focus on after this month's build, it won't feel very realistic if the characters you're intracting with don't physically react to your thrusts. At the same time, simulating all the motions involved physically rather than with animation would be an impossible task. So how do I handle this? Well, it turns out a tool I purchased a while back, Puppetmaster, may be the key to making this happen.
Puppetmaster is a plugin which basically allows you to bridge the gap between animation and physical simulaiton. It's often used for ragdolls, but can also be used to make the character physically react when you thrust into them. Their animation would continue to play, but IK would move their hips back while keeping their feet and hands planted, and then the hips would spring back to their original position after each thrust.
Unfortunately, as with everyhting else, there are a few kinks I need to work out. Nothing is ever so simple!
Specifically, for this to work, the characters need to have rigidbodies on all the limbs, and the limbs need convex colliders. But right now, I'm using a tool which generates concave colliders for the entire mesh. This tool can also generate convex colliders, but there in lies the problem. I've been using concave colliders because those closely match the shape of the body. which is necessary for the size changing mechanics. You can't for example climb inside the mouth if the head has a convex collider. And in a similar vein you can't climb on top of someone's dick if they don't have colliders enabled so that they can penetrate other characters.
So I've been doing a lot of thinking about how to work around these issues, and its going to be a bit complicated. But I think I can set it up so if you are below a certain size in relation to another character you get the concave colliders, otherwise you get the convex colliders, though that still presents problems if you say, want to put your fingers in the mouth or vag of a character which is the same size as you.
It might be possible to resolve those issues by adding bones for the jaw, and on either side of the vag so that the concave collider creator can generate seperate colliders for those areas but that in itself brings a whole host of other issues. For example, it would require those importing their own characters to rig them up in that manner, but nobody does that for VRChat avatars, they just use blend shapes... and I can't use blend shapes to generate the necessary colliders.
One possibility I've considered is perhaps having some kind of trigger volume around those areas which disables the convex colliders when an object enters that region. So for example, I could have a sphere trigger collider in the mouth which starts out small when its closed, and expands as it opens, and if your finger touches this trigger before it hits the convex head collider, then it could disable the convex head collider, and enable a concave collider instead, which would no longer be able to physically react to forces, but at least you'd be able to do mouthplay stuff.
Anyway, I'm just mentioning all this to give you an idea of how complex this problem is. If Unity could collide rigidbodies and do physiucs on convex colliders it would make all this so much simpler, but alas, it cannot and even if a third party physics solution existed which can do this, it would not be compatible with the Puppetmaster stuff. So I'm left using tricks like these to make it work.
The other thing I've been doing this month, which you can see in the screenshot above, is optimization.
A lot of folks have complained about the game's performance, so I have been working on trying to improve that. So I took the whole house into Blender, and went over it with a fine toothed comb and, well... I found some areas in which I could clearly improve things, but not nearly as many as I'd hoped.
The most obvious area for improvement was all the foundatons and the base of the fence went below ground and because their meshes are subdivided pretty heavily because they're rock, I went through and I deleted all the excess polygons which would never be visible to the player.
Aside from that... There wasn't a lot of room for improvement. Even when I looked at the props themselves, there weren't many areas I could really cut corners. I could make multiple LODs for the vases, but at best that would reduce the polycount for the scene by like 60K polys, which sounds like a lot, but the whole scene has 8M polygons to start with!
Also, all the props are individual objects rather than prefabs, so before I could even think about making a change like that I'd have to go back and replace all those prefabs. Which would take days... Unleess, I could automate it. And thankfully I have a script which will allow me to replace objects in a scene with a prefab, and with a few modifications it now even copies over the material I had assigned to the object in the scene, and its scale, so with one click I can set the scene up right for any particular prop I want to replace.
Still, as I said, using LODs alone isn't going to get me much in terms of performance.
However I have some other ideas. That side project I was working on taught me a trick where I can cast shadows from a less detailed invisible object, and because every real time shadow caster's polys are duplicated, that can result in significiant savings. But also right now I have all those vases and many of the other objects in the game set to cast shadows, even though they really don't need to. Outdoors, it makes sense to have the objects cast shadows onto the tables, but indoors the house itself is casting a shadow from the sun onto everything inside it, so nothing inside casts its own shadow unless it happens to fall in a sunbeam. I suspect that I will get some major performance benefits just by disabling all those shadows that you're not even seeing.
Lastly, I've been grouping all the objects in the world by the room they're in. I started doing this because I decided to close the doors to the upstairs bathroom and the room above the dining room because they had a lot of props that weren't really adding much value since I didn't see myself using them as sets. However I thought maybe I might change my mind, so rather than just delete everything I put them into a container object and hid that instead. This then got me thinking that I should do this for all the rooms. I'd tried using Unity's built in culling system a couple months ago, but it turns out its complete crap. So instead, I'm gonna write a script which I can stick on a trigger volume to show specific collections of objects based on where you are in the world. So, if you're in the upstairs hall, most of the stuff downstairs, and the stuff in the garage, will be hidden. This will probably take a week to set up, but its fairly easy to implement and should give much larger performance improvements than trying to create LODs for all the props which would take a month and see far smaller gains.
Other things I've been working on?
Well, I've been fixing the lightmapping in the world. It turns out that when you export from Blender normally the objects end up having a scale applied to them in Unity, and the lightmap UV generator does not like that. I was trying to add lightmapping to some of the cabinets and it would not let me increase the detail as much as I needed even though I clearly was not using the whole lightmap for the object by a long shot. There were also some ugly seams on the roof because there were polygons inside the roof that attached where the seams were, and the lightmapper was seeing those as a hole or something. I've been getting better at using Blender lately now that I've figured out how to hide all the objects I'm not currently working on and that there's a walk naviation mode like Unity has so its easier to get into those weird nooks and crannies to edit them. There's still a really annoying issue with the baseboards not being lightmapped properly though and I think it may have to do with Unity ignoring lightmaps for "degenerate polygons" which is any polygon which is too long and thin. I might need to subdivide those a bit to fix that. Otherwise, they'll have annoying black lines on them. But aside from that, the lightmaps are working way more reliably now in terms of setting the scale of them all to match and getting enough detail on things like cabinets for them to look good.
Finally, you may notice I redecorated the master bedroom. Eventually there's gonna be some hanky panky going on in there, but I was REALLY unhappy with how the room looked before. The room was cramped, the TV was over in a corner, there was a big couch which was never going to be used and was just wasting polygons, and if you were standing at the foot of the bed looking at it, you were staring right into the sun, and the view from the bed itself wasn't much nicer. Now you have a view out the windows, or at the TV, which I could have displaying a camera feed, or I could use to let you play videos by pasting a URL or local file path in there. Anyway, I'm much happier with the look of that room now, so the next scene I set up will probably be in there.
Oh, I almost forgot, I've also redecorated the downstairs a bit here and there. Mostly the dining areas. Basically I was looking for props I could delete to improve performance without impacting the appearance of the rooms too much. So in the dining room I removed a chair and pillow and a vase or two and rearranged things so it still looked nice, and then in the cabinets that hold the dishes and glasses I deleted bunch of those and rearranged things so those still look nice as well. Nicer actually. I also moved the chairs around a bit so the place would feel a little more disorganized and lived in rather than having them all placed perfectly.
Anyway, I think that about covers it for now. As I mentioned up top, I intend to have a new build available this month. It will most likely include only the performance enhancements I mentioned, but we'll see if I can toss anything else in there!
Furotic
2022-07-03 03:46:45 +0000 UTCXander
2022-07-03 01:35:17 +0000 UTCFurotic
2022-06-24 12:48:24 +0000 UTCPainCakes
2022-06-24 04:57:03 +0000 UTC