Notifications
Article
INFAMY (done in 1 day) [Final]
Updated 9 months ago
367
0
A Cyberpunk city, under invasion by an out-worldly foe, rapidly descends into a post-apocalyptic new world. But morning soon arrives and out of the ashes and rubble stood the victorious defenders.
Note: any late updates are revisions to asset list, spell check/typos, better screenshots. this was submitted before deadline.
This article discusses the techniques I used to quickly put this together including setting up a simple "render farm" to process 4K video in 15min, hours before deadline.

VERSION 2 VIDEO / Short Film/game concept [final]

I notice I still had 2hrs of time before deadline so I tweaked the Post Processing and enhanced the speech scene.

VERSION 1


This project was completed in 1 work day, from conception to production. In this article, I discuss how I did it in such short time leveraging the power and speed of Unity. Hopefully, you'll find some methods useful in your own projects.
I'm a multi-platform developer & AI engineer working on multiple IP in next-gen A.I. technologies, gaming, and film.
I'd been very busy so I learned of and entered this contest late (2 days before the deadline)... Thus I did not have enough time to get votes. I gave myself 12 hours to complete this project (48 hrs max). But I'm glad I made the deadline! Thanks to Unity - the ultimate rapid development tool. So now I have the added bonus of showing off just how fast one can make something with Unity in such short time, coupled with my own rapid-dev methods (and tools) I developed over time - hopefully you will benefit from my article.

WELCOME TO INFAMY



CONCEPT & THEME

A futuristic cyberpunk city rapidly descends into total chaos and transforms into a post-apocalyptic new world, one that is mired by conflict with a superior outworldly invader.
What if the dark cyberpunk world of BladeRunner suffered the invasion from Independence Day? I did not have a specific concept art but I knew I needed a design that was "futuristically" complex but simple enough for me to build in such short time. I was partially inspired by this scene from Independence Day:

However I wanted to put my own spin on that with a cyberpunk feel. This is my final result:
NIGHT ENVIRONMENT (CALM BEFORE THE STORM):

NIGHT ENVIRONMENT (DURING THE ATTACK):

MORNING ENVIRONMENT (AFTER THE BATTLE):

All 3 scenes are the same, with a shift in direction light and fog. If this were a real game, a Day/Night controller would manage a smooth transition between the time phases.



SHAMELESS PLUG

I made heavy use of Cinemachine, Unity Timeline, and my own AI tools that I also sell on the Asset Store:
(Please do not use this thread for tech support)
AI Designer Pro
Population Engine
(SEE END OF ARTICLE FOR FULL LIST OF ASSETS USED)

RAPIDLY BUILDING A LIVING CITY

How would I quickly populate a city, simulating civilians running for their lives while the brave soldiers charge towards danger? Such a task typically takes days to prototype and weeks to implement which is totally reasonable. But how to do it within a day?
The answer: With A.I.
Without AI, one would have to meticulously place and animate a civilian to run across the street (and do this 100 times with 100 runners) and still be able to sustain a sense of randomness and chaos - this process, again, could take days or weeks. But with AI, I simulated a simple but chaotic scene within 1 hour.

UNITY: PERFECT PLATFORM FOR A.I.

EXAMPLE: RAPIDLY CREATING A BATTLE SCENE

Luckily, the Unity Engine is the perfect platform for an AI programmer, in terms of realtime performance, API, and a very welcoming integration system for third party scripts. This aspect significantly reduces development time for smaller teams by allowing us to shift certain tasks over to automation.
Without AI, one would need to meticulously animate a fire fight, complete with actors, bullet tracers, muzzle flashes, and death effects when hit by laser fire. However, AI enabled me to do all this within 1 hour. Specifically, AI Designer Pro drives the slightly random battle scenes between the invading Alien and defending forces. This eliminated the need to micromanage the choreography of the battle scene. The AI battles itself automatically, driving all special effects, bullet tracers, and NPC movement logic. I then attached one of the AI agents to Cinemachine to simulate procedural camera shake (like a camera man following a human actor). Due to the random nature, I did 3 takes of the same battle scene and picked the one that looked best.

REALTIME + GAME-READY POWERED BY UNITY PHYSICS

All aspects of this scene are game ready, dynamic, and made for real time. About 80% of the motion you see is driven by Unity physics. The other 20% is camera animation and the Mechanim system for characters. Flying debris, explosions, AI, etc... all naturally respond to physics making this scene totally dynamic - no play-through is exactly the same. If this were turned into a game, the player would experience a living breathing environment that is shaped by his actions. If I had more time, I can simply remove the auto camera and throw in a First Person Controller and register it with the AI system for cinematic battle gameplay.

THE PROCESS

PROTOTYPING THE CITY (30 min)

I began by prototyping the scene with simple cubes. I simply placed cubes within cubes and stretched them randomly. This allowed me to set boundaries for the action to come later and gave me a rough idea of where to spawn special effects (explosions, falling debris, etc). I prefer to use Post Processing in this early stage - it helps to set the mood and the ambient occlusion helps me to see the buildings more clearly.

CREATING A RAILING FOR THE STREET (10 min)

This is the glow-in-the-dark railing you see in the video. If I had enough time, I would've went the typical way of modeling in Blender and importing it into Unity. But in this rapid development case, I simply used Unity's built-in cubes to flesh out my designs. For the railing, I simply merged a ton of skinny cubes:

CREATING THE ROADS (10 min)

The ground was made from a giant cube with the Standard PBR Shader. I used a rocky normal map typically used for terrains, a glow texture, and turned up the Metallic and Reflection settings to simulate a futuristic street that is wet from rain. Unity's PBR Shader made this whole process smooth as silk.

DARKENING THE MOOD (5 min)

With a more dramatic looking road created, it was time to darken the mood. Made some tweaks to the post processing stack, turning on Color grading. (compare these 2 images):

DESIGNING 2-WAY TRAFFIC FOR CROWDS (30 min)

Before finishing up the rest of the environment, I decided to begin setting up the action itself. Continuing with my "setting boundaries" process, I use Population Engine to draw out the path on which the civilians would run on. I made sure that there is enough room for action, that the AI agents have enough space to run around BEFORE finishing the environment itself, so I don't run into any surprises later (e.g., finding out the street is too narrow for the NPCs).
I wanted the resulting chaotic scene to have 2-directional traffic with civilians running in opposite directions from the initial shock. Therefore, I placed waypoints in opposite directions using Population Engine.


GENERATING REALISTIC CROWDS (20 min)

It's time to spawn the crowds. I took a more realistic approach. I considered that in a real city, pedestrian traffic usually develops in clusters - not randomly scattered throughout. This is due to traffic lights ("DONT WALK" sign) that force pedestrians to cluster up at an intersection. When the light turns green, the cluster of people walk ou together.
To simulate this, I used Population Engine to automatically spawn crowds clustered around my designated waypoints:

I simply used the civilian models that came with my own Population Engine asset, with slightly modified clothing. I clicked the "Generate" button to immediately spawn 70+ civilians.

INJECTING A NATURAL & "HUMAN" FEEL TO THE CHAOS

Realism doesn't always mean the model texturing -- the civilian models used are actually very low poly with only 512k textures. Instead, realism here means enhancing the civilians' reactions and movement.
Population Engine has a feature that controls the head bone of NPCs and have them automatically gaze at specified objects of interest. In this case, I set the civilians to gaze at objects tagged as "Enemy" (which is what they're running from). You can see this effect in the following screenshot. Here, the woman at center runs forward, but peers behind her at the danger, greatly adding a more natural & human feel to the action.

GENERATING THE FLYING TRAFFIC (20 min)

I took a ship model from the Asset Store and hooked it up the same way I did with the civilians. Hover car traffic is created the same way - by drawing out a path and spawning the ships. This path is then placed high above the civilian path. The green lines here designate the hover car path.


TESTING THE RUNNERS (5 min)

Before proceeding further, I made sure everything was working according to plan so I don't run into surprises later. I played the scene for the first time, and the civilians ran for their lives:


ENHANCING THE STRUCTURES (1 hour)

With everything in working order, it was time to enhance the buildings which, at this point, were still made of cubes. I want to note that some of these cubes were actually kept in the final production - a benefit of using post processing fx early on is that it convinces us even some simple models can still look appealing - saving us the effort to switch them out. I loaded various free packages (old Bootcamp environment, NASA space assets, etc) provided by Unity and mashed them into the cubes. For example, in this screenshot I used the crawler NASA model as the side of the building:

I later added some walls taken from Unity's various free sources.

ADDING BELIEVABLE ENVIRONMENT EFFECTS (~1 hour total)

The running civilians already gives a sense of chaos, but what are they running from? What's the motivation behind their reactions? Why are they running around in an otherwise serene city? At every point of development I asked myself (and you should do the same): Does this scene thus far make sense? Does it convey the proper emotions? If you don't ask these questions constantly during dev time, your gamers definitely will and you'll be forced to release patches to make up for plots and endings that made little sense to players.

ADDING ENVIRONMENT HAZARDS

To help explain why the civilians are running in various directions, it's time to add some environment hazards. If this were an actual video game, such hazards should even give the player the motivation to run away with the crowd.
I simulated falling debris in the video by randomly spawning (again, with Population Engine) clusters of photorealistic rocks taken from the Asset Store high above the city (in the same way I generated clusters of civilians without having to manually place them by hand). I attached a sphere collider and Rigidbody to each rock. Naturally, the rocks will fall and tumble down and be pushed around by physics forces.
These rocks automatically get pushed around by various physics forces and even bullet forces sent from the AI like in this screenshot:


ADDING SMASHING VEHICLES

I then added some vehicles (provided by Unity for free a long time ago). These were fitted with a Rigidbody and Sphere Collider so that they can be naturally knocked around by physics forces as you saw in the video. A sphere collider was chosen instead of a box or mesh collider for performance reasons - this might seem trivial but I wanted to squeeze every bit of performance out of Unity.
And this was the final result:

ADDING FIRE

The scene wouldn't be complete without fire. I added some fire effects from Unity's Particle Effects package:
Fire plays well with the falling debris, rocks, running crowds, flying traffic -- all in one shot.

GENERATING BATTLE AGENTS (1 hour)

I selected the old Soldier model from Unity's old Bootcamp project as the defending forces.

I selected the free Challenger model from Unity to represent the invading forces. I modified its clothing material slightly to give it a more cyborg look.

I used templates from my own asset, AI Designer Pro, to quickly create 2 types of ranged combat agents, one for each team. I loaded them with blaster tracers made with a simple gradient line in an image editor. I attached the free flamethrower effect from Unity's Fire particles asset to the invader AI and set its damage mode to hit-scan.

I used animations provided free from Unity on the agents and simply loaded them into AI Designer:

I decided on a flamethrower-type of weapon for the invaders. Damage to targets is calculated using random min/max values and sent when a raycast hits the target.

The defending forces use standard projectile weapons with damage calculated on collision with the bullet object:

FINISHING THE ENVIRONMENT & POST PROCESSING (2 hours)

With my actors and AI now finished, I can now finish up the rest of the city block. I further tweaked the Post Processing FX, generally making the env darker through color grading and then turning up the bloom.
I placed red and blue Point Lights throughout the city block. This took some trial-and-error as some lights were too intense, while others were too low range.
I continued mashing models together using my initial cubes as guides to give a sense of cyberpunk structures.
To finish it off, I further tweaked the Post Processing FX, adding Chromatic Aberration and Motion Blur to simulate a sense of chaos (even if the agents and camera really aren't moving that fast).


BRINGING ORDER TO CHAOS WITH THE TIMELINE

Unity's Timeline tool helped to bring order to chaos. With 70+ civilians all running in random directions, an aggressive invader force attacking them, a heroic defense team charging into battle, falling debris flying everywhere, and randomly generated explosions, it soon becomes difficult to manage this while simultaneously triggering the camera to film all 3 major areas of the scene (the runners, the battles, the fluid and destructive environment).
With the Timeline, I can organize camera animations and have them automatically film specific scenes, jumping from action to action. Of course this assumes that I had created animations for the camera path first...which brings me to Cinemachine.


USING CINEMACHINE

I wanted to simulate a camera man following a live action sequence of charging soldiers. The camera shaking should be realistic and slightly unpredictable. I simply set Cinemachine to track one of my AI agents. As stated previously, the battle scene happens automatically, powered by AI. I just needed to program a camera to follow the action. Due to the random nature of both Cinemachine and the AI battle, I did several takes of same scenes and picked the one I liked best.
I used Unity's Framerecorder to record the Animation (not the video itself yet) of the camera driven by Cinemachine. This made sure that I retained some control over the randomness.
I then added the resulting camera animation to the Timeline and disabled Cinemachine for the final take.


FINISHING THE CAMERA SETUP (2 hours)

As stated above, I combined Timeline and Cinemachine to create camera movement for the final take, making sure the camera captured what I wanted.

ADDING ENVIRONMENT AMBIENCE

The ambience of screaming civilians is created using simple 3D Audio Sources strategically placed at NPC spawn points. This ensures that as the camera moves closer to the spawn points (which, naturally would be near clusters of civilians), the noise gets realistically louder.

CREATING THE INTRO (15 min)

The intro city was created by taking the prototype I had initially built of the city block and duplicating the city 5 times. Thus I did not have to create another scene from scratch. This way also opens the future possibility of allowing the player to move into the city seamlessly from far away (an open world setting). The giant ship was taken from Unity's space shooter demo.

CREATING THE SPEECH SCENE (30 min)

The speech scene is played at the beginning and end and shows the morning after the battle with a human forces leader standing on top of the debris. It's implied that the good guys had won the battle.
Instead of building a new environment from scratch, I simply duplicated the original dark scene and removed all the AI and battle effects. I then added some random large debris in front of the camera. To simulate morning, I loaded up the default Unity sky and turned up the directional light and reflection probe. The Post Processing was untouched. I placed 2 soldier models and the Challenger character at center screen.
I created the podium using just 2 overlapping cubes.
I used SALSA from the Asset Store to simulate the talking with a public domain audio file.
And this is the result:

This scene was done in a rush. It could use some more lighting work. If I had more time (perhaps a few more days), I'd also add in some particle effects like some strategically-placed smoke and burn shaders on the rubble materials.

THE ENDING SMASH

You might be wondering how I created one of the ending scenes with the giant piece of debris flying into the camera before transitioning to the final speech scene. This was not specifically choreographed. Instead, I simply increased the probability of debris flying into the camera by placing lots of chunks concentrated in a single area within my camera path. I predicted the debris would naturally fly into the camera due to physics forces being exerted on them from the cluster of civilians running towards the camera. This would not have happened had the camera been moving in the same direction as the civilians. This scene took 3 takes to get just right.

4K RECORDING PHASE / RENDER FARM (15 min)

Recording & rendering to disk 4K video is only as fast as your hard drive (you can have the fastest CPU & GPU, fastest Unity game engine, and it still can be painfully slow.) This is why some folks use SSD for video production but it still can be slow. The average record rate (not framerate) for my whole vid was about 40-90 seconds per frame (there was simply too much going on in the scene). And I'm sure some of you faced this also. At that rate it would have been impossible to make the contest deadline during the final hours (I estimated Youtube would take another 3 hours to upload).
I knew Hollywood used "computer farms" to render their movies. How would I pull off something like that here?
Simple, actually: I set up a quasi "render farm" using some old laptops. While they're too slow to play games, they can still run Unity. Unity's Framerecorder has an option to set boundaries on frame number. Each computer would render just 300-500 frames and I'd splice them together later. When some of the scenes crashed older computers, I simply adjusted the frame range to less crowded scenes (like the speech scene).
Video then took another 2hrs to process in a video editor and Youtube upload.

LIST OF ASSETS USED

  • Population Engine (for crowds and spawning)
  • AI Designer Pro (for battle scenes)
  • Unity Standard Assets
  • Post Processing Stack
  • Unity Particle Pack
  • Cinemachine
  • Unity Space Shooter (for the invasion ship model)
  • Unity Recorder
  • Angry Bots (for some props)
  • NASA Space Flight Assets
  • The Blacksmith: Characters
  • Music: The Combat Collection
  • Spaceship: By Pixelmake (for the flying cars)
  • SALSA
  • Photoreal Debris Pack
  • Unity Bootcamp Map (no longer available on Asset Store)
  • Unity Humvee Vehicle (no longer available)



Darwin Yu
Developer - Producer
1
Comments