Game Development Community

Torque3D Linux Status

by Luis Anton Rebollo · in Torque 3D Professional · 09/19/2013 (12:36 pm) · 168 replies

img833.imageshack.us/img833/9893/4q3c.pngimagizer.imageshack.us/v2/800x600q90/853/99ok.png

Torque 3D on Linux

This branch is based on the work of RonOHara-GG that you can find at: github.com/GarageGames/Torque3D/tree/linux-rnd. I removed everything related to Nvidia CG because it was not useful for my OpenGL project. The current state is very basic, but enough to be a good starting point.

Changes or updates on Linux, will be posted on this thread. If you have any questions feel free to post.

You can find the code at:

  • github.com/BeamNG/Torque3D/tree/dev_linux_opengl

  • How to compile

  • dl.dropboxusercontent.com/u/28887086/T3D%20CMake%20docs/mdwiki.html#!index.md

  • Status:

    • Only tested on Ubuntu, compiled with gcc.
    • To modify TorqueScript, is needed an editor that can save with Windows EOF.
    • Use CMake for build project.

    Torque 3D Version:

    This branch is based on Torque3D 3.5.1 development.

    What to do if you want to help?


    Reporting bugs:

    If possible, Github is a great place to post issues to a forum.
    I appreciate any donation to help the project. https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif.
    #21
    10/08/2013 (2:59 pm)
    Good luck, Luis.
    #22
    10/08/2013 (3:05 pm)
    @Steve
    Thx, only a minor but annoying problem.

    @Daniel
    Added fix makefiles to my todo list.
    Codeblocks release build have problem, sorry.
    Updated status on first post.
    #23
    10/08/2013 (5:29 pm)
    I meant to mention before, but I hope your personal problems are okay. Thanks for the work you've been putting into this :).
    #24
    10/23/2013 (4:25 am)
    Back to work :)

    On Github: github.com/LuisAntonRebollo/Torque3D/tree/dev_linux_opengl
    • Fix: Project Generator not build VS2008 and VS2012 on Windows.
    • Fix: Project Generator Codeblocks build on Windows but dont work.
    • Fix: X11 window use XAutoRepeatOn and XAutoRepeatOff and can Affect other aplications. Code based on SDL2.
    • Fix: Inline assembler on platformCPUCount.cpp do not compile on GCC Release with optimizations. Not a final solution, need more work.
    • Fix: Project generator & compiler errors on Make builds.
    For now, I will continue working with the port to OpenGL.
    #25
    10/23/2013 (4:32 am)
    You're superhuman! Hope all's well outside development. I'll pull this down and have a look when I get the time...
    #26
    10/24/2013 (12:44 pm)
    Thanks for the update Luis! I've been using the openGL build on windows for a while, and as always its great to see improvements to the code. My last merge was with the advanced lighting update you did a while back.

    For some odd reason water crashes the game, I think it might be a shader issue, I'll have to check again.

    Another thing is that the terrain looks...not good at all on openGL but works great on D3D. There is like no detail to it. Here is a picture of what it looks like in OpenGL:

    i.imgur.com/iVBJZ2J.png
    And the equivalent (relatively speaking, not exact coordinates but whatever) version in D3D9:

    i.imgur.com/k3vNbOU.png
    Another issue is with advanced lighting, direct3D:

    I am using a custom class that I have made for a control object. My control object in Advanced Lighting does not have a shadow anymore on D3D, but does on Basic Lighting.

    I'm just letting you know in case if you didn't. Other than that it works great and I really appreciate what you are doing for all of us. Keep up the fantastic work!

    Jeff
    #27
    10/24/2013 (1:02 pm)
    @Jeff Thanks for testing the code.

    Only effects/code needed for a Full Template have been ported to OpenGL. The water does not work yet.
    #28
    11/16/2013 (11:55 pm)
    Hey Luis, do I need to do any special setup for the Codeblocks project? At the moment, I'm getting errors when linking:
    ||=== Empty, Debug ===|
    ld||cannot find -llmng_DEBUG|
    ld||cannot find -llpng_DEBUG|
    ld||cannot find -llungif_DEBUG|
    ld||cannot find -lljpeg_DEBUG|
    ld||cannot find -lzlib_DEBUG|
    ld||cannot find -ltinyxml_DEBUG|
    ld||cannot find -lopcode_DEBUG|
    ld||cannot find -lsquish_DEBUG|
    ld||cannot find -lcollada_dom_DEBUG|
    ld||cannot find -lpcre_DEBUG|
    ld||cannot find -lconvexDecomp_DEBUG|
    ||=== Build finished: 11 errors, 0 warnings ===|
    Do I need to fiddle with include paths?

    EDIT: I've encountered some enthusiasm for the Linux port on Reddit but haven't been able to help people very well. Probably doesn't help that I mysteriously can't build the engine any more (using a dual-boot partition with 12.10 now). Ah well, progress...
    #29
    11/18/2013 (5:27 am)
    Sorry for the lack of updates :(

    On the state of the project. In December I start to work part-time(20 hours week) for at least two months. I would like to have it finished before Torque3D 4.0.

    I've been researching on performance issues, and I have resolved most of them. I have to clean and better check the code before uploading anything.

    @Daniel, I downloaded a new copy of Github and I compiled correctly (debub and release). No need to set anything in Codeblocks, run "generateProjects.command" and open the workspace of codeblocks.

    I need more data to get an idea of what may be the problem.

    Tested on Ubuntu 12.10 with GCC using github.com/LuisAntonRebollo/Torque3D/tree/dev_linux_opengl

    And thanks for the info on reddit.
    #30
    11/18/2013 (12:06 pm)
    Luis let us know when you update, I'll be sure to test it to tell ya what I see. c:
    #31
    11/22/2013 (6:57 pm)
    In case anyone has a 64-bit linux machine who is unable to get the correct 32-bit libs needed to compile the engine, one way to get around those problems is to use debootstrap and schroot to have an environment to compile in.

    This guide is slightly old, but it should work for any debian based machines (and there might be better docs somewhere else on this too).

    https://help.ubuntu.com/community/DebootstrapChroot

    One important thing to do is to change the release to raring or saucy, rather than using the old versions mentioned in the article.

    Once you have built the engine in schroot, you can then execute the program as usual.

    Enjoy!
    #32
    12/03/2013 (3:43 pm)
    Already is December.

    An upgrade of the branch with improvements in OpenGL.

    www.garagegames.com/community/forums/viewthread/133262/2#comment-852506
    #33
    12/03/2013 (3:45 pm)
    @Luis Anton Rebello
    i would like to talk with you about something your port related/ funding and so on

    contact me via e-mail (its in my profile) when you get time
    and thanks for continuing your work
    #34
    12/03/2013 (3:55 pm)
    @J0linar, mail sent.
    #35
    12/03/2013 (6:27 pm)
    Frogger: thanks for the tip! Now I'm wondering whether my build issues are due to using 64-bit Ubuntu.
    #36
    12/03/2013 (8:25 pm)
    @Daniel

    Quote:Hey Luis, do I need to do any special setup for the Codeblocks project? At the moment, I'm getting errors when linking:
    view plaincopy to clipboardprint?

    ||=== Empty, Debug ===|
    ld||cannot find -llmng_DEBUG|
    ld||cannot find -llpng_DEBUG|
    ld||cannot find -llungif_DEBUG|
    ld||cannot find -lljpeg_DEBUG|
    ld||cannot find -lzlib_DEBUG|
    ld||cannot find -ltinyxml_DEBUG|
    ld||cannot find -lopcode_DEBUG|
    ld||cannot find -lsquish_DEBUG|
    ld||cannot find -lcollada_dom_DEBUG|
    ld||cannot find -lpcre_DEBUG|
    ld||cannot find -lconvexDecomp_DEBUG|
    ||=== Build finished: 11 errors, 0 warnings ===|

    Do I need to fiddle with include paths?

    I ended up having to set at least the relative path for each library under build options for the project. It was just something like ../../../Engine/lib/compiled/lib.a

    Also, you should be able to compile as a 32 bit application and run it under 64 bit operating system. It will just run as a 32 bit application.

    I have had issues with Ubuntu 64 bit in the past with other projects and had to resort to Froggers suggestion.
    #37
    12/03/2013 (10:57 pm)
    I loaded up an Ubuntu12.10(32bit) VM on virtual box to see if any of my problems I posted in the OpenGL thread were related to my os. Here are the steps if anyone is interested:

    1. Download virtualbox for windows, mac, or linux. virtualbox.org

    2. Create a VM with a fixed size disk.

    3. Download the Ubuntu iso for 32 bit 12.10 (ubuntu-12.10-desktop-i386.iso) The torrent is much faster:)

    4. Run the VM with the iso file selected under the storage options.

    5. Follow the Ubuntu install

    6. Fire up a terminal and sudo apt-get install build-essential nasm git php5-cli libsdl-dev libogg-dev libx11-dev libxxf86vm-dev xorg-dev libxft-dev

    7. Hit yes a couple of times:)

    8. run ./generateProjects.command from your project folder

    9. I needed to reorder my vorbis, theora, ogg lib in the make file as well. as follows:

    -include x Full
    -include x collada_dom
    -include x libvorbis
    -include x libtheora
    -include x libogg
    -include x ljpeg
    -include x lmng
    -include x lpng
    -include x lungif
    -include x opcode
    -include x pcre
    -include x squish
    -include x tinyxml
    -include x zlib
    -include x convexDecomp
    -include x $(DEPS)



    10. Then just cd over to your buildfiles/make/
    and
    make -f (yourprojectname).makefile command
    NOTE:where your projectname could be Full or Empty if you compile in the template folders and the command is either release, debug, or clean

    It compiles and runs. You can even use the GUI. Now when the game finally loads is when it crashes for me.

    I am getting all the same shader errors as my opensuse computer which is not a vm.
    Console Log OpenSuse
    #38
    12/04/2013 (3:56 am)
    A new update on Github: github.com/LuisAntonRebollo/Torque3D/tree/dev_linux_opengl
    • OpenGL GLSL Fix: error:`discard' may only appear in a fragment shader
    • OpenGL Fix: Render upside down when $pref::Video::displayDevice are not OpenGL
    Updated header post with info about report errors.
    #39
    12/04/2013 (7:44 am)
    I decided to give it a hook on a newer version of linux, linux mint 16 to be exact (it's all ubuntu anyway). The only version specific issue I ran into ( as far as I can tell ) was with PHP project generator. The mint 16 repository has php at version 5.5.3, and as of 5.5.0 there is a class in php called Generator. Therefore, the project generator that comes in the tools folder produces an error for redefining a class. So, I changed the class name to T3DGenerator and it generated the files fine.

    For Code::Blocks I got the same results as Daniel:
    ||=== Empty, Debug ===| 
    ld||cannot find -llmng_DEBUG| 
    ld||cannot find -llpng_DEBUG| 
    ld||cannot find -llungif_DEBUG| 
    ld||cannot find -lljpeg_DEBUG| 
    ld||cannot find -lzlib_DEBUG| 
    ld||cannot find -ltinyxml_DEBUG| 
    ld||cannot find -lopcode_DEBUG| 
    ld||cannot find -lsquish_DEBUG| 
    ld||cannot find -lcollada_dom_DEBUG| 
    ld||cannot find -lpcre_DEBUG| 
    ld||cannot find -lconvexDecomp_DEBUG| 
    ||=== Build finished: 11 errors, 0 warnings ===|

    I tried doing it via make as well, and I had a few issues with that. First, it couldn't locate main.cpp or torqueConfig.h so I added:

    CFLAGS += -I../../../../Engine/source
    CFLAGS += -I../../source

    to the Full makefile, and then it got a little further and spit out:
    Release/Full/main/main.cpp.o: In function `TorqueMain(int, char const**)':
    main.cpp:(.text+0x7): undefined reference to `StandardMainLoop::init()'
    main.cpp:(.text+0x19): undefined reference to `StandardMainLoop::handleCommandLine(int, char const**)'
    main.cpp:(.text+0x34): undefined reference to `Platform::AlertOK(char const*, char const*)'
    main.cpp:(.text+0x40): undefined reference to `StandardMainLoop::doMainLoop()'
    main.cpp:(.text+0x49): undefined reference to `StandardMainLoop::shutdown()'
    main.cpp:(.text+0x4e): undefined reference to `StandardMainLoop::requiresRestart()'
    main.cpp:(.text+0x57): undefined reference to `Platform::restartInstance()'

    Which is about the point I said "enough for tonight" and went to bed. One thing I've noticed is both the instructions and Kyle Hagin's post say to run "make -f Full.makefile release" but I don't have a Full.makefile? I have a makefile in the Full folder, and can run "make release" etc, but where are you guys finding (yourprojectname).makefile? Perhaps that's where it's all going wrong.
    #40
    12/04/2013 (5:39 pm)
    @Andrew

    For using the makefile you will need to run generateProjects.command first in the folder "Torque3D-dev_linux_opengl/Templates/Full/" or where ever your project is located. This will create the make files. If you ran the project generator to create your project, then your project files would be under "Torque3D-dev_linux_opengl/MyProject/YourProjectName/"

    After running the generateProjects.command the makefiles are located in "Torque3D-dev_linux_opengl/Templates/Full/buildFiles/Make/" or "Torque3D-dev_linux_opengl/MyProject/YourProjectName/buildfiles/Make/" In the full template folder the make file is called Full.makefile. This is the one I needed to change around the order of the libs as shown in my post above. It will be called YourProjectName.makefile if you used the project generator.

    I wasn't actually loading a project but just compiling in the full directory for a quick test. Something tells me this is probably not a good idea:0 But I was being a little lazy.

    To compile with code blocks you will need to use the 32 bit version of codeblocks and I needed to specify the paths for the libraries under project->build options then there is a tab for libraries you will see all the names of the libraries. You can double click the name and you will be able to specify the path which is something like ../../Engine/Lib/compiled/lib.a I made a post about this in Luis's opengl thread.

    Hope that helps.