Hello Guest

Author Topic: diagonal tiles?  (Read 9058 times)

skisos

  • Newbie
  • *
  • Posts: 7
    • View Profile
diagonal tiles?
« on: August 14, 2014, 09:33:38 am »
Hi everybody!

I'm working on a pseudo Top-Down RPG using tk2d Tilemap. I really like the tool but I would need a "diagonal tile", as seen in "Legend of Zelda: A Link to the past" or here: http://knightgirl.robotknight.com/unity-builds/v2.1a.html  and I don't know how I can get it.

I don't want to use colliders to keep the player inside the "walkable" area, I just use the tilemap as the "logic" behind my sprite background (telling the player things like "you can walk here", "you cannot pass through here", etc). Currently, I can move my player around the "walkable" tiles and get stuck on the "wall" tiles, but if I want to make a "diagonal road" I have to make them with tiles and the player can't walk through them very well as he gets stuck:

[ ] : tile
 /| : diagonal tile
 |/ : diagonal tile

What I have:

         [ ] [ ]
    [ ] [ ]
[ ] [ ]

What I'm looking for:

      /| [ ] [ ] |/
  /| [ ] [ ] |/
 [ ] [ ] |/

How could I achieve that? Any ideas about how to approach to this? Should/Could I edit the mesh of a specific tile?

Thanks!
« Last Edit: August 14, 2014, 12:34:08 pm by skisos »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: diagonal tiles?
« Reply #1 on: August 14, 2014, 12:04:12 pm »
Those are just drawn diagonal tiles in addition to square tiles. I don't think theres anything special about it. If you notice there are only 2 diagonal angles in that demo

skisos

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: diagonal tiles?
« Reply #2 on: August 14, 2014, 12:11:40 pm »
Those are just drawn diagonal tiles in addition to square tiles. I don't think theres anything special about it. If you notice there are only 2 diagonal angles in that demo

thank you four your reply unikron, I was editing my previous post to explain it better.

Could I achieve what i'm looking for?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: diagonal tiles?
« Reply #3 on: August 14, 2014, 12:39:21 pm »
You will need much more robust and possibly complicated collision detection if you stop using the physics. You will need to store the slope of each tile somewhere.... I'm not sure if I know any tutorials on doing handling the collision response after that step - probably worth googling about it. Its totally outside the scope of the tilemap editor though. You can do it by turniing off collision generation in tk2d tilemap and doing it yourself.

skisos

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: diagonal tiles?
« Reply #4 on: August 14, 2014, 12:52:13 pm »
You will need much more robust and possibly complicated collision detection if you stop using the physics. You will need to store the slope of each tile somewhere.... I'm not sure if I know any tutorials on doing handling the collision response after that step - probably worth googling about it. Its totally outside the scope of the tilemap editor though. You can do it by turniing off collision generation in tk2d tilemap and doing it yourself.

I think I didn't explain myself very well, sorry about that  :-[

My game uses a top-down camera so I don't really need the slope data. Check out this screenshot of another game:



I'm looking for something similar, "diagonal roads" where the player can walk on (as they are "walkables"), but currently my roads aren't diagonal at all as my tiles are squared and the player gets stuck on them, so I would need to "cut" some tiles or to be able to paint a "triangular" one.

« Last Edit: August 14, 2014, 01:13:18 pm by skisos »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: diagonal tiles?
« Reply #5 on: August 14, 2014, 01:26:44 pm »
But you do need the slope data even for this. How are you to otherwise know to smooth out the diagonal lines? You'll need different tiles for that though, you can't automatically smooth that data out.

skisos

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: diagonal tiles?
« Reply #6 on: August 14, 2014, 01:33:04 pm »
I didn't think about that... Any workaround to solve this?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: diagonal tiles?
« Reply #7 on: August 14, 2014, 02:04:08 pm »
No not really, I can't think of any way of guessing this information.

skisos

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: diagonal tiles?
« Reply #8 on: August 15, 2014, 10:04:47 am »
Ok so I have to think a new way for this. Thanks for your help