
NEW UPDATE NOV 23, 2021 BLACK FRIDAY RELEASE of Unity Idle Business Tycoon 2.0!
I just completed an entire re-write of the entire idle data generator using Scriptable Objects! The entire system as been re-factored to use scriptable objects. I've uploaded a BETA build of the code already and will be preparing a detailed lecture on the re-design.
You can go ahead and download the code for yourself from this lecture under resources.
Game Design Document
Now attached to this lecture is a GDD (Game Design Document). It is very simple but as was pointed out in the comments it is a good idea to have a GDD when building out any game.
Introduction
This short introduction lets you see the finished game with some simple creative common graphics. Attached to this lecture is a zip file of the final Unity Tycoon project for the game.
Why this course includes a free preview of advanced prompt engineering, and when to watch it while you build the idle game.
In this exercise course you are asked to attempt to tie the current balance of your company to the Unity UI interface. You will need to incorporate many of the skills you have learned so far. This is a great exercise for those who have some experience programming and are confident that the material up to this point has been easy.
A core part of Business Tycoon Simulations such as this one is the timer that determines when a store's income should be added to the current balance. Timers are also very valuable in many game designs so learning how to use them early on in useful.
In this lesson we see how to animate our store timer using the Unity 5.0 UI Slider. This visual feedback adds to the game play and should be giving you a great feeling of accomplishment at how the game is starting to shape up this early on.
In this lecture we move away a bit from adding additional features to the game and instead look at some important game design concepts and prepare our game design to allow multiple stores.
In this lecture we use our real game example to see how our objects (the store and the game manager) can communicate and share information with each other. You learn that public methods and public properties are accessible outside your class and inside the Unity editor while private methods and private properties can only be accessed internally.
In this lecture you complete the process of making the tycoon game capable of handling multiple stores. An important take away from the course up to this point is that we are using many of the standard Unity features that are easy to get started with. Your game is up and running and the core engine is in place. Now we can begin adding features and expanding the game design.
At this point in the course you have the foundation for a simple game. In this exercise you are to take what you have learned and built out six stores (or how many you wish) with various costs, timers, and profits on the sale.
One key feature in these idle Tycoon type games like ADVenture Capitalist is that you unlock managers so you don't have to click on the store over and over. The store timer will automatically restart on its own once you have a manager for a store. While we will wait to implement the user interface for automating the store we will go ahead and add the feature into our store class so we can more easily test our game play.
Up to this point our stores are a fixed cost. In Tycoon games like this it is often desirable to have each new store cost more than the previous store. In this lecture you learn how to integrate a powerful c# math library that lets you create a function for your Tycoon game that allows you to scale up your store costs. More importantly you will learn how to use this library so that you can apply it to your own game designs.
Now that we have improved our store cost calculations, let's show the player the cost of the next store in the buy button. Learn how to dynamically change the button text.
Add visual feedback in which you can change the buy button to be disabled and show different colors when the player doesn't have the money to purchase another store.
While this entire course focuses primarily on using Unity 3D's User Interface and introducing game design patterns we do at least want our stores to have a picture associated with each one of them.
Unity Prefabs allow you to create reusable objects within your Unity scenes. This video begins introducing you to prefabs and how they can be used in the editor. In a later lecture you will learn how to use these prefabs to programatically generate your stores from XML.
For our design we want to hide the stores until they are available. While this design is a bit different than ADVenture Capitalist it is common in many other Tycoon games in this genre.
In this lecture we introduce some overall improvements to gameplay and learn some additional C# scripting along the way.
We begin to decouple our stores dependencies with the game manager by introducing the Singleton pattern. A classic design pattern used to implement game managers to they are easily accessible to all of the other systems in your game.
As a beginning programmer it is easy to put together a game like this Tycoon clicker. However when you get into more challenging games with complex designs your beginning skills will make it difficult. This lecture will teach you how to separate out the user interface elements from the game the game manager. While this very simple example only addresses the current balance, the design principal will prepare you for a far more complex Store UI manager in future lectures.
One of the most important game development concepts is the ability to create events the various systems in your game can respond to. Instead of tightly coupled objects that are brittle and require much dependency using the Observer Design Pattern and Delegates and Events our User Interface can update itself when the game manager announces that the current balance has changed. This is a dramatic improvement over the previous design in which our game manager would have to know details about the user interface.
Each store has several UI components and like our game manager it is important to separate out our UI from our game logic. Because the store class has more complexity this lecture certainly will be more challenging to those who started this course as a beginner. For those who are already programmers this re-factoring exercise should prove enlightening and provide you with examples of how you can go about better designing your own games.
Breaking out the store UI from the store game logic required quite a few steps but it should have been very valuable for those who wish to create more complex games. It demonstrates how composition of your objects is important and that you want to avoid from the beginning if possible having your UI tied in tightly with game logic. Most importantly it demonstrates that it is never too late nor never too early to re-factor your design for future growth. Build, test, re-factor, test, build, re-factor, test, build. Always take time to go back and clean up your code and re-factor when you are working on complex game projects.
The design to this point uses up a lot of CPU cycles because the UI is refreshed in the update method of the game objects. In this lecture we make our code more efficient by moving code out of the Update method and using other techniques to update the user interface in the game.
In this exercise you are asked to do some of your own re-factoring by changing variables from public to private.
How the store list moves out of the Unity Editor and into an XML file, and what the next lectures load from that file.
In this lecture you learn how to create a simple XML document and load game data out of it so it can be utilized within the game setup.
Create a grid layout that holds the store prefabs, so new stores line up without placing each one by hand.
In this lecture you make a big leap in the game design going from stores that must be created manually in the Unity Editor and instead dynamically create the store prefabs from the data in the XML file. While this is a pretty simple example you can apply this to everything from loading rpg stats, maps, choose your own adventures... and pretty much any game elements. This is also an essential technique to making games in which users can easily make their own mods.
While most of our store data can be set right inside the store class, the store name needs to be updated in the text box at the top of the store interface.
Now that we are creating our store prefabs dynamically we must now load in our store image dynamically as well. Fortunately this short lecture will have you dynamically loading your pictures into the Unity UI in no time.
We still have additional data we need to load into our store from XML. This lecture gets the remaining elements of data we need into our store.
As many other objects in our game depend on the data that we are now loading dynamically, we use an event to notify the game manager that our data is loaded. This extends on what we have learned in previous lectures on using events and demonstrates how events can be used to effectively control the sequence of actions within your game design.
While we've completed loading our store data we now need to add the ability to load our starting balance from the XML file as well.
This exercise asks you to take what you have learned from loading data out of XML and create the ability to load the company name out of XML using similar techniques.
Our Load XML Data method grew quite large as we built out all the features it required. In this exercise you are asked to re-factor the method so it is more modular. Then the remaining part of the lecture is my attempt to re-factor the method. Please feel free to post your solutions to re-factoring this method in the discussion.
Lay out the panel the player uses to unlock a manager for each store.
Build the manager unlock buttons from prefabs in code instead of placing each one by hand.
Set up a small state machine so the manager panel knows whether a store's manager is locked or unlocked.
Write the method that unlocks a store manager and turns on automatic clicks for that store.
Add a button listener in code so each unlock button calls the right store.
Connect the manager panel to the stores and confirm a manager clicks for the player.
How store upgrades reuse the manager unlock design. You look at the current stores, then add upgrades a player can buy to improve a store.
We start in the lecture by focusing on the interface mechanisms that will open up the upgrades panel. Because the manager upgrades button, panel and list are so close in functionality we can quickly duplicate them to create a starting point for our upgrades.
Just like our managers, we must have prefabs that will be utilized for our upgrades. Using the manager prefab as a starting point we create a new upgrade prefab and slightly modify the appearance.
Now that we have our prefabs ready to load we need to modify the load game data script so it can create the new upgrade prefabs. Once again we copy the code we used for the manager upgrade and modify it so we can get our prefabs populating in the upgrade list.
To this point in this section we have primarily focused on the interface and the population of the upgrade items in the upgrade panel. Now that we have that functional we can tie it into our store and actually implement the upgrade.
This lecture we are forced to get a bit more creative with how we approach our design due to how the XML is imported. We make good progress at loading in an XML element and using it to create our upgrade prefab but the design breaks down when we have both a cost for the upgrade and a multiplier when the managers design only had the cost. While this lecture could have been edited to avoid a few minutes that were less than productive I have chosen to leave it unedited as I feel it is important for aspiring game developers to see real world game design decisions and learn how they are handled.
In this lecture we begin by looking at the XML we will use to define the store upgrades. This allows us to restructure XML loading methods so they can handle the new upgraded store design. While we still have a major design step ahead of us, this lecture takes us much closer to having our multiple store upgrade design implemented.
We have come a long way without creating the primary class that will represent our storeupgrade. It would have been a completely legitimate development decision to start by making this class first and working backwards towards the interface design. In fact if we were not building off the already functional manager mechanisms we probably would have taken that approach.
When the Upgrade button is clicked it is still wired into calling methods inside of our store class instead of our storeupgrade class. In this lecture we get the core mechanics of our multiple store upgrade in place.
Finish the multiple-upgrade path so each store can hold more than one purchased upgrade.
JULY 2017 - Unity Business Tycoon Upgrade 2.0! Many new features
Design and coding improvements
In this lecture we begin walking through some of the upgrades that have been made to the game manager. Specifically we begin with namespaces and we have included them throughout the project to better encapsulate our scripts and prevent them from conflicting with other modules or code you would bring into the project. Then we look at some basic uses of constants and how they are use much like variables... but cannot be changed at runtime.
Finally we look at how we can improve our overall design to protect the properties in our classes using setters & getters.
In this lecture we begin walking through some of the upgrades that have been made to the game manager. Specifically we begin with namespaces and we have included them throughout the project to better encapsulate our scripts and prevent them from conflicting with other modules or code you would bring into the project. Then we look at some basic uses of constants and how they are use much like variables... but cannot be changed at runtime.
Finally we look at how we can improve our overall design to protect the properties in our classes using setters & getters.
Reset the game with static methods and properties so a new run starts from the starting balance.
In this lecture we will review how we used a CSV file to store hundreds of big number descriptions and load it into an arraylist. We then use LINQ to find the correct description for a given value.
Load store, manager, and upgrade rows from CSV files into the idle game data generator.
Turn the generated store data into the XML the game loads at startup.
Replace hand-placed store prefabs with a custom inspector that builds the store list from data.
Use the custom inspector to generate a new idle game's stores, managers, and upgrades.
What the Scriptable Object upgrade changes, and how store data moves off the old XML path.
Create the Scriptable Object assets that hold a store's name, cost, and income.
Load those Scriptable Objects into the game at startup in place of the XML store list.
Create Scriptable Object assets from a script so you are not making each one by hand.
Build a complete idle clicker tycoon in Unity with C#. You start from an empty project and finish with a business sim in the style of AdVenture Capitalist, Cookie Clicker, and Web Tycoon. The finished game has many stores, managers that automate those stores, upgrades the player can buy, and saved progress.
The course opens with a welcome. You see the idle game you will build, and why a preview of advanced prompt engineering is included for developers who use AI while they write game code.
You learn Unity game development by writing the game. The lessons start with simple C# that a beginner can follow, including variables, if statements, and a timer. They then move into patterns you can reuse on later games. You use a singleton for the game manager, delegates and events for the observer pattern, and a UI manager with a small state machine. Prefabs create stores at runtime.
The game grows in layers. First you build one store and a progress bar. Then you add a game manager, more stores, store cost math, a buy control, store art, and prefabs, and you hide stores the player cannot afford yet. A managers panel unlocks a manager for each store so that store keeps running. Later lessons add upgrades, scroll views, a control for buying several stores at once, a per-second rate for each store, and large numbers described out to 300 exponents. You save and load the run, including progress that continues while the game is closed, and you add a prestige reset that starts a new run.
Data is part of the design. You load stores from XML, load names and upgrade tables from CSV, and save state with PlayerPrefs. A later section moves store data into Scriptable Objects and a custom inspector. The Idle Game Data Generator builds stores, managers, and upgrades from parameters, and it writes human-readable XML you can edit. You also practice static methods, constants, properties, LINQ, and coroutines, each one tied to the tycoon you are building.
The project source is included, with comments in the scripts, for Unity 2019, Unity 2020, and Unity 2021. Artwork in the project comes from Creative Commons. The course is for beginners and intermediate developers. You should already be able to open Unity and find your way around the editor. Prior programming experience helps, and it is not required. If you are new to code, plan to rewatch lessons and look up C# basics as you go. There are about 14 and a half hours of video instruction.
After the welcome, the tycoon lessons run in build order: the first store, more stores, store features, managers, XML data, purchasable upgrades, saving and generated data, then Scriptable Objects. The Advanced AI Prompt Engineering section is after those tycoon lessons.
This course includes the section Advanced AI Prompt Engineering. It is a free preview of the introduction and foundations from Advanced Prompt Engineering: Agentic & Multimodal Techniques. Those lectures cover how models read a prompt, the anatomy of a strong prompt, clarity, and common failure modes. Watch that section when you want a better way to ask an AI tool for help with C# and Unity, then come back to the tycoon lessons.
Greg Moss teaches the course under Odoo Class Videos. Copyright 2015-2021 First Class Ventures, LLC. This item is not authorized for posting on Steam, or on any other game or game asset site, without permission.