B Info Module System Of Trolls, Orcs, and Elves: Experiments using SCALE from module_skins.py

Users who are viewing this thread

Hi all,

I've been helping out expand TLD and one of the issues I wanted to look into was with regards to Orcs/Dwarves and the issues that come up due to their small size (i.e small meshes and small skeletons).

Issues:
  • Orcs / Dwarves, when used by players, will have a bad camera angle due to their size.
  • High Level Elves (ie. high Archer prof) will consistenlty go for head shots, but because of Orc's small size, it will go above their heads (ie. Archers think that their heads are up there).
  • Bonus Issue: Trolls / ents have larger skeletons / meshes, but their walk cycle was reduced so they become slower (ie so that they do not walk as fast as humans). Foot sliding / stuttering occurs as a result of this; archers aim for the groin instead of head; and when conversing with trolls, you get a very good view of it's crotch (those who have played TLD will know this).

So, inspired by Viking Conquest and their use of SCALE to have different sizes for characters, I, with the help of mtarini, set out to test if using SCALE from module_skins.py would alleviate the above mentioned problems.

A short discussion on Warband and mesh sizes (mtarini):

In an ideal world, where everything worked the "sensible" way, there would be no need of any "scale" parameter, and the skeleton (the one stored in a BRF file) would determine everything alone.

Unfortunately, that's not the case :sad:

Instead, there's as many as three sources of info used by the game in a way or another:

(1) the skeleton BRF data, which you can manipulate in OpenBRF

(2) the associated hitboxes, which are found inside the file skeleton_bodies.xml
      (and you can also manipulate in OpenBRF)

(3) the scale multiplier, found in module_skins.py (and thus skins.txt)


It is not clear (to me, at least) which of the three things affects which aspect of the game exactly.

In order to deal with TLD's races, certain things had to be done (mtarini):

We exploited skeleton brf data in very tricky ways to gain all sort of effect on poses (e.g. hunched+bowlegged orcs, slightly taller elves).

We carefully edited hitboxes in skeleton_bodies.xml to get hitboxes right.

As you say, we didn't have the scale parameter because it just didn't work in M&B 1.011. But now we do!


First, we had to study what SCALE actually does. What does the multiplier...multiply exactly?

So if I set the Orc Scale to be K = 0.85,

A) Is the skeleton itself, i.e. (1), multiplied?  (our understanding is that it is).

-- If so, the orc skeleton needs to be scaled by 1/K to compensate (i.e. enlarged).

B) Are hit-boxes, i.e. (2), multiplied?

-- If so, they need be refitted (e.g Troll skeleton has natural LARGE hitboxes, and this is right for their size, with a scale factor of 1). If the scale factor was pushed up to, say, something around 2.0, then the current hit-boxes would become twice the size they are now, which is way too much.
We would need new hit-boxes which are half of what they used to be (ready to be the right size... when multiplied by 2). This is quite a bit of work and difficult to get right, but it must be done only once.

-- Same for orcs -- actually the opposite. They have correct, SMALL hit boxes now (now = at a scale factor of 1.0).
If you set the scale at 0.7, the current boxes would become too small.

C) Are rigged wearable meshes multiplied? E.g. armours and rigged boots.

-- Hopefully, not. Otherwise, it would be quite work intensive: every armor would need to have the "orc" frame scaled up by 1/K to compensate (as Orc-specific meshes were made to be smaller)

D) Are non rigged wearable mesh multiplied? E.g. helmets and non-rigged boots.

-- If they are, it is a *real* mess. You would need to enlarge all orc helms to compensate (scale them by 1/K).

-- But then they would look too big when worn by uruks / humans etc.

-- So in practice this would break cross-dressability of helms, so if this is the case I think the multiplier cannot be used.

-- The source of the problem is that our orcs (and dwarves) and smaller body but human-sized heads, by design (especially true for dwarves).

So I set out to do a very quick and dirty experiment: SCALE URUKS TO 5!!

Here are the quick and dirty results (note, I used Custom battles and cheats).

lnkgF.jpg
lcyiA.jpg
syB0H.jpg
w53ry.jpg
R21TJ.jpg
Yh5vf.jpg

So what do these results tell us?

  • Skeleton is scaled by 5. It looks obvious from the images :smile:
  • From the test, it looks like the hitboxes are multiplied, along with the skeleton, as i can hit each part of the uruk as a whole.
  • Rigged meshes: It looks like they are multiplied, along with skeleton and hitboxes, as it fits the way it should on the character.


Conclusion: Scale factor multiplies everything.



Hence, what will happen if we use this for TLD?

Experiment 2: Perform the changes mentioned in A (scale skeleton by 1/K), B(refit hitboxes), C (scale armor meshes), D (scale helm meshes)

Trolls:

Scale factor of K= 1.666667.

With the changes implemented, the trolls now look majestic when they walk. No more foot stuttering / sliding. High Level Archers are also now aiming at Troll Heads! So Bonus Issue was corrected!


However, because of the SCALE factor, when arrows hit Mr. Troll... well... see for yourself:
3Gzzl.jpg

As you can see, arrows became "Magic Arrows" where it is quite large when it hits the troll (scaled by K, most likely).

Orcs:
Scale factor of K=0.877192982

A2_zA.jpg
WHagm.jpg
76WKi.jpg
imfw0.jpg
Video of High Level Elves VS Rescaled Orcs

Conclusions:

- Orc will have smaller heads.

- Walk Cycle will look faster

- No change in high level archer aim. They still shoot above their heads :sad:

Bonus Test:

- Make Orc heads slightly bigger so that they look 'normal sized' head (same as uruks/humans), with small bodies, and change helm meshes to accomodate the change.

- Reason being is that theoretically, it would look bigger when Uruks or Men wore the helmet, but what does it look like in-game? Maybe it is acceptable?

Results:

XCSBm.jpg
zdeMA.jpg

So it looks like little uruk borrowed his big brother's helm.. For us, quite unacceptable.

Final Thoughts:

Pros of using SCALE:

- No more Troll feet sliding / stuttering.

- Archers aim towards Troll heads, not crotches

- No more talking to Troll crotch during dialogues

- Better, but still not perfect, aiming for high level elves VS orcs.

- Camera fixed for Orc / Dwarve players

Cons of using scale:

- Aiming of high-level elves still not fixed

- Have to resize skeletons, meshes, and hitboxes of affected races

- Giant arrows for trolls, mini arrows for orcs/dwarves when they are hit

- Crossdressing (e.g uruks/humans wearing orc/dwarven helms) would look funny.


With all these tests and experiments, weighing both the pros and cons, we concluded that it is not worth going through the effort of making the changes for affected races. We cannot justify that much work for such little gain. Perhaps if TLD still had a full and dedicated team again, then it might be plausible.

Looking back at VC, it looks like they used their largest character (Tall) to be the standard (scale = 1). From there, they reduced the scale of each skin (something like normal height=0.9, short=0.85, child=0.75).

It might have been acceptable for the team to have slightly smaller arrows stick to short/normal characters; faster walk cycles for the shorter/normal characters (i think thats why it always look like your character run so fast!).

I hope this post is of help to people thinking about using SCALE. I havent seen much posts about scale and the above experiments/discussions were mostly through PMs and Skype, but we decided that it might be of help to others.

TL;DR:

What does SCALE in module_skins.py do?

- Multiplies everything by the Scale factor (skeleton, hitboxes, meshes).

Experimented on using SCALE for TLD due to the different races (trolls, orcs, dwarves) to fix the below issues:

- 1) high level elven archers s shooting above orc heads (they are going for a headshot but orcs are short)

- 2) camera issue when playing as orc or dwarf

- 3) Troll foot sliding / stuttering due to code to slow it down

Did it fix the issues?

- 1) no

- 2) Yes

- 3) yes

Did it cause other issues?

- Giant / Mini arrows when it hits scaled races

- faster walk cycles for shorter races

- Crossdressing (e.g uruks/humans wearing orc/dwarven helms) would look funny.

Thanks!

 
So, by using scale, you would have an invincible naked abomination with odd movements and, are we not encouraged to use it anymore or the otherwise?

What scale basicly does is to scale skeleton and hit-boxes, not correctly but still does it to a believable extent, right? If I would be in need of a 5 meter giant, that would be a problem, but it wouldn't be a problem for a little-taller race compared to what is already in the game. Right?

Really nice research.
 
Thanks Khamukkamu for the meticulous experiments and the super-informative report.
I've seen less rigor, care and exposition clarity in scientific papers!

Too bad that the net balance is... nothing. :sad:

At the end of the day, the result is that we can't exploit the scale mechanism for anything useful, as the drawbacks are just too punishing.

Too bad! I had my hopes up to finally fix that horrendous feet-shuffling of trolls and, even more, the elves-shooting-over-orcs-heads thing (the... "Wilhelm Tell Invisible Apple syndrome" :grin:).
Alas, the big arrows and the deformed orc heads are clear deal breakers :sad:.
(plus, the loss of back compatibility with M&B1.011, but that,, if it was the only thing, could be considered).

This experience gives us, at least, two items of a wish list for moddability mechanisms (for example for BANNERLORD).
Specifically:

1. Please, please, please let modders specify a per-skin "leg_scale" multiplier, determining the speed multiplier of walk/run/etc cycles
    (like skin_scale does now, but without any other effect).

2. Please, please, please let modders specify a per-skin "head_height" measure, determining both the height of the aim for opposing headshotting AIs,
    and camera poistions for player controlled characters.  (the latter, like skin_scale does now, but without any other effect).

Let's try to make these two things known to Bannerlord Devs!
(and, cmpxchg8b, if you read this, any possibility of cramming these two functionalities in existing engines?)
 
Efe Karacar said:
So, by using scale, you would have an invincible naked abomination with odd movements and, are we not encouraged to use it anymore or the otherwise?

What scale basicly does is to scale skeleton and hit-boxes, not correctly but still does it to a believable extent, right? If I would be in need of a 5 meter giant, that would be a problem, but it wouldn't be a problem for a little-taller race compared to what is already in the game. Right?

Really nice research.

No, it doesnt make the naked abomination :smile: I just put it there for fun! As I mentioned above, the Troll mesh and skeleton was originally made BIG because SCALE did not work in M&B 1.011.

So because I just wanted to do a quick test (swap skel_troll to skel_uruk) without RESIZING the mesh (which like i said above, was originally big), the abomination occurred.

What scale does is that it multiplies everything, but you will still need to adjust mesh, hitbox, and skeleton accordingly (which is what mtarini did). If you do those, then I think SCALE will work as intended.

The issue is, that for the purposes of TLD, it does not work.
 
IIRC AI won't adjust their aim height with differing shot-speed bows, so if you reduce the shot speed on the elven bows by ~15-20 they should start hitting orcs in the head, and humans/uruks in the chest. Also, you could consider using the scale only for ents/trolls to stop the foot sliding, and do some sort of on hit mission trigger to stop projectiles from sticking in their bodies and getting resized (if that's even possible..?) Heck, maybe with WSE you could give trolls a "quiver" with 0 ammo, then add 1 each time they get shot (up to 5) and have the vertex animation make the arrows look like they're sticking out of the troll. Of course you won't be able to do any kind of proper hit detection so the arrows will always show up in the same places in the same order... But it would be a neat workaround anyway, and better than the magic growing arrows.

Also, how do the death animations look with the scaled characters? In my experience everything scaled >1 has issues with death animations. The ragdoll needs to be put off until the animation is more or less completely finished, and even then bodies will half sink into the ground. I guess once an agent dies the game no longer pays attention to its scale? But maybe there's a different reason. I also didn't have custom death animations for the new skins so maybe it's not an issue in TLD.
 
RE: shot-speed, that's cool, I would definitely try and test that! What do you think the result would be for lower level elves (e.g lower archery proficiency)? Would they then start hitting legs/feet or simply just start missing? I could reduce the shot-speed for bows used by the high-tier elves...

RE: Death animations, yes we had that problem :smile:


mtarini believed (and correctly so) that this was due to the hitboxes being scaled. So he tweaked it and we no longer had the problem. That's what we meant above that we cant just change SCALE in module_skins.py and be done with it. Meshes, skeletons, hitboxes all needed to be tweaked :smile:
 
Ah my bad, I thought you said scale affected the hitboxes correctly. Also I think I saw someone dance like that at a club once...

And yes I do believe low level archers will under-fire, but their reduced accuracy probably gives them more variation in each shot so you can probably find a balance. The best way would be to have specific bows for the high-tier elves, or to make the higher level archers have more power draw but not a lot more archery proficiency. Typically I find 150 wpts to be about the max usable archery proficiency for bots - you still want some variation in each shot. There comes a point when greater accuracy vs a single target actually works less effectively vs large groups.
 
Just some clarification.

What the game engine does when the skin scale is not the default "1.0" is basically guesswork.

Here's a summary of what we (think we) know, especially thanks to Khammukkamu experiments:

The big picture:

The underlying principle seems to be, in theory:
scaling up/down a perfectly normal human must work "as-is" and give the expected results.
But, it is not perfect in all details; I would call it a bit buggy (less so in WB than it used to be in M&B 1.011, but still)

For TLD: whether or not this can be exploited for our specific purposes it is a different matter. Chances are, it can't.


The details:

...with notes about what each point means for TLD.
Currently, TLD uses 1.0 scales for everything: trolls skeletons+meshes, for example, are "naturally" large and dwarves/orcs one are "naturally" small.


Scaling a skin will give you:

[*] 1) A rescale of all meshes used by the scaled characters.

That's the most obvious effect.
Note: all the meshes. Rigged (like armours) or not (like heads/headgear). And equipped items like weapons, worn equipment items like quivers, etc. Everything.
(that is consistent with the principle above)

For TLD: while this makes sens in general, it is actually a problem for us. Orcs and Drarwes are not just scaled down uruks and humans: they have different proprortions. The problem is the head. An orc head must be the same size of a uruk, and a dwarf head the same size of a human. That's BTW very important to us, from an art perspective: the respective scaling of head and body tells you more than anything else what the height of the character is (Google for 1-to-9 head proprotions, to have an idea). So, if we want to assign <1 scales to orcs and dwarves, then, to keep the current proportions, we would need to ENLARGE their head/headgear meshes w.r.t. normal humans (just as any other meshes they use). But this means an headgear mesh for (say) a dwarf is actually larger and this break headgear interchangablility.    IN TOTAL: using scales for short races would affect either head proportions, or damage/impair headgear interchangeability. Either way, very bad!


[*] 2) A rescale of hitboxes sizes. More or less.

But, maybe, not really, because things starts breaking here and there with ragdolls. Not clear exactly why.
It is not 100% clear is what scaling does to other "ragdoll-associated" values, like per-piece weight (which is used by ragdolls), or per-piece angle limits.
(it would make physical sense that the weights were scaled by the cube of the scaling factor, meaning assuming constant density, but we don't know.
Naturally, whatever the game engine does, if you know then, as a modder, you can tweak the parameters accordingly.)

The net effect, anyway, is that scaling races can produce glitches in the ragdolls, which are difficult but probably possible to fix manipulating the hitboxes values.

For TLD: this would not in principle be a big problem. We would need to readjust the current hitboxes: scale them UP for small races and DOWN for large races (to compenate the respective scaling). I even made a new tool in OpenBRF to assist doing so.  IN TOTAL: a bit of work here, but probably no problem.


[*] 3) A (very welcome) scaling of walk cycle speed,

...and of the algorithm the game uses to decide if the character needs to be walking or running, given his ground speed. That is, the larger the scale is, the slower his movements (a giant stride is longer than a gnome one). I think this affect scripted death animations too, and maybe other things.

For TLD: yes yes this would be great. It would mean that trolls stop shuffling their feet. It would also mean that they become majestic and enormous looking. Nothing like speed affects the way we perceive size. (Ask any visual effect specialist: the most obvious way to shoot a model of a building collapsing and pretend it is a full sized building collapsing is to slow the footage down). Secondarily, it would also mean that the dwarves and orcs need to move their legs a little faster to keep the pace with longer-strided companions, which would be nice, also!  IN TOTAL: we so much want this. Too bad we cannot afford the other side effects (see other points).


[*] 4) A (very welcome) repositioning of camera for player-controlled scaled characters.

Again, according to the underlying basic principle: scale up a human, everything works as-is.

For TLD: again, a very welcome effect which we long desired. Too bad we can't really have it because of the side effects of scaling.


[*] 5) A (terrible) rescaling of  missiles stuck into the scaled characters

This is nothing but a bad bug (apparently). Why would anyone, in any scenario, want a missile hitting a giant to become gigantic?

For TLD: total deal-breaker. see screenshots above of mega-arrows on trolls.


[*] 6) Nothing changes for where ranged AI aims (unfortunately)

Again, apparently, just a bug (or a missing feature maybe). A giant is aimed at as if it was normal sized: e.g. a self-confident AI will go for where the head would be (but isn't), etc.

For TLD: so using scale would not helpus with  our long-lasting problem of elves consistently mis-targeting over orcs heads (we double tested).


[*] 7) A (totally wrong) repositioning of camera in dialog windows with the scaled character.

The change in camera position would be a good, sensible thing, but it seem to be done wrong. Again, this is, apparently, just a bug. Not clear yet if this can be fixed by coding.

For TLD: dialogs screen with non-human sized characters are already a bit broken, but this makes it worse. A problem, but a secondary one.
 
my 2 cents:

looks like you guys are trying to use scale outside the engine design.

Giant arrows are not necessarily a bug, but could be a simple limitation of the current engine. Same for the other issues.

We need to remember that Warband was created for a specific game (Native), and expanded for its DLC (NW, VC). It makes sense that the core engineers would not implement code to handle cases that were never needed in the first place. That would be just a waste of resources/time and a new risk for bugs.
--> given the choice between a quick solution that works well for what you need, and a expensive solution that you will never use, any dev team would tend for the first. In the agile world its usually called KISS (Keep It Simple Stupid) + YAGNI

As modders we are left with two options: exploit the engine with workarounds, or restrict our own ideas to what the engine is suppose to do.

You guys should try to get attention from the devs (PM Cap, post on Bannerlord thread, etc) to see if you can generate interest for the next engine, as what you are studying here is a great feature for fantasy mods (like in Lords of the Rings). I want to see a TLD + WB2  :smile:
 
kalarhan said:
looks like you guys are trying to use scale outside the engine design.

TOTALLY!
That's what we always do, in TLD.

You wouldn't believe, for example, how twisted and surprising was our misuse of the skeleton+skinning mechanism to hunch-back and bow-leg orcs.
Same for many other things: we hijack mechanisms intended for something else, as well as totally unintended ones, for our purposes.
GetAssista, for example, invented a nice trick to confuse the world map engine enough to give us crossable "shallow rivers". And, we exploited shaders for all kind of unintended effects.
There would be many other examples. Sometimes, it kinda works. This time, it didn't.

M&B / WB (and BL hopefully) is quite good for moddability, and good Armagan, on several occasions, gave us mechanisms, sometimes even on direct request, which helped us very much!
But it is never enough: for the rest, we purposely "misuse" things to bypass limitations and unlock possibilities. We are aware of that.


That said, point 5 of the list above it more of a plain bug. I cannot imagine a situation where that is useful (or even acceptable, except for mild re-scalings).
Same, more or less, for 6 and 7. Point 1, yes, is just us "misusing things".

 
Which begs the question.. what was the original intention of having SCALE?

It seems like (to my knowledge), it was only used recently (and officially) in Viking Conquest.

Hopefully, we'll have better implementation in Bannerlord for those who are thinking of making Fantasy mods that would require larger than usual models/skeletons.
 
I'm having a blast with new skeletons, skins and scale, death animation has worked on the races I've checked

https://forums.taleworlds.com/index.php/topic,350334.0.html

The only problem I have is the scaled larger characters have their arms stretch sometimes when they die

20fyzgo.jpg
 
Khamukkamu said:
Which begs the question.. what was the original intention of having SCALE?

As it was never used in Native my guess is that they had a plan to use it, it didn't work well and they gave up on that feature, so the skin option was just a useless leftover (a feature that never was).

For VC they probably fixed it to the point the DLC required (small variation 0.75 to 0.90), without testing other edge cases (some crazy dude trying to create a giant with scale 10  :mrgreen:)

Poke the devs/Cap and see if they work on it for 1.169/1.170  :smile:
 
Back
Top Bottom