Map Editor (works with hex grids)

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Post Reply
Message
Author
tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Map Editor (works with hex grids)

#1 Post by tiger_eye »

Hey guys and gals, I made something that I want to share:

https://gitorious.org/tome_map_editor/tome_map_editor

This is a GUI application that can modify existing ToME4 maps! The documentation on the website is a little sparse, so this forum post will serve as the primary documentation for the moment.

Installation
Click the "download" button from the webpage above, or clone the git repo which will let you easily update to the latest version:

Code: Select all

git clone git://gitorious.org/tome_map_editor/tome_map_editor.git
Prerequisites
Python 2.7 and pygame should be the only requirements. Note that Python 3 won't work (at least not yet). Somebody is looking into making a standalone application for Windows users that will have no requirements.

Running the app
From the command prompt:

Code: Select all

python main_pygame.py [filename]
or

Code: Select all

./main_pygame.py
where "filename" is the ToME for map file, such as "data/maps/towns/derth.lua". If no file is given, then a file browser dialogue is opened that allows a file to be chosen.

Features
  • Hexagon tiles and Square tiles are both supported; toggle-able
  • Color of background and text matches what is shown in-game (when using ASCII)
  • Tiles can show in-game text, and the text used in the map file; toggle-able
  • Locations defined by "addSpot" are displayed; toggle-able
  • Save map files directly to usable Lua files
  • Save screenshots
  • The originally loaded map can be shown; toggle-able
  • Virtually unlimited Undo/Redo
  • ...and more!
Screenshots
(click any image below for fullsize image)

Below shows Derth with hexagon tiles, "addSpot" locations shown, using in-game text display:
Image

Next, Last Hope with hexagon tiles, black border/grid disabled, using text as defined in the map file:
Image

Finally, since this is a map editor, here is an example of an edited map just for fun!
Image

Using the editor
The toolbar shown below displays all the tiles for the current map, the currently selected tile, and the available commands:

Image

There are three columns displayed for the tiles.
  • The left column shows the in-game text used in ASCII mode (note that many tiles display "#").
  • The middle column shows the number of these tiles currently used in the map.
  • The right column shows the text for the tile as defined in the map file, which is guaranteed to be unique.
There are many ways to select a tile:
  • Click on the tile in the toolbar
  • Middle-Click on a tile in the map editor
  • Use the mouse wheel to scroll the selection up or down
  • Arrow keys to move the selection up or down
Left-Click on a tile in the editor to change it to the currently selected tile.
Right-Click on a tile to revert it to its original state.

And, uh, that's about it!

Final remarks
This map editor application was developed very rapidly. It currently has a narrow scope of functionality, and I think it performs that functionality wonderfully. However, this is not (yet) a general purpose editor. If you want additional features, then please share. All feedback and contributions are welcome! Actually, contributions would be excellent: feel free to modify the code and please share your modifications.

So, yeah, I hope some of you find this application useful. This actually came about because I want the fixed maps redrawn for the tome-hex addon (please help!), and since ToME has more than 50 fixed maps, editing all of them will take some time.

I can also see this application being useful for the new Quest Addon contest.

Cheers!
darkgod wrote:OMFG tiger eye you are my hero!

Marson
Uruivellas
Posts: 645
Joined: Thu Jan 16, 2014 4:56 am

Re: Map Editor (works with hex grids)

#2 Post by Marson »

Awwwwwesome!

The Revanchist
Uruivellas
Posts: 762
Joined: Sun Nov 03, 2013 12:14 am

Re: Map Editor (works with hex grids)

#3 Post by The Revanchist »

Does this one only work on Linux?

(That is what .py means, right?)

Because, if so, that is unforntunate for me...

Marson
Uruivellas
Posts: 645
Joined: Thu Jan 16, 2014 4:56 am

Re: Map Editor (works with hex grids)

#4 Post by Marson »

Python also runs on Windows and MAC: http://www.python.org/download/

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Map Editor (works with hex grids)

#5 Post by tiger_eye »

I added some features to the map editor that should make it easier to use. Here are the highlights
  • Configuration file ("configs.py") to let you easily change default behavior
  • Command line arguments (run "python main_pygame.py --help" to see usage)
  • Examples of making a new map with new tiles ("example_tiles.py" and "example_map.lua")
The examples should be particularly useful for some people; for instance, those designing a map with new tiles, or those who are working on completely separate modules altogether :)

I am not familiar with installing and using Python 2.7 in Windows, so I am unable to give instructions for how to make this work in Windows. Hopefully somebody else can provide instructions (or a standalone application).
darkgod wrote:OMFG tiger eye you are my hero!

Sradac
Sher'Tul
Posts: 1081
Joined: Fri Sep 21, 2007 3:18 am
Location: Angolwen

Re: Map Editor (works with hex grids)

#6 Post by Sradac »

tiger_eye, y u so cool?

I think your signature sums it up.

Any chance to get a "build a new map" feature with this, as opposed to just editing what already exists? If ToME had an "easy" to use map builder, I think it would open to floodgates for ToMES popularity so now almost anyone could create custom content without having to know LUA

dyze
Wayist
Posts: 22
Joined: Sun Mar 09, 2014 1:28 am

Re: Map Editor (works with hex grids)

#7 Post by dyze »

yeah so has that somebody had any progress with compiling an executable? :D
i was just thinking that having this could enable players/modders to create versions of the world map, and we could have a randomly selected world map on startup.

joelsdaman1
Wayist
Posts: 23
Joined: Sun Feb 09, 2014 9:15 pm
Location: Ravnica, Selesnya Conclave

Re: Map Editor (works with hex grids)

#8 Post by joelsdaman1 »

This is the coolest thing ever!
Earth.

Post Reply