-
|
|
3D World Editor Questions... I'm going to attempt to make my own!
|
Hey again,
I realized this section is probably the proper place to post this.
I figured it'd be really worth it for me to attempt making my own 3D level editor. The end result goal of mine is something very similar to the level editor in this youtube video. I know it's a big goal because that editor looks simply amazing. I'm not worried about the Windows Forms coding, since that's where my comfort area actually is. I'm not sure how I'll go about rendering the XNA scene in a window like this does, but I've heard people discuss it before and I recall them saying it's fairly simple to do.
Anyways, I really have just been trying to come up with a checklist of things I'm going to do in order, since I don't truly know where to start or how level editors should work. I've only really gotten so far as to render heightmaps on my own in my game, and draw a texture on it. So, taking what I know I figure my current list of things to do in order would be...
- Allow a user to generate a generic terrain, using TriangleStrip, by either entering desired length x width, or by loading a pre-existing greyscale heightmap.
- Come up with a solid terrain picking algorithm that support various types of pointer types (circle, square, ring-shaped, whatever)
- Figure out how to let a user specify what texture to use at any given X,Y coordinate on the terrain grid and connect the terrain picking functionality with this functionality. This will be the basis of my level editor.
- Add the ability for a user to raise or lower the terrain under the mouse cursor.
- Come up with some way to save this information so that an XNA game can load it up and use it. Perhaps generate the heightmap, and then use XML for where textures should be applied? If this were the case, though, why not just load height data from the XML file also since either way every polygon would need to be told what texture to use.
I figure if I can get this far then I'll have a pretty nice level editor in the works.
Does anyone have any advice for me? Or tutorial links that might help me out with this? Or, maybe you can kind of fill in some the things I'm unclear about based on the mentioned listed items?
Thanks in advance
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Hmm well I can give it a shot but Im by no means an expert.
1. For the ways to do terrain I would start by looking at Reimer's tutorials. It deals with how to create a terrain with water and texturing from a heightmap and its pretty good. Link: Reimer's Terrain Tutorial3. See answer 1. It has to do with "weights" in the shader, where you basically tell each point to be 70% texture0, 20% texture1 and 10% texture2, etc... The tutorial will explain, but if you want more advanced stuff check out Reimer's advanced tutorial. Link: Reimer's Advanced Terrain Tutorial4. Same thing as above - you can alter the coordinates around where your cursor is before redrawing it, this should give the effect of raising the terrain. Bit simplified explanation, but I would save this till you got the other stuff working. 5. Hmm not sure I fully understand this one. Saving the heightmap is probably a smart idea as it will work pretty easily. You can output a colour image alongside the heightmap that shows which textures to put where as a full colour image where the red values represent texture0, the blue represents the amount of texture1, etc... That means you can maximum have 4 textures (per map anyways) for Red, Gree, Blue and Alpha value... but on the upside you can easily to texture splatting (think thats the correct term hehe) where you use these values as alpha values for each layer of your textures.
I hope you get somewhere and when you do - come back here and show us the results : )
It's gonna be a lot of work, so if I was you I would do it in clearly defined steps, i.e. "Step 1 - Load a terrain and show it, Step 2 - Give the terrain textures, ..." etc. The tutorials should be good for that. With that said - Good luck!
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Thank you for the great response. I'm going to go through those tutorials you linked, as well as the several books I've got, and am going to try to get something very simple working, today. I'll keep you posted.
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Well, I promised I'd keep you posted. So, after a long day of staring at Visual Studio, I finally realized using the Game class is not going to help me much. I did a lot of blog, tutorial and MSDN reading and came up with a pretty cool and extremely simple basis for my level editor. I'm going to go with a simple MDI Parent/Child approach. Here's what I've got so far, which basically sets me up to start telling XNA how to render whatever I want through controls.
Screenshot of my editor after day 1
All it does right now, visually, is draw that moving rectangle. (it's moving around the scene.) It also supports resizing of the child window.
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Always a good place to start : ) If you need any help on how to use controls wioth XNA Game etc here is another good link from this site (does similar thing to yours): Winforms Controls & XNA.Keep it up and lets see what you come up with!
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
I had a very busy day today with school, and stuff. I was able to write a Heightmap and Terrain class, though.
Currently, the Heightmap class is responsible for providing the vertices and indices for the terrain. It also does Normal generation. The Terrain class is responsible for the actual rendering of the terrain. That's basically all I had time to write tonight, though. Here's my second screenshot.
Screenshot 2
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
I would put the vertices and indices on the terrain class, and keep the Heightmap class stricly as a container of the height map data. Even better create a BaseMap class which has the map data, and have the Height map class subclass that (it might not even need extra code), then you can subclass the BaseMap for things like HeightMap, WaterMap, NormalMap, AttributeMap etc. Then you could also consider making the BaseMap a generic class BaseMap<T> so you could have maps of different numeric types such as short, int, float etc.
Game hobbyist hell-bent on coding a diabolical Matrix
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Craig Martin:I would put the vertices and indices on the terrain class, and keep the Heightmap class stricly as a container of the height map data. Even better create a BaseMap class which has the map data, and have the Height map class subclass that (it might not even need extra code), then you can subclass the BaseMap for things like HeightMap, WaterMap, NormalMap, AttributeMap etc. Then you could also consider making the BaseMap a generic class BaseMap<T> so you could have maps of different numeric types such as short, int, float etc.
The Terrain class does keep the vertices and indices. The Heightmap class just has some get properties that cough them up based on the heightmap. That was my basic idea, though. I wanted the Heightmap class to strictly contain heightmap data. If at all possible, I wanted my Terrain class to know nothing about "heightmaps", hehe.
As far as the BaseMap concept, I'm not quite that pro yet. By that I mean, I don't know how I'll be doing water, or anything. I've been looking into terrain splatting because that's how I want my editor to function - not textures blended based on terrain height. Once I kind of figure all of this out I'll know exactly how abstract I need to make certain classes of mine.
I'm basically learning as I go. Making some good progress, I think. hehe :-P
|
|
-
-
- (0)
-
premium membership
-
Posts
23
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
|
|
-
-
- (2663)
-
premium membership
-
Posts
1,014
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
You have a VERY basic map editor here, its made for total beginners - nothing fancy: http://www.xnawiki.com/index.php?title=Generated_Geometry-Interesting discussion, I am wrestling with a special map editor myself. I am trying to invent something different, hard to explain but it is basically a method to create the tiles in runtime by randomly mixing materials - hopefully you will see the result some day :)
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Valentin:
hello valentin,
why did you change to wpf ? what are the pro and con ?
cheers
|
|
-
-
- (0)
-
premium membership
-
Posts
23
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Hi Black Reaper,
I change to WPF for many reasons.
WPF is more efficient to build complex interfaces (architecture, control communication, databinding)
With WPF you can make smart user control more easily than in Winform
The design with WPF is easier (with tools like Blend) and allows richer, more modern and simple interfaces for the users.
I am working on a new way to build world in 3D, it is more simple to create a new ergonomy. With WPF you design a screen or some controls, in Winform you arrange widgets together. This is not the same way of doing.
I were strong on Silverlight and Winform but totally noobs on WPF :) Now i know well WPF.
But :
Xna and WPF : the integration is not easy.
You can easily slow down your application
It costs a lot of memory
There is no help you can find when you have problems (there is not a lot of people using WPF and XNA...)
To finish, Frank Savage tells me that one day, there will be some Xna in Silverlight. So i will be able to put my editor online very fast :)
Sorry for my "french" english.
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
I don't really know anything about wpf and winforms because I'm not much of a tool developper. I want to do a really basic level editor ( place and scale object on a level). I'm an 2d artist so making nice ui is a always appealing. Would you recommend using wpf from your experience ? your sample seems fairly simple and not so hard to understand.
I'm looking for information over internet but if you know some good place to start or some library ( I don't think I need to create one from scratch ) I would be glad if you share them.
Also why do you want to put your editor over the net ?
cheers
ps : don't worry about your english I'm french too :)
|
|
-
-
- (0)
-
premium membership
-
Posts
23
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
On parle Français alors ? :)
If you don't know WPF and Winform, i think it is better to try WPF first. The next version of the .Net Framework will help for the merge of Xna and WPF (there are a lot of blogs and forums that speak about it over the Internet).
Nice UI is appealing ? So try Microsoft Expression Blend to work on your UI. All designers that i know have a very good ownership on this application. In // you have to increase you skill on WPF by making some little applications in WPF.
Then Build the real application that you want for your level designer (2D level ?). But do not use Xna first. it will complexify you work too much.
The integration of Xna have to be made when the basics of your UI application is done.
Witch kind of information are you looking for ? WPF ? Xna ? Level designers ?
If i have the skills i can try to help you.
Why online ? To help people, to make business in the future with a professional edition (i hope so), beacause the future of the Web is the 3D, and for my MVP skill
Amicalement
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
J'aimerais parler de ça en français mais j'imagine que ça va limiter les autres donc soyons polis ! :)
Basically I want to understand what silverlight and wpf are exactly ( I still looking into it to figure out our different use) and how they are related to xna. For everybody around this seems obvious but for a non dev it's a bit unclear.
If you know some good video tutorial about silverlight and wpf coulld be great to learn a bit of these tool and then apply my experience into xna.
about your editor what features do you plan to add ?
I can see some texture painting. How do you plan to store the level information. one teh decal is made how do store that ?! I look over internet and there is a little information about decal. Expecially if you are using custom model and not terrain like in you demo.
The video is quite slow is it your configuration or winforms performance issue ? I've read several complain about it. Did you use xnb file or do you complie them on the fly?
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
I've also been working on an attempt at this. I haven't focused on terrain as heavily yet though, just some simple texture splatting etc. etc.
I'd be interested to talk with you, see what you've gone through getting things working. My level editor was more of an experimental learning tool for myself.
|
|
-
-
- (0)
-
premium membership
-
Posts
23
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Ok ça marche pour moi :)
They are two way of making UI for applications. Silverlight make cross browser, cross plateforme and cross device application. Whereas WPF is dedicated to the Windows World (even if run on a Browser with Xbap). Silverlight and WPF decribes their UI with Xaml (an Xml language). They do not work on pixel like Winform or Xna. Their rendering is vectorial. They are not directly concern by Xna. But they are more powerful to make UI. So married Xna and those technologies is a good way to make applications such as a level editor.
Take a look at http://www.silverlight.net/getstarted/
It's a good way to begin on Silverlight.
And for WPF http://msdn.microsoft.com/fr-fr/netframework/aa663326.aspx
My editor ? All the things needed to build worlds like Wow's :
Topography
Texturing
Objects
IA
Effects (fog area, blur, etc.)
All of this in a great editor (i fell in love with Warcraft 3 editor). With mine you make a world in few minutes, generate a file that can be loaded in a Xna game with only on instruction. The background API offer a lot of services to interract with the world.
Engine engine = new Engine (gameServices).
engine.World = contentManager.Load<World>("mygeneratedWorld");
//...
engine .Initialize()
//...
engine.Update();
//...
engine.Draw(gameTime);
Never learn something about Decal system. I am using a texturing technique close to the texture splatting ( http://www.gamedev.net/reference/articles/article2238.asp). I have a little trick that give me a way to render on screen up to 16 ground textures (16 textures brushes). I am using ARGB composant of each pixel of two texture to create that.
Each time a modification is made on the ground topography or texturing an asynchronous process is launched to save the world on file system. Each node visible on the ground have a pointer to its description in this file.
Yes very slow, it is the software that make this video. But in real it is fast. I did not make a real game for now. Just build some worlds and run it on Xbox or Windows.
Here is a screen shot of the wpf version http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/valentin.Arcane.Esquisse/6886.test.png
|
|
-
-
- (0)
-
premium membership
-
Posts
23
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Great job Garrett, very impressive too.
Thx to you us that.
I did not work yet on the transformation to apply my 3D object (just translation).
If you have some tips can you share ? :)
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
I simply used Un's manipulator control. It was really easy to implement. However, he uses quaternion rotations, which makes it difficult to change rotations manually.
I also had a unique issue with his control slowing my program down greatly. I assume it's because of the way it checks for a click & hold on the control manipulators because when I am moving something the frame rate shoots right back up. Has anybody else used Un's control?
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
thanks for the link
http://www.ziggyware.com/readarticle.php?article_id=189
this is a great example for manipulators. I hope it helps you.
I'll start working on my engine soon still making the design and services. But I'm really concern about the asset manager. Modifying, saving, loading building all the mesh into the game editor and then use it in a game. I still looking for documentation and shawn post are a great for that but all this is really new so maybe in a coulp of week.
A game editor I found inpiring is the overgrowth's one.
|
|
-
-
- (0)
-
premium membership
-
Posts
23
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Thx for the Link Black Repear, la classe que j'ai commencé est semblable à cela. that's cool.
J'ai fait mon gestionnaire d'actifs propres. Qui se chargent de façon asynchrone Ressources et libre, elle, après un laps de temps où l'on n'utilise pas.
J'ai créé mon propre format de modèle basé sur le nouveau monde ml Format (fichiers XML dans une decription zip). Je l'ai nommé "MML" (langage de balisage pour le modèle). Il est très similaire à M2 format modèle de Wow. Mais il est plus proche d'une base de données d'un fichier.
L'éditeur de jeu, vous montrer est belle aussi, love it:)
|
|
-
-
- (0)
-
premium membership
-
Posts
23
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
No, never use the Un's manipulator Gambit Sunob, sorry
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Do you still have the Un's manipulator source code from his ziggyware article ? I have the article, but I do not have the source code. Now that ziggyware is dead, I do not find any way to obtain this great piece of code :'(
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
|
|
-
|
|
Re: 3D World Editor Questions... I'm going to attempt to make my own!
|
Thank you so much for your help. This tutorial is a great piece of code.
|
|
|