Friday, October 24, 2014

Articles

I'm at a point in Sever where I can't just keep building without stopping and making a plan.  I mean, there are a few things I could do, but I'd basically just be killing time before I move to the important stuff.  This is the wall I hit in projects that usually stops my progress short.  However, I imagine I'll hit this wall with every project I ever work on.  The difference between the successful projects and the failures will be whether I chose to climb over the wall or not.

It's a bit scary thinking about that.  I've done it too many times.  Anyway, rather than giving up just yet, I'm choosing to do a little research that will hopefully give me what I need to move forward.  In particular, I'm reading up on RTS networking and AI.  Sever isn't nearly your typical RTS, so I'll have to pick through the AI articles for anything that might apply, but the networking methods should be very relevant.

I didn't realize that networking for an RTS might work differently from any other multiplayer game.  However, it makes perfect sense once I think about it.  Basically, the game runs in steps, and each player gets to decide what moves to make, and all moves from all players are executed at once, and then on to the next step.  Many games communicate states of units back and forth, while RTS's typically communicate unit commands.

Because there are so many units, it would take up too much bandwidth to send the unit states back and forth for so many units.  Because they only communicate each players' commands to each other, each client computer has to run his own version of the simulation and each has to be in sync.  This is the only practical way to network a game with so much going on.

With that in mind, I'll have to rethink how I've been planning to run Sever.  I'll have to make some changes to make sure it runs in steps.  I'll also have to have all player input be sent to the engine in the form of commands.  I think I'd like that anyway.  It would simplify player interaction and how I build the AI.  Here's an article about this sort of thing from the developers of Age of Empires.

About AI, I read a few articles by the developer of AI War: Fleet Command.  I've never played the game myself, but I found the articles fascinating and I'm tempted to try the game out.  I don't know how much will really apply to Sever, but it's given me some ideas to try.  Basically, his intent with the AI was to avoid traditional decision trees.  Instead, he gives each individual unit a little bit of intelligence and has it make its decisions based on what the units around it are doing.  He did this in hopes that the AI would have "emergent" behavior, as he calls it.  In other words, he didn't want all tactics and tricks that the AI uses to be pre-programmed.  He wanted them to think for themselves and do things even the programmer hadn't thought of.

In order to do this, each unit needs to do some number crunching about what's going on around it.  This particular developer uses LINQ to run queries in order for each unit to make a decision.  I've never used LINQ, but I have been reading up on it a bit.  I write SQL every day, so it shouldn't be too bad.  Also, this method apparently requires less code to write than the typical humongous decision tree.

Again, I'm not sure if I'll use his method or not, but I think I might at least try.  I won't be able to make every node autonomous because of how crucial every move is in comparison to a typical RTS where a unit can simply turn-around and go the other way if he makes a mistake.  It will really have to be almost 100% hive-mind, but I think I can try out some of the principles he explains.

At the moment, networking might be the easier path to take.  I'll start by making the game run in steps with commands, and then I'll try to develop some simple networking code, at least enough to be able to connect by LAN.  I really think it will be important for me to actually play the game and see what strategies work and what doesn't before I can really build an AI.  I understand the mechanics of the game and I have some general ideas about what strategies might work, but when it comes down to it, I know even more strategies for typical RTS's that I'm terrible at.  So it's pretty important that I actually play the game (alot).  Once I get the networking working, maybe I'll recruit somebody to help me test it.

I'm hoping in the testing that I'll have more epiphanies.  I really need epiphanies right now.  I've also been listening to lectures by Jonathan Blow, the creator of Braid (one of the best games, highly recommended).  He says a good way to make a game is to build it around a good idea.  For example, Braid's good idea is time manipulation.  Throughout the game are time puzzles, which evolve as you progress.  A more famous example is Portal.  Portal has (or had, until Portal 2 added more) one cool mechanic that the entire game revolves around.  Rather than trying to come up with as many cool ideas as they possibly could, like most games, they just explored that one concept fully and cut out all the extra content that didn't contribute.  And the results were great.

I guess what I'm saying is that I think I have a good idea, but I haven't explored it.  I think there's so much more than networking and AI that will be put in this game.  However, I think they're the minimum.  Once I have at least enough of both to be able to play the game, I want to start experimenting.  I want to try everything out and see what sticks.  I want to try building puzzles in the game.  I want to build a typical RTS map and duke it out with another player.  I want to add different kinds of nodes with different properties and see how it affects gameplay.  I don't think it will turn out like Braid or Portal, but I want to at least use their method of building a pure game and see if I can do the same for mine.

I know that wasn't much of an update, but it's what's on my mind at the moment.  Thanks for reading!

clevceo

No comments: