Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity 4 Linux Games!

Discussion in 'Developer Preview Archive' started by SevenBits, Aug 23, 2012.

  1. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Well, now we know that Virtualbox is a terrible gaming environment.

    Thanks, I'm sure people will want to use this. I'll review them, of course, per my duties in this thread.
     
  2. KameZero

    KameZero

    Joined:
    Aug 29, 2012
    Posts:
    4
    Hmm, looks like Reciever (Wolfire's entry to the 7dfps) is open source.

    Anyone wanna try their hand at a Linux compile? :D
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It's not open source; you need permission from Wolfire to do anything with it.

    --Eric
     
  4. KameZero

    KameZero

    Joined:
    Aug 29, 2012
    Posts:
    4
    ... I gotta learn to actually read readme's :p

    Looks like if someone wanted to try they'd need to email contact@wolfire.com for permission first. Hmm.
     
  5. chris7

    chris7

    Joined:
    Aug 29, 2012
    Posts:
    6
    You should try vmware (player, perhaps) and a linux distribution that has the vmwgfx stuff vmware recently implemented per default. Compared to virtualbox it works very, very well.

    Maybe Ubuntu 12.10?
     
  6. Wurmphlegm

    Wurmphlegm

    Joined:
    Sep 2, 2012
    Posts:
    8
    SO i tried using recordmydesktop, and i wasn't getting the FPS i wanted, i even tried changing it. It just wouldn't show the game moving. Ive never had any luck on any system with recordmydesktop, although i did get glc-capture and that recorded perfectly, i just cant figure out exactly how to decode the .glc file..

    But i assure you, the game is running at top speed, with no errors at all.

    -Wurm-

    Operating System = Peppermint OS Three 64bit
     
  7. Wurmphlegm

    Wurmphlegm

    Joined:
    Sep 2, 2012
    Posts:
    8
    Unitroids works well, just dont care much for the controls.

    -Wurm-
     
  8. lazysnake61

    lazysnake61

    Joined:
    Oct 6, 2010
    Posts:
    26
    Stock mint 13 x64 here,both game worked fine. Angry bots had minor stutters here and there and no fullscreen.

    c2d e7200
    4gb ram
    hd 4670
     
  9. runningbird

    runningbird

    Joined:
    Sep 3, 2009
    Posts:
    382
    @SEVENBITS

    Great let me know of any issues I just downloaded them from the earlier links and uploaded them.
     
  10. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    I actually already reviewed those games. I referring to new uploads that I would review.
     
  11. BigB

    BigB

    Joined:
    Oct 16, 2008
    Posts:
    672
    Hey guys,

    I'm really new to Linux, so this question is probably stupid :)
    I just exported a game to Linux ,and tried to run it on Ubuntu (latest installation from their site).
    When I click on the file Unity generated I get this message "there is no application installed for executable files".
    Right clicking on the file, properties and Permissions-Tab I choose Allow executing file as program, and now it runs.
    But, how about customers and other people running our games ?
    They need to go trough all this ?

    thanks !
     
  12. chris7

    chris7

    Joined:
    Aug 29, 2012
    Posts:
    6
    The angrybots and unitroids zip files posted in this thread have the permissions of the game executable set to be executable and all the other files as not executable.

    Perhaps they were created on a Mac (which knows unix permissions) and you created it on windows which doesn't have a file system that supports unix permissions?

    If this is indeed how unity3d creates these zip archives then they certainly should edit the permissions of the game executable in the zip file after packaging it.
     
  13. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    @chris7
    It's interesting how people came to the conclusion that i was using VirtualBox, which i wasn't. Anyway thanks for the suggestion but at least VMWare Player, contrary to Fusion, isn't available for OS X. As for Ubuntu, i downloaded 12.04.1 from their site.
     
  14. chris7

    chris7

    Joined:
    Aug 29, 2012
    Posts:
    6
    Well, someone mentioned virtualbox and I didn't read it very well so I assumed he knew it. :)

    Anyway, this phoronix article suggests it should just work with vmware fusion and ubuntu 12.04:
    http://www.phoronix.com/scan.php?page=article&item=vmware_virtualbox_osx

    The games on page 2 and 3 are not the most visually demanding games, but angrybots should run fine...

    I don't know if it's completely out of the box though. You can probably find out with:
    Code (csharp):
    1. sudo apt-get install mesa-demos
    2. glxinfo | grep OpenGL
     
  15. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Indeed Unitroids was created on a Mac and Unity does set the permissions as appropriate.

    Unity doesn't output any zip archive. It's up to the individual how he wants to package the files.

    --Eric
     
  16. chris7

    chris7

    Joined:
    Aug 29, 2012
    Posts:
    6
    Well, that explains it then.

    Perhaps unity3d could look into adding an export option to automatically create a installable package with a proper installer (for example mojosetup). It could take care of "installing" to a proper place and setting the permissions correctly while installing.
    I don't know how complicated that would be though...
     
    Last edited: Sep 6, 2012
  17. KameZero

    KameZero

    Joined:
    Aug 29, 2012
    Posts:
    4
    Depends on how you package it up. What you'll want to do is set the permissions yourself like you did, and then compress the files into either a zip or tar.gz, either of those should keep the permissions properly and when a Linux user unzips it on their computer they won't have to go through changing the permissions, they will be able to just double click and it should run.
     
  18. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    @chris7
    Well, i had less demanding stuff running properly. Anyway thanks for the link and i'll give it some further tries once i find some time to.
     
  19. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    If you are exporting games for Linux, you should know how to package them up as packages. When you export to Windows from Unity, it doesn't make an installer for you.
     
  20. Samssonart

    Samssonart

    Joined:
    Dec 14, 2011
    Posts:
    25
    I guess this is the thread to ask this. I have OpenSUSE installed on my desktop (dual boot with Windows 7), I build a project to Linux 32 bits, reboot, select OpenSUSE double click what I think is the executable and I get the "There is no application installed to open this file" message. I tried opening it from console (both ./ and sh), I tried chmod'ing it and still can't get it to open. Maybe I'm just missing something, how do I run Unity builds on Linux? Or is it just that OpenSUSE is not supported?
     
  21. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182

    Maybe I should keep me mouth shut because it looks like Linux programs might actually a Java archives based on what I saw flying by during the install process for Unity: In this case install the latest version of Java on your Linux box if it hasn't been already installed by default.

    If it is a java program then to run it do (LINUX needs to finally get these ENV variables set be default for newbies):

    a. xterm;
    b. JAVA_HOME=/usr/java/bin; # or where ever your JAVA_HOME is
    c. export JAVA_HOME
    d. DISPLAY=mydisplay:0.0 # or whatever your display is
    e. export DISPLAY;
    f. PATH=$PATH:$JAVA_HOME;
    g. export PATH
    h. java /path/to/<my game archive>.jar; #generally java apps are saved with a jar extension even though they are zip files

    If they are java archives then you'll be able to run your games on alot more then Linux but I'm not sure of Java's 3D support and support of various type input devices. MicroJava maybe?

    Otherwise if it a standard Linux a.out file (which I doubt) then:

    It sounds like you have KDE or Gnome or some windows manager trying to run files based on file name suffixes and mime types. Name your program something easy like: racing and if the permission are correct (??x??x??x) the window manager should know to run the program.

    As it doesn't sound like you're that familiar with starting and setting up displays in a shell try right clicking on the icon that represents the program and see if that runs you program.

    If not then:

    a. xterm;
    b. cd /where/your/program/is;
    c. chmod 775 yourprogram;
    d. export display yourdisplay:0.0;
    e. ./yourprogram
     
    Last edited: Sep 13, 2012
  22. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    I'd also go with Ubuntu unless you're really interested in Unix admin and development other than Unity with OpenSUSE for some reason. It's been almost 3 years sinced I used any kind of LINUX but Ubuntu is still the best for workstation environment type users.
     
  23. Samssonart

    Samssonart

    Joined:
    Dec 14, 2011
    Posts:
    25
    Thanks goat, I'll give the *wink* java stuff a try later and let you know how that goes. About the distro, I use OpenSUSE just because I like it, it wouldn't be that big a deal if I had to switch to something Ubuntu-based.
     
  24. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Can someone same if it's a jar file generated by publishing to Linux? I guess since that's what Android does that makes the most sense.

    I guess I'll publish there myself in a days and look myself.
     
  25. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    It is not Java based. I know because Ubuntu does not have Java installed by default, but it still runs in Ubuntu.
     
  26. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Thanks alot for clearing to up for me.
     
  27. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    This message means that the player is not executable (this happens when building the player on Windows, because Windows doesn't know about things being executable or not).
    Setting the player's permissions to allow execution (either from a graphical file manager, or by chmod 755 myPlayer at the command line) should fix this.

    Note: You need to copy the player onto your local Linux filesystem - a player sitting on a FAT-formatted USB stick or on a mounted Windows share can't be made executable (again, because FAT filesystems don't support executability). This is the case for any Linux program, and is not specific to Unity.

    Another note: If you're trying to run a 32bit player on a 64bit Linux system, you will need to have that system's 32bit compatibility libraries installed.
     
  28. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Android .apk files are NOT jars. They are container files that are expanded when installed onto the filesystem. JAR files are entriely self contained.

    Exactly. For best results, build the game from a Mac (as Mac understands execute permissions), and then zip up the file (zip retains permissions as long as the file is created and extracted correctly), copy to Linux, and the un-zip. Viola!

    If anyone has any Linux games to test, I can do so. That's one of the purposes of the thread.
     
  29. VortexStudios

    VortexStudios

    Joined:
    Jul 16, 2012
    Posts:
    84
    Hello everyone!

    I have some problem here when I try to execute any Unity build in Linux, I'm using the last Ubuntu build (I've downloaded and installed today), but, when I try to run the game with sudo, terminal, double click, nothing happens :(
    (when I try to run with double click the app open in PyPar2)

    Someone have any idea of what are going on?! :(


    All the best!!
    Alexandre
     
  30. Nanity

    Nanity

    Joined:
    Jul 6, 2012
    Posts:
    148
    I always forget how gullible Windows users are ;) In each case you download and try to run a program from a non-reliable source outside the software manager the file must be explicy set as executable file. This is to make you think about what you actually downloaded and check the source, otherwise you get a virus...

    tl;dr : Right click on the file, properties, permissions and check "Allow executing file as program"
     
  31. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Yes, we discussed this above. The game needs to be given execute permissions, which doesn't happen when you build from Windows, as the file system does not understand Linux file systems. Either build from a Mac (which does understand execute permissions) or type:

    chmod +x <file name>

    into the terminal. Depending on the distro you can also sometimes click properties and check "Allow Execution" or similar.
     
  32. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Actually, this is due to the operating system not having an extension for executables like Windows does. Linux inherited this from System V, which had had it for many years, mainly due to file name length restrictions. By not having an extension you could give your program better names.

    I suppose this may have the side effect of some security when building from Windows but in general all Linux (and OS X, which also inherits from System V) executables have that permission set regardless of build environment. It is Windows's (likely purposeful) arrogance of Linux that causes this problem.
     
  33. Nanity

    Nanity

    Joined:
    Jul 6, 2012
    Posts:
    148
    Teach me wrong, but there's no such thing as a real "file extention". The .exe/.txt/.jpg endings originally only gave the user a hint what program to use to decrypt the data and diplay properly in the front end. The program itself shouldn't care about the file extension but the file header information. Therefor movie players still play .mpg after renaming them to .randomfileextention

    If you change the .mpg extention to .doc on the other hand, windows will try to open the video file with microsoft word. A thing that will never happen on unix systems because they check the header only. Ironicly windows' default settings make known file extentions invisible, althought they were designed for user visibility in the first step because nobody will check the header information manually before trying to decrypt the full file.

    Each time I used to compile a .jar file in linux I was forced to set the newly created program as executable file before it could be opened by Java, therefor this isn't a windows sided fault this time (not that I couldn't bother with this circumstance).

    I'm not that sure about executable linux types in general. You even can execute simple text files with shell commands, so no clue where the difinition of executable files starts (must be compliled or not ?) and where it ends.
     
  34. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Unlike in Windows, there is no differentiation between text and binary executable files. In System V descended systems, the system searches for the #! (colloquially known as the sharp bang hack) character in the first characters of the file, and then uses the following path name to determine what application (if any) should open your file. Therefore you are 100% correct in your statement.

    Windows inherited the .exe extension for executables (along with others, which are now long deprecated) because MS wanted to make it easy to determine if a file was executable as opposed to checking permissions. Whether that was a good choice is debatable.
     
  35. chris7

    chris7

    Joined:
    Aug 29, 2012
    Posts:
    6
    Actually, the file managers of several desktop environments do use the extension. At least dolphin does it. I think they do it because you might want to open sql scripts in another editor than c++ source files while both are simple ASCII text files.
     
  36. natosha-bard

    natosha-bard

    Joined:
    Feb 24, 2011
    Posts:
    29
    Hey guys,

    We apologize for bugs/troubles you've found in the Linux builds you've had opportunity to test. I can assure you that we are working like crazy to fix bugs and optimize the Linux player so that the end-user experience is as smooth as possible.

    If you want another Unity game to try out, head on over to http://humblebundle.com and purchase Humble Indie Bundle 6, which features Rochard made in Unity :)

    Cheers,
    Na'Tosha
     
  37. Samssonart

    Samssonart

    Joined:
    Dec 14, 2011
    Posts:
    25
    @natosha.bard Hey Na'Tosha, just to get something straight, are we allowed to publish Linux Games now?, I mean building with the Beta. I know it's probably not the safest thing to do, but if we test our build out rigorously and seems fine, can we publish it already without violating some kind of NDA or something legal?
     
  38. BigB

    BigB

    Joined:
    Oct 16, 2008
    Posts:
    672
    Hey Natosha,

    I submitted a bug about the mousewheel not working correctly in Linux., didn't heard any feedback on that, hopefully you guys are checking that one out !
     
  39. dev_peter

    dev_peter

    Joined:
    Aug 9, 2012
    Posts:
    38
    Rochard works fine and out of the box in Fedora 17! Really smooth. Looking forward for some more games to play (and buy!). We need a good racing game ;)
     
  40. chris7

    chris7

    Joined:
    Aug 29, 2012
    Posts:
    6
    Rochard works fine on Archlinux 64bit, catalyst 12.9 beta, HD 6550M. Performance is not ideal but it might be catalyst's fault, because it's beta. Still well playable.
     
  41. Budgieboy

    Budgieboy

    Joined:
    Sep 6, 2012
    Posts:
    39
    I'm confused, I changed it so my app is allowed to execute as program but it's still not running and I even tried using software manager to open it, Ubuntu 12.04
     
  42. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Yes, you can, otherwise this thread would not exist right now.

    That's great! I haven't tried it yet, maybe if I get the money and a Linux machine with a good enough video card.

    ATI drivers are buggy in Linux, but the port is still in beta as well. It could be both. Keep in mind that Arch requires manual setup so it could be your fault as well.

    This has been discussed before. Post your system configuration. Please need Unity is only supporting the Unity desktop version of Ubuntu, not Kubuntu or Ubuntu with a different desktop. That could be your issue.