Hey guys,
So I have been looking into modding the menu, rendering extra stuff, because I want to add my own Crusader Trail as a third trail. However, it is farm from easy to do so. But here are some progress:

Here you can see that I have cloned the First Trail, moved it to the right and set its data to the Warchest trail. These icons are ID based, so adding a 4th (First Edition, Warchest, Skirmish + new) is not as easy. My method of modifying menus is that I look up the array of buttons in the current menu, when it runs in the rendering function, I override the address of the array, I copy the whole array to a new location and add more items to the array.
At the moment, I have no idea how would I add new graphics for it, or how to assemble a whole new screen for the trail, but baby steps does it I suppose.
Maybe this menu rendering knowledge could be used to make a starting unit selection screen for the players in the Setup Identity screen.
thats great. I d love to have an interface, where you can setup your own trail, by linking your own missions/maps, which then get loaded one by one. So you dont just have the 'play a map' from the Scenario Editor, but actually a full Skirmish trail, that opens if you load that trail. So i mean, your trail might be nice and all, but i would love to have the opportunity to play as many skirmish trails as i want to put into the game myself. So the icon, beeing just this extra map wouldnt actually fit the idea of a moddeable trail that well. As it would probably be better to have some kind of menu to choose which trail you want to play.
Sorry rushed this comment out. I think this idea of puttingyour own trail into the game is definitly a great thing, and i am lookign forward onto playing that trail even with custom AI :D
@LordHansCapon I know this is unrelated, but could you please take a look at something that is VERY important for me? Look at issue #318 .
Hey guys,
Progress have been made regarding the menu modification.
Here you can see that I have moved the back button down (not final position, will be moved to the left) and added a unit icon. This icon is clickable and switches between archer, crossbowman, arabian archer, slinger and horse archer. This changes the starting units of the player, but while also setting a different count to them. So you can get 5 archers, 3 crossbowmen, 4 arabian archers, 8 slingers and 4 horse archers.

I will also add melee units. Keep that in mind that this only changes the units in the Normal and Deathmatch settings, as the Crusader setting has more melee units which are not settable for now. Until I make a totally new menu copying this one but with units:
Started with slingers here:

And it looks like this in menu:

@LordHansCapon Wow!!!
I wait you patch !!! Link pls...
@LordHansCapon Hope you won't just include ranged units. And you forgot fire throwers. I'd like my spearmen as starting units still :D
Or how about ... tunnelers? ;)
Edit: Did you overread my comment above your latest ones?
Would it be possible to set the vanilla groups?
As in 5 arab archers and slaves or 5 normal archers and spearman and have the units balanced.
So for 3 crossbowman i would say 2 pikeman as melee units would be good
Or for 8 slingers, 2 arab swordsman can work
Or for horsearchers, you could add 3 assassins :)
Maybe if you want, you could make one siege option:
5 engineers and 4 tunnelers, that sounds like a balanced starting troops option :D
For firethrowers, i could see like 3 firethrowers together with maybe 3 Maceman work?
Also what i would like to know would be, if this was useable for Multiplayer?
@Krarilotus you should not mix arabian and european units.
@Krarilotus you should not mix arabian and european units.
Ok fair, maybe then also slaves with firethrowers?
I could also immagine the melee troop only variant: 1 knight and 5 maceman.
Or the holy troop variant: 8 monks and one catapult
@ByBurton Sorry, I forgot to answer your question. I am not going to look into it now, maybe at a later date. Working on getting this unit selection done.
@Krarilotus I have no idea if it works in Multiplayer. If you are hosting, it probably does, but I don't know (as I didnt test it) whether it sets the other players' starting units or not.
Hey guys,
So I have the Melee unit selection, and added the fire thrower to the range unit selection.
So the selection is:
Ranged:
Melee:


The only problem I don't know how to solve is that currently there is no way to save the unit preference, so it just resets every time you restart the game. Also worth mentioning that selecting Arabian or Crusader lord no longer affects units, as you can now select them manually. Though the unit counts are fixed at the moment.
Having this in the menu, makes me think about adding the player color selection into this menu aswell.
So AI / human advantage does not affect the unit count?
Ranged:
5 Archer
3 Crossbowman
4 Arab Archer
8 Slinger
3 Horse Archer
3 Fire Thrower
Melee:
7 Spearman
4 Pikeman
5 Maceman
3 Swordsman
2 Knight
3 Engineer
5 Monk
6 Slave
5 Assassin
4 Arab Swordsman
this is definitly not balanced!
Slaves are not as strong as spearman, the balance came from having 5 arabian archers with them.
Same: 3 crossbowman beat 5 archers or 4 arab archers every time. The balance would come from having less melees, like 2-3 pikeman only. 5 Maceman are also way way stronger than 7 spearman and so on.
also yes, if the advantage setting was shifted, the units were also shifted. I would bind starting units as a ranged/melee combo pack or balance them properly.
But balance here is difficult, as if you put more units it can also mean more startin peasants.
but i would rather have less units overall, so lets propose this and discuss:
Ranged:
Melee:
In the end it doesnt matter much, as you are the one modding it and having control. but maybe just making the modability not ingame but out of game would be the best. So like a text file. where you could define all the starting units for players and/or for AI's.
So in this example, you would just cut the option out, to have different starting units for different lord types, and fix the starting units by default to one combination, of units you can pick yourself.
Then you can also set the scaling for the different gold advantage settings.
Okay, I have tested it, and it looks like AI/human advantage DOES affect unit count. It probably has a multiplier/divider on it, so its all cool. However, setting the game type to Crusader or Deathmatch means it uses a different array combination for the player, so it uses the default at the moment. I could always override those aswell though.
Its not meant to be balanced though, if you check the base game without mods, you get 7 spearmen as a Crusader lord and 6 slaves as an Arab.
Although I am the one modding true, I could always implement unit counts into the patcher via a slider for example. I don't make mods solely for myself, so any constructive comment is welcome!
Regarding saving the unit preference
Why not use one of the things that is preserved between restarts? Those are (from the top of my head): gamesaves, campaign progress, trail progress, trail year, chickens, lord name, settings like sound volume etc.
As a proof of concept you could encode troop settings into lord name.
Even better if you manage to automatically save it before closing game and read (and delete) after restarting. Some tinkering with invisible ASCI characters is also an option here (although it depends on how game handles rendering them).
Its not meant to be balanced though, if you check the base game without mods, you get 7 spearmen as a Crusader lord and 6 slaves as an Arab.
Yes, but the one with the slaves has at least 5 arab archers to make up for that. Not only 4 :) Thats exactly my point, they are balanced in combination, not alone!
Nice work!
At the moment, I have no idea how would I add new graphics for it, or how to assemble a whole new screen for the trail, but baby steps does it I suppose.
Adding a graphic to the game or make a new graphic, which can be put into the game? For editing/ generating new graphics, there is https://github.com/PodeCaradox/Gm1KonverterCrossPlatform
Let me throw in another idea regarding the menu:
Maybe one can replace the Historical Campaign Button (or adding it for Extreme) with a menu for user content. Adding a folder somewhere (Documents or Crusader path), where you can put user generated trails, read it out and display it like the historical campaigns or the Stronghold 1 campaign:
Kind of a low tech solution, but much more scaleable than adding a fourth icon for a single additional trail. Maybe it is also possible to add the nice graphical overview with the chicken, but any clean way to play a set of user missions would be amazing :)
Hey guys,
So I have ported the script into the patcher, and I wanted to make the unit count settable inside the patcher via sliders, but I can't find a way to reference a dynamically (patcher) allocated memory region from a different header. Anyone know how to do that? @Sh0wdown ?
Anyone interested in checking my latest changes, check my fork at https://github.com/LordHansCapon/UnofficialCrusaderPatch/tree/feature/custom_setup_identity_menu
Those who don't want to build the software:
WeTransfer.com link, lives for 1 week.
https://we.tl/t-vyYTnZyOMI
@LordHansCapon
Anyone interested in checking my latest changes, check my fork at https://github.com/LordHansCapon/UnofficialCrusaderPatch/tree/feature/custom_setup_identity_menu
Those who don't want to build the software:
WeTransfer.com link, lives for 1 week.
https://we.tl/t-vyYTnZyOMI
I have BUG !

I have Stronghold Crusade (English Version) 1.4.1 Steam.
My Config :
ucp.zip
P.S I updated Russian translation !
@Lolasik011 Thank you for the Russian translation! It looks like something has already overridden the menu my code is trying to override. Is there any mod you use which modify menus? I also use 1.41 Steam version.
Edit:
Just realized you are using Extreme, menu code must be different in Extreme.
Bad news, looks like the following blocks I made changes to can not be found in Extreme edition:
o_playercolor_ai_video_message_shield_enemy_taunt
o_playercolor_ai_allied_menu_emblem
o_playercolor_ai_allied_menu_attack_emblem
o_playercolor_ai_order_menu_emblem
o_playercolor_ai_allied_menu_ally_name
o_override_identity_menu
I will try to look for a common block for these, but as it stands now, most of the changes I made works only with Stronghold Crusader HD, but not with Stronghold Crusader Extreme HD.
@LordHansCapon I'll wait for the new patch...
@LordHansCapon dont worry abt the menu. I would rather have a functional than visual upgrade, as it has been done before, with the patcher. We could leave a grafics rework of the game to the devs, as they will probably release a definitve edition of it at some point in the future.
Do you have a priority list of what could be looked at for further modifications?
If not i ll collect some most mentioned issues and bugs to work on first.
But what comes to my mind right now, are 2 things:
When i am done with my current projects, i will use your guide to work on the things that i think are most requested and important for the users right now. But until then i ll rely on you and sh0wdown for the good work. Keep it up :D
dont worry abt the menu. I would rather have a functional than visual upgrade, as it has been done before, with the patcher.
I also prefer function over visuals, however I can fully understand, that he first wants to finish the graphical reworks as he currently has the knowledge (even with good documentation, if he returns in two months or later to do some visual upgrades, it will take way more time.
We could leave a grafics rework of the game to the devs, as they will probably release a definitve edition of it at some point in the future.
Do you have any reason to think this will happen? Firefly never done this before and I personally bet that something like a definitive edition will never happen. They also have currently two big projects, and are really small studio, so I think they won't have the resources to even think about this
- Importing configurations over different languages without loosing information ...
See issue https://github.com/Sh0wdown/UnofficialCrusaderPatch/issues/467.
- second i would say is: people want to collaborate or use the mod efficiently ...
See issue https://github.com/Sh0wdown/UnofficialCrusaderPatch/issues/452. Very controversial. Very different directions to go.
Just let the guys do whatever they prefer, every step towards a better game is nice (larger maps are the holy grail, though).
@J-T-de
https://www.youtube.com/watch?v=-wYSxse3NMs
5:30, for your question about definitive edition.
And wqhen asking them in comments, they seemed open for the idea as if they are working on it in the back of their heads.
-> last comment from me under their new years video:
https://www.youtube.com/watch?v=BJGQfG2Zvp8
Got most upvotes after channel owners comment by nick.
Hoping for larger maps will not end, but thats way more difficult :D
I think I have fixed the crashes regarding the playercolor blocks. Anyone interested in the build:
https://we.tl/t-ESWRv3Hkje
However, this build DOES NOT contain the identity menu changes. I need more time to fix that. If you happen to play the base game, you can check the link in my previous comment as that will work for you. If you play Extreme, you will have to wait for that.
@Lolasik011 @J-T-de @Krarilotus
I am usually playing extreme with GRhin on his stream each friday and sunday, if i got the time. And modding AI's also primarily for extreme. Tho the normal Crusader is the only game that can run Scenarios right now. Do you think, it would be possible, to run Scenario maps also in Extreme? That would be so cool, and also adding in a custom troop limit, which could be determined by the map creator and not by the games unit limit, that is hardcoded and bugs out peasant spawning and such.
I got the unit selection mod into Extreme, but we seriously need some way to apply different mods when its Extreme, because the spritesheet locations changed in extreme, along with a bunch of addresses which makes it way harder to create more complex modifications.
Currently I need to allocate button arrays twice into both exes because there is no way to tell them apart when the patcher is running. This means only a few KB difference of course, but its still unnecessary bytes. I also have to check every menu render cycle whether we are in Extreme edition or not, because then I need to use different addresses.
Please @Sh0wdown modify the UCP so we can use global labels (accessing labels from a different header) and some way to differentiate between Extreme edition and the base game.
Hi guys,
I have finally finished the unit selection integration into the patcher this time supporting Extreme edition. Although I am unsure about the version check, so could someone else also test the latest build and see if it works with the base game and the extreme version aswell? Thanks! Oh yeah, its on the "Other" tab.
Also would be useful to know how it affects multiplayer!
Latest build:
https://we.tl/t-5Dc7nmyjBC
@Krarilotus @Lolasik011 @J-T-de
@LordHansCapon Thank you for your great work man, it's nice to see such things implemented. 😊
Please @Sh0wdown modify the UCP so we can use global labels (accessing labels from a different header) and some way to differentiate between Extreme edition and the base game.
Can't you just copy the same label code to all headers?
@Sh0wdown I can not, I need that specific allocated address from a different header.
Also, any tips for creating multiple checkboxes and merging functionality? For example, I have overridden the menu renderer, but I also want to implement more menu changes, but in a different header.
In code it looks like this:
new BinAlloc("OverrideMenuRenderer", null)
{
0x66, 0x9C, // pushf
0xE8, new BinRefTo("IsExtremeToBool"), // call IsExtremeToBool
0x50, // push eax
0xB8, new BinRefTo("IsExtremeBool", false), // mov eax,IsExtremeBool
0x83, 0x38, 0x01, // cmp [eax],01
0x58, // pop eax
0x53, // push ebx
// Not extreme
0x75, 0x0D, // jne D
//region EXTREME
// Identity Menu
0x81, 0xFE, 0xA8, 0x13, 0x60, 0x00, // cmp esi,"Stronghold_Crusader_Extreme.exe"+2013A8
0xBB, new BinRefTo("IdentityMenuButtonArrayExtreme", false), // mov ebx,IdentityMenuButtonArrayExtreme
0xEB, 0x0B, // jmp B
//endregion
//region BASE
// Identity Menu
0x81, 0xFE, 0x98, 0x14, 0x60, 0x00, // cmp esi,"Stronghold Crusader.exe"+201498
0xBB, new BinRefTo("IdentityMenuButtonArray", false), // mov ebx,IdentityMenuButtonArray
0x0F, 0x85, 0x02, 0x00, 0x00, 0x00, // jne short 2
//endregion
// Move selected array address into esi.
0x8B, 0xF3, // mov esi,ebx
0x5B, // pop ebx
0x66, 0x9D, // popf
0xC7, 0x43, 0x14, 0x00, 0x00, 0x00, 0x00, // mov [ebx+14],00
0xC3, // ret
},
But what if the player don't want the Identity Menu override, but do want a different menu changed? How would you approach this problem?
Fixed a bug where the arabian lord's units would not get set.
Build is available at:
https://we.tl/t-INoGmjh7Uc
Hi guys,
In my latest experiment, I have implemented player color selection into the game:
This of course required cross-header label referencing and the rewriting of the player color blocks. It tooks some time, but it's worth it, as it is no longer required to quit the game and re-apply the patch to change color, you can just go to the setup identity menu and change it on the go.
The technical side:
Regarding the cross-header label referencing, at the moment it only allows to BinRefTo to BinAllocs as that is the most reasonable and needed change to the Patcher. When does it come handy? In this experiment I allocated 3 addresses which are player color related in the o_playercolor change, which is used by that change, but also used by my o_override_identity_menu change, thus I needed the reference the same address which was dynamically allocated.
BinAlloc is not forced to be globally accessible though, it can be only accessed if it was instantiated with the third parameter as true.
BinRefTo automatically checks GlobalLabels, but first it checks its parent Header's labels first, then the global one.
Before releasing this build, I have one more thing to solve. Which is the initial icon of the playercolor when first visiting the menu. Because it is never the same like the units when you boot up the game.
Tho the normal Crusader is the only game that can run Scenarios right now. Do you think, it would be possible, to run Scenario maps also in Extreme? That would be so cool
Actually, it IS possible to run scenarios in SHC-E - and even castle builder games - as has been discovered years ago:
http://stronghold.heavengames.com/cgi-bin/forum/display.cgi?action=ct&f=4,3889,60,720
https://www.strongholdnation.co.uk/article/163-custom-scenarios-freebuilds-in-crusader-extreme
That aside, amazing to see the progress you guys make! :)
You could think about copying parts of the invasion mode troop selection menu, the one with the sliders.
@LordHansCapon Have you looked into issue #318 yet? Or @J-T-de ?
Just thinking on the Starting Unit selection balance. Can we do a points system?
I.e. you have 48 points to use, and each unit has a defined value, I have found that the game records a weighted current units value already, and from my testing the values are as follows:
slave = 1,
Slinger=2,
A.Bow = 8
H.A=16
Assassin= 14
A.Sword = 20
Fire Thrower = 16
E.bow=5,
spear = 4,
mace=10,
pike=10,
xbow=10,
E.Sword = 30,
Knight=35,
engineer=5,
tunnellor=5,
monk = 8
If so, we would need to balance also that multiple units are stronger than fewer.
So we could do use the points and then add +1 cost for each unit chosen so far on the next unit.
I feel like that would be up to the user. if i wanted 2 HA, 2 engineers, and 1 slinger (bad for multiple) its not bad cos those are the units im likely to recruit with my starting gold anyways, i dont think a player that wants 24 slingers should be forced to get less because they are getting more of the weaker type. I cant imagine a scenario where selecting more cheaper/weaker/worse units would give an unfair advantage, or if it did, thats the cost of using your points for the expensive stuff.
I can imagine someone countering my 2 HA and 1 slinger with 48 slaves, i can move out and kill them earlier on, or i can spend some gold on more troops. ultimately once the dust settles i will be in the stronger position still.
I have the impression, you guys overcomplicate things. Your suggestions are nice and all, but is it really necessary to balance out these details to the last? You are still the player, you can still do whatever you want (and except if everyone in multiplayer agrees to choose the same starting troops, you can't use it in multiplayer). I really like the current implementation, it is simple, yet you are able to choose it to your liking. And if one combination is OP for you, just use it, or don't.
Side note:
laddermen and tunnelers are no valid starting troops, but therefore an unmanned fire ballista (but this could be changed)
Mate, this entire patch is "unnessacary" and "overcomplicated" but it
improves the game anyway. I am giving my preference. I would personally
prefer it to be balanced for multiplayer (which is what I play 90% of
the time) without defeating the purpose of having configurable start troops
(by telling ppl what they have to have). You dont need to agree with the
extent I ask for, but that doesnt mean that my request is not beneficial
for my situation.
As it stands an unbalanced unit selection feature is useless to me, for my
usage of the patch. Doesnt mean I should tell ppl they shouldn't ask for it
for their usage.
On Thu, 20 Feb. 2020, 2:53 am J-T-de, notifications@github.com wrote:
I have the impression, you guys overcomplicate things. Your suggestions
are nice and all, but is it really necessary to balance out these details
to the last? You are still the player, you can still do whatever you want
(and except if everyone in multiplayer agrees to choose the same starting
troops, you can't use it in multiplayer). I really like the current
implementation, it is simple, yet you are able to choose it to your liking.
And if one combination is OP for you, just use it, or don't.Side note:
laddermen and tunnelers are no valid starting troops, but therefore an
unmanned fire ballista (but this could be changed)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Sh0wdown/UnofficialCrusaderPatch/issues/504?email_source=notifications&email_token=ALGGWTS5Q5WZB45RAWS7LBDRDVIXNA5CNFSM4KI26SQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMIJPEY#issuecomment-588289939,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALGGWTVUFMRI4WEOXWGUEP3RDVIXNANCNFSM4KI26SQQ
.
This was not meant to be an offense. I implicitly excluded multiplayer from my argumentation, as in the current form, this edit is not compatible with multiplayer (except everyone in multiplayer agrees to the same startup troops, which is again balanced).
I agree that balance is needed for multiplayer, but I am rather sure, that with the current possibilities of the UCP, it is not possible to implement this feature for multiplayer (one workaround for two players exist, if they coordinate stuff beforehand, but then you can anyway agree on everything).
@LordHansCapon
Maybe we can try to hook the DDraw.dll with this https://github.com/elishacloud/dxwrapper
it allow us to run a Process or inject a custom .dll into the Crusader Process. With this we can maybe add new draw Code with a Custom dll. But I'm not 100% sure now, i just found out that we can run Crusader with Directx9 instead of DirectDraw(maybe Directx7).
For example i write a custom stream overlay for GRhin(this is just a test, had some issues that i cant overdraw old DirectDraw at first):

Mouseclicks get hooked with Windows inputs.
Hi,
I was wondering if maybe we could add oil-engeneers to the ranged starting units?
Hey,
The game has an array of starting units which does not include the oil engineers as far as I remember. So no, I don't think it is possible currently. It would require more work for a pretty low benefit.
Would be possible to add more than 16 AI characters by this method? As we already have AIC and AIV editors would be great to game other people AI's together with default characters without eliminating some of them...
This cheat table helps modifying buttons. Just hover over a button and "hover item" will show you where it is.
(Structures: Menu, Menu item)
Most helpful comment
Hey guys,
Progress have been made regarding the menu modification.
Here you can see that I have moved the back button down (not final position, will be moved to the left) and added a unit icon. This icon is clickable and switches between archer, crossbowman, arabian archer, slinger and horse archer. This changes the starting units of the player, but while also setting a different count to them. So you can get 5 archers, 3 crossbowmen, 4 arabian archers, 8 slingers and 4 horse archers.
I will also add melee units. Keep that in mind that this only changes the units in the Normal and Deathmatch settings, as the Crusader setting has more melee units which are not settable for now. Until I make a totally new menu copying this one but with units:

Started with slingers here:

And it looks like this in menu:
