7 ms·
Show HN: Unity 3D in Docker
- hesdeadjim 9y agoHmm interesting, would a good use-case be deploying a scalable fleet of multiplayer servers?
- jayd16 9y agoEasier and cheaper to run your MP code as a plain old .NET process and client lib.
- hesdeadjim 9y agoYou are assuming you can divorce your authoritative server logic from Unity.
- deleted 9y ago[deleted]
- aglionby 9y agoYou can I believe - your server will end up being a standalone binary with all the necessary Unity things bundled in.
- hesdeadjim 9y agoI 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.
- aglionby 9y agoAh yes - misread GP. I can't imagine doing that would be fun at all (though whether normal MP Unity dev itself is is also contentious!).
- lynxaegon 9y agoOr you could use nodejs & socket.io for the MP server which is even cheaper
- robterrell 9y agoNot sure how it's cheaper cost-wise, since the .NET runtime is free, but his solution avoids a re-write of game code in JS.
- nenadg 9y agoWell that would be nobrainer with something like: `docker-compose scale unity=n` where n = 1...n *You will only have to assign pool of ip addresses for your services, since it's fixed in this example. Reference: https://medium.com/@tonywangcn/how-to-build-docker-cluster-with-celery-and-rabbitmq-in-10-minutes-13fc74d21730 https://medium.com/@tonywangcn/how-to-build-docker-cluster-w...
- robterrell 9y agoYou wouldn't want the full Unity editor for that use... you'd make an executable build of your game in server configuration and build a docker container of that.
- hesdeadjim 9y agoSorry that's what I meant.
- TazeTSchnitzel 9y agoReal-time 3D graphics over VNC sounds painful.
- zitterbewegung 9y agoAutomated testing of video games is less painful than manual testing though.
- stuntkite 9y agoProbably 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 9y agoI wonder if Steam Home Streaming works for the Unity editor? It's a popular and accessible option.
- seba_dos1 9y agoIt works for the whole desktop, so yes.
- stuntkite 9y agoYou 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
- knowaveragejoe 9y agoWhat are some use-cases for this sort of thing...?
- RandomBK 9y agoImagine spinning up 1000 instances of your game through Kubernetes and running automated end-to-end tests, with automated inputs and screenshot capture.
- joshstrange 9y agoWell for that you would probably just spin up containers running your game itself, not unity. This is more for building the game on like a CI I would think.
- RandomBK 9y agoPerhaps. I'm not very familiar with Unity and the development kit itself, but I would imagine it contains the necessary testing harness and other infrastructure.
- nenadg 9y agoI'm using it in very specific [undisclosed yet] scenario where Unity needs to do something, and that needs to scale. Much of the process is explained in this post https://medium.com/@tonywangcn/how-to-build-docker-cluster-with-celery-and-rabbitmq-in-10-minutes-13fc74d21730 https://medium.com/@tonywangcn/how-to-build-docker-cluster-w...
- legohead 9y agoNot sure of the full capabilities of this but perhaps spawning game clients to test out your multiplayer server?
- stuntkite 9y agoUnity 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-accelerated-data-analytics/ https://devblogs.nvidia.com/parallelforall/goai-open-gpu-acc...
- yodon 9y agoThis 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 9y agoexactly; anyone who doesn't see the use case hasn't built a business based around unity (not recommended btw!)
- HammadB 9y agoI'd love to hear your thoughts on why you don't recommend that. Think I could learn.
- yodon 9y agoThere 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.
- HammadB 9y agoI see, I also look forward to Three.js / WebGL stack to become a suitable replacement. These are exciting times.
- pjmlp 9y agoFor that WebGL needs to be able to offer the same feature set as native 3D APIs, which will never happen due to security and the new direction of graphics programming. It only a suitable replacement for those not requiring more than what OpenGL ES 3.0 offers.
- zdw 9y agoShould `rm` the downloaded package after here to save space: https://github.com/nenadg/docker-unity3d/blob/master/Dockerfile#L72 https://github.com/nenadg/docker-unity3d/blob/master/Dockerf...
- nenadg 9y agoit's already solved @ https://github.com/nenadg/docker-unity3d/commit/b7e4bc702fdffafb5dbc55ab077e045d45aab48b https://github.com/nenadg/docker-unity3d/commit/b7e4bc702fdf...
- cjwoodall 9y agoHaving 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)
- aetherspawn 9y agoI 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 :)
- stevefan1999 9y agoIs 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 9y agoSeems like we do have an UE4 container. https://hub.docker.com/r/wshearn/ue4editor/ https://hub.docker.com/r/wshearn/ue4editor/
- TeddyDD 9y agoThat'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.