How do I fix this overlapping problem

0 favourites
  • 10 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • 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?

  • 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.

  • 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 ?

  • 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..

  • 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..

  • 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

  • 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.

  • .. 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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:

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

    Im sure i'll get forward with this.

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