Drone Eats! - Development Blog

Hi! I’ve decided to make a blog here to show my progress on my own take on Terminal Hacker.

Player Experience
Stressed out. Fast-paced resource management.

Core Mechanic
“Code” your bots to make as much deliveries as possible during certain period of time.

Core Game Loop
The player “codes” his bots to go a certain location, pick a package, then code them again to deliver the package, then code them to return to recharge batteries. The game ends when a timer runs out, after that the player can buy enhancements for the bots or buy new ones, then a new “mission” starts.

The mechanic is already working, the player uses the arrows on the keyboard, it does not show the route on the map, that’s part of the mechanics you gotta learn where your bot will end before coding it, you can lose it if it run out of battery. Thing I still have to code.

Currently I have to refactor the code, is kinda messy, and the “clamp” to prevent the bot to go out of the grid is kinda messy, I don’t like it but it works, I’ll leave as it is.

2 Likes

Glad to see you here :wink:

I’ll definitely keep a watch on this blog.

Great Player Experience. I love fast paced games.

Core Mechaninc is very interesting! You have me hooked.

I really like the idea that you have to really visulaize where you are going because the route won’t show on the map. Great stuff! Hey if the code works, it works :stuck_out_tongue: Keep it up Yee!

P.S. Did you see that you are on the GameDev.tv Newsletter?

1 Like

I got a message from Lucy, she gave me a heads up and told me you told them about me, thanks about that! I haven’t seen the newsletter because I don’t even know where it is being posted xD

1 Like

Main mechanic almost done!

Drones now can run out of battery and have battery indicators which is one of the main resources the player will have to track. You can have up to 6 drones at the same time.

How does this work?
The drone has a script that takes track of the battery. Each move reduces the battery life by one, the moment it reaches 0 the drone cannot longer be used.

The indicators are animations. The animator has a single parameter called BatteryLeft, that is set in the Battery script. I’m planning to add different drones with different stats so not all drones will have the same battery life, this means that I had to calculate the percentage to set the battery indicator correctly.

Challenges during scripting
The hard thing was to populate that lower menu, since the drone and indicator are linked to each other and the player can buy different type of bots, it had to be populated via script instead of doing it manually in the Editor.

I manage to do this with a loop. At the start of the scene each drone searches for an available slot then pick one, so the menu will populate in an orderly fashion regardless of the number of drones in the scene.

Each slot only has an animator. When the drone searches for an available slot it grabs the animator and links it to itself, also sets the BatteryLeft parameter of the animator to 100, this activates it, if the parameter stays at 0 it won’t show anything on the screen and that’s exactly how each Drone searches for an available slot, if the animator parameter is greater than 0 it means it has already been picked so it cannot be used.

To check the value of an Animator parameter

Animator.GetFloat(string)

This can be used with the other parameters as well, GetInteger, GetBool.

I just realized I didn’t talk about how I managed to achieve the movement, that was actually kinda hard, maybe I’ll write about that later on.

Movement, recharge and animations.

- Movement, How does it work?
The player presses the arrow keys in any sequence, then press enter and the selected drone moves according to the “inserted code” introduced by the player. This sounds simple to do, but it wasn’t.

- Challenges while coding the movement
First I needed to find a way to print the arrows in that “terminal”, this aren’t strings, so I needed to find another way. I draw 4 sprites, 4 arrows, up, right, down, left, that was the easy part, How could I know which arrow key was pressed and how to print it?

The moment the player presses a key, the code converts the axis of that key it into a vector 3 which is firstly saved into a Queue for later use, then it looks into a dictionary that holds vectors as keys and sprites as values, the next part, is print the sprite selected into the terminal.

When the player presses enter the code checks if there’s a drone selected, if there is, it will command it to follow the move orders, this is done by passing the Queue, the drone moves and won’t be able to stop until it finishes it’s movement, so no more commands to that bot until it stops. You still can command other drones while the other is moving.

Animations
Captura de Pantalla 2020-07-31 a la(s) 20.22.38

This are just animations, but are a neat feature for the player to know when one of the drones is charging or destroyed. When the battery reach 0 the drone will be unusable, the player will need to repair or buy another one later on.

Drones, when in a certain place, can recharge their batteries, this is a simple physics check, nothing fancy. I didn’t use any other method because this allows for me to move the base if I so desire in an easier way than any other method, I just have to move the recharging station instead of changing the code of all the different prefabs.

Selecting a Drone
When a player presses the key 1, 2, 3, 4, 5, or 6, the selected drone and it’s battery indicator change color, this is to help the player to keep track of the drones.

This was done with this code: I’m pasting this, because it might be helpful for some people doing actions bars like the ones found in WoW, Minecraft, Diablo, and others.

//An array that holds the keys.
 KeyCode[] keyCodes = new KeyCode[6] { KeyCode.Alpha1, 
KeyCode.Alpha2, KeyCode.Alpha3, KeyCode.Alpha4, 
KeyCode.Alpha5, KeyCode.Alpha6 };

 void SelectDrone()
 {
    for (int i = 0; i < 6; i++) //A loop that...
    {  
        //... checks if any of the keys has been pressed
        if (Input.GetKeyDown(keyCodes[i]) && drones.Count > i) 
        {
            //Returns the previous selected drone to it's regular color
            if (moveDrone != null) { moveDrone.ChangeColor(basicColor, false); }
            //Selects the drone and changes it color
            moveDrone = drones[i];
            moveDrone.ChangeColor(selectionColor, true);
        }
    }
}    

This is all for today, I’ll start tuning some things and also start coding others, the game is almost done.

1 Like

Almost done!

The game is almost done! Only a few things remain to be done which are:

  • Main Menu
  • Tutorials
  • Score
  • Timer
  • Store

Sounds like a lot but in reality the only thing that will be kinda hard to implement, mainly because it will rely on other systems, is the store, I’ll need to do some refactoring. The other things will use the systems already implemented, so there will be very little coding, actually for the Tutorials I’ll not use more code, with the tools I created will be more than enough to design it.

As you can see I did some of the art and coded the delivery and grab systems. Each time an order is placed a food icon will appear on the grid, the player can send a drone to a restaurant to pick the order and then deliver it, a drone cannot pick an order if no order has been placed.

This is were the fun begins
Game design. This part will take me roughly two days to balance. I still need to tweak the colors, adjust the UI, balance prices for the drones and so much more.

I hope I’ll get this done by Friday.

1 Like

Last Update Before Game Launches

Everything is up and running!

Timer is done alongside the “score” which is the money you earn per delivery.
I still have a lot of work to do, like doing the extra drones, the store, the tutorial and tweaking the art which is the thing that will consume most of my time at this point, also testing everything will take a while, already discovered some bugs and fixed them, I still need to fix that black arrow tho.

It’s quite fun to see the progress through this images and posts, it started as a bunch of green screens with a placeholder sprite, now everything looks so chaotic, too much going on, I like this game, it’s definitely not for everyone, the amount of panic it can cause is quite high, having to keep track of all the drones battery without knowing the exact battery left is kinda scary and I haven’t implemented the last battery draining mechanic yet, that is going to cause a lot of issues for the player.

1 Like

This will be the last Update before game launches… I know I said that before but this has been such an amazing ride.

I’ve learned a lot from this little game which isn’t little and drove me crazy in more than one way, I’m just here to say that I’ll be writing a… lengthy?.. I don’t know, but I’ll be writing a postmortem because I definitely learned so, so much from this, I can even describe how much I learned from this. I’ll try to make it as interesting as possible, I’ll also apply a lot from what I’ve learned in the next project, Project Boost.

The game is almost ready, I just have to implement a single thing which is the store, and also design it… ok… is not as ready as it should be, but it is, there’s a game loop running, tutorial is completely done, main menu is also done, sounds, everything is ready to launch with that small detail. Hope you guys like it.

1 Like

Wow you have been very busy!! Great work with the updates and the game! How did the release go?

1 Like

I’ll release it tomorrow! I still have one key feature to implement.

Now, this is truly the last one… I just want to take a rest, I’ve been doing art and coding for the last 5 hours and the day just started, I’m tired xD

The store is still missing some components but the game loop is working perfectly, you can buy a drone then you can use it in the game, you can also replace drones with new ones, you’ll have to replace drones that you lost and you can lose or keep going until you get bored of “coding” drones.

Depending on how much it takes me to implement this last two things the game needs I’ll probably code and make a special feature, which I might not add because I would have to do a tutorial for that and I don’t want to :rofl:

PostMortem

Play the game HERE at your own risk.

What the… happened?
Well, I had to cut the entire tutorial because it’s just not workin! Why? I have no idea, not a clue! In Unity the tutorial runs perfectly, but the moment I compile everything stops working, this annoyed me to no end, but let’s forget about that shall we.

Ok… what went wrong… pretty much everything. The game isn’t fun whatsoever, it isn’t balanced at all, and that’s all because my hideous code, it’s the biggest spaghetti I’ve ever done, and I’ve cooked for parties, this game was supposed to be small, but it went completely out of control, the game over isn’t even a game over, you die and go the title screen but your score remains! That’s how useless the code is!

The important question here is “Why did this happen?”, it happened because I had no plan, I actually had one, I want to take a picture of it but I’m just tired and want to write this. So I’ll just write it down:

MainMenu -> Play -> Score Screen || -> Game Over.

That’s it, there were no tutorials, there were no enemies just move the drones, and try to collect money. It was supposed to be a simple “compete with your friends to see who can get a higher score” type of game, now it is a super grind fest to buy more stores and drones and what not, it has game loops inside game loops, that wasn’t the plan.

I’m tired, I’m super stressed, and I just want to lay down. This was a nightmare to pull off, the game looks so simple but it isn’t, it truly isn’t and nothing was planned, if you play the game, which I wouldn’t if I were you, you’ll notice that the GameOver/Success screen doesn’t some parts of the screen, Why? Because I didn’t plan that, I’m using over 200 layers for the sprites, 200! I have no idea what covers what, what’s on top of what because nothing was planned, I had to use so many mask to pull some of the effects but instead of doing things the organized way I made a mess.

Everything in this game is a mess, the folder structure, the scripts have circular dependencies, the prefabs, the stats, the scriptable objects, nothing makes any sense and I don’t want to go back to that game ever in my entire life.

This is why I decided to start making smaller games rather than make that big game I want to make, I’m still lacking a lot of experience and this small project showed me that.

What’s the next step?
Continue with the course, take a few days off of coding, at least on my own and just follow Ben’s and Rick’s sweet voice to guide me through project boost one more time.

Fresh acquired knowledge to apply - Project Boost
I want to try and make project boost and enjoyable experience not just for me, but for the player, Drone Eats as it is now is not enjoyable, I impregnated that game with my frustration.

Here’s what I’ll be doing for project boost:

  • Start with the player experience, that was perfect with Drone Eats, just write things down and make them as simple as possible.

  • Be sure to make the game loop as descriptive as possible, try to look forward instead of just doing things as they come up.

  • Code from the Start not from the middle. I had always started my projects by making the main mechanic, I think that needs to stop and start making things not like a prototype but rather as full game, trying to think as ahead as possible. I know this is not how big companies work, but I’m not a big company with a big team. I can try to look for my “game development” style and I think I found it. Or if I’m coding in the middle, then be sure to include those slots to fit the start and the end. One thing that happened is that I didn’t see the need to spawn or buy drones, that came way after I finished the main mechanic, that’s probably why the Tutorial isn’t working.

  • Use other kind of tools, like Todoist to have a detailed list of what should I be doing.

  • Longer deadlines.

I want to feel proud about making project boost the best game I can possible make, so far, in my dev journey, I’ve only had 1 game I’m actually proud of, I want to change that, I want to make a game that is worth people’s time. I’ll do my best, I’ll be fore organized and far more detailed with what I actually want to achieve, think before coding, think before making art, think before anything. Seriously you would be amazed by the amount of audio sources in the Drone Eats, that’s because I didn’t thought of adding sound until I was testing and everything felt so… silent.

But the best thing I get from all of this is this Devlog, I was thinking to not write a develop, but I will, this is a very good learning experience, and it also might help someone, which is nice.

If you are reading this in a few days from now, or reading this years ahead, thank you for taking the time to read all this nonsense, have fun and keep “deving”!

Edit:
I fixed the tutorial, long story short, there was some racing going on, yay spaghetti!

Privacy & Terms