Clockwork Empires

Clockwork Empires

View Stats:
dragonfyre13 Apr 18, 2015 @ 9:08am
Making the latest update (start to) work on linux
Wanted to drop this here as I noticed Clockwork Empires actually downloaded something, figured I'd give making it work a shot (I'm running on linux).

First, ran the game from steam and it couldn't find the executable. So trying to run it from the commandline (go to browse local files in game properties, then open a terminal there). The amd64 version is the only one loaded, but I've got a 64bit kernel so that's fine for me.

Needed to do an "apt-get install libsdl2-2.0-0 libsdl2-ttf-2.0-0" to grab those two libraries, they were missing for me (just starting the game pointed to the library files being missing). It seemed to pick them up in the default install path, so no ld_preload or symlinking annoyances needed.

Ran again, it needed Copied from another game I had loaded, but of course the first time I copied a 32bit elf. Deleted it and copied a 64bit version over instead. To find one and copy it to the current directory, presuming you have another game with a 64 bit version of the library already installed (starting in the "browse files" install directory of Clockwork Empires):

find ../ -name -print0 | xargs -0 file | grep "ELF 64-bit LSB" | cut -d: -f1 | tail -n1 | xargs -d\\n -i echo cp \"{}\" ./

For you awk lovers out there, yes this could be done much more efficiently in awk but I didn't feel like writing up an awk script right now...

Next, running it goes fine at the initial menu. Click start game however, and it dies with an undefined error. strace is our friend here.

strace ./ClockworkEmpires-amd64

Tons of stuff will puke to the commandline, but it will (slowly) get to the menu it died at before. Click "Start Game" again, and it will die once more, this time with tracing information. This is what the end bit looked like:

recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\1\0006\1\2\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 40
recvmsg(3, 0x7fffda073de0, 0) = -1 EAGAIN (Resource temporarily unavailable)
open("./", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(12, "[MISC] CRITICAL ERROR: unable to"..., 165) = 165
--- SIGTRAP {si_signo=SIGTRAP, si_code=SI_KERNEL} ---
+++ killed by SIGTRAP (core dumped) +++
Trace/breakpoint trap (core dumped)

Notice the "open" call that ends with "No such file or directory"? It's pointing at another library, this time And it's looking in our current directory. Let's move that in the current folder (you'll need libopenal installed of course, but I already had it there. if you're missing it, try here {LINK REMOVED}:

ln -s /usr/lib/x86_64-linux-gnu/ ./

Then Clockwork Empires will at least start up, get through the main menu, and run without serious explosions on startup.
Last edited by dragonfyre13; Apr 18, 2015 @ 9:55am
< >
Showing 1-8 of 8 comments
dragonfyre13 Apr 18, 2015 @ 9:09am 
FYI - I also fixed the steam_appid.txt file by running:

echo "224740" > steam_appid.txt
dragonfyre13 Apr 18, 2015 @ 9:21am 
Note, this gets you only to the choice of colony, after this it will continue crashing on filename case sensitivity. To see which file it's failing on, you can run under strace again. Here's the ones I found intiially, I'm sure there are several hundred more:

mv models/character/animations/bipedPistolfire.upa models/character/animations/bipedPistolFire.upa

mv models/character/animations/bipedAttentiontoStand.upa models/character/animations/bipedAttentionToStand.upa

mv models/character/animations/bipedAttentiontoCombatStand.upa models/character/animations/bipedAttentionToCombatStand.upa

dragonfyre13 Apr 18, 2015 @ 9:54am 
Note, even after some hacky workarounds using ciopfs (case insensitve fuse mount), it appears there's some kind of bug reading from fonts/ClarendonCn.ttf, specifically:

terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr

So still not really working even after resolving case sensitivity and missing libraries. But closer and closer we come.
dragonfyre13 Apr 18, 2015 @ 10:06am 
For those who would like to replicate the ciopfs stuff I did, you'll need to install it (it's loaded as an ubuntu package, easy enough), change all filenames in the "Clockwork Empires" folder to lowercase, then move the "Clockwork Empires" folder in it's entirety to ".Clockwork Empires" and then mount a new "Clockwork Empires" folder in the common folder as a case insensitve fuse mount with ciopfs (starting from the Clockwork Empires folder, doing the below):

find -depth -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;
cd ../
mv Clockwork\ Empires .Clockwork\ Empires
mkdir -p Clockwork\ Empires
ciopfs .Clockwork\ Empires Clockwork\ Empires
cd Clockwork\ Empires

After this, it will work-ish, but then run into errors attempting to read from some font files. It looks like specifically from fonts/ClarendonCn.ttf, though that could be a red herring of a problem, indicitive of something larger like line ending differences or something.

Note, you'll need to remove all local files and remove both the Clockwork Empires and .Clockwork Empires folders after you're done, then reinstall from steam in order to revert.
Last edited by dragonfyre13; Apr 18, 2015 @ 10:07am
Nicholas Vining  [developer] Apr 18, 2015 @ 6:22pm 
Yeah, I've fixed a few of these locally. :)
oh boy, exciting news! can't wait for iiiiiiiit!
dragonfyre13 Apr 19, 2015 @ 9:50pm 
Great to hear. Can't wait to try out the build once it's pushed.
Clément Mar 29, 2016 @ 5:55am 
Any news about this? It is almost one year old.

For the file name case problem, I use a little script to create symlink (some files are referenced with different names, so moving is not a good solution):
#!/bin/bash find . -name '*.xml' | while read xmlfile; do for file in $(xmllint "$xmlfile" --xpath '//@file' 2> /dev/null); do eval "$file" file=$(sed -e 's/\\/\//g' <<< "$file") if [ ! -e "$file" ]; then oldfile=$(find . -type f -ipath ./"$file") [ -n "$oldfile" ] && ln -sv $(basename "$oldfile") "$file" fi done done

The output on my installation is:
« models/character/animations/bipedPistolFire.upa » -> « bipedPistolfire.upa » « models/character/animations/bipedPunchBlocked.upa » -> « bipedPunchblocked.upa » « models/character/animations/bipedAttentionToStand.upa » -> « bipedAttentiontoStand.upa » « models/character/animations/bipedAttentionToCombatStand.upa » -> « bipedAttentiontoCombatStand.upa » « models/character/animations/bipedAttentionToCombatStandRifle.upa » -> « bipedAttentiontoCombatStandRifle.upa » « models/character/animations/bipedChoptree.upa » -> « bipedChopTree.upa » « models/character/animations/bipedChoptreeStart.upa » -> « bipedChopTreeStart.upa » « models/character/animations/bipedChoptreeEnd.upa » -> « bipedChopTreeEnd.upa » « models/character/animations/bipedChoptreeLoop.upa » -> « bipedChopTreeLoop.upa » « models/character/animations/dressPistolFire.upa » -> « dressPistolfire.upa » « models/character/animations/dressPunchBlocked.upa » -> « dressPunchblocked.upa » « models/character/animations/dressStareAtSea.upa » -> « dressStareatSea.upa » « models/character/animations/quaggarothExamineBelow.upa » -> « quaggarothExaminebelow.upa » « sfx/vehicles/steamKnightWalkloop01.wav » -> « steamKnightWalkLoop01.wav » « sfx/vehicles/steamKnightWalkloop02.wav » -> « steamKnightWalkLoop02.wav » « sfx/CF_footsteps3.wav » -> « CF_Footsteps3.wav » « fonts/ClarendonCN.ttf » -> « ClarendonCn.ttf »

Then, I get the same exception as dragonfyre13
Game base dir is '/home/clement/.local/share/Steam/steamapps/common/Clockwork Empires/' Setting breakpad minidump AppID = 224740 Steam_SetMinidumpSteamID: Caching Steam ID: 76561197983471242 [API loaded no] terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr Abandon (core dumped)

I don't think it is related to fonts/ClarendonCn.ttf, the last file opened according to strace is ui/tooltips/commandTooltip.xml for me.
< >
Showing 1-8 of 8 comments
Per page: 15 30 50

Date Posted: Apr 18, 2015 @ 9:08am
Posts: 8