
Show HN: Unity 3D in Docker - nenadg
https://github.com/nenadg/docker-unity3d
======
yodon
This isn’t about running Unity games in Docker, it’s about running the Unity
editor in a container, for use in automated continuous integration processes.

~~~
mlevental
exactly; anyone who doesn't see the use case hasn't built a business based
around unity (not recommended btw!)

~~~
HammadB
I'd love to hear your thoughts on why you don't recommend that. Think I could
learn.

~~~
yodon
There was a time when Unity was by far the best tech platform for building
your game on. Then they took on a ton of VC money, grew very fast, and went
after all forms of mobile, VR, and desktop development, at which point they
morphed from the best platform for game development to the worst platform for
enterprise development.

Speaking as a 10 year customer of Unity, I can’t wait for Three.js, gltf, and
a couple other components to get just a bit more solid so I can drop my
dependence on Unity. Three or four years ago it would have been inconceivable
for me to say something like that, as I was a long term hardcore fanboy.

It’s just not the same company or solid development experience it once was.

~~~
kot-behemoth
Speaking of Three.js, have you heard of PlayCanvas
([https://playcanvas.com](https://playcanvas.com))? It's pretty much a Unity-
like IDE based on Three.js, and allows a whole bunch of cool features, like
live collaboration.

Here's an example game made in it: Tanx, [https://tanx.io](https://tanx.io).
And here's a lightmap-heavy scene for eye candy:
[https://playcanv.as/p/txPePQvy/](https://playcanv.as/p/txPePQvy/)

~~~
lucaspiller
It looks good, but on my Macbook Air I get really bad framerates (<10 FPS).
I'm not sure if that's because of this tool, or WebGL itself, but I'm able to
play Unity games like Cities: Skylines without any issues.

------
aetherspawn
I made this CLI installer for Unity that will install any semantic version
range for OS X (hard coding URL not necessary):
[https://github.com/zettaforge/unity-
installer](https://github.com/zettaforge/unity-installer)

I would accept pull requests for Linux and Windows package support.

You can also avoid hard coding any install paths using unity-path:
[https://github.com/zettaforge/unity-
path](https://github.com/zettaforge/unity-path)

I would accept PRs there too to professionalise documentation (emotional
appeal was an experiment that brutally failed) or help with marketing.

Both these tools could be useful for customisation of this Docker image. They
are thoroughly tested with full coverage :)

------
TeddyDD
That's pretty cool actually. I knew you can run VNC in Docker container but I
never managed to do it :)

I adapted this to run Godot Engine: [https://github.com/TeddyDD/godot-docker-
vnc](https://github.com/TeddyDD/godot-docker-vnc) It's not useful I think
since Godot has headless server you can use for CI but it was fun anyway.

------
knowaveragejoe
What are some use-cases for this sort of thing...?

~~~
stuntkite
Unity is extremely useful for all sorts of things outside of and gaming
adjacent. Compiling 3d assets, spatial calculation, audio processing,
procedural tasks, physics and material modeling, GIS/Architectural/Structural
simulation.

I have a containerized set of headless unity processes that take a map
selection from a variety of public and private sources plus user data and
compile it into a detailed modeled environments to be later served in WebGL,
mobile, desktop, and 3D printed. Doing it in the users client would involve a
lot of memory management and storage on sometimes restrictive devices, also
unity can hand things off to numpy/scipy, ffmpeg, etc easier on my server than
it can your phone or desktop.

There is also a huge push from Nvidia[1] specifically and others to build new
tools for remote GPU use taking the load off of thinner and thinner clients
doing more and more things. OSX High Sierra offers remote GPU usage in Metal2.
Connecting all these vector processors will frequently be for data ETL, but
rendering that data is going to fall onto tools like Unity a lot, which will
also be sharing in the role of assembly and iteration.

With the new new embedded machine learning chipsets in every new gizmo, tools
like Unity and Unreal are about to be ubiquitous doing all sorts of heavy
lifting. There isn't quite a written playbook for what's going on, but it's
pretty crazy and exciting. Almost like it was 1996 internet again.

[1] [https://devblogs.nvidia.com/parallelforall/goai-open-gpu-
acc...](https://devblogs.nvidia.com/parallelforall/goai-open-gpu-accelerated-
data-analytics/)

~~~
bfortuner
You should write a blog post! It's an awesome reply.

~~~
stuntkite
Thanks! I've been working on a series. We are about to go live and start
pushing out my devlog content too. We've had to be sort of protective about
some of it to make sure important launch IP is protected, but soon! And thank
you for the compliment, I've been sneakily building up my blog chops with
anonymous Reddit and HN posts. It seems to be working!

------
zdw
Should `rm` the downloaded package after here to save space:

[https://github.com/nenadg/docker-
unity3d/blob/master/Dockerf...](https://github.com/nenadg/docker-
unity3d/blob/master/Dockerfile#L72)

~~~
nenadg
it's already solved @ [https://github.com/nenadg/docker-
unity3d/commit/b7e4bc702fdf...](https://github.com/nenadg/docker-
unity3d/commit/b7e4bc702fdffafb5dbc55ab077e045d45aab48b)

------
cjwoodall
Having just done this for my company, this is awesome. I probably won't move
to using this for the time being, but there are a lot of pitfalls to doing
this, many of them subtle.

We use Unity3D + Docker for CI and automated builds, which has massively
decreased the number of "builds on my machine" issues (which Unity3d is very
prone to)

------
hesdeadjim
Hmm interesting, would a good use-case be deploying a scalable fleet of
multiplayer servers?

~~~
jayd16
Easier and cheaper to run your MP code as a plain old .NET process and client
lib.

~~~
hesdeadjim
You are assuming you can divorce your authoritative server logic from Unity.

~~~
aglionby
You can I believe - your server will end up being a standalone binary with all
the necessary Unity things bundled in.

~~~
hesdeadjim
I believe the parent means writing your game logic in pure C# and avoiding the
need for Unity entirely server side. For some types of games that’s doable,
but when you start needing physics or nav agents or even animation driven
logic a headless Unity binary is the only real option.

------
TazeTSchnitzel
Real-time 3D graphics over VNC sounds painful.

~~~
stuntkite
Probably not what OP is doing, but there are way better ways to do that than
VNC. You can adaptively stream gaming pretty effectively over any network
especially a local wired one.

~~~
TazeTSchnitzel
I wonder if Steam Home Streaming works for the Unity editor? It's a popular
and accessible option.

~~~
stuntkite
You can literally dump frames out of a headless copy of a game into FFMPEG and
transcode it into an adaptive stream.

I haven't tried this specific thing with video games needing live input, but
you can run headless on AWS GPUs and dump those frames to an AWS Lambda
process[1] to do the conversion and only have to manage the input. In this
situation the only thing you are running is the game and not all the other
bullshit that an operating system has to deal with in a remote desktop
situation. All you would have to manage is the sync from the controller over a
socket.

Another nice feature would be being able to save your gameplay and maybe edit
it later for broadcast if you wanted.

[1] [https://github.com/binoculars/aws-lambda-
ffmpeg](https://github.com/binoculars/aws-lambda-ffmpeg)

------
stevefan1999
Is there any UE4 docker container? I would like to use UE4 instead, Unity3D is
a horrible choice for a game engine. Maybe it is good for enthusiasts and
hobbyists, but it is definitely not good for us pros

~~~
stevefan1999
Seems like we do have an UE4 container.
[https://hub.docker.com/r/wshearn/ue4editor/](https://hub.docker.com/r/wshearn/ue4editor/)

