Who stands in front of who..

smurftedsmurfted Member, PRO Posts: 523

I have a couple of tall actors doing their thing in a scene but when they walk infront or behind the other one it doesn't look right. The one behind still looks Infront etc. How can I fix this?

Comments

  • pHghostpHghost London, UKMember Posts: 2,302

    There are some templates for this, I think.

    Basically, you need to trick it.

    Depending on an attribute (which defines the actor on top), you will need to spawn a constrained actor at the top of the layer group.

  • jamie_cjamie_c ImagineLabs.rocks Member, BASIC Posts: 5,659

    You can adjust actors positions on layers, they are used just like layers in Photoshop. Layers on top, will literally be on top of layers below. So put the actor you want 'in front' on a layer above the actor you want 'behind'.

  • smurftedsmurfted Member, PRO Posts: 523

    Sorry i wasn't clear jamie_c, i did mean actors that pass both infront and behind of each other.

    Does anyone know a good template with an example of how to do this?

  • ArmellineArmelline Member, PRO Posts: 4,916
    edited March 2016

    If you want to change the layer order, you have to do it via spawning. It can be done very effectively in GameSalad. The effect can be seen in this game:

    https://itunes.apple.com/us/app/election-2016-the-battle/id1083118997?mt=8

    The trick is to spawn the actor on a new, higher layer (or new lower one) and destroy the original actor. I'll see if I can whip up a new demo. Taking a short break from bigger projects :D

  • ArmellineArmelline Member, PRO Posts: 4,916

    Super quick demo. Would need lots of fine tuning in an actual game.

  • smurftedsmurfted Member, PRO Posts: 523

    Looks great. I will check it out when I get home..

  • smurftedsmurfted Member, PRO Posts: 523

    Sorry for the delayed response. I have been busy on another project (http://forums.gamesalad.com/discussion/91560/donald-j-thump).

    But now i'm back. Armelline, that is great way of getting it to work but what i can't think of how to get it to work with say 10 sports characters?!

    Is it the same trick but with a system i can't yet see or is something different required?

  • smurftedsmurfted Member, PRO Posts: 523

    So i'm back on this as i think it will open up much more graphical games.

    I'm still adamant that i need the layers to stack according to their vertical situation.

    Here is an example of my problem..

    http://gsrca.de/138646

  • SocksSocks London, UK.Member Posts: 12,822

    @smurfted said:
    I'm still adamant that i need the layers to stack according to their vertical situation.

    Here is an example of my problem..

    Example looks great, nice style, great subtle lighting too !

    You can simply make 6 or 7 (or however many you want) spawners that spawn the soldiers in the appropriate layer order.

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited September 2016

    @smurfted what you are asking is z-order- or depth-sorting.

    Yes,

    • we need a special function which can be called at the beginning of the draw cycle, sorting actors for a specific layer, according to their y-position.

    • or given the control to switch the layer an actor is on during gameplay. Then we could do the sort ourselves with simple rules.

    @CodeWizard, @ForumNinja

    The methods often suggested in the forum are way too inefficient if you have a lot of moving characters on the scene.

    Too me, this is probably the most basic feature still lacking from an 8 year old 2D engine. Basically prohibiting any kind of isometric or 2.5D game.

    2D games like these are just not realistic with the current feature set.

  • AlchimiaStudiosAlchimiaStudios Member, PRO Posts: 1,067

    @Hopscotch said:
    @smurfted what you are asking is z-order- or depth-sorting.

    Yes,

    • we need a special function which can be called at the beginning of the draw cycle, sorting actors for a specific layer, according to their y-position.

    • or given the control to switch the layer an actor is on during gameplay. Then we could do the sort ourselves with simple rules.

    @anichols, @snichols

    The methods often suggested in the forum are way too inefficient if you have a lot of moving characters on the scene.

    Too me, this is probably the most basic feature still lacking from an 8 year old 2D engine. Basically prohibiting any kind of isometric or 2.5D game.

    Agree +1000

    Follow us: Twitter - Website

  • smurftedsmurfted Member, PRO Posts: 523
    edited September 2016

    So i have faked it using the technique that socks mentioned here (glad you like the style too fella). It looks right now, but obviously none of my guys can move in or out of the screen?!

    This is something that if addressed could allow multitudes of new ideas..

    Here is the new version running...
    http://gsrca.de/138646

  • smurftedsmurfted Member, PRO Posts: 523
    edited September 2016

    I've got my little soldiers thinking & doing stuff now...

    Time for bed i think.

Sign In or Register to comment.