UnofficialCrusaderPatch2 icon indicating copy to clipboard operation
UnofficialCrusaderPatch2 copied to clipboard

Read in and apply certain changes at runtime instead of hardcoding them at UCP install time

Open Heroesflorian opened this issue 4 years ago • 5 comments

The way the UCP currently works is by patching different values for various settings into the Crusader executable directly at UCP installation time (e.g. overriding AIC parameters, start resource settings (upcoming feature) and other stuff), which essentially hardcodes those changes into the exe. This means changing any of those settings will require exiting the game, then reinstalling the UCP, potentially deal with antivirus false alarms subsequently, then restart the game and hope it all worked.

If we compare this to some other aspects of the game - which already are configurable by the user without the UCP - and how they are handled (such as AIVs, maps, savegames, skirmish trail data (most prominently the extremeTrail.csv)), then we notice that the Crusader executable reads those things in at application startup time and/or at runtime when accessing relevant ingame screens. This means users can add new maps, change AIVs, etc, and can directly use them ingame immediately, or at most need to restart Crusader once for some of them to take effect. That makes it a lot less cumbersome, error-prone and time-consuming to change those things.

Now, coming back to the UCP, I wonder if the UCP could - instead of patching in modifications of settings values directly into the Crusader executable - patch in modifications in the form of adding a function to the Crusader executable, that is then called during game startup or at runtime and loads modified settings values from a cirresponding file, similar to how it is done for AIV files, skirmish trail files etc.

This would make it easier to change certain settings without having to reinstall the UCP every time.

It may sound difficult to implement such functionality at first glance, but the vanilla game already does the same thing for certain aspects of the game, so it should be quite feasible actually. It may be more useful for some settings (frequently changed ones) than for others.

Heroesflorian avatar Mar 26 '20 00:03 Heroesflorian

How hard to implement this depends on how things are done in the code and how easy one can adapt them. @PodeCaradox already identified some of the file-loading functions, maybe he has an idea?

But in general I think this is gonna be rather hard to achieve with the methods the UCP uses. It would be really easy to do something like that with CheatEngine and other high-end tools...

J-T-de avatar Mar 26 '20 06:03 J-T-de

I found this in the Stronghold version 1.41Adress:0x46C4E0 grafik It reads this at Stronghold startup. Maps i think will be loaded on Screen change to Map Selections.

But maybe we can call that Method somehow to load other AIVS for rat at start of the game. This will need a Second Program that hooks to the Stronghold.exe Process and apply changes to it like Cheat engine do.

PodeCaradox avatar Mar 26 '20 08:03 PodeCaradox

A reasonable attempt for this I'd say is to make the crusader executable load some kind of UCP.dll which then does all the things.

Sh0wdown avatar Mar 27 '20 08:03 Sh0wdown

Hallo guten Tag ich habe mir euren Patch runtergeladen aber es funktioniert irgendwie nicht ich bekomme ständig beim Installieren eine Fehlermeldung weil ich hatte schon mal eine vorherige Version runtergeladen gehabt die hatte damals funktioniert aber leider existiert sie nicht mehr das war genau die Hotfix Version 2.15a-7. Mai 2021 die hatte ohne Probleme funktioniert aber nur jetzt die aktuelle funktioniert nicht und ich schicke euch ein Bild von dem Fehlermeldung Unofficial Crusader Patch (UCP)v2.15b

MuratBoss avatar Dec 27 '21 11:12 MuratBoss

Hi, erstmal ist das hier der falsche Ort für diese Frage (das hat nichts mit der vorrangegangenen Diskussion zu tun). Immer gerne einen neuen Issue erstellen ;)

Kannst du den Fehler genauer beschreiben oder den angeteaserten Screenshot schicken? Sonst können wir dir nicht helfen. (Am schnellsten bekommst du normalerweise Antworten über Discord).

J-T-de avatar Dec 29 '21 15:12 J-T-de