OpenXcom Forum

Modding => Tools => Topic started by: werty on May 22, 2014, 07:42:48 pm

Title: tiled (mapeditor.org) as tool for designing maps
Post by: werty on May 22, 2014, 07:42:48 pm
Hi.
I was looking for user-friendly mapping tool for openxcom and found nothing.
I've found tiled is very simple and sufficient for designing isometric maps.
Want to change tiled to support reading and writing maps to openxcom files.
One of core problems I already solved - added "level" attribute to TileLayer and now it supports tile height
I know I can reverse-engineer C# code of mapview to get results, but not sure if it would be fast enough to not to loose motivation.
If someone interested in contributing to this beginning, please let me know here.
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: Warboy1982 on May 23, 2014, 02:42:18 am
the trouble i'm guessing you'll face is that all the map data is stored separately from the maps themselves, the graphics, and the AI nodes for pathing. structure is somewhat similar to:

[.MAP File] (https://www.ufopaedia.org/index.php?title=MAPS)
contains (L*W*H) tile entries, each with potential references a floor, a north wall, a west wall, and an object.

[.MCD File] (https://www.ufopaedia.org/index.php?title=MCD)
numeric data table, 61 bytes per entry. floor/wall/object references in the map file refer to entries in these files. MCDs also contain references to corresponding .PCK/.TAB files with the terrain sprites. these are referred to by the map sequentially based on file order.
also contains references to scang.pck for the minimap sprite and loftemps.dat for the 3d representation of the object.

[.RMP File] (https://www.ufopaedia.org/index.php?title=RMP)
a database of nodes on the map, containing info on unit spawn positions and patrol destinations. generally used by the AI to make its way around the map before XCom is discovered.
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: LCSand on May 23, 2014, 09:59:04 am
Hi.

So you hacked tiled to support multiple levels above each other?
Good work, that was the main obstacle to it being useful for the xcom/ufo games.

https://www.ufopaedia.org/index.php?title=MAPS
https://www.ufopaedia.org/index.php?title=MCD
https://www.ufopaedia.org/index.php?title=TERRAIN

That said the old xcom format is very limited and it might again be time to think about a new format for post 1.0 time.
Might even be based on the native tiled format(xml based).

If you need help I could write a converter in either c/c++ or python, when I have a little more free time.
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: werty on May 23, 2014, 07:26:48 pm
tiled is a opensource project in qt, I just added some code to support level height in px for map and lvl number for TileLayer. Additionally made some fixes to proper drawing.
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: werty on May 23, 2014, 07:30:03 pm
This is a very good idea to create new map format, as using old xcom format for modding is like animating zombies from dead bodies. Can we discuss somewhere new format? I can develop it instead of making reader and writer for tiled, it would be much easier.
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: Angelus_EV on May 23, 2014, 08:06:40 pm
This is a very good idea to create new map format, as using old xcom format for modding is like animating zombies from dead bodies. Can we discuss somewhere new format? I can develop it instead of making reader and writer for tiled, it would be much easier.

+1
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: Yankes on May 23, 2014, 09:41:47 pm
First feature I would like to see is 4 walls supported by this new format (and in OXC).
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: LCSand on May 23, 2014, 11:26:57 pm
Well you can just discuss that here in the forum maybe create a new topic for that.

A new tileset format would be needed then as well I think.
And for example by changing from pck to png(already supported by oxc anyway) we could get rid of the pallete problem.

Lets gather a bit of input from everyone first: What file formats could use an overhaul and what should the new formats acomplish/handle?
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: Yankes on May 24, 2014, 12:48:57 am
removing palettes introduce new problems :> color shift relay on palette index.
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: werty on May 24, 2014, 01:34:12 am
Can someone provide me sample xcom tileset for general purposes? PNG format preffered.
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: werty on May 24, 2014, 02:38:34 am
tiled multi level view screenshot
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: LCSand on May 24, 2014, 06:43:23 am
removing palettes introduce new problems :> color shift relay on palette index.
You mean for lighting and stuff?
How did the ufo2000 guys do that?
But I do not object to palettes in general just the use of different ones and the problem that arises when you try to mix them.
Does xcom always use the same palette for battlescape? Or can they be tileset specific?
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: LCSand on May 24, 2014, 07:34:06 am
Can someone provide me sample xcom tileset for general purposes? PNG format preffered.
This is for ufo2000 but it should be what you are looking for.
https://www.xcomufo.com/forums/index.php?showtopic=242025394
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: Solarius Scorch on May 24, 2014, 02:32:09 pm
I understand the hypothetical new editor would include a converter of the old UFO/X-Com format, right? Yuo wouldn't have to make all maps again from scratch?
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: werty on May 24, 2014, 10:45:19 pm
I understand the hypothetical new editor would include a converter of the old UFO/X-Com format, right? Yuo wouldn't have to make all maps again from scratch?
The best solution for this to create converter and do the batch conversion so all old maps would be available in new format
Title: Re: tiled (mapeditor.org) as tool for designing maps
Post by: LCSand on May 24, 2014, 10:46:25 pm
Well right now it looks like a new file format will be created with all the stuff that OXC needs. The editor already exists but has to be modified to support this new format.
And once we have a format I could write a converter old->new, so all the old stuff so it can be used in that editor.