• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Analad

Captain
32 Badges
Oct 3, 2009
324
0
  • Majesty 2
  • Ancient Space
  • Tyranny - Tales from the Tiers
  • Shadowrun: Dragonfall
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • BATTLETECH
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Shadowrun Returns
  • Tyranny: Archon Edition
  • Shadowrun: Hong Kong
  • BATTLETECH: Flashpoint
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • BATTLETECH: Heavy Metal
  • Tyranny: Gold Edition
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Pillars of Eternity
  • Europa Universalis IV: Pre-order
  • 500k Club
  • Warlock: Master of the Arcane
  • Teleglitch: Die More Edition
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis IV: Call to arms event
  • Majesty 2 Collection
  • Warlock 2: The Exiled
  • Warlock 2: Wrath of the Nagas
The purpose of this post is to explain how to change the speed and allure of a unit. It's not for those already digging the game files as this change is simple to quote and understand by reading some game files. It's more to know that such mod is possible and a start a place where to collect mod about this topic.

What follow is very detailed, too much, but it's a way to show how sample are some changes even for someone not used to coding or who didn't care give a look to game files.

Changing units speed is rather easy, everything is in the .def file of the unit.
For example for the Cleric it's in the file:
Code:
Majesty 2\resource\entity\units\heroes\hero_cleric\hero_cleric.def

1 - Raw speed
The raw speed of the unit is defined in the "Mover.FootMover" section, for example:

Code:
{"Mover.FootMover"
	{pathprofile "DEFAULT"
	}
	{stepLength 2}
	{speed 3.5 4.5 4.5} ; <= THE SPEED of the hero, for walk, run, flee
	{angleSpeed 800}
}

You can change those values and you'll change the hero speed for the corresponding allure. So for example, to make the walk allure as fast than the run allure you can change to:
Code:
{"Mover.FootMover"
	{pathprofile "DEFAULT"
	}
	{stepLength 2}
	{speed [COLOR="Red"][B]4.5[/B][/COLOR] 4.5 4.5} ; <= THE SPEED of the hero, for walk, run, flee
	{angleSpeed 800}
}

This will work with only this change. But you'll get a strange effect because the animation won't be adapted to this speed. This effect can be cool but you can also adapt the animation speed.

II - Adapt the animation speed
The move animations are also defined in this same .def file, there's one section per allure:
  • For the walk: {StateWork "move_default"
  • For the run: {StateWork "move_fight"
  • For the flee: {StateWork "move_panic"
  • Some units like the Dwarf have also a fourth allure, the lazy walk: {State "move_laziness". I have still some point to clarify about it as only 3 speed allures are defined for a hero. My current hypothesis about this allure is that it's the same speed than the walk but with a walk animation a bit slower.

For example the walk allure animation:
Code:
{StateWork "move_default"
	{SyncNotifyStart "MOVE_RESUME"}
	{SyncNotifyFinish "MOVE_PAUSE"}
	{looped}
	{AnimName "walk" {speed 1.4}; <= ANIMATION and its speed for the allure.
	} 
}

With the example used in previous section we made a walk as fast than a run. To adapt the animation to this new speed you have two ways:
  • Change the walk animation speed to increase its speed as much than you increased hero walk speed.
  • Substitute the walk animation by the run animation.

III - Adapt the walk animation speed
So for the example the increase we made of the walk allure was from 3.5 to 4.5. It's a rate increase of (4.5 - 3.5) / 3.5 = 0.286

The walk animation speed is 1.4 for the original walk speed so it should be now 1.286 * 1.4 = 1.8

So the change is just:
Code:
{StateWork "move_default"
	{SyncNotifyStart "MOVE_RESUME"}
	{SyncNotifyFinish "MOVE_PAUSE"}
	{looped}
	{AnimName "walk" {speed [COLOR="Red"][B]1.8[/B][/COLOR]}; <= ANIMATION and its speed for the allure.
	} 
}

With those both changes of the walk speed and the walk animation speed you get a hero with 3 allures, run and flee as normal and a hurry walk, which is in fact as fast than the run but looks like a hurry walk.

The effect is fine like this because the allure is almost as important than the real speed and you'll get a hero that hurry to shop or for paying taxes.

But you could prefer a more logical change and just make the hero run for everything including shopping.

IV - Substitute the walk animation by the run animation
With the example we changed the walk speed to make it as fast than the run speed. So using the run animation will be sample, we will just reuse the same animation and animation speed than for the run defined in section {StateWork "move_fight".

So the change is just:
Code:
{StateWork "move_default"
	{SyncNotifyStart "MOVE_RESUME"}
	{SyncNotifyFinish "MOVE_PAUSE"}
	{looped}
	{AnimName "[COLOR="Red"][B]ag_walk[/B][/COLOR]" {speed [B][COLOR="Red"]1.1[/COLOR][/B]}} 
}

With this change you'll get a hero that constantly run even for shopping and buying. It's not fully perfect because there are intermediate states associated to an allure and by doing only those changes you'll keep the animation transition of the original walk. But overall the effect is still very good.

I haven't push further the changes to try also change intermediate states of an allure but this is also defined in this same file.

One point to quote is that with the changes quoted in this post, the emoticons won't be changed and even if you use the attack run animation you won't get an aggressive emoticon giving the feeling that the hero assault shops! For sure on this base you could do different variations like a hero running cowardly to shops and to pay taxes, hey that make sense! :D

IV - Make a hero levitate
One cool variation is to make a hero levitate, that's very simple, just use the walk animation with a slow animation speed and for all hero allures.

In a way you can consider Priestess of Krypta already levitate because his dress doesn't show legs. But you can increase the feeling by slowing a lot the animation speed of each allure and by using walk for the run too.
 
I'm not sure I understand your question. It's mod I have done, both variations, fully tested. My original purpose for testing this is to include in a personal mod some stuff related with that sort of modification:
  • Faster walk.
  • Faster Dwarf.
  • Very fast Archer of Helia.
  • Levitating Krypta, I've still have to look how make them float a bit in the air or just fly at low altitude.

There's some links I haven't yet seen/found in the opened files so I suspect it won't be possible to add new attitude that really mean something. For example you could probably remove the current lazy attitude of some units or add the lazy attitude to some, because it seems that they are key words probably used somewhere else and probably for all units or at least heroes.

But even that could not be possible because of bugs or unfinished features. A good example of this is probably the existing code for repair building in the Dwarf files, everything seems here but it doesn't work. I tried pick up some definitions related to a unit that repair but the best I achieved was unexpected weird result like the hero inventory is empty if I add to hero definition the class "citizens".

Also in no way I found an entrance in the AI so you could add new behaviors.
 
Lol yes that's not a major changes of the game. I'm not sure what you can get with a much faster unit, and making walk faster is just to not feel them weird when they go lazily to shop as the kingdom is burning. :D
 
Can you give me a screenshot of the priestess levitating?
 
Lol yes that's not a major changes of the game. I'm not sure what you can get with a much faster unit, and making walk faster is just to not feel them weird when they go lazily to shop as the kingdom is burning. :D

I was thinking about Helia today. As it stands now they are very boring and a waste of a temple. Elves make better glorified rangers and they are cheaper too. What if you made them like Lunard's adapts were in the first game? The new patch is adding a "defending the realm" mode so you can make it a high priority for Helia on top of increasing their speed.

This would really help the people complaining about their town being overrun with rats and skeletons and it would give Helia an actual purpose. It would be even better if you could move their home to the guardhouse and make the temple a prerequisite for recruiting them. I would limit it to 1 archer per guardhouse and move the actual temple to a lv 2 palace requirement so they can actually be useful in defending the town. I would probably also nerf them so they weren't too powerful since you can get 4 or 5 guardhouses in a town.

So in the end we have Helia garrisoning guardhouses (when they go home to their guild) and we supply players with a way to actually enjoy watching their heroes on the frontier instead of babysitting their town. Could it work?
 
Yes I add similar thing in mind for Helia change. Well not changing model so keep them as long range units but faster than any other units plus a sort of long range teleport plus much more focus than other units into protecting buildings.

What you suggest has link but is rather different. There's two way to try do it:
  • Use global spawning to try have a temple build into spawn condition and try spawn heroes. Not sure at all that this will work and if it works the hero spawned will be probably chained to the tower, no shop and other.
  • Another approach would be to try to attract them more around some buildings, and make this very high for some like towers. For towers I had in mind to allow Heroes rest here too but perhaps this can be limited to Helia. Alas I don't think you can add a new behavior and behavior text like guarding towers. But the idea could be tried roughly.

I like this idea and put it on my list to things to try. :)

About nerfing, my plan is to nerf all temple heroes and dwarf and elf. Alas first tests show me that my initial plan to allow more heroes but weaker hurt to the flickering graphics problem. And I'm not sure of what I could do and what general gameplay I could aim.

I have in mind to make some temple opposite to reduce number of heroes and offer some more choices anyway. Negative conditions for building seems not possible or too approximative but perhaps a new friendly attack destroying in one hit friendly enemy temple will discourage players build opposite temples. :D Another possibility is to spawn a little god that destroy in one shot friendly enemy building.
 
Lol no that's fine, I'm not a graphic artist or a 3D modeler so there's nothing spectacular in anything I change and plan to change to make a mod. If I ever finish this mod I don't have any illusion, it will be for me, or eventually some coding and changes examples for few other. :D
 
Alas first tests show me that my initial plan to allow more heroes but weaker hurt to the flickering graphics problem.

Have you tried the unitbars file I uploaded? It completely eliminated flickering graphics for me and I tend to recruit a lot of heroes. I'm curious if those settings work for someone with only 2 gigs of ram.