Game Development Community

dev|Pro Game Development Curriculum

Torque 3D 1.1 Beta 3 Linux Patch

by Fyodor -bank- Osokin · 11/19/2010 (9:37 am) · 17 comments

Hello everyone.

If you want to run a Torque3D server on Linux - this resource is for you!

Download patch:
T3D11B3 Linux Dedicated for GIT
T3D11B3 Linux Dedicated for SVN
Patch should be applied to the clean/stock T3D 1.1 Beta 3 installation.
Only "Full" template is changed/adopted to work on Linux.

Note 1
Torque3D is not compatible with latest GCC, so this one is working only with GCC4.1

The main requirements are still the same as with building TGE on Linux.
You need to have installed MESA/SDL/Vorbis/Theora and "nasm" (this one for .asm compilation).
On openSUSE its:
Mesa-devel
libtheora-devel
libvorbis-devel
SDL-devel
nasm

That should be enough, if I haven't missed anything.

Note 2
You will need to apply patch for both - the server sources and client (on Windows/Mac).

In order to "make it working" - after applying patch ofc - you will need to run generateProjects.command:
1.
> chmod +x generateProjects.command
> ./generateProjects.command
or:
2.
> sh generateProjects.command

it will generate makefiles.
So, the overall steps:
> cd Templates/Full/
> chmod +x generateProjects.command
> ./generateProjects.command

> cd Templates/Full/buildFiles/Make_Ded
> make debug
> make release
> cd ../../game
> ./Full -dedicated -mission levels/mylevel.mis

All of this doesn't work if you use "My Projects" folder for your projects.
I've changed it to "Projects" and all is working fine.
Keep in mind that you also can't load mission which file name contains spaces (like "Empty Terrain.mis"), so use something like EmptyTerrain.mis

My main dev pc is openSUSE 11.1 (x86) - that's the OS I stick with to host our game.
Haven't tried to run on newer releases (11.2/11.3). Once (about a year ago) I've got it running on Kubuntu - but don't remember on which version.

Another note: in order to get faster compiling, change the "OPTIONS := --jobs=X" where X is the amount of cores on your Linux box. In my patch by default it's set to 4 (using C2Q Q9550 processors on all of our servers). See Tools/projectGenerator/templates/makeSolution.tpl.

Huge thanks goes to the whole Torque team and specially to Rene and Tom - they helped a lot in getting T3D on Linux. Since T3D 1.0 a lot of fixes was applied to engine only to get this working. This is why my "patch" is so small. :) Thanks guys!

See this thread for the initial release of this.

--------------------------------------------

List of supported* Linux distros:

* used to host T3D11-powered games by the community

  • openSUSE 10.2 x86
  • openSUSE 11.1 x86 (2.6.27.56-0.1-pae, 2.6.27.11-ovz-1.43-pae)
  • openSUSE 11.3 x86 (2.6.34.7-0.7-desktop)
  • Archlinux 2010.05 (2.6.33.4)
  • Debian 6.0 Linux Squeeze (2.6.32-5-amd64)
  • FreeBSD 7.2 RELEASE (not Linux, but still it works)

#1
11/19/2010 (10:19 am)
Cool stuff, thanks for your linux work! :)
#2
11/19/2010 (10:28 am)
Excellent, thanks so much!
#3
11/19/2010 (11:21 am)
Great job, Bank. It will save everyone money on server hosting. Thank you very much!
#4
11/20/2010 (5:24 pm)
Great to see this, thanks a lot Bank!
#5
11/20/2010 (9:31 pm)
Good job, this is something really needed if you wanted to host a server.
#6
11/21/2010 (2:38 pm)
This resource is just awesome!!

Very easy and straight forward, I have been able to build and get a working server without a lot of efforts.

I need now to work on building my own game with extra dependencies & preprocessor^^

Thanks to Bank & GG for getting this real.
#7
11/22/2010 (7:13 am)
Thanks Fyodor.

Nicolas Buquet
www.buquet-net.com/cv/
#8
11/23/2010 (4:28 pm)
This is freaking amazing thank you so much for this.
#9
11/30/2010 (8:39 am)
Hey everyone!
Can I ask you something? If you have running T3D server on Linux, please post the distro name/version, so I can compile a list of "Supported" distros and put it in the resource.
#10
12/01/2010 (6:41 am)
We are using Archlinux for the moment and it's working perfectly well. we just add to follow your resource and it worked.

# Current Release: 2010.05
# Included Kernel: 2.6.33.4
#11
03/03/2011 (9:46 pm)
I just recently applied your patch to my Torque 3D 1.1 beta 3 files and did run into patch complaining about unable to apply changes to several makefile generator scripts, so I had to manually merge those changes , and I also went ahead and corrected two header files' templates to make it possible to build T3D with latest gcc, well at least gcc-4.4 on Debian. So here is my own patch file if it helps anybody else out: t3d1.1b3_modernLinuxFix-20110303.patch

Dedicated server working fine on:
Debian 6.0 Linux Squeeze
2.6.32-5-amd64

By the way you can run the dedicated server with spaces in the path using double-quotes such as this:
./Full -dedicated -mission "levels/Empty Terrain.mis"

Enjoy!
#12
03/15/2011 (7:22 am)
Thanks for posting this resource, dedicated T3D linux server is a must. Hopefully GG will support this as part of the product seeing as it looks like most of the work is done now.

Got the server compiled and running on: CENTOS 5.5 x86_64
Mesa was already installed so just had to yum install the other pre-reqs:
# libtheora-devel
# libvorbis-devel
# SDL-devel
# nasm

When running generateProjects.command from Templates/Full the projectGenerator.php script ended up running with a working directory of Tools/projectGenerator. I worked round this by adding Templates/Full to the php include_path and moving the makefiles to the right place after the script ran.

I also didn't have a gcc-4.1 in my path so created a soft link to gcc (version 4.1.2 20080704 (Red Hat 4.1.2-48))

Did some brief testing on the Empy Terrain missing and unning around/shooting etc all seemed to work correctly. When doing a Ctrl-K suicide it hit an error trying to create the health patch...
scripts/server/health.cs (60): Unable to find function ItemData::create
Set::add: Object "" doesn't exist
scripts/server/health.cs (75): Unable to find object: '' attempting to call function 'setTransform'
scripts/server/health.cs (76): Unable to find object: '' attempting to call function 'applyImpulse'
scripts/server/health.cs (77): Unable to find object: '' attempting to call function 'setCollisionTimeout'
scripts/server/health.cs (79): Unable to find object: '' attempting to call function 'schedulePop'
score:   20 20
#13
07/04/2011 (6:41 am)
Anyone managed to get dedicated server working in final yet? So far I've managed to compile it OK but not got it running yet.
#14
08/22/2011 (1:51 pm)
Here's the patch for Bank's changes against 1.1 Final:
www.justin-k.co.uk/T3D1_1_Linux.patch

Note that this will work with gcc 4.1, for more recent versions of gcc see Nathan's post above.
#15
09/01/2011 (3:13 pm)
Is this nasm?

Debug/Full/math/mMathAMD.cpp.o: In function `mInstall_AMD_Math()':
/media/sf_Torque/T3DPro_Linux/Templates/Full/buildFiles/Make_Ded/../../../../Engine/source/math/mMathAMD.cpp:194: undefined reference to `Athlon_MatrixF_x_MatrixF'
Debug/Full/platformX86UNIX/x86UNIXCPUInfo.cpp.o: In function `Processor::init()':
/media/sf_Torque/T3DPro_Linux/Templates/Full/buildFiles/Make_Ded/../../../../Engine/source/platformX86UNIX/x86UNIXCPUInfo.cpp:49: undefined reference to `detectX86CPUInfo'
Debug/Full/unit/tests/testMatrixMul.cpp.o: In function `TestMatrixMul::run()':
/media/sf_Torque/T3DPro_Linux/Templates/Full/buildFiles/Make_Ded/../../../../Engine/source/unit/tests/testMatrixMul.cpp:55: undefined reference to `Athlon_MatrixF_x_MatrixF'
/media/sf_Torque/T3DPro_Linux/Templates/Full/buildFiles/Make_Ded/../../../../Engine/source/unit/tests/testMatrixMul.cpp:71: undefined reference to `SSE_MatrixF_x_MatrixF'
collect2: ld returned 1 exit status


A forum search brought up similar results with somebody having issues with nasm and the custom build step not happening... Another post mentioned a missing xfree86 package.

I attempted this on Ubuntu first with the same result...since Ubuntu uses xcore instead of xfree86, I thought I'd switch to openSUSE. Now trying this with openSUSE 11.4 with the same result.

I figured I should probably go with a distro that was at least mentioned in the resource since I've not the faintest when it comes to NIX environments!

I manually merged the files into a stock 1.1 final build with Nathan's changes also - so I'm not ruling out I fooked up...but after going over the files a few times I haven't found where I did. If anyone has any pointers of where to look/things to try it would be appreciated.

Cheers


EDIT: Apologies. Please ignore this post. I found where I fooked up...late nights and all that...after setting up openSUSE (virtualbox) and mounting my T3DPro_linux directory...I didn't delete the exsiting buildfiles/Make_ded directory! Issue is probably still valid for my ubuntu setup...but I'm going to persist with openSUSE for now.

*feeling sheepish*
#16
12/06/2011 (2:45 am)
having a stab at this with 1.2...

mSilhouetteExtractor.h

circa lines 78

// Determine orientation of each of the polygons.

         const U32 numPolygons = this->mPolyhedron->getNumPlanes(); // added this->
         mPolygonOrientations = ( Orientation* ) FrameAllocator::alloc( sizeof( Orientation ) * numPolygons );

         Point3F camPos = camView.getPosition();

         for( U32 i = 0; i < numPolygons; ++ i )
         {
            if (this->mPolyhedron->getPlanes()[i].whichSide( camPos ) == PlaneF::Front) // added this->

EDIT: OK, that was the only additional change I had to make.... Spent ages debugging a seg fault only to find I'd smacked a change in renderPassManager.cpp

#17
12/30/2011 (1:15 pm)
Last night I merged the changes from Bank's patch, my changes to get T3D to build with gcc 4.4.5 (Debian 4.4.5-8), patch from Justin Knight, and mSilhouetteExtractor.h fix from Joshua into a new patch file for T3D 1.2: t3d1.2_modernLinuxFix-20111230.patch 30KByte.

Upon trying out the dedicated server on my Debian Squeeze machine (2.6.32-5-amd64) I ran into a problem where the client running on Windows and the game server wouldn't get beyond the challenge request/response stage as eventually the client would give up and show a timeout prompt. I'm currently looking into why it isn't working, probably something wrong with just the torque scripts for the Full template its self. I'll post an update as soon as I get it working correctly.

In the meantime this patch really should only be used by those who just want to get the dedicated server to build in Linux and have the time to resolve any further problems themselves.