Hello Guest

Author Topic: Tilemap Editor - Isometric  (Read 12366 times)

Square

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Tilemap Editor - Isometric
« on: September 20, 2015, 05:04:58 am »
Hi Unikron,

I still want to congratulate you on a very great Unity add-on. It cuts down time, even streamlines creation of 2d games in Unity work flow, which I'm sure was the intention.

I'm currently developing a game using the Tilemap Editor using isometric formation. I was wondering quite how hard this would be as it is in BETA (thus a warning in the editor). Nontheless the game has progressed and I'm quite happy - (I would show some screens to assist this post but I cannot reveal the game yet!)

Here are some things people should be aware of when using the isometric editor:

Begin your project with 3d defaults
This makes things a lot easier to see and navigate around your scene. (I prefer it whether my game would be orthographic or perspective camera view)

When designing tiles make them as flat "diamonds" or square tiles rotated 45 degrees.
With adjustments in y size, use the lower half of the "tile". The tile settings will by default select the whole tile as it's really in BETA and is not in favour of isometric tiles.

Always(!) use the Tk2d Camera.
I cannot stress this enough because even if things look wrong or overlap in the Unity Scene window it will display fine with this, regarding you have set it up correctly.

Don't use Z layers inside the Tilemap editor - unless you are certain
Most problems will be cleared up by Tk2d Camera, though I've hit a little related problem which I might mention.

Z layers can make things very complicated when developing a game in isometrics, because of course you are using 3-dimensions (usually with a half-down view or similar) to make things easier. Unless you are strict about orthographics, I'd say make use of Unity in 3d workspace, as above.

I've got so far without advice and this post looks good, but I've had a persistent problem.

Layer chunks:
The Tilemap editor is dividing my base layer of ground (or grass for example's sake) into 2 layers.

This is disasterous and was very confusing at first as it naturally display overlaps any GameObjects with Z co-ordinates less than the centre of the chunk. This allowed me to panic when setting up things and I wrongly employed Z layers, which as I have described is no good solution for persistent isometrics.

Would this be resolved by creating the ground Tilemap with partitioning setting configured off somehow? If only there was a way to merge these Layer chunks, or prevent them from occuring as more than one GameObject, as everything else is fine!

Resolved by using a seperate layer for "upstanding objects"

Prefabs in tile data:
My problem with this is mild, though is more of a suggestion. When adding a prefab to a tile in it's settings, the tile itself disappears! I'm sure this is a fault or wrong of 2dtoolkit, as my prefab (for example, a tree) stands facing the camera with an absent tile underneath.

This totally negates the original tile!
Not to mention there is no possibility of previewing your level with prefabs or "upstanding" features. You would be designing a level blindly, except for when the game is running in Unity editor.

To be clear, my suggestion for development of 2d Toolkit is that the Tilemap editor does reveal it's data GameObjects which designing a level, in the Scene window.

This would be a great development.
« Last Edit: October 04, 2015, 06:06:51 pm by Square »

Square

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #1 on: September 23, 2015, 06:52:12 pm »
Unikron, from looking at your roadmap https://trello.com/b/UfqlXqXy/2d-toolkit-roadmap under Feature Requests - Tilemap.

I'm looking at "Tilemap SetTile for tiles with associated prefabs". Thinking this would be more or less the solution I'm looking for in the TileMap editor. Also how long before this is implemented?

Would the update make the TileMap editor more workable as thus my post suggestion above, referring to isometric level style creation:

Quote
... there is no possibility of previewing your level with prefabs or "upstanding" features. You would be designing a level blindly, except for when the game is running in Unity editor.

To be clear, my suggestion for development of 2d Toolkit is that the Tilemap editor does reveal it's data GameObjects which designing a level, in the Scene window.

I would have to write my own prefab placing solution otherwise, (basically a level editor) as my project has a deadline.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #2 on: September 26, 2015, 01:52:01 pm »
Hiya,

The prefab thing isn't planned anytime soon - its a pretty big task to get working in a robust way. If you want a quick hack I can tell you where to put it...

Square

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #3 on: September 30, 2015, 12:59:26 am »
I see.

That would make me very grateful thanks! Please discuss why the code fits in the relevant sections for a "quick hack".

I shall await your response.

puelogames

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #4 on: October 01, 2015, 01:53:41 pm »
Hello, I have a issue that I can't solve

Sorting order layer of player and terrain on the ground.
As you can see from the images attached when the player is near an elevation tile it doesn’t appear behind the tile.
« Last Edit: October 01, 2015, 11:55:05 pm by puelogames »

Square

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #5 on: October 02, 2015, 01:07:49 am »
puelogames: I understand you want to obscure the player using certain tiles.

In the method you are using and from your screenshot, you could introduce an extra layer on the tilemap. But your problem begins - that is more of a game design solution - when will the cliff and rock tiles obscure the player. How is your program to know when to place the character ahead (when on the left side of the screen on the cliff tops)?

You could introduce a game feature to help with this, or see my example.

When going up the grass the player must change it's state to be seen over the cliff tiles. I hope this solves your issue somewhat.
« Last Edit: October 02, 2015, 01:10:03 am by Square »

Square

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #6 on: October 02, 2015, 01:19:23 pm »
My example diagram didn't attach: (sorry to draw on your great screenshot)


puelogames

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #7 on: October 02, 2015, 02:52:49 pm »
It's really hard to take the z-deep of the player depending on each tile.
I change the tile order of polygons on every line as an user suggest on other post, but the problem start when I try to get the z-deep of the player.
at the moment I solve it using prefabs of each tile, but mabye it's not the best solution

maybe if you can show me your example I will be very graceful.
because I'm running out of ideas of how to solve it without using tile prefabs
cheers and thanks for your help  ;D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #8 on: October 04, 2015, 01:00:28 pm »
I see.

That would make me very grateful thanks! Please discuss why the code fits in the relevant sections for a "quick hack".

I shall await your response.

Its a quick hack because it is not robust enough to ship as a feature. Basically, you create 1 prefab with the sprite, using the correct sprite collection, and assign it as the prefab to every single sprite you wish to spawn. What will happen currently is that tk2d will simply instantiate that 1 prefab & sprite everywhere, which isn't desirable. The hack will basically assign the right sprite to the instantiated prefabs.

In tk2dTilemap.cs, line 156, add this -
Code: [Select]
tk2dBaseSprite sprite = instance.GetComponent<tk2dBaseSprite>();
if (sprite != null)
{
sprite.SetSprite(tile);
}

Square

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #9 on: October 04, 2015, 06:03:35 pm »
Thanks Unikron.

I'll post back when I manage to get better workflow/results. I'm sure the code change will make level editing a lot easier for me.

Square

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #10 on: October 05, 2015, 12:45:04 pm »
Ok. Tried pasting in the relevant code at tk2dTileMap.cs line 156 in Code folder. This cannot be right at all, compile error.

"The name 'instance' does not exist in the current context."
"The name 'tile' does not exist in the current context."

I quickly tried to debug, but I'm not familiar with your code : )

Using tk2d version 2.5.4

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap Editor - Isometric
« Reply #11 on: October 06, 2015, 10:30:49 am »
Sorry, my bad - it should have been in tk2dTileMapBuilderUtil.cs.