Author Topic: Import Tilemaps  (Read 1131 times)

b1tsh1ft3r

  • Newbie
  • *
  • Posts: 16
  • Karma: +1/-0
    • View Profile
Import Tilemaps
« on: October 16, 2017, 03:19:18 am »
It would be nice to import tilemaps so they can be used in Jo-Engine. Maybe .TMX format (tiled map editor) since this seems to be a popular one. The current MAP format of  [filename], x position, y_position is ok, however converting to something like this that the saturn understands can be painful and time consuming if another map editor is out there that can be used. I think the purpose of jo-engine isnt to build a map editor, but provide an easy library to code on the saturn rather.

mindslight

  • Administrator
  • Full Member
  • *****
  • Posts: 157
  • Karma: +6/-1
    • View Profile
    • Jo Engine
Re: Import Tilemaps
« Reply #1 on: October 16, 2017, 01:05:09 pm »
I will check to integrate this format  ;)

b1tsh1ft3r

  • Newbie
  • *
  • Posts: 16
  • Karma: +1/-0
    • View Profile
Re: Import Tilemaps
« Reply #2 on: October 16, 2017, 03:50:24 pm »
Thank you! I appreciate you taking the time to look into it!

b1tsh1ft3r

  • Newbie
  • *
  • Posts: 16
  • Karma: +1/-0
    • View Profile
Re: Import Tilemaps
« Reply #3 on: October 26, 2017, 02:06:08 am »
Just wanted to update this. I started working on a tool that will convert a CSV export of a tilemap from the TILED map editor to the jo-engine map format  ( [file] [xpos] [ypos] ).

I have a working prototype now, but it doesnt account for a few things just yet. Ill post it under the jo-map editor section when i have something release worthy :)

b1tsh1ft3r

  • Newbie
  • *
  • Posts: 16
  • Karma: +1/-0
    • View Profile
Re: Import Tilemaps
« Reply #4 on: February 18, 2018, 03:10:53 pm »
Just thought I would update this post with a link to my GitHub where I have the go source for a tool I wrote to convert to the format JO-Engine uses for displaying a tile map. This should make things somewhat easier for others hopefully. It still needs some testing I'm sure but, it seems to output in the right format.

https://github.com/b1tsh1ft3r/tile2map/

mindslight

  • Administrator
  • Full Member
  • *****
  • Posts: 157
  • Karma: +6/-1
    • View Profile
    • Jo Engine
Re: Import Tilemaps
« Reply #5 on: February 18, 2018, 05:13:58 pm »
Thank you for this converter  ;)

I have so much thing to do on this project and not necessarily enough for the Jo map Editor :'(

I made a dedicated thread for your converter : http://forum.jo-engine.org/index.php?topic=859.0
« Last Edit: February 18, 2018, 05:19:34 pm by mindslight »

b1tsh1ft3r

  • Newbie
  • *
  • Posts: 16
  • Karma: +1/-0
    • View Profile
Re: Import Tilemaps
« Reply #6 on: February 20, 2018, 03:11:18 pm »
No problem!

Feel free to use the logic and incorporate it into your map editor if you like. I know its not a very robust tool at this point but it seems to get the job done for now.

Also is there any limit on number of sprites shown with jo engine? Could you make tile maps of 1024x1024 or something of this large size without slowdown or consequence? Forgive me for not doing any research ahead of time but I figured someone might know outright.

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Import Tilemaps
« Reply #7 on: February 20, 2018, 05:32:11 pm »
It wouldn't work simply because how the SGL workarea works.
You will need to cull the sprites that aren't on screen.
It should be quite easy using a simple grid, but since I never use the 2D functions I couldn't tell you exactly how you could do it.
The idea is that if each tile is like 32 pixels wide and your screen is 320 pixels wide, you only show tiles that are within 5 or 6 units of the screen's center.
Perhaps a new map rendering function would need to be create as I don't think the current functions cull-away the sprites that aren't onscreen.
SGL will discard the sprites that aren't on screen, but they will still get processed and fill the workarea quickly, so you need to do culling on your end too.

mindslight

  • Administrator
  • Full Member
  • *****
  • Posts: 157
  • Karma: +6/-1
    • View Profile
    • Jo Engine
Re: Import Tilemaps
« Reply #8 on: February 20, 2018, 06:00:48 pm »
You can load large maps in the engine without any problem and no slowdown (I already used 10000x10000 maps !)  ;D

I don't use SGL for this part but a custom implementation.

Look at the "demo - map" sample.

Besides, the Jo Engine is way more powerfull in 2D than 3D today (but it will change).

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Import Tilemaps
« Reply #9 on: February 20, 2018, 06:33:40 pm »
Good to know!
2D on Saturn is indeed very interesting, sadly I don't have the patience to create sprites and deal with animations, so I'll stick with 3D for while. ;)

b1tsh1ft3r

  • Newbie
  • *
  • Posts: 16
  • Karma: +1/-0
    • View Profile
Re: Import Tilemaps
« Reply #10 on: February 22, 2018, 01:06:33 am »
You can load large maps in the engine without any problem and no slowdown (I already used 10000x10000 maps !)  ;D

I don't use SGL for this part but a custom implementation.

Look at the "demo - map" sample.

Besides, the Jo Engine is way more powerfull in 2D than 3D today (but it will change).

Wow thats quite large! Ill have to give it a try soon and post some results. I have a pretty large world composed of MANY tile maps that are extremely large but would be loading them in sections as the player moved into those areas.

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk