How do I fix this overlapping problem

Get help using Construct 2

Post » Mon Sep 21, 2015 8:34 pm

So i've been trying to crack the secret behind the isometric style games for a bit now and im stuck in a deep bog with this one allthough i've come quite close to getting the next thing to work.

https://dl.dropboxusercontent.com/u/735 ... etric.capx

in the capx, you walk around the house, it looks good. you go inside the house, the house walls opacity drops so you can see the player when behind a wall. I've set it up so that the player changes layers after reaching either < or > 250 Y. So that it doesnt look like the player goes through walls. This works ALMOST well, but there is a problem where the players collission point is half way this 250 Y, it goes all wrong... Any advice how to fix this somehow?
B
7
S
1
Posts: 93
Reputation: 632

Post » Tue Sep 22, 2015 2:40 am

I went to check out your issue, but im not ready to upgrade to r213 yet...

so im going to guess that there is alot of flashing and flickering at the transition point...

this would be do to the system changing layers 60 times a second while the system makes "one tick" and he is at the >250 position.

I would set the "inside house" theme to a separate layout all together.


you could using the " trigger once while true.." function, but I doubt it will help.
... or, on trigger, set the character about 10 pixels out from the trigger pixel position so he is no longer at that spot.

hope this is useful.
Image
B
26
S
4
G
3
Posts: 147
Reputation: 4,875

Post » Tue Sep 22, 2015 4:04 pm

Well not really, it works just fine actually. it's just not.. refined i suppose. i snapped a few pics from the game and code to:
https://www.dropbox.com/sh/cginlq04h1tu ... wPlca?dl=0

Setting the inside house theme to a separate layout would be a bit problematic as i would want the game to be a rts type of game, so everything should be still in motion in the world layout even if the player enters a house, enemies can barge in the same house etc..

The problem can be seen here. I dont know how can i improve the code from here.
https://dl.dropboxusercontent.com/u/735 ... .52.28.png the player changes on top of the layers or below them where as i would need it to react differently on each wall side. I was thingking maybe if i make the house walls separate groups, like x.left_wall, x.right_wall, y.left_wall, y.right_wall ...maybe that way i could have more control how the walls react to the player ?
B
7
S
1
Posts: 93
Reputation: 632

Post » Tue Sep 22, 2015 4:18 pm

A far easier way would be to check the player's y position with the y-position of the objects..
Placing the origin at the bottom of the objects and the bottom of the player sprite..

That's actually the only way I've seen it done properly, because you can just z-order everything based on the y-position of the objects, which would make using layers unnescessary or at least optional..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 22, 2015 5:53 pm

Oh, so something like "Player_sprite.Y = House_wall.Y" ?

What do you mean by "to the bottom of the sprite. as in..the bottom of the square box where the graphics are inside of.. of the graphical bottom of the sprite? puzzled as it's in isometric so there is no definate "bottom" on a wall since its in an angle. the bottom could be anywhere along the lower end of the sprite..
B
7
S
1
Posts: 93
Reputation: 632

Post » Tue Sep 22, 2015 7:35 pm

If you search the forum for isometric you will find many examples..
Like this one:

viewtopic.php?f=147&t=129745&p=969922&hilit=isometric#p969922

Probably in the tutorial section as well..
Like this one:

https://www.scirra.com/tutorials/1165/z ... etric-grid
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 22, 2015 8:03 pm

Well i seriously need to brush on my search skills it seems as i have tried, but not found these ones.. the first link seems vaguely familiar but could be that i found it at the pinnacle of my frustration and did not read it properly. Thanks, i'll have a go with these and hopefully get a step forward.
B
7
S
1
Posts: 93
Reputation: 632

Post » Thu Sep 24, 2015 9:10 pm

.. oh hell, so if i've understood this correctly from what i've read, i just can't make it work like that since it can't be sorted properly ? motherfu.. gawd! there is no way around it then?

Maybe i'm going about it the wrong way. How would i implement a similar way that fallout 1 for example uses that it fades the walls away around the player if he gets hidden, that possible?
B
7
S
1
Posts: 93
Reputation: 632

Post » Fri Sep 25, 2015 10:10 pm

In short: visually sorting isometric objects is often a royal pain.

If all the objects are roughly square and on the same ground level then the "for each ordered" way works well, but you need to be consistent where the origin point is on the sprites. A common solution is to use the bottom center.

If the objects are thin and long (like the walls in your capx) then the above way won't work as well. The behavior I made can handle objects like that, but you need to set up the isometric sizes correctly. Here's a tutorial on it:
behavior-isometric_p979499?#p979499
B
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

Post » Sat Sep 26, 2015 7:50 pm

In the words from matrix "Hallelujah. You're my savior, man! my personal jesus christ!"

Im sure i'll get forward with this.
B
7
S
1
Posts: 93
Reputation: 632


Return to How do I....?

Who is online

Users browsing this forum: Elliott, Voytek, Yahoo [Bot] and 20 guests