r/adventofcode • u/handcraftedbyrobots • Dec 16 '19
Visualization [2019 Day 10] Blowing up Asteroids In Unity
2
u/artificial_neuron Dec 16 '19
This puts my command prompt outputs to shame.
I've not used Unity before. Are these pre-made items downloaded or did you make them yourself?
2
u/handcraftedbyrobots Dec 16 '19
Yeah - this is 100% kit-bashed from stuff out of Unity's (excellent) asset store. Here's what you're seeing on screen
Space Graphics Toolit - For the starfield skybox and Ceres(-ish) model
Asteroids Pack - A few HD variations of asteroids
Sci Fi - VFX Pack - For the particle and VFX for the lasers.
Modular Asteroid Base - For the actual base.
Mesh Exploder - For 'sploding the asteroids
The whole thing came together for about $150 in assets (which go into my toychest for later) and 3 hrs of tweaking (bloom puts some vaseline on the lens and hides a lot of art inconsistencies)
11
11
u/handcraftedbyrobots Dec 16 '19
Had some fun recreating this in Unity this weekend. Most of my solutions are built out in go - so this is just a rendering of the output.
A few notes
Zero radius asteroids from the problem description makes visualization of this inherently challenging. There's a few times where you'll notice laser beams clipping through asteroids
I originally started with laser trail renders that felt more like star wars, but it was difficult for them to read meaningfully on the scale of the problem description and a velocity that matches something you'd see in star wars makes for an extremely long simulation (the clip is already a little too long for my tastes)
Framerate is pretty terrible in a few parts due to procedural deconstruction of the meshes on impact. Probably would want to have more bespoke break-apart prefabs - but whats in there is reasonably convincing (I think)
True ambient light in space makes many things not in direct light unreadable - so it's quite a bit higher than realistic.
Persistent kill cam is fun and something I want in every game
Love AOC - happy to be a continued supporter :)