In The Shadows

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Message
Author
urmane
Cornac
Posts: 40
Joined: Sun Jan 01, 2012 5:57 pm

In The Shadows

#1 Post 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

VRBones
Low Yeek
Posts: 6
Joined: Thu Jun 30, 2011 2:58 pm

Re: In The Shadows

#2 Post 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 ;)

urmane
Cornac
Posts: 40
Joined: Sun Jan 01, 2012 5:57 pm

Re: In The Shadows

#3 Post 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

VRBones
Low Yeek
Posts: 6
Joined: Thu Jun 30, 2011 2:58 pm

Re: In The Shadows

#4 Post 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?

urmane
Cornac
Posts: 40
Joined: Sun Jan 01, 2012 5:57 pm

Re: In The Shadows

#5 Post 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.

chezzo
Higher
Posts: 55
Joined: Thu Aug 16, 2012 10:52 pm
Location: Philadelphia, Pennsylvania, USA
Contact:

Re: In The Shadows

#6 Post 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.

urmane
Cornac
Posts: 40
Joined: Sun Jan 01, 2012 5:57 pm

Re: In The Shadows

#7 Post 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

urmane
Cornac
Posts: 40
Joined: Sun Jan 01, 2012 5:57 pm

Re: In The Shadows

#8 Post 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?

urmane
Cornac
Posts: 40
Joined: Sun Jan 01, 2012 5:57 pm

Re: In The Shadows

#9 Post by urmane »

Flickering torches and braziers added.

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: In The Shadows

#10 Post 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)

urmane
Cornac
Posts: 40
Joined: Sun Jan 01, 2012 5:57 pm

Re: In The Shadows

#11 Post 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.

urmane
Cornac
Posts: 40
Joined: Sun Jan 01, 2012 5:57 pm

Re: In The Shadows

#12 Post by urmane »

Restarting development. (Damn you, Masterwork Dwarf Fortress!!)

Effigy
Uruivellas
Posts: 970
Joined: Fri Oct 10, 2014 4:00 pm

Re: In The Shadows

#13 Post by Effigy »

I really enjoyed the original Thief game. This sounds like it will be really cool.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: In The Shadows

#14 Post by darkgod »

yay!
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Faeryan
Sher'Tul
Posts: 1308
Joined: Wed Jan 07, 2004 5:01 pm
Location: Finland

Re: In The Shadows

#15 Post by Faeryan »

Sounds awesome. We need more sneaking!
Will the Stealth work like in the base game?
Stronk is a potent combatant with a terrifying appearance.

Post Reply