I started to work on a stealth thieving game. I'll be updating my progress here. I'll be trying to post my progress here every week.
Week 1: And so it starts, or
OMG, artists!The idea came to me about 2 weeks ago. A top down stealth game, in the line of "metal gear", but with twists from
Trilby the art of theft and some flexibility of nethack mixed in it.
The stealth from metal gear and trilby, combined with the "play however you want" from nethack should make an interesting mix. Do you sneak trough the airduct avoiding the guards, disabling the power and robbing the vault? or do you blow up the wall, avoid the guards in the chaos, and escape WITH the vault on a truck? It will be up to you.
(*disclaimer: The above events might or not might be implemented in the final game)
Light and shadows will be an important game element, and so I set out the program
shadow casting to start of. After 2 failed attempts with OpenGL (worked, but didn't provide the look I was aiming at) I decided to go pixel pushing. And I finally got the results I was looking for.
Next was some artwork to work with, because I'm no artist (unless you count code as art) I set out the hunt for one
in this topic. I never had much luck with finding artists before, so after I got contacted by 3 artists I was pretty happy. (Go Tigsource!)
And the the first one was never heard from again, the 2nd one had another project interrupting him, and the 3th produced something I like a lot.
At the same time I was continuing coding. Some quick and dirty collision detection and some very stupid AI later. I had something of a mockup thingy:
While you can move the player, and the guards walk in circles, they don't react to you yet.
I'll be working on the guard AI for the rest of the week, hoping to have a playable something at the end of it.
Week 2: Artificial intelligence/stupidity or
how I didn't get as far as plannedAI is HARD. I already knew this, we all know this. And I have the experience to know this. I went trough 3 iterations of guard AI last week. Before settling on the current design. Tip for all coders out there, do NOT start coding AI without a plan.
I knew how I wanted the guards to react and act (quite the same as in metal gear) but trying to build so without planning was a horror show. It became a huge mess of conditions and results. After failing twice (I can be a bit stubborn) I started to plan it out more.
There are 3 basic depths of AI:
- Low level, walking around, looking, pathfinding
- High level, deciding where to go, to walk, run, investigate
- God level, this goes beyond individuals, and makes multiple guards work together, right now just the alarm which sends all guards after you
Once I started to code in these 3 different levels I finally got something workable and maintainable. The low level didn't sound so hard, so I quickly implemented it, without the pathfinding, but just a simple walk straight to your target.
With this done the path for the high level AI was open, which is a simple Finite State Machine. With the states Patrol, Alert, Alarm and Seek. This isn't really complex, and there is still room for expansion. But for now it works.
The god level is really basic, when 1 guard reaches Alarm state, they all go into alarm. And when you are not seen for a while by any guard in alarm state, the alarm state is released and all guards go into seek state. This will require a bit more work, because letting all guards seek your last known position makes for an easy path to any other location.
It took me the better part of my free time to work this out. (ok, free time that I worked on the game, not free time I spend playing other games... curse you DesktopDungeons!) Now I'm left with the pathfinding, which A* is quite capable of. I have some nice ideas for the pathfinding, but that's for next week!