Saturday, April 14, 2012

Map editing

So far my maps were randomly generated using three different tiles. Procedural generation of maps isn't that bad per-se. Some great indie games like Minecraft, Recettear or Dwarf Fortress generate all their maps that way. The result is a versatile game environment with great replay value.

But still, when you want to do story telling and want to be a creative game designer, you need some way to create locations and scenarios by hand. This means I need a map editor. My requirements are:

  1. Creating and editing maps by placing tiles
  2. Creating warp connections to other maps
  3. Defining monster population
  4. (later) placing NPCs and scripted events

So what options do I have?

 

1. Writing map definitions in a text editor in JSON format

Pro:
  • I don't have to program any external tools

Contra:
  • No WYSIWYG
  • Very tedious
  • Very hard to troubleshoot
Maybe I will do that as a stop-gap measure until I have a more viable tool.

 

2. Use Tiled

 Pro:
  • A very mature and powerful map editing application
Contra:
  •  I would either have to write my own plugin for Tiled which saves to the format I need or I need an XML-parser. Tiled can save JSON files, which have a schema which is quite easy for me to parse.
  • Tiled doesn't work with my overlapping tiles. It does work with them, but you have to define the amount of overlapping yourself
Although using Tiled instead of reinventing the wheel would save a lot of work,  it is still not perfectly suited for my needs. Getting tiled and my engine to work together will require some work and maybe will even mean that I need to say goodbye to some features.

3. Create my own map editor as a stand-alone application

Pro:
  • An application perfectly tailored for my needs
Contra:
  • A lot of work
Creating an own map editor as a GUI application - no matter what framework I will use to do so - will be just as much work as creating the client.

 

4. Put map editing capabilities into the client

Pro:
  • Perfect WYSIWYG 
  • Easy way to get the community involved in content creation
Contra:
  • Still a lot of work, although I can rely on the map rendering
  • Puts more code in the client than I would like to have
  • Air-tight permission management required
Using the client as a base would save a lot of work over creating a new application from scratch. But integrating the map editor would add a lot of code which would be downloaded by the average player although they will never use it. To avoid this problem I could create the map editing component as a user javascript which runs locally on my machine (or that of the mappers).

No comments:

Post a Comment