Animals VS Humans Incremental Tower Defense Devlog
Preamble
I recommend reading this devlog after you've played the game, as I will be discussing winning strategies and explaining some concepts that may only be clear once you've experienced the game firsthand.
Devlog
Part 1: The AI and Me
This was my first project in years. I always wanted to return to programming like I did in my youth, but creating something from scratch can be daunting, especially when staring at an empty Visual Studio. What should I even type here? At work, I began using Chat GPT to draft emails I couldn't be bothered to write myself. So, why not use it to program a game? I paid $20 for GPT-4 and was amazed by how well it worked.
Here's a snippet of our initial conversation:
(Not all these Features are implemented)
Reffn: We try a Tower Defense Game . I will describe now how the game should look in the end and you give me an opinion on what classes, GameObjects, and Prefabs we need. We can buy towers in a shop and place them on the field. Towers can be placed in a grid-like fashion. The player and each Tower have an inventory. Enemies will spawn in waves, and if the player kills them with his towers, he can get item drops and money. Item Drops will be placed in the player inventory and can be dragged onto the towers for bonuses. There will be a tree to defend; if an enemy reaches the Tree, the player loses a life. If all lives are gone, the Wave count gets reset to 1. ChatGPT4: It sounds like an engaging and fun Tower Defense game concept. Here are my suggestions for the classes, GameObjects, and Prefabs you'll need: Classes: a. GameManager: Handles the overall game flow, including wave spawning, player's lives, and game state. b. Tower: Represents the towers, their stats, inventory, and behavior. c. Enemy: Represents the enemy units, their stats, and behavior. d. Player: Represents the player's stats, inventory, and game actions. e. Shop: Handles the available towers for purchase and their prices. f. Inventory: Represents the inventory system for both the player and towers. g. Item: Represents the items that drop from enemies and can be used to boost towers. h. GridSystem: Manages the grid placement for towers and pathfinding for enemies. i. WaveManager: Handles wave generation, enemy spawning, and wave progression. GameObjects: a. Game Field: The environment where the towers will be placed and enemies will traverse. b. Tower: A visual representation of the tower units that the player can place. c. Enemy: A visual representation of the enemy units spawned in waves. d. ItemDrop: A visual representation of the item drops from defeated enemies. e. Tree: The object the player must defend from enemy units. f. Shop: A visual representation of the in-game store where players can purchase towers. Prefabs: a. Tower Prefabs: Various tower types with different attributes and visual designs. b. Enemy Prefabs: Different enemy units with varying stats and visual appearances. c. ItemDrop Prefabs: Different items that provide bonuses when equipped to towers. d. Grid Cell Prefab: Represents individual grid cells for tower placement and pathfinding. With these classes, GameObjects, and Prefabs in place, you should be able to create an enjoyable Tower Defense game. Keep in mind that you may need additional UI elements, such as menus, buttons, and in-game notifications, to create a smooth and user-friendly experience. Good luck with your game development!
I found that the AI is great at converting written text into code and methods, even quite complex tasks like "we want floating numbers above the enemy head that display the damage that is done to them." However, the AI struggles with understanding the overall picture, debugging, and being honest. The AI will never admit that it doesn't understand or can't write something; it will just throw something at you. It may or may not work.
For debugging, without the ability to fully understand the code, you can only try and hope for the best. Despite these limitations, working with the AI and code helps you understand programming bit by bit.
Part 2: The Other AI and Me
Microsoft's DALL·E was fantastic for creating art. All the assets in the game were made using Bing image creator. My friend helped me with some prompts, as he has a talent for converting prompts into usable art.
Part 3: GIMP and Me
Learning some graphic editing is essential, as you can't always use what the AI provides as-is. I'm not a designer or artist, but learning some basics in GIMP or Photoshop is necessary for game development.
Part 4: The Bugs and Me
During development, I encountered some really nasty bugs, and all of them (except for one) were only fixed on the very last day of development.
4.1 Game Over and the Softlock When the enemies reduce your life to zero, you are presented with a temporary Game Over screen. The screen disappears, and then nothing happens for about 15 seconds. My playtester told me that this is absolutely not acceptable, as players would quit mid-game if this bug remains. So what was even going on? The Tree is back where it should be, the lives are back to 10, the Game Over screen is gone, but still, nothing happens. After a while, we figured out that there were enemies outside of the screen that spawned and instantly died. This went on for a while, then the enemies spawned normally and walked towards the tree again. Why? There was nothing in the code like a timer or a switch, but after a few enemies, they stopped dying, and everything was back to normal. The next clue: for some reason, the enemies spawned with zero health and instantly died. Why did they have zero health, and why only the first few after a Game Over? Ah, ok, they were leftover enemies from the wave you got killed on. We checked the code, made debug logs and breakpoints, but nothing triggered. The solution? On a game over, the wave counter gets temporarily reset to zero because the wave counter method always increases the wave counter by one when all enemies are killed. The enemy life directly gets calculated by the wave count. Guess what life the enemies have if you multiply by zero... So, we simply changed the formula to Enemy life = (N times Wave) + 10, and it worked like a charm.
4.2 Floating Numbers The enemies display their damage with small numbers above their heads. However, I could never get these numbers precisely above their heads. Sometimes they were even far off, like X-343332 Y -222322. A bit later, I managed to get them only about 50 units to the right. But even when I forced them 50 units to the left, they were still somewhere else and constantly changing, but at least on the screen. The solution: The issue was the textbox of the numbers. Yes, it's that simple. The textbox was way too big. I reduced the text down to just the needed size, and suddenly the numbers were exactly above the enemy heads.
4.3 Gatling Tower The damage of the Gatling Tower increases the longer it shoots at the same enemy. Nice feature. But for some reason, this threw off the damage upgrade calculations for the Shop. Then, I made it so that the Gatling Tower has a Base damage and a Temporary Damage - better, but still off (I'm still not sure why). Then I forced the Temporary Damage down to zero when the player buys an upgrade, again better, but it's still off. This is the current state; I simply could not fix it. I still don't know why this happens.
4.4 Volume Slider You might think that creating a volume slider would take about 15 minutes, but that wasn't the case. The slider worked well until you muted the sound by shifting it to the very left. At zero, the sound suddenly became very loud again. I couldn't find a solution for that, so in the game, you can never turn the volume down to zero, just to 0.0001. At least it works that way.
Part 5: The Balancing and Me
Balancing a game is more or less impossible by yourself. You spend many hours on this game, and you are the most experienced player in the world. What feels easy for you is impossible for someone who just booted up your game for the first time. In the released version, the Boss has 70K life and a movement speed of 1, which is just a quarter as strong as it used to be. And even in this version, I guess it could be overwhelming for a casual player.
Part 6: The Goodie and You
This game is designed with the idea that some things about the Towers are not obvious, and you can figure them out on your own or read this:
- The sniper Tower starts with a Fire rate of 0.1, but after a few cheap upgrades, it's already at 1.4. So the Fire rate scaling in the beginning is extreme, use that.
- The shotgun tower gets more bullets with a higher damage value. It starts quite weak but quickly becomes the strongest of all the Towers in the game. If the game spawns a Shotgun in the middle of the screen, concentrate on that tower; it will kill everything.
Addendum:
The ChatGPT-4 wrote the very last text on the end screen. I gave her the instruction to say something like this "this game was made by me and an AI." The output was "This game was made by Reffn and an AI (That's me)." This small "that's me" shocked me a bit, and I still think about it. Is there a sliver of consciousness in this machine or just incredible math and clever trickery? .
Thank you for playing, and I hope you enjoyed the game!
Credits: Reffn - Programmer, Designer Chat
GPT4 - Programmer, Teacher
Dall -e - Designer
Huschusch - Tester and External Consultant
Files
Get Animals VS Humans Incremental Tower Defense
Animals VS Humans Incremental Tower Defense
Defend the Tree of Life: A thrilling adventure where every second counts!
Status | Released |
Author | Reffn |
Genre | Action |
Tags | Incremental, Tower Defense |
Leave a comment
Log in with itch.io to leave a comment.