Basic Level Editor Question

Started by
11 comments, last by BornToCode 11 years, 1 month ago

BornToCode

Could you please tell me which UI you use for editor? I want to use Win Forms control inside WPF window to make good and easy customized UI.

Is this correct decision, how do you think?

Advertisement

All of DirectX just seems like a bit much so far, I really do enjoy it however. It just feels like.. a lot of the "support" or community for it isn't here / they aren't sure about certain things. There are times that I think i'm asking in the wrong area / forum because of these questions. It is nice to find you (and a few others) who do understand DirectX and are actively using it however.

DirectX is all over game development, the "community" is HUGE. Every major studio is using either Direct3D or OpenGL for their 3D rendering. There's a specific subforum just for DirectX. I'm having trouble understanding why you think there's no/little support for it out there. Books, tutorials, and entire websites are dedicated to the topic.

Though technically, your question doesn't have anything to do with DirectX specifically, it's more of a generic architecture topic.

Anywho:

My editor serializes data based on what I've determined is "just enough" to rebuild the level with in the game, and saves that out to a binary file. It includes references to all the assets it needs, and where/how to put them when the level is loaded. Just decide what raw data describes your level well enough to recreate it on load and that's what you want to save. It can be as small (or huge) as you prefer.

Concrete example: I put a rock bridge prop into my scene. It's centered at (100, 250, 25), scaled up by a factor of 2, and rotated 30 degrees on the Y axis. Instead of putting a 400-triangle mesh plus texture into my save file, all the Save() function does in the editor is jot down "position: 100,250,25. scale: 2,2,2. rotation: 0,30,0. Prop: rock_bridge_1." (Not in text, serialized Vector3s and a string, but you get the idea).

The level loader goes to the appropriate resource package (another story, I'll save for later *), looks up the mesh and texture associated with "rock_bridge_1", and places it in the scene at 100,250,25, scales it up by 2, and rotates it 30 degrees on the Y axis.

So yes, you determine the file structure and type, and like a lot of software development, it really IS straightforward and easy once it's been demystified. smile.png

I name my file type ".mmp" but that's entirely arbitrary.

Keep in mind you can serialize binary files, or you can write out things like JSON or XML files as well. I went binary because C# has a handy binary serializer/deserializer. Some people prefer the text-editable files because you can just hop in and tweak them directly if you want.

*Edit: if your curious, turns out I already wrote a post on it here.

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

BornToCode

Could you please tell me which UI you use for editor? I want to use Win Forms control inside WPF window to make good and easy customized UI.

Is this correct decision, how do you think?

I am using C++ for the engine. And C++/CLR for the editor. I could have easily use C# instead, but i did not want to go through the hassle of creating wrappers for my C++ engine.

This topic is closed to new replies.

Advertisement