Search Unity

Raspberry Pi 4 Dedicated Server for Unity

Discussion in 'Multiplayer' started by VelociCrafter, Apr 25, 2020.

  1. VelociCrafter

    VelociCrafter

    Joined:
    Apr 25, 2020
    Posts:
    1
    I own a raspberry pi 4 and I'm constantly seeing people use them for dedicated servers for games such as Minecraft.

    I used apache2 to get an IP for it, but it says it's an HTTP server, and I'm not completely sure if that will work or not.

    If it does, I want to know how I can use it as a dedicated server for Unity, so I can use it for multiplayer. I know that there are other options like P2P and Client Servers, but the dedicated server seemed like the best one, since I already have my own raspberry pi and that option is probably best for gaming experience anyways.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Unity currently does not produce Linux builds for the ARM architecture. It has been discussed that you can install Android on the Pi and then make a Unity Android build. Though an Android build isn't really intended for use as a game server, so you may face unexpected hurdles, nor does Unity have the Pi in mind when testing their Android support.

    There's been several threads on this topic you can search up. The best solution generally is instead of a Raspberry Pi, to instead get a mini x86_64 PC or single board PC. You can generally find good ones around $125 or less. Then you'd just install Linux and create a headless Linux build.

    Apache2 is specifically a web server. It doesn't have anything to do with Unity unless you design your game to use a specific web service you're providing with the web server.
     
    horeaper likes this.
  3. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    Am not sure i should post here.....

    But..... i do :p

    Raspi is an arm.
    Linux runs on arms and beautifullty runs on Raspi ( with 3D acceleration )

    U3D targets to linux.
    U3D targets to android ( arm 64 CPUs )

    Android IS a proprietary linux.

    U3D don't target To Linux running on arms CPUs....
    errr.... :p who's pullin my leg ? ;)

    I never tried to have a peek in this but am almost sure that an app running on android can be run on any linux ( provided the app is built for the specific CPU running the nux ).

    Am i right ? or wrong ?

    Does anybody have time for digging in this ?

    Some ppl talk about U3D app running on an arduino.
    Running app on a Raspi4 sounds far less crazy to me ^^

    Discussion is open :)

    Happy unitying !
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    All true

    False
    While Android does use the Linux kernel, primarily what makes up Android is is own software stack which isn't part of any regular linux distro. To run Android apps on a regular Linux distro you'd have to port the entire Android stack, which would be a pretty non-trivial task.

    https://en.wikipedia.org/wiki/Android_(operating_system)#Software_stack

    Generally approaches to run Android apps on regular linux give up on that approach (because that would be an enormous amount of work you'd have to continually maintain as Android changes) and instead run Android in their own container or VM, to isolate it from the rest of your system. But running your Unity game server in an Android VM or container on top of regular linux, all running on a Pi sounds like a horrible idea.

    https://anbox.io/

    Wrong, see above.

    Android apps are generally written in Android's own unique flavor of Java for the Android API. They are not native Linux binaries. You put in the months to years of work getting the Android software stack all moved over cleanly to a regular Linux distro and I'm sure you're golden. Let us know when you're done.
     
    grobonom likes this.
  5. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    @Joe-Censored your answers make me sad :(

    Yes i saw anbox.... I bet that just like bluestack on a win PC, it works like a charm and allows droid app running but....
    I guess it's even not worth a nut i try running a 3D app on it on a Raspberry ^^

    errr.... even if nux runs on an arm ?
    Did you even give this a try ?

    Thanks a lot for the info you posted :)
    And happy unitying and Raspiing !
     
    Joe-Censored likes this.