Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411587 Posts in 69386 Topics- by 58443 Members - Latest Member: Mansreign

May 06, 2024, 10:26:00 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)How does your level editor work?
Pages: [1]
Print
Author Topic: How does your level editor work?  (Read 3003 times)
BorisTheBrave
Level 10
*****


View Profile WWW
« on: May 16, 2010, 02:28:39 PM »

Imagine the best possible level editor / designer. It would have to support a superset of how different editors make levels. I'm looking to compile a list of features it would need. The problem is though I do see level editors that I'd love to use for my games, adopting their file format or transforming it, there's always something I find I need to represent that doesn't fit nicely into that editor.

I'm thinking of different layout mechanics here, not whether it is in-game or not, nor how scripting works.

Here's the list I've got so far, can anyone think of techniques. I'd love to hear from you if you made an editor with a unique feature, even if you think it's specific to your game. I'm not even sure of a good definition of "level" distinct from other game data.

  • Tile based - regular pattern of slots to be filled in by a small set of tiles
  • Entity based - positioning point-like entities arbitrarily
  • Property based - add properties of little or no meaning to the editor to items from another editing system
  • Vector based - drawing lines, circles, polygons
  • Bitmap based - heightmaps, solidity maps, value maps
  • Code based - levels are defined as source detailing the actual construction
  • Generative / procedural


P.S. Should this be in the Design forum instead?
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #1 on: May 16, 2010, 02:59:40 PM »

like this:



Logged

ChevyRay
Guest
« Reply #2 on: May 16, 2010, 03:32:30 PM »

If you're looking for more inspiration and ideas, I recommend checking out Matt's Ogmo Editor for ideas and playing around with it as well. It's a highly inspired editor designed for extreme usability, and is updated very often with bug fixes and features suggested by users in the community. It's missing a few of the features you list, which are very good ones, but there's a lot more than meets the eye. You can create different layers (grid, object, and tile layers are supported so far) which all server useful purposes, objects can be resized, rotated, and duplicated, and levels can be resized on the fly. You can specify object limits, get object counts, choose what format you want grid and tile layers to be exported as, and it all works with XML for maximum compatibility with different languages and platforms. It's also good for certain things such as mapping enemy movement/behaviour, as you can give objects any amount of arbitrary "properties" of different types (int, string, boolean, etc.) and also assign then "nodes", which can be used for stuff like mapping out enemy routes, etc.

Right now it's still very in the works, but because the editor is focusing on functionality and implementation intead of GUI, it allows Matt to add and update features rapidly. I think this is a nice approach to take while developing such a project, even if it's a bit of extra work for early users to have to write out project files manually when they start a new project, and there's nothing stopping the creator from implementing a GUI later on when all the major features are implemented and working nicely.

Also yeah, I think that having this moved to the design forum could yield a better/wider discussion.
Logged
increpare
Guest
« Reply #3 on: May 16, 2010, 03:45:15 PM »

One of the nicest thing about mappy is that it has lua hooks for file input/output, so you have a lot of options when it comes to export formats (and can define your own).

It'd be very interesting to investigate procedural map generator options - I amn't aware of any in existence already.  Could be fun combining a large-scale room-grammar editor with a smaller scale cell editor, or maybe have something more stastical/random.  The problem with this stuff is that if you want stuff to be procedurally generated in the game, you end up usually duplicating a lot of code.   Maybe you could have something where you can define local rules for room composition, and then paint structures together on a larger scale (at a very simple level, editors that automatically insert corner/edge/transition tiles would probably fall into this category).  Hmmm.


Also: you seem to be working from a 2d perspective - but quite likely there's tonnes of cool stuff  that can be done in 3d as well. Mmmm.
« Last Edit: May 16, 2010, 03:49:47 PM by increpare » Logged
ChevyRay
Guest
« Reply #4 on: May 16, 2010, 04:08:08 PM »

Also: you seem to be working from a 2d perspective - but quite likely there's tonnes of cool stuff  that can be done in 3d as well. Mmmm.

Actually, 3D level design/editors is something I'd like to see explored and discussed a lot more, as I feel that there's so much ground to be explored still. I rarely play a 3D game where I feel the level design really works with and/or emphasizes the 3D world and takes advantage of that to awesome degrees. Portal did certain things that were really fun and interesting, and Cactus' Tuning mixes 2D level design with 3D perspective and transformation in a fun and interesting way. I'd just like to see more of that in general.

But sorry, I don't want to derail the thread too much.
Logged
increpare
Guest
« Reply #5 on: May 16, 2010, 04:15:12 PM »

Actually, 3D level design/editors is something I'd like to see explored and discussed a lot more, as I feel that there's so much ground to be explored still. I rarely play a 3D game where I feel the level design really works with and/or emphasizes the 3D world and takes advantage of that to awesome degrees. Portal did certain things that were really fun and interesting, and Cactus' Tuning mixes 2D level design with 3D perspective and transformation in a fun and interesting way. I'd just like to see more of that in general.

But sorry, I don't want to derail the thread too much.
New thread, so? :D
Logged
Triplefox
Level 9
****



View Profile WWW
« Reply #6 on: May 16, 2010, 06:59:29 PM »

I kind of wrote a whole essay for this somehow.

Although this discussion was preluded by a focus specifically on "layout paradigms" and not "UI" or "internal vs. external" or "code vs. data," I find that UI is actually at the core of the issue in making an optimal editor and all those things matter up front and roll back into the layout methods; you can't escape having that enter the discussion. If UI didn't matter, the layout paradigm wouldn't matter, and you would be coding your levels inlined in the source with whatever functioned for the gameplay. As it is, what we are doing with the "tiles/points/nodes/fields/polys" metaphors is mapping data structures to problems by the UI we can present to them. If you want to explore those mappings, reviewing CS literature is probably the strongest way to do so. And after trying to make an editor that does everything and wasting about a month of time for it, my prerogative has become: get the most optimal UI possible with the smallest amount of UI programming.

What I learned from trying to build an editor the other way, explicitly aiming to make it refined and reusable for many purposes with a browsable, WIMP paradigm, is that it ends up being mediocre everywhere and bloated with mountains of potential configuration options. If you are building a tile editor, for example - is it a tile editor for materials like solid/liquid/air/conveyor/etc., where the gameplay info comes first and some procedural magic is used to create final graphics, or is it a tile editor for art first and you do the gameplay secondarily or separately, with the metadata on the tileset or on a separate layer? A puzzle game might want the former, while a cinematic platformer might want the latter.

For the former, it can all be done in-game and you can even make procedural algorithms that are responsive in real-time, but if you write a generic tool, it either has some clumsy script/plugin thing to do proceduralness, or it doesn't even try for an accurate representation and you have to play "guess-and-check."

For the latter case, I started doing art in Pro Motion's tilemap tool, which lets you do full-canvas pixel-pushing, autoreduce to a tileset, and then refine the tiles from there; the combo of art features + tile features is very well focused and will give a faster workflow than a pure tile tool that uses an external art package. And then I can handle gameplay data with an in-game thing banged together in a day or less. If I want to go gameplay-first in this system I can use the gameplay data to export an image from the game, import it into Pro Motion, and then start drawing on it.

But the main point of the example is that you can't actually "optimize for both," because adding that configuration option hurts the overall UI. I looked at Ogmo Editor's tutorial and it begins, "edit an XML file..." which is an immediate(but understandable) UI failure; the requirement of massive flexibility has already strained the app outside of WIMP and into writing code. If it didn't do that, it would become something far more horrific, a travesty of GUI programming that lets you assign generic properties much as you would do if you were coding, only not as conveniently.

Returning to the layout discussion, I think we should consider "editor libraries", "APIs" or "frameworks" with which to quickly manipulate our vocabulary of tiles, entities, nodes, polys, fields, etc. and add exactly the amount of UI necessary to facilitate this, scripting procedural assistants as necessary. An app can only optimize itself one way.

Of course, then the question is, what exactly do level editors need to facilitate their development? And then I end up thinking "it's all in the hands of the game engine, really." That is, the whole engine should be constructed with editor-building and "scaffolding work" in mind. Pursuing this line of thought is how I've been proceeding on Fireball - making the entire engine designed only to facilitate the iterative process, to reduce debugging time, etc.

The result: The most interactive-necessary things are in-game and you access them by shortcut keys and clicking in the view. The things that need more involved data manipulation are in JSON, XML, or similar human-readable formats and I edit them in a text editor and have the game update from it live. The things that are really time-consuming to layout I write procedural code for. I don't want to have a single button, toggle, slider, input field, or dialog box devoted to editing; those things only aid in browsing, and you are probably going to be the only one using your editor. Console input is my last resort, when single-button shortcuts and clicks aren't detailed enough and text editors aren't interactive enough. The console is good to pull up arbitrary queries and reports or prelude interactive commands with more detail; I haven't needed to write code for it in Fireball yet but I'm sure the need will arise sometime soon.

But I don't see any reason to step outside these paradigms - you can remix them over and over, and do something like.... have a tilemap and point system that maps coordinates and metadata into an XML table containing script parameters; said script then procedurally generates landscapes and structures for a 3D world; 3D geometry can be used to hint to the script about particular details and customize each locale in further depth(size and scale of buildings, road delineations, etc.) and then within those locales, subset systems can be used to describe rooms, terrain markings, etc. Everything customizable, in layers, using the most powerful metaphors at each level, but with a very minimal UI for each part.
Logged

BlueSweatshirt
Level 10
*****

the void


View Profile WWW
« Reply #7 on: May 16, 2010, 08:39:31 PM »

The difference between programming and developing is that with programming, you need to use text to edit and create, whereas developing(in the context of a level, not the broad and rather vague term itself) is nearly completely visual.

I'm designing a level editor, myself.(along with a pixel art tool, and a couple other minor things)
But, basically, my editor is designed to be a general, flexible editor. It's not a tile-based solution, but you can snap any object to a grid.
With that said, there're just objects in my editor. There's not differentiation from tile and object.
Every object has a default depth and scale.(which you may adjust individually) One key flexibility is that you can add properties to the objects. This comes in handy, for instance, when you want to make treasure chests.
You create objects through a little dialog where you set the properties. It's mostly just setting an image, name, and default values. After that, the object is automatically saved. You can manually organize objects into groups, to keep things cleaner.

Everything is exported to a single format, XML based. It'll be up to the game/engine using it on how to decode it to work in the game, but that allows the editor to be as vague and flexible as it is. Of course, the format will be fully documented, and my own game engine will automatically support parsing and handling of the editor, to an extent.

Anywhoooooo~ I hope my rather long nutshell explanation helped the discussion in some way.
Logged

nikki
Level 10
*****


View Profile
« Reply #8 on: May 17, 2010, 01:59:27 AM »


it has flood-fill.


(for one reason or the other, alot of tile-editor i looked at didn't have this.)
Logged
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #9 on: May 17, 2010, 12:43:08 PM »

Cools, thanks for the replies so far. I will have to check out omgo - it seemed one of the better editors, but now it sounds even more full featured than I had expected.

And triplefox, you're right that a UI is so important. Perhaps I am more intersted in the underlying representation than layout, like I was asking. I don't quite get Pro Motions auto tile feature, do you have a youtube video for it? Pro Motion is quite possibly the least googlable product name I've seen.
At least I can answer one of your questions fully - I want an editor that is design first, looks second. I'm a believer in separation of concerns, which means no in game level editors (though hypocritcally the editor I'm working on atm IS in game, and works ok). If you want to see truly what it looks like, it should be by quick turn around time to playtesting a level.
Logged
bluescrn
Level 1
*


Unemployed Coder / Full-time Indie :)


View Profile WWW
« Reply #10 on: May 17, 2010, 01:26:09 PM »

Braid had a nice way of doing away with tilemaps:

http://www.davidhellman.net/blog/the-art-of-braid-part-4/

Soft-edged-alpha channels, free placement of tiles with arbitrary rotation/scale - that's the way to go - at least if you know how to handle a bit of OpenGL/D3D, and aren't scared of dealing with arbitrary line segments for collision edges (either manually or via a physics engine)

Take something like this, make sure all 'tiles' go into an animatable hierarchy, give it a nice Windows interface, add some support for 2D lighting/shadows and physics objects. Maybe 2D skinning...  And a set of blend modes and a few interesting shaders.  And post effects (bloom etc).

XML makes sense as a level format. Although for really big levels, it might be worth preprocessing those into a binary format.

That'd be getting pretty close to the ultimate 2D game editor...

My attempts to build it haven't got very far yet Smiley
Logged

BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #11 on: May 17, 2010, 02:03:21 PM »

Yes, positioned premade pieces is one of my favourite, and XML too. No need to sell me on those! But it's knowing where those don't work that is important. Just like tile based games feel pretty samey in some very broad sense, so do entity-based ones. You start to notice that things don't knit together ideally with alpha blend.
That's why most games use at least two techniques for variety. But still, I feel I gotta catch em all.

Also, i meant to include 3d games, too, but there is much less variation in how they work, no? Though there was that "brush-based" system that Unreal used to use, where you would carve the world using constructive solid geometry.
Logged
siiseli
Level 6
*



View Profile
« Reply #12 on: May 17, 2010, 08:02:02 PM »

My level editor works rather well, thanks for asking.
Logged
st33d
Guest
« Reply #13 on: May 20, 2010, 08:11:17 AM »

RLE compression is a must.

You can convert a shit load of tile data (especially empty space) into one tile reference with a frequency indicator next to it. And it's still readable when you look at the XML, more so than the data being uncompressed.
Logged
Overkill
Level 3
***


Andrew G. Crowell


View Profile WWW
« Reply #14 on: May 20, 2010, 08:28:47 AM »

RLE compression is a must.

You can convert a shit load of tile data (especially empty space) into one tile reference with a frequency indicator next to it. And it's still readable when you look at the XML, more so than the data being uncompressed.

I'd say when you're actually at the point of needing compression, you probably have a large enough map that you aren't editing tiles by hand anymore. Just zlib compress a binary representation of the tilemap to get the size down, and then base64 encode so it can be stored in XML (takes 4/3 times more bytes than the compressed binary blob, but this is pretty minor).

That said, nothing stopping you from having many different compression options!
« Last Edit: May 20, 2010, 11:46:08 AM by Overkill » Logged

bateleur
Level 10
*****



View Profile
« Reply #15 on: May 20, 2010, 09:15:05 AM »

I've given up on writing level editors. These days I always just give my game built-in editing capability. Activate edit mode somehow (sometimes a magic key when in dev mode or sometimes from the dev mode menu if there is one). This pauses the game and turns the mouse and keyboard into editing interfaces. Save if you want. Resume.

Of course, there's still the question of UI, but mine tend to get built in ad-hoc fashion from existing UI library classes I have lying around.
Logged

BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #16 on: May 20, 2010, 10:52:07 AM »

I don't think's really avoiding that much work, it is still a level editor. The main advantage of in game imho is reasonably quick feedback on your level, and versimiltude, not the smallish amount of code saved by re-using your preexisting display code.
Logged
bateleur
Level 10
*****



View Profile
« Reply #17 on: May 20, 2010, 12:26:13 PM »

In practice it seems to drop the development time well below half of what it would otherwise be. It's not so much any huge sections of code you don't have to write as just avoiding lots of small irritations.
Logged

Glaiel-Gamer
Guest
« Reply #18 on: May 20, 2010, 12:43:30 PM »

i usually make mine on a per game basis just so the *edit-test-tweak* cycle is as quick as possible

also means I don't have to worry about adding generic stuff to them that I don't need for the game at hand
Logged
richtaur
Level 0
**

the galaxy is at peace


View Profile WWW
« Reply #19 on: May 20, 2010, 01:33:53 PM »

My dev partner and I were slowly making progress on a map editor, but then we found Tiled: http://www.mapeditor.org/

Really damn good. Trying to reuse instead of rewrite whenever possible ...

Logged

game developer and artist
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic