HOWTO: Play using the Windows lobby with native executable - Page 2

HOWTO: Play using the Windows lobby with native executable

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

CautionToTheWind
Posts: 272
Joined: 30 May 2006, 17:06

Post by CautionToTheWind »

Ok, i've redone all the steps from scratch after cleaning up the previous attempt and now it works flawlessly. Thanks for the help, Det.
nicko117
Posts: 19
Joined: 30 Nov 2006, 10:33

Post by nicko117 »

Hum ...

Launching of native spring seems to work, but it doesn"t use the command line parameter:

In fact I get the game launched as if I launched it with "spring" (linux) only.

> ./spring

I have the screen where I must choose the script to run, then the map and the mod ...

Where is my fault ....
CautionToTheWind
Posts: 272
Joined: 30 May 2006, 17:06

Post by CautionToTheWind »

It seems spring is missing a file called script.txt. You have to link it from the windows lobby client directory to the linux native spring directory. Look for that step in det's instructions and make sure you did it right.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Yes, simply create a symlink script.txt inside the directory from which Spring reads its files (SpringData in .springrc) to the actual script.txt that gets generated by TASClient.
nicko117
Posts: 19
Joined: 30 Nov 2006, 10:33

Post by nicko117 »

Yes !

Nice it works now :)

Thank you a lot.

PS: but there is a little problem when using bot. The AI files are named ".dll" in script.txt, so the file isn't found when running the native linux. I'll try to symlink my .so to fake .dll to see what it do ...
User avatar
det
Moderator
Posts: 737
Joined: 26 Nov 2005, 11:22

Post by det »

Let me know if sym-linking the .dll to the .so works. If it does, I will add it to the guide.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

Adding some logic to the dummy spring.exe (modifying script.txt) should work, right?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Well, in order to properly replace each "AiDLL=\a\b\c\myAI.dll" reference with one like "AiDLL=/d/e/f/myAI.so", you would first need to know Spring's data directory. However, opening ~/.springrc or $HOME/.springrc to read the SpringData line is problematic because fopen() does not expand the tilde or variable (that's the shell's job), and since stuff like chdir("~") or getenv("HOME") doesn't work as normal under Wine (getenv("PATH") returns "c:\windows\system32;c:\windows" for example), there's a minor roadblock. :)

Edit: scratch all that, getenv("user") does the trick. :)

Edit2: here is a modified version of the Spring dummy binary plus source, please let me know if it crashes or otherwise misbehaves. :)
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

That works well, thanks :)
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

For those of you running TASClient in wine...

If you find that TASClient is misbehaving, and ignoring that which
your window manager would have it do; stick it in a box. I found that
TASClient (in wine), ignores its virtual screen assignment, and is
generally annoying, so I started up an Xserver within my Xserver:

Code: Select all

Xnest :1
And then put TASClient in that server.

Code: Select all

DISPLAY=:1 wine TASClient
P.S. I also have a custom server/client set written that allows you
to escape from a 32-bit chroot to a 64-bit native executable space.
The mingw32 compiled Spring.exe sends the entire starting script
to the server (daemon). With very little work, you could have the
TASClient run on a real (separate) windows box, and clients on a
linux box (although I can't really see any reason for that :-)
Last edited by trepan on 03 Dec 2006, 18:26, edited 1 time in total.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

well, I can: total independence from Wine ;)
Last edited by Kloot on 13 Aug 2007, 17:09, edited 2 times in total.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

Yeah, hollowsoul could use some help with the lobby :)
User avatar
kujeger
Posts: 91
Joined: 07 Oct 2004, 14:46

Post by kujeger »

EDIT: With the newest version of the windows lobby, this doesen't work anymore.
edit again: http://spring.clan-sy.com/phpbb/viewtop ... 940#160940

Unless I'm missing something there's no need for a faked spring.exe.

First, install spring with wine. Substitute ~/.wine/drive_c/games/TASpring/ for wherever you install it to.
Substitute ~/games/spring for wherever you put the ./game/ dir after you compiled spring-linux.

Then, let's copy over TASClient.

Code: Select all

cd ~/games/spring
cp ~/.wine/drive_c/games/TASpring/TASClient.exe ./
cp ~/.wine/drive_c/games/TASpring/DevIL.dll ./
cp ~/.wine/drive_c/games/TASpring/MSVCP71.DLL ./
cp ~/.wine/drive_c/games/TASpring/MSVCR71.dll ./
cp ~/.wine/drive_c/games/TASpring/unitsync.dll ./
cp ~/.wine/drive_c/games/TASpring/zlibwapi.dll ./
Then, the (non-free) datafiles.

Code: Select all

cp ~/.wine/drive_c/games/TASpring/base -r ./
cp ~/.wine/drive_c/games/TASpring/maps -r ./
cp ~/.wine/drive_c/games/TASpring/mods -r ./
and lastly we make a symbolic link.

Code: Select all

ln -s ./spring ./spring.exe
wine TASClient.exe
and you're good to go. Or should be anyway, I tried a small match against myself between spring-linux and spring-wine and it worked fine as far as I could see.

edit: Assuming 32-bit here.
Last edited by kujeger on 23 Jan 2007, 23:02, edited 2 times in total.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

^^ Confirmed to work on amd64.
nicko117
Posts: 19
Joined: 30 Nov 2006, 10:33

Post by nicko117 »

Oh btw, I confirme also, that symlink the AI*so to fake AI*dll work. At least for AAI.so which is the only one which is avaiblable/compiled with SVN.

> ln -s AII.so AII.dll
Nonor
Posts: 19
Joined: 28 Dec 2006, 01:21

Post by Nonor »

All this is working, yes, but I have a problem... Is it me, or is the linux version slower than the windows one ?
I don't know if this has anything to do with the windows lobby emulation via wine, but my game is quite slower under linux as soon as there's a lot of units and/or animation on the map. I've already reniced the "TASClient.exe" process to 19.
This annoys me a lot. Is that a known problem ?
own3d
Posts: 129
Joined: 25 Aug 2006, 16:31

Post by own3d »

did you not compile it with optimisations?

or worse did you do a debug ;) ?
Nonor
Posts: 19
Joined: 28 Dec 2006, 01:21

Post by Nonor »

hemmm.... I tried with a svn version that i had compiled myself. And YES I didn't compile it with optimisations.... :-/
How can i do that pleeeease ? :-)
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Post by hollowsoul »

Code: Select all

scons optimize=2
Nonor
Posts: 19
Joined: 28 Dec 2006, 01:21

Post by Nonor »

Code: Select all

profiling NOT enabled, debugging NOT enabled, level 2 optimizing enabled
Looks like it was alright... :-/
For all of you, linux version is working as fast as windows version ?
Post Reply

Return to “Linux”