Who stands in front of who..
smurfted
Member, PRO Posts: 586
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
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.
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'.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
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?
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
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Super quick demo. Would need lots of fine tuning in an actual game.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Looks great. I will check it out when I get home..
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?
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
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.
@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.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Agree +1000
Follow us: Twitter - Website
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
I've got my little soldiers thinking & doing stuff now...
Time for bed i think.