Creating a map editor

Started by
4 comments, last by arnero 9 years, 1 month ago
Hey, Im thinking of attempting to create a map editor/creator to act as both a game creation tool for myself aswell as a potential user tool for modding, what would be the most efficient way of doing this? I would using a method of while the editor is in use record the amount of times each time a certain model is placed aswell as its position and rotation, then export that information in a text file which would end up looking like:

Model: wall1
position: 34,0,12
rotation: 0,0,0
amount: 6

and so on for each model... and then when needed load the map into the game by using the "amount" as a for loop amount for each model for placement aswell as being used in the update/run function for checking for collisions?

thanks :)
Advertisement

Why would you record the time? I misunderstood.

What you are describing sounds reasonable.

The most efficient way is definitely to use an existing editor.

Use an existing level editor - or maybe even just a pixelmap editor or text editor - and then write whatever conversion utilities are needed to produce the data in the format you want.

Some editors already have some mechanism to make plugins - for example, using a high-level language that won't waste your time too much.

Also consider the amount of time it's going to take your content team to build maps.

A feature-rich third party editor with plugins, add-ons, and conversion utilities, is likely to provide a better user experience with less effort, than trying to roll one from scratch.

As appealing as using an image editing program like MS Paint might sound, when I went that way once, I found it unnecessarily annoying to use. Loading the images and reading the pixels to place objects in the world was very easy... but trying to place objects where blue is one object, and slightly-different-shade-of-blue is another object, made it increasingly difficult to look at the image and know at a glance what objects were what. It'd only be fine if you had a few different types of objects - but once you start having different floors, walls, plants, items, enemies, etc... to add to the map, the colors start to add up and the image-editing comprehension starts to go down.

Maps can still be saved/loaded as images though!

Getting a very simple in-game editor up and running in your engine takes very little work, as long as you rely predominantly on keystrokes and mouseclicks and don't care too much about fancy editor UIs.

Definitely use something like Tiled or Gleed2D if they suit your game, because they'd have more built-in tools allowing for faster content creation. You may need to spend a week or two to figure out how to load their file formats into your game though.


I would using a method of while the editor is in use record the amount of times each time a certain model is placed ...

Model: wall1
position: 34,0,12
rotation: 0,0,0
amount: 6

and so on for each model... and then when needed load the map into the game by using the "amount" as a for loop amount for each model for placement aswell as being used in the update/run function for checking for collisions?
No idea what this "amount" is supposed to be. The example uses the model multiple times (whatever that means) but it seems to provide a single 3D position for placement.

In my experience, I found Blender very viable by using node extra properties and a python script to pull them out.

On Collisions

Do not use the same models. You will be sorry. Many beginners, often using uselessly overpowered i7 computers don't realize how much power they waste. Collision information cannot be reliably/trivially (pick one) inferred from the models. Annotations built in the models tightly couple representation and behavior. You'll end up having three identical models where the only difference is a bit in the collision mask. This can be worked out but I find it just easier to require explicit, separate annotation of collision volumes.

Previously "Krohm"


I w

On Collisions

Do not use the same models. You will be sorry. Many beginners, often using uselessly overpowered i7 computers don't realize how much power they waste. Collision information cannot be reliably/trivially (pick one) inferred from the models.

I thought BSP-trees were invented for this. It seems there still is a need for a GPLed dynamic balanced BSP-tree with overlapping nodes implementation.

This topic is closed to new replies.

Advertisement