Page 1 of 2

In The Shadows

Posted: Thu Feb 28, 2013 5:49 pm
by urmane
Inspired by the old PC game Thief, I'm writing a module called In The Shadows. The objective is to create a "sneaker" type of game - that is, where one normally wants to avoid rushing in to combat - and to create and maintain a feeling of nervousness and fear on the part of the player.

Besides the overall concept, the game details are not finalized, though I have plenty of ideas.

Technically, I have several objectives to help with the overall theme:
- variable ambient light - the ability to see just a little if the player is not holding a light source
- the ability of NPCs to see a light source from farther away than their own light source extends
- NPCs normally moving before they catch sight of the player, including patterns like patrol routes by guards
- a lockpicking and/or puzzle solving pop-up UI
- procedurally generated world(s), and maybe other things, too

The TOME engine is great, it was pretty easy to start on the module and some of the above.

I'm keeping the code here: https://gitorious.org/its

Re: In The Shadows

Posted: Fri Mar 01, 2013 4:39 pm
by VRBones
Sounds pretty cool. I'd be very interested in how you're going to tackle lighting, because.. err .. thats the bit I'm hung up on at the moment ;)

Re: In The Shadows

Posted: Sat Mar 02, 2013 3:47 pm
by urmane
VRBones wrote:Sounds pretty cool. I'd be very interested in how you're going to tackle lighting, because.. err .. thats the bit I'm hung up on at the moment ;)
So far, I've added an ambient_light variable to zones, and modified the canSee() function to take it into account. I've also modified it so that NPCs can see lighted squares in their FOV.

from my Actor.lua:

Code: Select all

--- Can self see the target actor
-- This does not check LOS or such, only the actual ability to see it.<br/>
-- Check for telepathy, invisibility, stealth, ...
function _M:canSee(actor, def, def_pct)
        if not actor then return false, 0 end

        -- Check for light / visibility
        -- Actor can always see self or
        -- Actor is emitting light (we already know he's within sight radius) or
        -- We have a lite and he's inside the radius or
        -- There is ambient light and self can pick up actor out of the shadows
        if ( actor == self ) or
                ( actor.lite and actor.lite > 0 ) or
                ( self.lite and ( core.fov.distance(self.x, self.y, actor.x, actor.y) <= self.lite ) ) or
                ( game.level.data.ambient_light and self.sight_min and ( self.sight_min <= game.level.data.ambient_light ) ) then
                -- FIXME - need to check if actor within other emitted light radii, maybe not here
                -- Visible unless other effects prevent it, check those now

                -- Check for stealth. Checks against the target cunning and level
                if actor:attr("stealth") and actor ~= self then
                        local def = self.level / 2 + self:getCun(25)
                        local hit, chance = self:checkHit(def, actor:attr("stealth") + (actor:attr("inc_stealth") or 0), 0, 100)
                        if not hit then
                                return false, chance
                        end
                end

                if def ~= nil then
                        return def, def_pct
                else
                        return true, 100
                end
        end
        return false, 0
end

Re: In The Shadows

Posted: Sat Mar 02, 2013 10:02 pm
by VRBones
I gave it a run and it's looking pretty good so far. Were your torches (or other static light sources) going to be mapped into the ambient light or treated like unmoving actors?

Re: In The Shadows

Posted: Sat Mar 02, 2013 11:38 pm
by urmane
VRBones wrote:I gave it a run and it's looking pretty good so far. Were your torches (or other static light sources) going to be mapped into the ambient light or treated like unmoving actors?
Ambient light is intended only for the player to see a small bit if they don't have a light (desirable, as the NPCs can see the lights), or for NPCs to pick up the player "seen in the shadows". It would be really cool to have variable ambient light across a level, but one thing at a time.

Torches and static light sources are just going to light up an area, I just need to encode a mechanism into the zone files to denote them I think.

Re: In The Shadows

Posted: Thu Mar 07, 2013 8:44 pm
by chezzo
Maan, to do torches I was going to animate different tiles, one for the area right next to the torch, one for the next square out, and so on. Please let me know how you did this so I don't go blind from all the pixelating.

Re: In The Shadows

Posted: Sun Apr 14, 2013 3:12 pm
by urmane
Flickering lights added to the guards - randomly sets his projected light within his min and max radius
Pulsing lights added to will-o-wisps (in the graveyard) - increases stepwise to max radius, then decreases stepwise to min radius

Re: In The Shadows

Posted: Sun Apr 14, 2013 3:17 pm
by urmane
chezzo wrote:Maan, to do torches I was going to animate different tiles, one for the area right next to the torch, one for the next square out, and so on. Please let me know how you did this so I don't go blind from all the pixelating.
I've read this a bunch of times and still can't parse it - what are you asking?

The effects in there now are just what comes with TOME - so far I'm only changing the "lite" variable, and the existing display code is doing everything on the display regarding dimmer squares at the edges. Is that what you're asking?

Re: In The Shadows

Posted: Thu Aug 22, 2013 5:55 pm
by urmane
Flickering torches and braziers added.

Re: In The Shadows

Posted: Thu Aug 22, 2013 6:01 pm
by Zireael
I already told you I like the idea, and we wanted lighting to be an important part of Veins, so I'll be following this one intently.

Speaking of, you said you have ambient light. Does it cause slowdowns in level generation? (we used to have something similar, but it slowed down level gen a lot and we're wondering what's the problem)

Re: In The Shadows

Posted: Thu Aug 22, 2013 6:12 pm
by urmane
No, but at this point it's only a static integer in the level struct. There's one extra test in canSee(), and only a small number of npcs per level so far.

I would love to make it dynamic and per-grid, but that's probably going to wait until after more of the actual game arc is fleshed out.

Re: In The Shadows

Posted: Sun Oct 18, 2015 11:46 pm
by urmane
Restarting development. (Damn you, Masterwork Dwarf Fortress!!)

Re: In The Shadows

Posted: Sun Oct 18, 2015 11:51 pm
by Effigy
I really enjoyed the original Thief game. This sounds like it will be really cool.

Re: In The Shadows

Posted: Sun Oct 18, 2015 11:54 pm
by darkgod
yay!

Re: In The Shadows

Posted: Mon Oct 19, 2015 5:13 am
by Faeryan
Sounds awesome. We need more sneaking!
Will the Stealth work like in the base game?