Unreal Engine How do we do penetration mechanics in 3D games?

razfaz

Member
Mar 24, 2021
171
195
Holla Velo,

I see there is progress regarding Dildos.

Have to familiarize myself with this Task befor I can can technically contribute something to this. But...

The next logical step would be a solid Concept, RTFM and technical clean integration. = Plugin = $
Like -> DAZ2UE GenX Mesh Velo Dildo Ready!
So...

Wishing all the best
Raz

PS: Fromo marketing POV I would prefer "SchlongsOfUe" or "SOU". /jokin'
 
Last edited:

Velomous

Member
Jan 14, 2024
265
227
The next logical step would be a solid Concept, RTFM and technical clean integration. = Plugin = $
I'm not really interested in monetizing something like this, when I perfect it i'll probably just straight up share my completed solution freely, to the benefit of perverts everywhere.

Why do we not have many good hentai games? Because every new serious hentai game developer needs to reinvent the wheel, e.g. start from scratch doing shit that hundreds of other devs have done before him but didn't share how they did it. Hentai game development is an unpaved road, sharing stuff like this helps pave said road.

A better paved road towards hentai game development and less reinventing the wheel, means more hentai games with better quality in the end. Everyone wins. Making some small potatoes cash through selling plugins isn't even worth it by comparison ;)

The really hard stuff isn't little things like this, it's making a lot of little things like this work together perfectly.
 

razfaz

Member
Mar 24, 2021
171
195
I'm not really interested in monetizing something like this, when I perfect it i'll probably just straight up share my completed solution freely, to the benefit of perverts everywhere.

Why do we not have many good hentai games? Because every new serious hentai game developer needs to reinvent the wheel, e.g. start from scratch doing shit that hundreds of other devs have done before him but didn't share how they did it. Hentai game development is an unpaved road, sharing stuff like this helps pave said road.

A better paved road towards hentai game development and less reinventing the wheel, means more hentai games with better quality in the end. Everyone wins. Making some small potatoes cash through selling plugins isn't even worth it by comparison ;)

The really hard stuff isn't little things like this, it's making a lot of little things like this work together perfectly.
I think your attitude is really good, that's mine too. I just wanted to present some possibilities with my answer, but foremost I wanted to check how you tick in this regard.

I am always looking for new challenges regarding programming and|or UE, because it's exactly as you say: The mastery of many smaller things and finally putting them together into greater, bigger things is awesome and we should support each other on this path of constant learning.

PS: How ever, lemmy know your current Nuts you're trying to crack atm. Maybe I can contribute one or two things and get usefull knowledge in return.
 
Last edited:
  • Like
Reactions: Velomous

Velomous

Member
Jan 14, 2024
265
227
The bones were already there. I made sure when i picked my placeholders that they'd have all the bones i found it likely I'd need. I just added colliders to them in the physics asset, as you can see though I am not very good at manipulating the physics asset (vagina won't open up very much for me)

output.gif

The dildo jittering like that is just a slight issue with the code i'm using to control the dildo, nothing to do with the colliders. I'll have to revamp that whole system soon~ish. Also i realized that putting the glass material on the dildo is a smart way to test this kind of stuff. I didn't stop there either.

output.gif

I was inspired by illusion and kiss's games letting u turn the male transparent, so i made some code to slap the glass material on and off. The version in the gif just gets the default materials from the static mesh, it's more efficient but limited in that if a mesh isn't using it's default material the restored material won't be the one it had before it was turned to glass, I solved that by just tossing all the materials into an array.

is that improved code. The only downside to that code is that the array which stores the materials can grow infinitely big. However when all objects have been turned back, the array is cleared to mitigate this a little. I tried to make a system where the materials are removed from the array after they are loaded but I encountered a lot of bizarre issues with that approach and eventually just gave up on it. Any final implementation would look different anyhow.

The next thing i'm likely to try in this direction is to use procedural animation in combination with those colliders to ensure the vagina opens up properly. But it's gonna be a while since i'm studying niagara right now.
 
Last edited:
  • Like
Reactions: TheExordick

Velomous

Member
Jan 14, 2024
265
227
I reworked the dildo rail system using a physics constraint instead of a handle, it's much smoother now.
View attachment 120824-201104.mp4
















It works much better now, and even has this happy little side effect of getting stuck inside when I let go of it.

First I created a socket I eloquently call pussyhole :whistle: it's positioned at the entrance to the vagina, with the X pointing up inside of the vagina (the penetration direction), this is what I will use to aim the dildo.
24-08-97.png
I then create a physics constraint in the female characters blueprint with these settings:
24-08-102.png

Then within the female character blueprint construction script I position this physics constraint to be positioned and rotated exactly like the pussyhole socket.
24-08-96.png
And finally I attach the dildo to it all.
24-08-99.png

Then to move the dildo I'm just using a standard physics handle to grab it and move it with the cursor.

I would make this a proper tutorial in the tutorial section but there are sitll a few problems with it i haven't solved.

Namely:
  • I can't control maximum penetration depth (this is because soft constraint has 'give' to it, if i wasn't using soft constraint I could set the linear X limit but the major reason I'm not doing that is because using soft constraint mitigates the second problem a bit)
  • The character is attached to the dildo as surely as the dildo is attached to the character, which means if you move the dildo to the edge of it's constraint bounds the character mesh moves with it. This is somewhat desirable when the dildo is penetrating, but less so when it is not. I'm not sure how to fix this, I thought I could use 'parent dominates' but I couldn't figure out a way to apply it for this scenario.
You can fix the second issue by manipulating the mass e.g. if the dildo is much lighter than themesh, it can't move it. You just need to make sure that the bones relevant for the hole that you're gonna penetrate are light enough for the dildo to be able to move them. By doing that you can also fix the first issue by using normal constraint instead of soft constraint which allows you to limit the angular movement to a certain range.
 
Last edited:
  • Like
Reactions: WarmGourd

WarmGourd

New Member
Mar 30, 2024
11
11
It's nice to see that you're still working on this and making good progress. As I've mentioned previously, my experience with Unreal is somewhat limited so I won't be of much help in that regard sadly, but I'm about done with my implementation in Unity and I'm putting together a minimalist tech demo for people to try. I'm currently reworking the base female (Genesis 8.1) from the ground up, so I'll take some notes as I'm going through the process of re-rigging everything and get back to you with an overview of how I chose to approach the implementation. With any luck, you'll be able to use something.

I know how frustrating it can get to be plugging away at the same thing for weeks on end. I think most people would have given up by now so your persistence is commendable and I look forward to seeing where you go with this. Keep it up.
 

WarmGourd

New Member
Mar 30, 2024
11
11
Sorry for the delay. I've been ill over the past few days so progress has been slower than expected but I've managed to put together a brief overview of how I'm doing it. With any luck there'll be something you can adapt to Unreal.

To begin with, the gens and any additional bones that are required are rigged and weight painted in Blender:
GenitalRig.png
Areas that require more a more precise deformation or will be interacted with more, such as around the hole are given a denser bone structure to improve the accuracy of the physics simulation and deformation.

GluteRig.png
As the glutes are only required to move and rotate in a limited fashion which will be handled by a configurable joint on each of them, a single bone is sufficient.

Next the character is imported into Unity to begin setup.

As I'm running the entire thing as a physics simulation, allowing Unity to generate the colliders for me is not an option. Initially I infilled the character with voxels and generated the collision structure from that. I realised however, that I was overthinking the complexity of the issue and instead decided to generate compound mesh colliders through code for each transform after a change of position. An example of the labia colliders as they're generated:
GenColliders.png

As for the physics, each genital bone that requires deformation is handled using a configurable joint. Each labia on either side is connected from front to back in sequence so that movement propagates across the entire chain. The labia joints are limited to move only away from the centre of the genital structure, while the hole joints are limited to moving only away from the centre of the hole.

Once it's all set up: