How To: Compile WtP 4.1DLL from source ! 08.05.2024

Barra

Warlord
Joined
Oct 22, 2014
Messages
112
Hello folks,

I saw there is a commit on github regarding traderoutes, because its not yet in the build i wanna try compile it/the dll on my own. BUT Im struggeling with the how to.

Found:
&
&

But I dont get it, when I download the projekt from git, it refers to RaR is this intended (the rar.sln)

Would like if someone could reach a hand, helping me setting up VS


Edit: Go to Post 14
 
Last edited:
Did it as explained on the wiki, download the current git, placed it into the mods folder of colo4 (install path not at documents) , started the compiler.bat, it downloaded to installpath/mods/compiler
But when i started the compile.pl it had no association to the perl extenbsion, so i downloaded strawberry perl from here: https://strawberryperl.com/
Afterwards I were able to start the compile.pl script, but it quits with the error above :/
(Hadnt done any change to the dll files yet, this compile was the first try just compiling the basic 4.1 dll source files)
 

Attachments

  • CompileIssue.png
    CompileIssue.png
    30.6 KB · Views: 40
Last edited:
Ehhmm was at master sry, now on dev it adds one more line of errors, sry
 

Attachments

  • CompileIssueDev.png
    CompileIssueDev.png
    46.2 KB · Views: 44
Last edited:
I have not really a clue, but could the missing slurp beeing related to using strawberry perl ?
Think read something MIGHT be related to it?!
 
I have not really a clue, but could the missing slurp beeing related to using strawberry perl ?
Think read something MIGHT be related to it?!
atleast this way i was now able to install slurp

but the compile.pl still does not find slurp...
 

Attachments

  • CompileIssue3.png
    CompileIssue3.png
    106.7 KB · Views: 50
Last edited:
That's really weird. I have slurp.pm at C:\Strawberry\perl\vendor\lib\File\Slurp.pm and to my knowledge it should be there by default when installing strawberry perl. I have intentionally never added anything other than what comes with the installer precisely to avoid this situation.

It's also weird that master failed to compile. Master is the last release and it shouldn't be a surprise that the newest release is actually able to compile.

atleast this way i was now able to install slurp
https://www.geeksforgeeks.org/perl-slurp-module/
but the compile.pl still does not find slurp...
Sounds like a path issue. Maybe restarting will fix it and maybe uninstalling strawberry perl, deleting the folder (if it didn't by itself) and then installing it again might help. It should set up paths by itself, but it looks like something went wrong while installing.
 
Small Hint:
Make sure Strawberry Perl is installed on C:\.
There may be problems otherwise. (Already had that in the past.)
 
Didnt get the missing slurp notification when trying to compile the master, but still the szArtDefineTag error.
I also found when i try to compile in VS2022, it seams to take the perl.exe from git (is this the same, or should it be the one from strawberry, im confused

Its directly on drive C, as we can see in the screenshots (and thanks for taking a look ;) )
StrawberryC.png
 
Last edited:
Ok it seems indeed related to git(Or a VC++Redist package), so i removed git, removed the downloaded compiler mod, deinstalled VS2022 and its redists, deinstalled strawberryperl(had done this already once before) reinstalled VS2017, used compiler bat for download, now that there was no git anymore i got the expected consolemessage from the compiler.bat, regarding strawberry (didnt got this before) , installed strawberry.
Hmm but somehow i have 2 perl installs now... neither find any at MS apps&*features.
The strawberry one quits without any error, right after choosing a compile option in the console (tried 2 and 6)
The one NOT from Strawberry atleasts starts to compile the master now, but still puts out an error
Edit:
This exact error (WHILE compiling) just apperead once :/ afterwards it just closed the console window...
 
Last edited:
Without GIT and Perl installed





with GIT but without Perl installed
(same as without GIT but Strawberry already installed)


So the compiler.bat and then i assume therefor the rest, does find/use the perl.exe included in the GIT release as default?!


installed this: strawberryperl as MSI: strawberry-perl-5.38.2.2-64bit




as soon as i hit enter after selecting 2 or 6, the console window immediatly closes (yet again other behaviour then before, before i atleast get an error message and was even already compiling it ONCE until another compile error appeared, this was with an unknown perl install, i cant really remember where its origin was from ;/)
clearly i do something wrong and need your help please, Im out of ideas...

Edit:
In VS2017 it starts compiling now but throws the following errors:



basically the same as the rar.log tells me after the console window immediatly closed:



so dont know do i really something wrong or is the 4.1 release not beeing able to compile (atleast not when the setup for it is done past last oct. ?! )

I think i will install a new virt.Machine just to test this, Im suspicious somehow...
 

Attachments

  • withoutgitandperl.png
    withoutgitandperl.png
    21.2 KB · Views: 11
  • withgitbutnotperl.png
    withgitbutnotperl.png
    14.5 KB · Views: 10
  • without GIT but strawberry.png
    without GIT but strawberry.png
    13 KB · Views: 12
  • vs17CompileError.png
    vs17CompileError.png
    37.2 KB · Views: 10
  • rar.log.png
    rar.log.png
    56.4 KB · Views: 8
Last edited:
Ok now, step by step, up2date win10, clean install

Step 1, nothing installed then the redistributables for civ IV as contained on last realease, colo4 confirmed running, path: C:\Games\Civ4Colonization including empty mods folder in it.

Project Colo4 FreshStart 1.png





Step 2, without installing GIT first, the recommended tortoisegit wont work, so I installed GIT (skipped the idea of using gitHub-desktop)

Project Colo4 FreshStart 2.png


Project Colo4 FreshStart 3.png




Step 3, GIT is installed and the wtp git is cloned to Civ4Colonization\Mods\TortGit-WTP, as expected the 'get compiler.bat' this time does ask for strawberryPerl (despite GIT is installed, so this was bad on the old machine).

Project Colo4 FreshStart 4.png




Step 4, strawberryPerl MSI is installing just fine

Project Colo4 FreshStart 5.png



Step 5, strawberryPerl is installed, compile.pl is executed, but......unfortunally :undecide:is the result the same, console just quits completly, no additional folder created (the one for the compiled dll) so this means also no rar.log

Maybe I should now install Visual2017 too...

Project Colo4 FreshStart 6.png
 

Attachments

  • Project Colo4 FreshStart 6.png
    Project Colo4 FreshStart 6.png
    282.9 KB · Views: 1
  • Project Colo4 FreshStart 2.png
    Project Colo4 FreshStart 2.png
    409.8 KB · Views: 1
  • Project Colo4 FreshStart 1.png
    Project Colo4 FreshStart 1.png
    308.6 KB · Views: 1
  • Project Colo4 FreshStart 1.png
    Project Colo4 FreshStart 1.png
    308.6 KB · Views: 3
Last edited:
Step 6, installed Visual Studio 17
Project Colo4 FreshSTart 7.png



Step 7, VS17 installed, running RaR.sln, VS17 is starting it...

Project Colo4 FreshSTart 8.png


Step 8, ...and finally compiling the 4.1 masterbuild...:thumbsup::goodjob:
I assume the popup isnt really interesting, just check for the dll beeing placed into mods assets folder, link the mod folder in civilizationIV.ini, and start the colonization main executable
Project Colo4 FreshSTart 9.png

Project Colo4 FreshStart 10of10.png



Finally it worked, did take me way longer then expected, but atleast now there is a detailed guide, including all must haves and their vers.Numbers as of today 08.05.24
:hammer2::bowdown::woohoo::salute:
 

Attachments

  • Project Colo4 FreshSTart 8.png
    Project Colo4 FreshSTart 8.png
    184 KB · Views: 3
there is a commit on github regarding traderoutes

@Barra did you do this originally to provide a hotfix that improves traderoute performance?

If so did it work for you and can you maybe provide the resulting DLL for other peoples?
 
I did this primarily because of bobisbacks commit about extra button in the traderoute windows for importing domestic goods and build materials, in the meanwhile i added rope and sailcloth to the mataerial button + adding 2 other buttons, military goods aswell as livestock.
Im afraid Im not skilled enough to hotfix any performance issue :)
But yeah now that Im able to compile, I will for sure do one thing or another.
I could provide the dll if this is legal but i did nothing in regards to performance, just the dev build + bobisback import changes commit which i extended a bit

I wish someone of the real pros here like nightingale or devolution would approach the task to do a better TR system, this is especially in regards to performance the most needed for this gem :)
 
Last edited:
The game is perfect except traderoute performance. I am currently watching one 40 minute Netflix episode between each turn. But I guess its not easy to change so appreciate what's done here anyway. Makes no sense that it takes so long but I know legacy software from work and its the worst. Ppl deserve praise for getting this version up
 
so long i dont have to wait :D but its ...i think because of a 12core cpu i use
 
Only got 8 core Ryzen but I love that if I ever run out of reasons to live I am still not ending myself because I want to live long enough to play some Dwarffortress lategame save at 60+ FPS or some other oldschool strategy title that's more CPU hungry than broken Moores Law could ever deliver.
 
Back
Top Bottom