Dunkelseele's Forum Posts

  • I take the liberty to bump this topic, because I think it's unlikely that no one here has a good hint how to get the problem solved... or so I hope

  • Hi,

    currently my lighting looks like this simplified version of my layer structure:

    0 A layer with GUI

    1 Layer with 75% Black background (to darken everything, I may later change the opacity of the layer to simulate daybreak or something)

    2 Layer for sprites

    3 Layer for shadow-caster objects beneath the sprites

    4 Background Layer for all textures/sprites that go behind all other objects (ground level)

    Now my first try was to simply put a light on a layer between 2 and 3. This results in a complete black level except for the part where the light was placed, all shadows act as like 100% opacity.

    screenshot:

    <img src="http://dl.dropbox.com/u/12049513/Construct/ZombiePanic/lighting1.jpg">

    If I add the effect "additive" it starts to look a little better, still it's dampened by the "darkness"-layer 1. Screenshot:

    <img src="http://dl.dropbox.com/u/12049513/Construct/ZombiePanic/lighting3.jpg">

    Then I recreated a tip from somewhere in this forum, to use a sprite on layer 1 and set it to effect "erase", that works - but without the shadows. Coloring of the "light" is also not possible. since it only partial erases layer 1... Screenshot:

    <img src="http://dl.dropbox.com/u/12049513/Construct/ZombiePanic/lighting2.jpg">

    How do I add proper colored lights that play nice with my shadow-caster objects?

    Thanks would be much appreciated!

    Best regards,

    Noel

  • Yeah, that did help me... I have now shadows that don't overlap anymore, thanks for that!

    It's a shame that I have to create a ton of shadow-caster elements to suit every not-quadratic element I use. I hope a better shadow-caster will be implemented in Construct 2, that would be a killer feat for me.

    Best regards,

    Noel

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It will be updated eventually, and the interface will be pretty similar to the one in the physics behavior. However, if we finish the inline editor for the physics complex shape, then we can just copy and paste the code from physics into shadow...

    I found this quote in an old post from around 2007 or 2008. Is this done, and ready to be copied and pasted? I read trough all threads in the forum vaguely touching the shadow-casting-of-complex-objects-subject... but the only finding seems to be that it is not possible.

    I am desperate enough to buy anyone a grand hot Venti who helps me on this...

    Best regards,

    Noel

  • Hello,

    I need your help with understanding something: A shadow-caster behaviour slapped onto a sprite that is round, is using the boundary box for rendering the shadow. The boundary-box is quadratic. This makes the shadow also quadratic. How to change this?

    Is the only solution to make a specific collisionbox for each not-quadratic object that will draw a shadow?

    The other thing is: Why does the shadow of two shadow caster-objects overlap, as if they where on top of each other? Screenshot: <img src="http://dl.dropbox.com/u/12049513/screenshot_01.png">

    *.cap if someone wants to have a look: http://dl.dropbox.com/u/12049513/ZombiePanic.cap

    Please help me on this, it's driving me mad.

    Best regards,

    Noel

  • I feel a bit stupid. I didn't see that you can invert conditions. That did the whole trick. Next time I try to search more careful before shouting for help.

  • Hi!

    I have some zombies running around my map. That's okay, I put them there.

    I get the moving state via condition "is moving" (RTS behaviour). I then set animation to "walk". This all works fine, except for they never stop walking. So what I need is a "is not moving" condition or rather a "special condition" that is "not". I tried it this way:

    Zombie is moving -> Set Zombie animation to "walk"
    else -> Set Zombie animation to "idle"[/code:21gge1gc]
    
    But that didn't work either. At the beginning of the level however, they are all standing still, even when one of them is starting to move ... 
    
    .cap for looking into it yourself is here: [url=http://dl.dropbox.com/u/12049513/ZombiePanic.cap]http://dl.dropbox.com/u/12049513/ZombiePanic.cap[/url]
    
    Best regards,
    Noel
  • Hey,

    sorry to dig up this old thread, but I found it via the search and thers that may find this too should maybe know this:

    To make this work with tiled backgrounds, you have to use a block-element (no sprite) with shadow-caster behaviour and properties "solid", and the sprite or tiled background on top of that (work with layers here, because you aren't allowed to make the shadow-caster block just beneath the tiled-background on the same layer - it leads to strange results). Making the shadow-caster block invisible at runtime via events also don't work, the shadow-caster element will need to be visible (although beneath another sprite/tiled background) to cast a shadow.

    I used different blocks with standardized heights (50 for walls, 10 for high objects, 1-2 for obstacles like crates etc).

  • Hi,

    I thought that I could also show my little project at the time, after reading trough all the 67 pages of this thread. It's very early WIP, in fact I just started working on it during this night. Yet it is already a little bit of fun, to kill the ugly placeholder-zombies.

    <img src="http://www.strongground.de/bunker/images/ZombiePanic2.jpg">

    As you can see I have a flashlight. It has simple dynamic lightning via light-element and shadow-tracer.

    <img src="http://www.strongground.de/bunker/images/ZombiePanic1.jpg">

    You can also shoot with your never-ending ammunition supply at the mindless (un)dead and watch their blood splatter around. This will of course be extended with various different blood-stains that will be randomly put on the ground on each hit via animation-frames... after all, what would a zombie game be without gore?

    I plan for it to be a strategic horror-survival game where there is no real chance of killing all zombies, rather you have to get to certain points of interest, resupply, find shelter etc. Just survive. The flashlight will partly be your only way to see and there will be always too much zombies to just shoot your way trough.

  • Thanks, SullyTheStrange... that was a perfect guess. I forgot to set the animation not be looped. That easy. Works perfect now.

    Thanks also chrisbrobs, very good to see that I was doing it right, basically (comparing with your event-list). I want to create all FX and visuals myself though...

    Best regards,

    Noel

  • Hello!

    I recently dug up Construct because the urge to create a top-down zombie game that would be better than Zombie Horde 3 was too much for me to bear.

    I quickly ran into a problem tough... how do you create decent muzzle-flash? Currently I have a animated (2 frames) sprite, which I create together with each bullet fired from the player-sprite. But how do I delete the sprite afterwards, because at the moment it just stays there indefinitely... I tried to destroy it after the animation has ended, but that didn't impress it a bit.

    I'm sort of stuck here, any help ... please?

    Best regards,

    Noel

  • Okay, that's my current problem:

    I want to draw him a column of tiles. I do this via:

    FOR EACH entry in array "Array" {
     IF:
     value at Array.CurrentX, Array.CurrentY 
        THEN:
        create object "GenericTile" at (LayoutWidth / 2) + (Array.CurrentX * Global('tileoffset_x')), 20 + (Array.CurrentX * Global('tileoffset_y'))
        add 1 to global variable 'x_counter'
    [/code:2hl03ttl]
    
    Fine. He should have drawn a number of tiles now ... but if he doesnt stop, he will draw the next few rows also at the same position. So at the end, no matter how many columns I wanted, I will have only one column with all other columns stacked over it. So I want him to stop after the first column is done, correct the offset and continue.
    
    [code:2hl03ttl]
      IF:
      'x_counter' equal to 'number_of_columns' 
        THEN:
        substract 'substractor_x' from 'tileoffset_x
        substract 'substractor_y' from 'tileoffset_y
        add 1 to global variable 'number_of_columns'
    }
    [/code:2hl03ttl]
    
    So the next column will be set off by the value of the substractor (usually the width of the tile). I continue this behaviour as often as needed till all columns are done. Is this wrong? It has to be, because it doesn't work.
    
    Suggestions please?
    BTW: Today is a rainy grey day. -.-
  • Epic. Using frames with zero animation speed is a clever thing. But I think this doesn't really helps me with the placing of my tiles. Besides the problem would then be, to change the animation frame of every tile according to numbers in an array.

  • That's a whole other box of worms since every other row/column is offset by a tile size.

    If it makes things easier you can make a grid manually in the editor, and then load all your images into one sprite, then simply change the frames at runtime.

    I don't fully understand that. I can toggle on a visual grid to help manual placement, but that's not what you meant, right?

    And how (and why) should I want to put all tiles into one sprite? Im utterly confused

    Thing is your still going to have to figure a way to get the offset, as well as pick that particular instance.

    'm out, maybe we talk about different things? At the moment the x/y positions of tile placement are defined as: (LayoutWidth / 2) + (Array.CurrentX * Global('tile_offset_x')), (20 + (Array.CurrentX * Global('tile_offset_y')) whereas the half-tileset-variable is used to offset the tiles, and is after every complete vertical row reduced by a full tilesize (50, 26). So I should start with a row as long as the arrays Y-value and continue to the left with new rows Array-x-length times...

    My problem at the moment is, that the condition at which it should jump into the new row (by changing the offset) to place it, is too true. My current event sheet in shortform:

    Fill Array with random numbers,
    go into for each loop {
      if Array.CurrentX, Array.CurrentY is 1 - place Desert sprite at (see formulae above) and add 1 to variable x_counter.
      if above condition is true and the variable x_counter is greater or equal than the Arrays X size - substract 50 from tile_offset_x and substract 26 from tile_offset_y
    
     the same thing above again with the only difference that, if Array.CurrentX, Array.CurrentY is 2, a grass tile will be placed.
    [/code:1bngpcsa]
    
    I'm aware that at the moment, it would only produce two correct aligned rows... and probably all other rows over the second one after that. But even this don't work. Because every loop he substracts again from tile_offset_y and x which leads to abysmal values like -4029 and greater. I need this substraction only once, for now.
    
    
    

    One thing I'll suggest is pick your tile sizes now, and make sure they work for both height and width... and divisible into the map. 48 x 23 doesn't work too well.

    Yep, I did that after finding out I need to offset each next tile by half the tilesize, and 23 really isn't that great for dividing. So the new tilesize is 50x26px which divides nicely into 25x16 offsets.

    I just tried iso sprites with rts behavior with no issue (except sorting, of course, but that's better solved with the filmation algorithm... it gets easier if everything is ground-based)

    You're not telling me my effort was pointless because I could used an built in behaviour which does everything I am trying to do manually, are you? I can't even seem to find that RTS-behaviour-thingy in Constructor...

    Beautiful concept pixel art btw. Really, kudos.

    Thanks, wait till you see the real deal ingame, and in (modest) motion.

  • Thanks to you two, I now understand another concept: referencing others objects values as variables in objects. I'm now near solving the problem that my map would need to be looking diamond-shaped while the map from your example, Citnarf, was a angular. box shape. You get it.

    I'll probably upload a first version of the generator with some eye-candy tomorrow, so you can see all your effort in helping didn't went down the drain.