Author Topic: Tiled Mapper Release  (Read 36312 times)

Offline Lexx

  • Rotator
  • Mexican Apple Thief
Tiled Mapper Release
« on: October 01, 2012, 08:18:10 pm »
As everyone who uses the FOnline Mapper for a while knows, especially the creation of cave maps can become a huge pain. To ease this pain, we started working on a way to create bigger maps more easily and with less of a hassle. Now, today we are releasing our latest tool, called "Tiled Mapper," which is used to create new maps with just a few mouse clicks in their basic shape, based on a tile-preset system.

In this release, we are providing our current preset_cave.fomap file, which includes all basic tiles + some variants of them. This file is a cave tile set, but the tool isn't limited to it. You can as well create a sewer, metro, bunker, generic desert or even city ruins tile set. Though, creating enough tile variants is lots of work, which is also the reason why we are sharing our cave preset, hoping the community will want to help in the creation of different sets- not solely for 2238. The tool is compatible to every other FOnline project, which we think makes it a very valuable asset for every FOnline developer.


Installation
Download the TiledMapper.zip and extract it into your FOnline SDK folder. The Tiled Mapper then can be found in /Tools/TiledMapper/ and the preset file under /Server/maps/presets/.

Download
Tiled Mapper 1.0.1 Release
Tiled Mapper 1.0.1 Source


About the Tiled Mapper
The Tiled Mapper (abbreviated as TM) allows for creation of simple, tile based maps and then converting them into proper FOnline maps by replacing each tile with a collection of ingame tiles, walls and other objects, based on the contents of a selected "preset" file. The preset file is a standard FOnline map, organized into a pattern understood by TM.

A tile based map is, basically, a grid filled with "empty" and "filled" tiles. When converted into a FOnline map, the tiles will be replaced by particular tiles defined in the preset file, based on whether they are empty and filled, but also on the state of their neighbours. For example, a west-east sequence of three filled tiles in a row, surrounded by empty tiles, will be understood by TM as (respectively) "west corridor dead end", "piece of west-east corridor" and "east corridor dead end"). The TM will make an appropriate substitution when creating ("compiling") a FOnline Map. A tile may have some further information, other than filled/empty, that will affect this conversion.

0. Setup and first run
On the first run, TM will ask about the preset files path. The presets data provided in the package inside maps/presets. It is advised that tilemaps directory is placed in server's maps directory so that the preset file can be easily edited. Further explanation of the preset files is contained in Section 3.
To start drawing of a new map, select File->New Map and input the new map's width and height. The width and height are expressed in tiled map tiles, each corresponding to 10x10 ingame tiles (and 20x20 hexes). Newly created map will be filled with width*height empty tiles.

1. Drawing a map
TM has two modes for map creation: "drawing" mode and "details" mode. Convert/Revert button switches between the modes. Once a map is created, TM will enter the drawing mode.
In drawing mode, the following actions are possible:
Toggle Tiles - clicking the mouse and dragging the cursor over the tiles "paints" either filled or empty tiles.
Toggle Walls - allows for creation or deletion of walls between two neighbouring tiles. This information is used when compiling the map: tiles divided by a wall are not treated as neighbouring ones.
Place Scrollblockers - allows for placing (or deleting) a chain of scrollblock markers. A chain of scrollblock markers is a sequence of tiles numbered 1, 2, ..., n (the numbers are displayed on the map view). When the map is compiled, a line of scrollblockers will be created between the centres of tiles numbered by two consecutive numbers (here, n and 1 are considered consecutive).

Once the map structure (filled and empty tiles plus walls) has been drawn, switching to details mode allows to add more information obout the tiles. In this mode, basic types of the tiles are already decided and the map's outline is shown. The following actions are possible:
Change Variant - right or left clicking on a filled tile forces a particular variant (defined in the preset file) to be used when replacing that tile. A number on a tile indicates the forced variant. Lack of a number means "no variant" set, meaning that a random available variant will be used. This is a default setting for all new tiles.
Change Width - toggles a filled "width". Functionally this is almost redundant to variants selection, but much easier to manage. A wide tile will use different tiles from the preset file when the map is compiled. WARNING: only straight corridors neighbouring normal corridors and cross-sections neighbouring normal corridors can be marked as wide.
Place Scrollblockers - identical to drawing mode.

2. Compiling a map
TM requires a preset file to be used for compilation. The preset is selected in Options->Compiler window, and it is one of the .fomap files contained in the presets path. This is blank by default and has to be selected before compilation attempt.
To compile a map, select File->Compile Map. A window with map header will pop up, where the usual details for the resulting .fomap can be set. Once this is done, all that remains is choosing the name for the .fomap.

3. The preset files
TM needs a path with preset files in order to compile the maps. The path must include the file block.txt and any number of .fomap files.
Technically, a .fomap file with tile definitions is organized as follows:
  • All tiles and objects with (x,y) coordinates in the range 22*X <= x < 22*(X+1) and 22*Y <= y < 22*(Y+1) are recognized as parts of a "bigger tile" with (X,Y) coordinates. A bigger tile is a definition of a single replacable tile in a tiled map. Because each such a tile is replaced with 10*10 tiles, this forces a one-tile gap between the tile definitions in the .fomap file.
  • All bigger tiles with the same X coordinate ("columns") are considered a variant of the same tile (see the explanation of "Change Variant").
  • There must exist at least one tile in each of the first 54 columns.
  • The order of tiles defined by each column must correspond to that in preset_cave.fomap. This order is defined in block.txt.

4. Miscellaneous
a. TM uses .tilemap files to save an restore tiled maps. These files themselves do not hold any references to fonline resources. They are written in XML.
b. TM caches the preset file used for compilation when it compiles the map. This means that if the preset file is changes, TM will ignore the changes unless either it is restarted, or if the preset path is changed, forcing the cache to be cleared.
c. While it is possible to have wide walls at corridor ends etc., this will result with incorrect .fomap.
d. All TM settings are stored in TiledMapper.cfg created on the first run.


Screenshots
A small cave dungeon:


And how it looks in the map editor (created with all random tiles):

« Last Edit: June 29, 2013, 05:09:12 am by Atom »

Re: Tiled Mapper Release
« Reply #1 on: October 01, 2012, 09:48:07 pm »
This is quite impressive!
The first step to dynamic dungeon creation :O
How long have you been developing this?
And why do you release it now?
And why secretly? :(
Why don't you ever tell us anything?
Please tell us everything you work on.
PLEASE







FUCKING PLEASE

Offline Lexx

  • Rotator
  • Mexican Apple Thief
Re: Tiled Mapper Release
« Reply #2 on: October 02, 2012, 12:29:38 am »
Didn't took long to write the editor. Atom wrote it some weeks ago in a night or two. What ultimately took so long was the planning (internally we talked about such stuff already since a few years, but didn't really started anything) and talking about how exactly the tool should look and work. Also creating the basic tiles is a lot of work. There was nothing secret about it, we originally just wanted to have a tool for faster cave dungeon creation and in the end figured that it as well works for any other FOnline related game, which results in the release now.

Dynamic dungeon creation is still something very different, but with the help of the tool you are able to create many dungeon templates in a very short time. Of course, the outcome will be better the more different preset-tiles are created. Currently not every preset has more than its basic variant. I'd say every preset should have at least 10 distinct different variants in order to make the tool give out really good results. The more the better.
« Last Edit: October 02, 2012, 12:32:28 am by Lexx »

Offline Gob

  • The Good
Re: Tiled Mapper Release
« Reply #3 on: October 02, 2012, 08:25:42 am »
So I belive that you made the new reno sewers with this right?

Offline barter1113

  • New Vegas fanatic =)
Re: Tiled Mapper Release
« Reply #4 on: October 02, 2012, 08:26:16 am »
When I try compile map I get a error:
Code: [Select]
The following error was encountered: internal: preset not found

Offline Gob

  • The Good
Re: Tiled Mapper Release
« Reply #5 on: October 02, 2012, 08:39:14 am »
When I try compile map I get a error:
Code: [Select]
The following error was encountered: internal: preset not found
Go to Options/Compiler/Current preset/ select preset. And make sure you copied the presets folder inside Server/maps folder.

This tool is a big time saver, provided we got enough presets. What would be nice is a preview mode, to see the outcome.
« Last Edit: October 02, 2012, 08:46:19 am by Gob »

Offline barter1113

  • New Vegas fanatic =)
Re: Tiled Mapper Release
« Reply #6 on: October 02, 2012, 08:46:24 am »
Good works. It is nice tool but that would be better if maps aren't sooo square. Anyway good progress and I hope you will improve this tool in the future :) Thanks.

Offline Lexx

  • Rotator
  • Mexican Apple Thief
Re: Tiled Mapper Release
« Reply #7 on: October 02, 2012, 09:24:33 am »
So I belive that you made the new reno sewers with this right?

No, Johnny Nuclear made it. There is no map in the game yet which was created by the tool. We are planning to do some huge dungeons with it when we get a little more tiles done.

It is nice tool but that would be better if maps aren't sooo square.

With different tile variants, this can be faked away to some extent (see the bottom of the map screenshot as example). You aren't limited to blocky paths, you can do whatever fits into one preset tiles size (20x20 hex). And after compiling you can still adjust the map manually with the normal FOnline Mapper.

« Last Edit: October 02, 2012, 09:50:12 am by Lexx »

Offline SEGA_RUS

  • Arbeit macht frei
Re: Tiled Mapper Release
« Reply #8 on: October 02, 2012, 12:54:59 pm »
Thanks Lexx
Skype - sega_75rus

JovankaB

  • Guest
Re: Tiled Mapper Release
« Reply #9 on: October 02, 2012, 12:59:06 pm »
Also it's mostly cave that needs so many variants to look natural.
Sewers for example wouldn't need that many (and they probably are easier to make too).

We hope that if you make some tiles you will share them with others.
« Last Edit: October 02, 2012, 01:00:53 pm by JovankaB »

Re: Tiled Mapper Release
« Reply #10 on: October 02, 2012, 08:45:05 pm »
ohh finaly source code for .frm to .bmp

Offline Wipe

  • Rotator
  • Random is god
Re: Tiled Mapper Release
« Reply #11 on: October 02, 2012, 10:57:15 pm »
ohh finaly source code for .frm to .bmp
Not sure what its supposed to mean?
Games are meant to be created, not played...

Re: Tiled Mapper Release
« Reply #12 on: October 03, 2012, 09:47:09 am »
Not sure what its supposed to mean?

I was lazy to implement .frm to .bmp converter and now you published SW for displaying .frm what is almost same so i will use your code if you dont mind.

Offline Gob

  • The Good
Re: Tiled Mapper Release
« Reply #13 on: October 03, 2012, 09:53:13 am »
What would be nice is a search box in the Mapper to search the tiles,walls you need....

Offline Atom

  • Rotator
Re: Tiled Mapper Release
« Reply #14 on: October 03, 2012, 10:15:36 am »
I have added Tiled Mapper's source code to the download links. The source should be considered public domain. FOCommon library's source, TM's dependency, hasn't been released yet as the code needs some cleanup, however a future release is planned.

I also updated the executable package with the latest TM version, containing some minor changes.