Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411528 Posts in 69377 Topics- by 58433 Members - Latest Member: Bohdan_Zoshchenko

April 29, 2024, 12:31:08 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsNot Yet Mine (working title) [started]
Pages: [1]
Print
Author Topic: Not Yet Mine (working title) [started]  (Read 1704 times)
Daid
Level 3
***



View Profile
« on: May 30, 2011, 05:32:07 AM »

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 planned
AI 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!
« Last Edit: June 07, 2011, 03:52:16 AM by Daid » Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
droqen
Level 10
*****


View Profile WWW
« Reply #1 on: May 30, 2011, 11:26:27 AM »

That lighting is awesome... or whatever it is.

Can you show me how you do it?

Also, all these things sound really cool. Best of luck. Posting to keep track. Also to ask that question.

EDIT :: I should probably click on more links, more often.
Logged

Alex May
...is probably drunk right now.
Level 10
*


hen hao wan


View Profile WWW
« Reply #2 on: May 30, 2011, 01:14:27 PM »

Looks very cool and I tried this in OpenGL a few times and didn't get a good look like you've got either.

Your lighting through the door on the left is wrong though I think - it seems to be hooking round the ceiling of the left door wall rather than the floor. It should be emanating from between the green and grey tiles, right?
Logged

Daid
Level 3
***



View Profile
« Reply #3 on: June 01, 2011, 12:42:47 AM »

Looks very cool and I tried this in OpenGL a few times and didn't get a good look like you've got either.
I got almost the result, but I was using both the stencil and the alpha buffer. And then it was still using a ton of code, and created a few artifacts in corner cases.

Quote
Your lighting through the door on the left is wrong though I think - it seems to be hooking round the ceiling of the left door wall rather than the floor. It should be emanating from between the green and grey tiles, right?
I use a simple trick for the walls, if the pixel below the wall is lit, then I light the whole wall. I made the light go up 3 pixels higher then shown in the screenshot, which looks better with these wall tiles.

The artwork is made by MegaLeon btw, he is producing fancy stuff :D I really like it.
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
Alex May
...is probably drunk right now.
Level 10
*


hen hao wan


View Profile WWW
« Reply #4 on: June 01, 2011, 04:28:24 AM »

Looks very cool and I tried this in OpenGL a few times and didn't get a good look like you've got either.
I got almost the result, but I was using both the stencil and the alpha buffer. And then it was still using a ton of code, and created a few artifacts in corner cases.

Yeah, I have decent shadows working using stencils (didn't really need alpha buffer...?), but my main problem is getting the lighting / visibility data back into the game's memory (transfer of pixel buffers form the card into the RAM is super slow) for use in gameplay.

Quote
Your lighting through the door on the left is wrong though I think - it seems to be hooking round the ceiling of the left door wall rather than the floor. It should be emanating from between the green and grey tiles, right?
I use a simple trick for the walls, if the pixel below the wall is lit, then I light the whole wall. I made the light go up 3 pixels higher then shown in the screenshot, which looks better with these wall tiles.

I didn't quite mean that. The wall lighting is definitely cool and correct. Here's a diagram of what I mean:



The artwork is made by MegaLeon btw, he is producing fancy stuff :D I really like it.
Yeah nice art. MEGA LEON
Logged

Daid
Level 3
***



View Profile
« Reply #5 on: June 02, 2011, 03:10:49 AM »

Ah, yes Smiley I see what you mean, it's because of the graphics in combination with my "old" idea. I made the shadowcasting with zelda style walls in my mind (I had fancy 3D walls with OpenGL)
You cannot walk under those black tiles yet, so the lighting is correct if you look at it that way.

I still need to update the collision detection (which is very bad right now)
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
gameyeti
Level 0
*


View Profile
« Reply #6 on: June 02, 2011, 10:29:56 AM »

Daid, have you seen the game Monaco? It's very similar

http://www.pocketwatchgames.com/Monaco/

After looking at this game, if you decide to continue then I suggest you watch Andy's GDC talk from this year at: http://www.gdcvault.com/free/gdc-11 Search for "How to Win the IGF in 15 Weeks or Less" as he talks about his lighting algorithm in the session.
Logged
Daid
Level 3
***



View Profile
« Reply #7 on: June 03, 2011, 10:16:13 AM »

@Alex: I forgot to add, in the OpenGL version I used the alpha buffer as a place to combine the multiple light sources.

Monaco might sound similar, but it will be very different, Monaco seems very action oriented, while mine will be much more slower pace. I also see the same light effect that I managed to get with openGL, nothing wrong with it, but not what I was looking for.
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
Daid
Level 3
***



View Profile
« Reply #8 on: June 07, 2011, 03:52:47 AM »

Added my last weeks of progress in the first post. (which isn't a lot of progress...)
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic