Isometric multiple floors

1 favourites
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • (Example capx and images have been removed)

    I've came across to some really bad limits in a 2D environment / engine.

    The game i'm working on is fully isometric, and should offer multiplayer.

    As i've worked myself through the most basic mechanics already, i was starting to think about having multiple floors within the same map/layer or whatever you may call it.

    In short: without being forced to load a new map!

    So i want the player to be able to enter houses, which are having at least a second floor up or downwards.

    For all the old gamers it might be clear.

    In the past in games like diablo or similiar isometric games, there was never the existance of multiple floors, unless it simply loaded the next map.

    But i don't want to have these limits, i'm trying to find a solution to get this actually to work.

    Including enemy AI to understand the floors and act properly in case they are chasing a player (peer) up or down to a different floor. Including proper line of sight calculation.

    While i've made some thoughts for myself already, i wanted to get some feedback and maybe even experience from other developers who might faced this rather big "problem" already.

    I've made some simple sketches to let you guys understand what i'm willing to achieve.

    Sketch #1 (2nd floor)

    Blue = Solid object on 1st floor (can not be walked through)

    Red = Walkable space were both floors are "coliding"

    Please note that players should also be able to move behind the building!

    So imagine objects which may be placed behind the house (bushes etc...) or objects inside the houses like tables etc...

    Peer#1 should NOT colide with any objects or unwalkable space which is placed on the 1st floor!

    Sketch #2 (1st floor)

    While Peer#2 is at the 1st floor, he should not see nor colide with anything that's placed on the 2nd floor.

    Not to forget that:

    • Bullets fired from Peer#1 should be invisible and never kill an enemy moving on the 1st floor.

    -- So actions of Peer#1 should be kinda ignored, or simply only happening within the 2nd floor. The same for the opposite.

    Sketch #3 (1st floor + AI)

    In case an Enemy AI had line of sight with Peer#1 before, and saw him walking up stairs.... the AI should understand the existence of a second floor and walk correctly upstairs and not try to walk directly through maybe a door or something else which wouldn't make sense within a 3D environment.

    In case an enemy is on a different floor it should never be able to get line of sight!

    So what are your thoughts, ideas?

    Do you think that's possible?

    Or do you have an idea to handle this completly different?

    Looking forward to some constructive feedback.

  • Yes.

    Give them a z to go with the x, and y.

    Z-height = y offset.

  • Yes what?

    Give who or what a z to go?

    I'm an absolute beginner, but from what i know is that Z is only the height of the object or layer.

    In the current state i'm using z-ordering to get the objects displayed in correct order (bottom to top)

    But until now it had nothing to do with collisions or anything similiar.

    Bullets fired from the top layer do still hit objects who are on the lowest z-order.

    This includes collisions with the character itself.

    I thank you for your answer, but it's not that constructive as i've hoped for

  • The z order is the order which they are placed on top of each other.

    The z height is each objects y offset to represent a different level.

    If it was on the ground its zheight would be higher than it would be if it were on the first floor.

    Its x would remain the same.

  • Ok.... uhm wait a second.

    I've searched myself through the whole scirra forum and tutorial page right now, and was not able to find anything similiar to what you've just said.

    There's Z Order, correct, simply telling Image 1 is VISUALLY above image 2. I'm using that... that's fine

    Then there's X & Y

    These are simply the position on the whole layout.

    X is left to right

    Y is top to bottom

    I've searched myself through the construct 2 events as well.

    Also through available plugins.

    But there's nothing that gives me the possibility to place something on top of each other that ignore anything that's under it.

    So for example ignore all Collission objects or whatever.

    Have i missed anything specific?

    Or are you only refering to playing the player by Y higher at the layout.

    Because that wouldn't help me at all.

    I'm sorry, maybe i'm just to dumb to understand what you mean.

    But i really wasn't able to find anything at all.

    There's nothing such as Z Height nor Y Offset to represent a different level

    Thanks in advance for your patience with me ^^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "Or are you only refering to playing the player by Y higher at the layout."

    Yes.

    Thats all there is to it.

    Keep in mind that you will have to think of that height as having its own specific rules.

    Like if player objects variable("zheight") = 10, then(initially) move its y so much, and ignore collisions for objects that are not at the same zheight.

    As well as dealing with the zorder in that it will have to follow those rules for its viewport.

    Its not easy. Im not saying there is any built in way to manage it, other than coming up with your own construct.

  • Ok, so you say zheight is just a player variable

    I don't understand why you always want to change the objects y position... but ok

    Here's a screenshot so you can see a better example, i have outlined the floors so you can see them better.

    There are currently only objects on the ground and the player is at the first floor

    Could you please explain me which event i can use to make a player avoid collisions with SPECIFIC SOLID objects (ground walls, table, chairs, bench, cupboard)?

    I mean sure, i can simply set a variable to the player to indicate that he is standing on the 1st floor now.

    But which events do i have to trigger to avoid specific solid objects?

    Or do i have to create an own collision system because it won't work with the solid function?

  • Ok upon further testing with construct 2, i found a pretty easy way to get the player to a new floor.

    I've simply triggered an event upon reaching the top of the stairs to de-activate the Solid objects on the ground.

    However in a multiplayer environment this would mean that other players walking around on the ground would also be able to walk through all the objects / walls etc.

    Is there any way to trigger such events considering UID's of a specific player?

    Instances or something like that?

    Since the "solid" is a behaviour of an actual object, i don't think so.

    But would this be possible by using a collision check (including UID) instead of changing the solid behaviour?`

    Like "if peerID1 colides with table, ignore" ?

  • Yeah, solid really wasn't designed for multiple players.

    Then again in a tile based system you should be able to compare x, and y positions.

  • But look at the screenshot of my game above.

    I can't compare x and y positions.

    Because x and y can be exactly the same on both floors.

    The 1st floor isn't that much higher that i could compare these values.

    I don't want to take away the freedom of the map design by simply pulling the floor THAT way higher within a big house design.

    Also i want the player to be able to walk completly free BEHIND the houses.

    Just imagine on the screenshot, that the zombie is standing exactly on the player, but the zombie is on the ground and the player is on floor 1.

    Visually it looks correct. But the engine will tell me that they're on the exact same x,y position.

  • Use instance variables for filtering. With it you can disable collisions of other layers and such. The stairs by far will be the trickiest to do. Well, other than implementing path finding and line of sight, you'll have to get creative for those.

    Here's an attempt at stairs you can go up and down. There's likely an easier and cleaner way but it escapes me at the moment.

  • R0J0hound

    [quote:1yigiahe]Use instance variables for filtering. With it you can disable collisions of other layers and such.

    Filtering - got that - works

    Disable collisions of specific objects - works

    But i can't find a way to filter "Enable/Disable collisions" or "Solid Enabled/Disabled" for other specific objects (players in multiplayer and enemies)

    I've tested it multiple hours today with all different kind of events but never managed to find something that could help me in this case.

    What am i doing wrong?

    Is it even possible or are those missing event checks not possible to be self-coded?

    My guess is that i'm simply missing something very specific that would explain everything by itself.

    Or it is really complicated

    Or it's simply impossible due MP feature being that young

    Update: just saw that i've added the "Wait" under calling function" but still, it also doesn't work if i move the function call to the bottom...

    [attachment=0:1yigiahe][/attachment:1yigiahe]

    By the way, thanks a lot for your support!

  • You can't disable a solid behavior partially, at a given time, it's either on and off, so all object collide or go through. You probably should not rely on the solid behavior if you plan to do "floor filtering" for collisions.

  • I was fearing that already.

    But i'm wondering how else it would be able to properly code a collision check so that you can't walk through which i would be able to seperate by instance variables.

    And so that Enemy AI using Pathfinding does not brake....

    I'm getting lost in this.

    I'm not a coder, so there's no way for me to write such a complicated plugin.

  • Everade, what you want is exactly what Ultima Online used to do.

    You need to create a variable for all objects that are physically in the game to represent the Z (Height) Axis like newt said.

    You would always need to adjust the object's Y thru custom movement according to the Z axis that you created. Construct does'nt have this built in. Z-Ordering would still be in effect, considering that an object with a higher Y is always drawing on top of the things below it, avoiding the issue you would have with disabling everything below.

    Stairs are more tricky, not sure how you could accomplish that in construct, you would need to gradually increase the player's Z coordinate as he moves up in it, unless you "teleport him" to the top room when he uses a stair object, then your Z could be based on what floor he is,

    Z = 1 -> Y = Y + Z * (offset).

    I might be talking out of my ass, but I think that might do it... Someone correct me if i'm wrong..

    EDIT: I had'nt seen the second page of the post.

    You could add an additional condition checking for the Z coordinate when doing collision checks avoiding issues of colliding with things under or above the player...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)