RPG game prototype

It’s very late for me right now but I’ve been excited about my RPG game prototype. And yes, the hovercraft is part of the game.

First proof of concept is skinned armor then onto melee combat.

Image: took me a while to modify, reduce the polycount on the X-bot model, and strip down the Maria model. Hopefully I can skin the armor and equip it in game in a day or two.


How do you “reduce the polycount?” decimate x2 / subdivide-retopo?
Normal maps?
I’d like to do the same, but I want to use Miku miku dance format, not supported by urho. So I need to write a custom importer first, then go onto reduce/retopo…

I invested in Maya LT when Amazon had it on sale last year, so there’s no decimate but reduce mesh command. For this model, unlike Beta lowpoly that I’ve been using, I separated the mesh into individual piecesl then specified the triangle count for reduction and actually swapped out sphere joints and stomach with lower res meshes. It turned out nicer and tri count at 8k.

For normal map, I use NormalMapGenerator, https://github.com/Theverat/NormalmapGenerator

Well damn, I thought it was going to be a challenge and would take a day or two to attach skinned armor onto another model, but I was wrong. In just few minutes:


Did you simply add StaticModels to the bone nodes?
No, I see some deformations. In that case you could play around with the weights to give the breastplate a more solid feel.
But yea, nice minutes! It probably would have taken longer to get into an actual set of armor. :slight_smile:

Model class already has functions that you need to do this.
Here’s my code snippet:

    Model *model = cache->GetResource<Model>("GameProto/Girlbot/Girlbot.mdl");
    Model *modelArmor = cache->GetResource<Model>("GameProto/Girlbot/GirlbotArmor.mdl");

// then simply call
   model->SetGeometry(4, 0, modelArmor->GetGeometry(0, 0));

My 1st pass of skinning is whatever the operation sets it to and I tweak it from there (if I even like the model). What you see is the 1st pass.


So this is the way for skinning a model. I don’t remember, is there an example for that?
In short, you have to create a separate mdl for everything’s added on… wearings, weapons, and so on…
Moreover, have you tried Awesome Bump?

1 Like

Looking good!
My method for skinning is to make the armor/dress directly over the main 3D model with the same origin as the main model, I then set the skeleton/bone weights on the armor/dress accordingly to how I want them to be influenced and then in Urho3D I mount them as AnimatedModel on the same node of the main model.

I’m not sure if mine it’s a good idea tough, especially in case of high poly meshes and wanting to hide what’s underneath the armor.

@johnnycable I think it’s explained in combined skinned model: on this page

In the true sense of RPG games where you can swap out armor pieces at runtime is what I’m after, hence, my code. But I wasn’t aware about the doc that Alex-Doc mentioned. That method looks as though you mount the entire set, unless you make your armor pieces as individual mdl files.

And I havent tried Awesome Bump. Thx for the link, I’ll give it a try.

Ya, that’s the best method that I found to skin the armor.

edit: I’ll have to experiment with the armor skinning and mouting a bit more. The Urho3D’s suggested method seems more simple and direct than calling SetGeometry(). I’ll need to evaluate whether I want to generate separate mdl for each piece.

@Alex-Doc yes, thanks for the link. I’ve already read it but, as usual, I’ve forgotten… :blush:
@Lumak Awesome Bump looks like a powered-up version of normal map generator you posted…
I think it’s possible to not having separated models for attachment probably, by having different animation streams in a composite, one per action… but not sure about it.

OK, so I started exporting each piece of the armor as separate mdl file and it occurred to me that if I add them as AnimatedModel, then I would also have to animate them with the same animation as the character animation. Think for a minute about if I had five armor pieces added as AnimatedModels, and imagine this for x number of characters you have in the game.

I think I’ll stick to my method of just adding geometry to the base character and not worry about articulating the armor pieces.

Maybe, but I’m against the idea of having to specifically animate armor pieces.

In my case, I solved by modelling the armatures directly on the model, which is simple but as downside, requires pretty strict standardization of the models(or restrict this method to dresses).

For the non-moving parts such as the helmet and plates, I’m opting for static models on a specific mount node: imagine you have to mount a shield on the wrist, you add a bone called wrist_mount which follows the animation, add then a “shield” node. the static model(shield model) will be a component of this last.

Does this mean that the character and armor/attachments are exported to a single mdl file and static in game, meaning that you cant remove the armor and/or swap pieces out?

And yes, it’d make sense to add static (non-skinned geom) to nodes.

No, I just use the same skeleton for the pieces, for instance, the gloves come in pair(one mdl for left and right) and in the 3D modeling program, share the same origin and armature/skeleton of the main (character) model.

To recap:
Blender file hierarchy looks like this

  • Armature
    – Character (naked)
    – Gloves

Armature has bones “hand.Right” and “hand.Left” which weights are mapped to both Gloves and to Character’s hands vertices.

When I export the model I will find Gloves.mdl and Character.mdl.

I’m sorry I’ve been confusing, I’m not currently at home, I will post a couple screenshots as soon as I get back (about 15 hours since this post).

Yeah, that’s what I thought from reading your 1st post but the “strict standardization” kinda threw me off, but ya provide pics.

The screen-shots I’ve promised can be found Here.
As you can see, each part is on a different object and they are sharing the same skeleton.

Those will be used as templates to build the other equipment.
The standardization comes from the fact that using this method implies the limitation of having:

  • Same base model (and care with weights, so bone scaling will affect the armor correctly).
  • Won’t be able to hide what’s below the armature.
  • Have to be very careful to skin it correctly to avoid compenetration.
  • Possibly z-fight(?)

I’m pretty sure that each method has its downsides and doesn’t exists a “correct way” to do that, but only a “works best for me” way.

I didn’t made a screen-shot for the “Mount bones” as it is pretty straightforward as they are just placeholders for the transform.

I hope it will be useful, looking forward to hearing what’s working best for you!

No, as long as you add all your AnimatedComponents to single node, you just need to animate first one,
and that will make all of them animate.

I don’t see Z-fight in the setup I use (probably occlusion is more intelligent than I thought) but there is visibility problem
in some cases. People suggest using special textures, as engine doesn’t support vertex-masking.

and that is getting closer to my setup, I hope @Lumak will eventually get to the same bone problems as me
(and that would probably make it easier to solve them).

You’re absolutely right because node only needs a single AnimationController component - can’t believe I missed this. While this is true, I’m still going to go with my method of adding geom to the base char to reduce all the bone matrix multiplications that happens in animatedModel.

I think our methods are the same - I place the armor on top of the char (as seen in the 1st post image) and skin it on the same skeleton then export just the armor with the skeleton. And yeah, I look for any areas where char’s body protrudes out from the armor and correct them by simply pulling verts away from the char’s body.

I think our methods are the same - I place the armor on top of the char (as seen in the 1st post image) and skin it on the same skeleton then export just the armor with the skeleton. And yeah, I look for any areas where char’s body protrudes out from the armor and correct them by simply pulling verts away from the char’s body.

How do you do this - in Urho or during modelling?