induktio / thinker

Improved game engine features for SMACX.
https://discord.gg/XdFuwWzzku
GNU General Public License v2.0
75 stars 10 forks source link

Regenerate patches for mingw so it works again #50

Closed hartmark closed 1 year ago

hartmark commented 1 year ago

I couldn't run ./tools/compile/mingw-compile.sh

This makes it work again.

induktio commented 1 year ago

Did you happen to have old Makefiles in the folder before running it? I was able to make it compile develop builds from the latest master commit without issue on debian stable. This update breaks the compile script for me because hunks #1 ... #4 will fail patching on Makefile_dll. Is this dependent on the compiler toolchain version or something else?

hartmark commented 1 year ago

I'm on arch Linux so it's probably a newer compiler. I can check out later tonight

induktio commented 1 year ago

That patch file also seems to list some individual source files. There might be some issues in this setup if lots of files in the codeblocks config get moved and the patch references lines that are too dissimilar. I'm also working on a large code refactor which should add some new files.

induktio commented 1 year ago

Any ideas how to proceed here? I suspect it still has the issues since I haven't changed the configuration much. It would be good to have debian based distros supported at least.

hartmark commented 1 year ago

Sorry for the delay, I've been busy with work.

I just tried to run: % ./tools/compile/mingw-compile.sh from the master branch and it seems to work well.

It seems that past-me was a bit unclear what issues I had when trying to run it before. The computer I had the issue on is formatted and my daughter has it now :/

Regarding any future refactorings: Yeah, that would probably break stuff with this approach of running a tool to generate Makefiles from the Code:Blocks project file and then apply some touch-ups of the makefiles before compiling.

I haven't used Code:Blocks for ages but I guess a simpler way would be to use Code:Blocks in commandline to build the files.

hartmark commented 1 year ago

Alt-t seems to no longer work so how can I be sure that thinker is really loaded? The logs doesn't say anything.

Did a fast git bisect and one of these commits seems to break the alt-t: image

I got the error about failing to apply the Makefile patches for the ones marked with skip.

I guess I could get the code that fixed that issue with another bisect but it's time for bed now so I can check that another time if you need help to narrow down the commit.

induktio commented 1 year ago

If you have PRACX loaded at the same time, Thinker's shortcut gets changed to ALT+H. This is because PRACX already used ALT+T so it was changed in commit "Alternative mod menu shortcut". Other than that I don't think anything meaningful was changed with the keyboard shortcuts. Sometimes on Windows there's an issue where ALT+T doesn't work when the game is first started but it works when immediately restarting the game with same settings. The cause for it is currently unknown. Regardless of anything else, whenever Thinker is loaded, the original game version menu should show the mod version (Menu > Help > Show Version Number).

hartmark commented 1 year ago

Cool. ALT+H seems to show the thinker popup. Was thinking it didn't get loaded as I didn't get thinker options to show then using ALT+T.

However, the readme refers to ALT-T in step 5 https://github.com/induktio/thinker#installation

Another thought I have is to get the thinker.dll linked into thinker.exe so we just need to add one binary in the SMAC-folder.

induktio commented 1 year ago

There seems to be a lot of requests regarding PRACX compatibility. I would have probably merged rest of the PRACX features into Thinker long time ago, but some of it is written in such a non-portable way that it relies extensively on patched code thunks in unusual places. It would have to be checked on a debugger almost line-by-line to get an accurate idea how the patches work so they could be rewritten.

Regarding thinker.dll linking thinker.exe doesn't actually run it itself, it just spawn a new game process which is modified to use thinker.dll to run the startup routines. So I think the dll has to be a separate file for it to work.

hartmark commented 1 year ago

I'll close this PR now as everything seems to be working at the moment on linux without any code-changes