Profile banner for rocket2guns

22.8K followers

rocket2guns

Adventurer, video game developer, and flag-waving New Zealander Dean Hall created the wildly successful mod DayZ and turned it into one of the best selling PC games of 2014. A former NZ officer of both the Army and Air Force he is also an accomplished mountaineer having summited Mt Everest in 2013

Frequently Asked Questions

###What is this stream? Hi there! I'm a game developer, and I stream my development with a few goals: 1. Leave about streaming, so I can better support it in our games 2. Educate and inspire people to learn and make games 3. Motivate myself through getting community feedback and ideas direct and LIVE from the community! ###When do you stream? I typically stream nights, New Zealand time, from around 8PM NZST through to midnight. Most nights! ###What is your studio? My studio is Rocketwerkz, and we employ about 70 people across two cities! We are making big and small games. My role is CEO, so my day to day activities are very leadership focused. This channel is my chance to do real coding! ###Is your studio hiring? Maybe! Check out our [careers section](https://careers.rocketwerkz.com/) on our website for the latest vacancies. ###What technology do you use? On the stream I use: 1. Unity for the game engine 2. Visual Studio 2019 for my IDE (code environment) 3. Resharper (productivity tool for visual studio 4. 3DS Max 2017 for 3D art 5. Adobe Photoshop for texture work Language is written in C#. Data structures typically in XML. ###Aren't you worried about people copying your code? Nope! Programming and game development is a complex activity. So much about development comes from how you approach a project overall, not the little specific parts of it. A game is a product of thousands of small decisions - its the amalgamation of those small decisions that makes a game. It would be far easier to decompile the released game than copy my code from the stream here. I personally think Non-disclosure agreements are a [waste of time](https://www.techrepublic.com/blog/cio-insights/peter-cochranes-blog-ndas-are-worthless/), even though my studio still uses them. If you're going to pitch a game, and someone comes out of that pitch without thinking "we can't make that game without them" - then you've failed your pitch. ###What advice can you give about making games? Start! That's the hardest part. Following that: manage your scope and manage your mood. The last one is the one people miss. You're not a robot. Some days, you will look at your project and see a steaming mess. Others, you will think its amazing. Work on a mix of small bugs and little achievable features, until you have the confidence to move forward on bigger tasks. Refactor with purpose. Solve real problems rather than theoretical ones: "make the problem before you make the solution". ###Shouldn't you be using 'for' rather than 'foreach'? With the latest unity compilers, this [isn't the problem](https://jacksondunstan.com/articles/3805) it used to be. Now I use foreach where it makes sense, and for loops where I need the index. It's about using the right tool for the job. ###What games have you made? * Speed Racer (Wii/PS2) * Clone Wars (PSP) * Arma 3 (Designer/Mocap) * DayZ (Director) * Out of Ammo (Director) * Stationeers (Director)

About

###Who I am I'm Dean Hall, creator of the video game DayZ. I'm CEO of a video game studio, [Rocketwerkz](http://www.rocketwerkz.com/). I'm a passionate game developer. I love mountaineering - I've climbed Mount Everest (2013) and skied to the South Pole (2020). I love cars, specifically Lamborghini, and I have two currently that you can see more on my instagram. ###My Socials Insta [@thedeanhall](https://www.instagram.com/thedeanhall) Twitter [@rocket2guns](https://www.twitter.com/rocket2guns) Youtube [icemotoboy](https://www.youtube.com/icemotoboy) ###The Stream Typically the stream follows this process: 1. Bugfixing. I'll start by fixing a few bugs, discussing what I did before, and closing off small tickets I've made on trello. 2. Poll. I'll run a poll (live!) here on twitch where YOU can help decide what feature or fix I should work on next! 3. If that gets complete, I might run another poll or work on other things off the list in order you voted on! 4. I explain what I am doing, and why, as I go. I take questions from chat and post links to references or tutorials that have helped me along the way. ###My Stream When I'm streaming it's usually my personal project, as its something I can stream. I will be streaming some of my "big studio" stuff, once they are announced. ###Multiplayer Tycoon Game My personal project is currently a multiplayer tycoon game. It's inspired heavily by Chris Sawyers "Transport Tycoon" and the game "Railroad Tycoon". It's name is Art of the Rail. You can see the [public trello](https://trello.com/b/fYYAYVq6/trainz) to track the progress. If you are interested in the game please [wishlist it on steam](https://store.steampowered.com/app/1286190/Art_of_the_Rail/). I love this genre, and there are amazing games in the area, but what I feel is missing: 1. Multiplayer 2. Large scale 3. Complex economic systems 4. Logic systems to allow you to optimize I'm aiming for something of a mix of OpenTTD, Railroad Tycoon, Factorio, and Cities Skylines. ###Any fitness advice? I'm very into my fitness! And actually, being fit and healthy the advice for starting is the same for starting a video game (or pretty much anything).... JUST START! The key is starting, then test and adjust your approach as needed to find what works for you. As with making a game, what works for you might be different for other people. One of the biggest barriers to success in peoples lives is a lack of belief that something can be achieved. That doesn't mean simply believing in something means you can (and will) achieve it. But any success story inevitably started with someone believing it was possible. Really makes you wonder how someone invented cheese though.

Information / Tutorials

###How did you make the tunnels? I used geometry to write to the depth buffer, and "trick" the renderer to cut a hole in the terrain. See the tutorial [here](https://www.youtube.com/watch?v=cHhxs12ZfSQ) ###How did you write the networking code? I used the Unity [low level networking layer](https://docs.unity3d.com/Manual/UNetUsingTransport.html) as a base, and wrote my own network management on top. See [this tutorial](https://gintas.io/unet-llapi/) as a good starting point. You can look through the (depreciated) [unity source code](https://github.com/jamesjlinden/unity-decompiled/tree/master/UnityEngine.Networking) for their High level API for networking, and take methods out of their for your own purposes. ###Which data structure should I use? The right one! Choosing the right data structure is very important. Consider the [costs involved](https://theburningmonk.com/2011/03/hashset-vs-list-vs-dictionary/) with adding, updating, and retrieving from your chosen data structure. What part will you be doing more? ###How to write performant network messages? Most importantly, don't send information you dont need to! Consider both how and what you are sending. Consider when and how often. Consider why you are sending it. Make sure you are considering the [size of the data](https://condor.depaul.edu/sjost/nwdp/notes/cs1/CSDatatypes.htm) you are sending. Consider joining your data into a byte array, and compressing that array before sending it. I have been working towards consolidating data I need to send in byte arrays, and then splitting the byte array up into fragments to send to the client. This is because routers can only handle relatively small "packet" sizes (~1.4KB). ###You talked about "envelope cost" for network messages? What is this? When you go to send a message you need to include some data to tell the client what the message is and how it is to be handled. I call this the "envelope cost", like the weight of the envelope when sending a letter. This is actually quite significant, and constant. Say 200B per message. So if you're sending 20B or 1000B of data, the envelope cost is the same. Hence - it's really important to make every byte count! So what i have been doing is making a big byte array, putting all the data in it, breaking it into fragments, and sending the fragments to the client. I am even compressing (just once!) the overall byte array, balancing the cost of compressing against the saving of size. ###How did you draw so many trees? The trees don't "exist" as a game object. I record their position, and I send an array of them to the GPU using Graphics.DrawMeshInstanced. See more at [this tutorial about how to do this](https://toqoz.fyi/thousands-of-meshes.html). There is even better ways to do this using compute shaders! ###What is "Garbage Collection" and why do you talk about it so much? In a managed language like C#, you are not managing your memory allocation - the compiler does that for you. The "garbage collector" runs through used memory, and checks to see if anything you have allocated there is used - if not - it frees the memory up. This reduces the complexity of your code substantially, however, there is a cost as to run the garbage collection the whole game has to stop. This causes the dreaded "freeze" many unity games have. The best solution here is to be very careful about allocating memory. Follow [these recommendations](https://unity3d.com/how-to/unity-best-practices-for-engine-performance) from unity. There is a [great post](https://medium.com/lonely-vertex-development/how-we-optimised-our-scripts-in-unity-447924863b3a) about optimizing strings as these can be a major source of garbage collection as strings are "immutable" (they can't be changed, only re-instantiated. Remember; a string is simply an array of numbers! There is also some great unity optimization tips in this [good post about the subject](https://danielilett.com/2019-08-05-unity-tips-1-garbage-collection/) ###How did you do the UI? I made a very controversial decision to ditch Unity's inbuilt UI, and use [Dear ImGui](https://github.com/ocornut/imgui). What is that? It's immediate UI. Instead of caching UI elements, I draw all the UI at once, every single frame. Instead of making UI widgets, I create the UI realtime in the code. This is not standard practice, especially for games. It is working for this project, but it would not be a good idea for many. This is a good example where it is about making sure you use the right tool for the right job. Carefully consider, test, measure, evaluate. ###How do I make splines? There are Unity Assets you can use, but consider your use case. What are you trying to use a spline for? How many splines do you need in your game? Splines can seem very scary to make, but actually, they're [rather straightforward](https://catlikecoding.com/unity/tutorials/curves-and-splines/). Work on getting something working using that tutorial, and stick to the minimum and most performant solution you can muster. ###How do you generate mesh on splines? Follow [this library](https://github.com/benoit-dumas/SplineMesh) as a base as an approach to bending and positioning meshes along a spline. You might need to modify for your purposes, but it's a great place to start. ###Why do you use dictionaries so much? I try to cache data where possible. After all, we have plenty of memory! So long as you are careful about what you use as a key in your dictionaries, they can be a powerful tool for a project. Checkout this [post about the subject](http://www.somasim.com/blog/2015/08/c-performance-tips-for-unity-part-2-structs-and-enums/) for advice about how to correctly use structs and enums in dictionaries. ###Dictionary v Matrix Array Sometimes you can use a matrix array rather than a dictionary. Looking up an array is basically free, whereas even with a well optimized dictionary there is a cost. If you know for sure the size of your world, instead of storing things in a dictionary with a key - make a multidimensional array and use the x and y for the positions in the matrix. I started with a Dictionary for ease of use, and once I got things ready - I switched over to a 2D array. It took me about 40 minutes to make the change! It's an example about going for "easy" first and then refactoring later once you have your use case sorted.