Creating a World Editor

Many people that come to TV need help with writting a world editor. While it is a very complex topic (too much to completely cover in one tutorial), this tutorial should get you on the right track. First, you should decide what TV objects you are going to support, and make seperate classes for each of those. For example, have a Mesh class, a Terrain class, ect...

In each of these classes, you should have the different properties you will need to store, such as Name, PosX, PosY, PosZ, Scale, LightingMode, ect... Have as many as you need, and be sure to take a look at the TV classes for ideas on what type of properties to add. For example, if you want to be able to generate terrains, in your terrain class you would need Heightmap, Precision, ChunkX, and ChunkZ properties.

Next, for each class you will need to have an InternalObject property that is the TV class, so you have access to the functions you will need to create the 3D representation. When the propreties change, you will have to call the TV class functions to make the real change.

Then, you will need dictionaries (or collections) for each object type to store all of the objects. You will have to make sure that all names of each object type are unique before adding them to the dictionaries. You can take this a step further by putting all of the dictionaries into one class to make everything easier to manage (your “Map” class).

Finally, have a way to add and manage these objects from your menu, such as an Add button, and a way to edit them, such as a property grid. You will also need a viewport on your form (obviously).

You may also want to look into having methods for special interaction with the viewport, such as being able to drag objects on the screen rather than just type in properties.

I would recommend starting with a simple object, such as atmosphere, and get that working, and then move foreward with the other objects. It will be better than creating all of the object classes at once, and you will be able to see if what you are doing will work or not.

That should get you going in the right direction. I basically just laid out how I made my own editor. It is a very complex topic, and obviously this explanation doesn’t cover everything, so if in the future you need help on more specific things after making a decent attempt, I am open for questions.

 
creating_a_world_editor.txt · Last modified: 2013/11/22 13:31