# Isometric multiple floors

Get help using Construct 2

### » Thu Jan 01, 2015 8:06 pm

Example capx:
http://92.51.171.10/construct/floors_online.capx

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.
Last edited by Everade on Sun Apr 09, 2017 8:56 pm, edited 2 times in total.
B
41
S
8
G
3
Posts: 159
Reputation: 3,052

### » Thu Jan 01, 2015 8:28 pm

Yes.
Give them a z to go with the x, and y.
Z-height = y offset.
B
175
S
50
G
200
Posts: 8,628
Reputation: 124,532

### » Thu Jan 01, 2015 8:42 pm

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
B
41
S
8
G
3
Posts: 159
Reputation: 3,052

### » Thu Jan 01, 2015 9:38 pm

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.
B
175
S
50
G
200
Posts: 8,628
Reputation: 124,532

### » Fri Jan 02, 2015 12:00 am

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

B
41
S
8
G
3
Posts: 159
Reputation: 3,052

### » Fri Jan 02, 2015 12:23 am

"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.
B
175
S
50
G
200
Posts: 8,628
Reputation: 124,532

### » Fri Jan 02, 2015 10:57 am

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?
B
41
S
8
G
3
Posts: 159
Reputation: 3,052

### » Mon Jan 05, 2015 8:58 pm

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" ?
B
41
S
8
G
3
Posts: 159
Reputation: 3,052

### » Mon Jan 05, 2015 9:36 pm

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.
B
175
S
50
G
200
Posts: 8,628
Reputation: 124,532

### » Mon Jan 05, 2015 9:53 pm

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.
B
41
S
8
G
3
Posts: 159
Reputation: 3,052

Next