BGE Development: Proposal Vertex hooks in game engine

Can vertex hooks be moved into the game engine?

I could take a “I beam” and put a hook at both ends, or a wall, and “stretch” it, by placing the hook locked on a 6dof so it can only stay lined up correctly

so you could “spawn” and manipulate them and make maps, I am not sure about the format of the output…

Good idea? bad? ugly?

I am guessing you would use empties for hooks, and use one hook on each end.
You can do the same thing by making a beam that starts in the object center and ends on 1 BU on any positive axis. So a beam that is 1 blender unit long and the center is at one end of the beam.
You can then place that beam anywhere you want and extend it by changing the scaling of that one axis.

I guess what I am thinking of can be done with armatures, it’s just not as easy,

Could you mke a sketch. I do not get what you mean.

Here is a .blend

so you can re-position the “Hooks” within X distance of its start with 6dof,
and “stretch” a wall in game,


HookExample.blend (448 KB)

Support. Much needed!

  • 1 for vertex hooks in BGE. That could be VERY useful.

Ahh, mesh editing depending on other objects. Ok now I get it.
Can’t you do that with armatures?

The armature Actuator + bone constraint do the trick!


HookWitchArmatureExample.blend (371 KB)

Brilliant, Monster! You have no idea how long i’ve been trying to get that result! I’ve tried that workaround as well a few days ago really, but probably i didn’t executed it correctly, so my experiment was a failure, and then i looked for another method. Thanks a bunch for the blend, Sir! It helps alot.

I have been tinkering with it, but I ended up having the faces expand for some reason,
also, you can’t scale a Ik target right? but scaling a vertex hook does effect the vertex scale

I am not sure, but can modifiers code block be edit/slapped around until it is in the bge?


TerrainMod.blend (555 KB)

BluePrintRandom, try to replace your IK constraints with Copy Location constraints and let’s see if that works.

??? move the whole bone?

I don’t understand,

can you .blend me?

Okay, i don’t understand what you’re going to do with vertex hook in your scene. And unfortunately, i cannot reproduce my first test with your blend using armature :confused: (Sorry, i should’ve saved that test file). I was able to get ‘vertex hook’ like behaviour, to one of the bone in your armature. Now when i tried it again, the plane is completely scaled up.

So, what you’re going to do with this vertex hook exactly? In my understanding, this work around suppose to use Copy Location constraints, and i don’t see any of it in your scene. I see only IK constraints.
Also, AFAIK you should avoid IK constraints whenever possible. IK is not a good idea for most game engine if not all. In a big scene, it can hurt BGE’s performance really badly.

this is for a terrain generation system or for walls etc,

for terrain, if you can scale, and move a “Vertex hook” that is a cube, then you can make craters, peaks stalactites etc in real time,
it’s so you can modify a mesh, X distance up and down,

a real time displacement map would achieve the same result if you could overlay a “falloff” brush based on a ray casting, and then update the physics mesh and the color etc,

but vertex hooks can animate many things, that are hard to represent with a armature, and not easily predictable

For terrain…
You mean something like this?

Attachments (86.2 KB)

We have direct access to the mesh vertex data and you can manipulate it as you like.
There is no need to change something in the game engine.

Here is an old example.


levelEditor3_save_load.blend (122 KB)

Would this work with navmeshes as well?

There is a rebuild() function in the navmesh, but it seems not to work.

rebuild() - rebuilds the navigation mesh based on the object mesh. It can be used to rebuild navigation data after changing in the object mesh.
Note: It works only for manually created mesh object (without using operator for automatic generation of navigation mesh).

It would be nice if it could though.