1st shadow test

Discussion in 'Feedback Requests' started by lennard, Sep 23, 2010.

  1. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,390
    Likes Received:
    12
    I have been adding edge shadow options on a layer by layer basis to Dungeon Demon this week (as inspired by comments in this thread: http://forums.indiegamer.com/showthread.php?t=22369).

    Here are some first results, I'll be posting some continent maps as soon as I get a little more code working. I have given the designer control over interior and (soon) exterior edge shadows/glow effects. Here's a sample dungeon built with a floor layer and then a wall layer on top that has some alpha channel to create a drop shadow effect. Here is a before screenshot:

    [​IMG]

    and after a slightly green tinted shadow (I'm a programmer, color choice may not be optimal) has been been added with the new edge effects option to the floor layer:

    [​IMG]

    Any constructive feedback would be appreciated as I'm in the thick of the code right now. Thanks.
     
  2. Jasmine

    Jasmine New Member

    Joined:
    Aug 8, 2010
    Messages:
    195
    Likes Received:
    0
    I like the effect, and it certainly creates contrast with the walls. But I would say it is too dark right at the edge of the floor. Perhaps the dark trim + shadow is too much together. Would it be easy to use the shadow without the dark trim or is that part of the tile texture?

    Also, with the shadow, the floor texture may be better lower contrast in itself. At the moment it looks like the broken stone texture is competing with the block walls.
     
  3. electronicStar

    Original Member

    Joined:
    Feb 28, 2005
    Messages:
    2,068
    Likes Received:
    0
    I don't like it, it doesn't add anything to the scene and it doesn't look like shadow at all, shadow should always come from a light source, your "ambient occlusion" solution doesn't work IMHO.
    could be useful though for some very special cases, for example for giving a sense of depth in a well ....

     
    #3 electronicStar, Sep 23, 2010
    Last edited: Sep 23, 2010
  4. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    And in the other corner, I like it a lot. A whole lot.

    It just makes a boring picture (there's only a couple of repeating tiles in this sample) into something that looks like someone has spent a lot of time hand drawing it. I'm definitely getting a feel of "ye age olde map to thine treasure" from the bottom image.

    I think when you munge this in with all your other details it's gonna look shit hot.

    Mind, I'm still not sure why you're actually making this tbh. Pet project? :)
     
  5. bantamcitygames

    Administrator Original Member Indie Author Greenlit

    Joined:
    Jul 27, 2004
    Messages:
    1,731
    Likes Received:
    78
    The second one looks better if it were an underground sewer or something like that (because of the green color), but for more generic shadow I like the top one. Both are too dark at the edge though. Try about half as dark and see what that looks like. I also think it would look better if you randomized the floor tiles a bit like you did with the wall tiles, although now that I look more closely the wall tiles don't look completely random either as there seems to be an obvious pattern. I would try mixing that up a bit as well.

    Please post update photos... I love to see this sort of thing :)
     
  6. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,390
    Likes Received:
    12
    Thanks for the feedback. Jasmine, I think you are right about the walls - I read your comment a couple of days ago and have been pondering what to do since then. The current wall creation system in Dungeon Demon is a little clunky - you pick a texture and tell the program to assemble walls which it does. You then quit the program, copy the new walls into the graphics directory tree and restart the program... I know. And there has been some demand for an auto-wall feature from my small user base. I've been more focused on making pretty new picture features for DD so an auto-wall feature has not been at the top of my list. But it is now. The upside is that the designer will be able to use the edge effects tool to tune the color, depth and alpha channel on the shadows which I am excited about. See y'all in a week with new pictures.

    Paul, I appreciate the enthuisiasm and I hope you are right. I don't play D&D anymore (my kids do) but it was such an important part of my teen years that working on a program like this satisfies my inner geek.

    Bruno, I'll think about a system that does something to randomize the wall tiles. It's been a peeve of mine that the output from larger map sections in DD is too flat.
     
  7. Jasmine

    Jasmine New Member

    Joined:
    Aug 8, 2010
    Messages:
    195
    Likes Received:
    0
    To get the most realistic effect, you could take a radiosity approach:

    Decide on a height to the walls
    For each point on the ground {
    Calculate the amount of sky visible from that point.
    Use that to determine the shadow alpha at that point.
    }

    :D
     
  8. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,390
    Likes Received:
    12
    Fundamentally I want this to remain a 2d, lego like tool that people can use to rapidly click things together. Every time I start thinking about a 2.5D approach to things the UI gets far too complicated for me to contemplate. A smarter bear than I might see this through... but I'm not convinced. I'm going to stick with 2d with knobs to twiddle.
     
  9. AlexWeldon

    AlexWeldon New Member

    Joined:
    Feb 6, 2008
    Messages:
    1,256
    Likes Received:
    0
    I think the problem is that you're combining the built in shadow that the tileset has, plus a generated one. It should be one or the other... if you're going to allow custom shadows, the tileset shouldn't have one built in, as the combination looks bad.
     
  10. Jasmine

    Jasmine New Member

    Joined:
    Aug 8, 2010
    Messages:
    195
    Likes Received:
    0
    My idea about the radiosity calculation would keep the game graphics entirely in flat 2d. The height of the walls (H) is a figure used for calculation only. As programmers, we just imagine the walls are standing that high, and work out how much sky we would be able to see from ground level.

    It's a little bit of geometry.

    So for each pixel on the ground with coordinates (a,b)
    {
    Take the coordinates of a wall corner (x,y), add in height H and shift the origin to make 3d vectors of the form (x-a, y-b, H). Project those radially onto an imaginary sky sphere x^2+y^2+z^2=1, and calculate how much of that sphere is occluded by all the walls, which gives the alpha for pixel (a,b) in the flat 2d image. Repeat for each pixel :)
    }
     
    #10 Jasmine, Sep 25, 2010
    Last edited: Sep 25, 2010
  11. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,390
    Likes Received:
    12
    That there is a slippery slope that ends with every object (tree, rock, chest, pile of skulls) getting some kind of geometry attached...
     
  12. Jasmine

    Jasmine New Member

    Joined:
    Aug 8, 2010
    Messages:
    195
    Likes Received:
    0
    It's only slippery if you have an all or nothing attitude to geometry :p

    Object shadows could be done with fuzzy circles on top of the the terrain shadow layer.


    edit:

    Here is an example of what my radiosity idea gives for a simple square test room, calculated per pixel.

    [​IMG]

    The value assigned to each pixel is the amount of light hitting that pixel as a fraction of what it would be with a completely unoccluded view of the sky. The perimeter walls here are imagined to stand 30 pixels high.

    [​IMG]

    :)
     
    #12 Jasmine, Sep 26, 2010
    Last edited: Sep 26, 2010
  13. AlexWeldon

    AlexWeldon New Member

    Joined:
    Feb 6, 2008
    Messages:
    1,256
    Likes Received:
    0
    How is that any different from what he had before, other than that you've chosen your parameters badly and thus darkened the entire room? It's basically just Photoshop's "Inner Glow" filter, but set to darken rather than screen.
     
  14. Jasmine

    Jasmine New Member

    Joined:
    Aug 8, 2010
    Messages:
    195
    Likes Received:
    0
    There are only two parameters: How high the walls are and how bright the sky is, but the sky is the same brightness in both the before and after images.

    It is surprising how strongly a low perimeter wall is affecting the amount of light entering the room. I imagine this is because we are rarely in a situation where we have a 360 degree horizon (out on the open ocean, or on the peak of a mountain). We normally have buildings and trees and landscape heavily occluding the low sky. So in reality, we wouldn't get much additional shadow if low walls are present or not.

    It is far more advanced. Radiosity is a global illumination effect that models the behaviour of light; an inner glow filter is not.

    A square room is very simple through. I expect it would look better with corridors and alcoves connected to the room, as you could then see how these features realistically affect shadow. :)
     
    #14 Jasmine, Sep 27, 2010
    Last edited: Sep 27, 2010
  15. AlexWeldon

    AlexWeldon New Member

    Joined:
    Feb 6, 2008
    Messages:
    1,256
    Likes Received:
    0
    It doesn't matter if it's realistic or not... this is a map, not a game world. If the artist designed the tiles at a certain brightness, it's because they're meant to be that brightness in order to make the map clear and readable. Adding a bit of shadow around the edges creates depth, so that's fine, but if your technique results in things not being the colors they're meant to be, then it's counter-productive.
     
  16. Jasmine

    Jasmine New Member

    Joined:
    Aug 8, 2010
    Messages:
    195
    Likes Received:
    0
    Since I do the art for my own games, I get to fiddle with both the graphics and the drawing techniques until things look nice. I can see the second image looks a bit dark, (it was only a quick demonstration) but I then came up with an explanation as to why it does look dark.

    If this were my game, I would now be fiddling with both the art and the technique until the combined image looked right. But I would stick with this technique because I know how good radiosity is for generating shadowy effects. :)
     
  17. Wrote A Game or Two

    Wrote A Game or Two New Member

    Joined:
    Oct 9, 2009
    Messages:
    179
    Likes Received:
    0
    Jasmine, I like this approach but I agree with Alex, it looks like darkness, not depth to me.

    What I'd do is create a shadow layer like you've done, but with more defined edges and with both shading and highlights, that can be rotated to indicate which way the light is coming from.

    If I wasn't at my dayjob work computer I could create an example to show you what I mean, but alas... maybe when I get home I can whip something up to show you what I mean if you're interested.

    And also (after rereading your post) my idea is far more simplistic than calculating wall height and such on the fly when the tiles render. This would just be a premade graphic the engine would render (and scale if need be) on top of the room. Assuming this is for some kind of game-art-asset-creator, and not a game itself, I'd write it so that when you achieved the look you liked, it would "bake" the shading onto the finished map so that all your game engine has to do is plop the final image on the screen and move on.
     
    #17 Wrote A Game or Two, Sep 27, 2010
    Last edited: Sep 27, 2010
  18. AlexWeldon

    AlexWeldon New Member

    Joined:
    Feb 6, 2008
    Messages:
    1,256
    Likes Received:
    0
    But this isn't a game. This is a map creation program for pencil & paper RPGs. The end user is probably not an artist and almost certainly not a programmer. The result has to look nice without "fiddling with both the art and the technique." Plop down some tiles, set the effect using a menu and at most a couple of numbers, and end up with something that looks good.
     
    #18 AlexWeldon, Sep 28, 2010
    Last edited: Sep 28, 2010
  19. Jasmine

    Jasmine New Member

    Joined:
    Aug 8, 2010
    Messages:
    195
    Likes Received:
    0
    I've never assumed otherwise. :confused:

    You're confusing the end user and the programmer in what I wrote. If the programmer wants the result to look nice, then they will have to fiddle with their program's art and drawing technique, as lennard is currently doing, and is what I would currently be doing if this were my program.

    But as it's not my program, I've made a (imperfect) demonstration of my technique of choice.
     
  20. AlexWeldon

    AlexWeldon New Member

    Joined:
    Feb 6, 2008
    Messages:
    1,256
    Likes Received:
    0
    It still sounds like the sort of technique that makes sense for a game, where the programmer is controlling the output. How can the programmer know what sorts of parameters are going to produce the best-looking results when he doesn't know what sorts of maps the user is going to be making?

    You need to leave some control in the hands of the user, but make it simple. I think something like a stripped-down version of PS's "Inner Shadow" would work better; let the user control shadow offset, blur, opacity and color, and that's about it. Should produce reasonable results without overwhelming the user.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer