Day 23- Brain Pain

Day 23- Brain Pain

Quote of the Day: “That’s what I do to stop my brain hurting sometimes. Get the basic idea down and if I’m not sure something will work I say ‘screw it, I’ll fix it later'” – Alex

Music of the Day: Not a lot, but if I was listening it was a lot of Rolling Stones

I came in today not sure what I was going to be working on, and left knowing what I’d be working on for the weeks to come. We’re implementing some massive changes to how survival mode works, to make it more engaging and fun, rather than endlessly mowing down waves of enemies. I can’t say all of the details, because almost all of it is still in the very early stages, but I can share what I specifically worked on today. The first thing is that we’re making enemies spawn in controllable waves now, rather than trickling in a few at a time like they are currently. This allows us to make more interesting formations, combinations of enemies, and gives us the opportunity to use it for those other features I can’t mention (yet).

Alex and I started the day by sitting at a whiteboard for an hour, brainstorming how formations would work, what the AI for enemies would be becoming, and how exactly everything was going to fit together. Here are the iterations of our brainstorming:

This slideshow requires JavaScript.

We then took a Pizza/March Madness break (there’s a really good pizza place down here, and the conference room has a big flat screen. Gonzaga destroyed Northwestern). And then it was back to work.

The creation of these formations is trickier than it looks, because my scripts depend on Alex’s and vice versa. We also have to hand design each individual formation, which is good and bad. The advantage is that we can be creative, make interesting shapes and such, but the downside is that it’s a pretty big time sink. Creating the default formation (2×5 rectangle of enemies) took almost an hour, because we had to make sure that they were positioned exactly the same distance apart and that the scaling was correct. The reason we’re doing it this way though is so that we can pas the enemy spawners whatever formation we want to use, and then they handle the rest. It means that we have a lot more freedom with designing survival mode than always being crippled by repetitive mechanics.

I then started working on the FormationBehavior script, which does exactly what it sounds like it does. Basically, we want the enemies to stay in formation while moving towards a player until they get within a certain range, and after that point to swarm directly at him/her. This is trickier in code than it sounds out loud. Basically, we create one instance of the formation that we then fill with enemies, and another identical instance centered on the player, then tell each enemy in the formation to path towards the corresponding position in the blank one over the player. That probably sounds pretty confusing, so here’s what I mean: think about that 2×5 formation. The enemy in the back left corner will path towards the back left corner spot on the blank formation over the player, if that makes sense. They will keep in formation like that until they get within a certain radius of the player, at which point they will all path directly at the player.

Still pretty confusing huh? Imagine having to do that all, but without being able to tell the computer what you want in plain English. It hurt my head. A lot. I slowly slogged through multiple arrays, NavMesh agents(the thing that lets you tell stuff where to go), and oh-so-many loops (remember that this targeting has to be done for each enemy individually). Finally, I had a very basic but error-free script. Now my work is done, and I pass it off to Alex for him to use in the spawners. once he’s done with all of that stuff, I get to return to it to add features and build more formations, but until then I’m going to be working on modularizing powerups (which I think I started on a few weeks ago, but moved to something else). Basically I need to make it so that each powerup handles its own effects, rather than each bot having a massive script that handles everything. It shouldn’t be too bad, it will mostly be moving big chunks of code from one script to a new one. There will be issues with a couple of the more specialized powerups, but for the most part I’m just making everything a lot smoother to use and easier to change in the future. With everyone back in the office it has become much more pleasant, and I’m never he only one here anymore. I’m enjoying myself a lot.

If you’ve made it this far, congrats! In a shameless plug for the game, I will now inform you that we’re having weekly scoreboard contests, starting this week! Winner gets cash. And no I’m not joking. It’s not a lot of cash, but hey if you get pretty good a MiniBotz you stand to make some money. Here’s the Steam sotre page if you want to join in: End shameless plug.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s