I'm learning 3D programming and I decided to make a really simple "engine" where you can just fly around the map, etc. Only basic rendering of walls.
So, I was thinking - how can I save the level and how can I edit it. I don't want to make also an editor for it, because it is only a learning project, and not an actual game. So, I was looking towards this level format: UDMF http://zdoom.org/wiki/Universal_Doom_Map_Format although it is for a completely different type of game, still, it does what I need. Specifies vertices, floor, ceiling positions, etc. So, basic 2.5D geometry, which could be easily interpreted into a 3D space, which is more than enough for my purposes. There are also tons of editors (main reason).
BUT, I do realise that this is not really the best solution, and kind of workaround.
So, my question: Is there any "open" map format and "open" editors that I can use for my engine/game?
UPD: I'm working with C# and XNA, if that is important.
You could use XML (or something even simpler) that provides the location and other attributes of all the objects in the level. This would be the easiest solution (and have the benefit of containing whatever info you want but nothing else) but would not provide a level editor.
However, I know you want an editor (who wouldn't). Here is a very new, work-in-progress editor that looks interesting: 3D Scene Editor for XNA
Related
Sometimes a Unity project has data that demands more than ordinary inspector fields and we want to create more sophisticated tools to edit the data. For example, here's a blog post about creating a node editor: Creating a Node Based Editor in Unity
It's useful to be able to create node editors, but that project draws nothing but boxes and lines and curves using the tools in GUI and Handles, which is fine for what it is, but what if we need to draw something not supplied by Handles?
For example, if we want to draw an elaborate mesh to represent some data that we want to be able to edit, it seems not ideal to render each individual polygon of the mesh using Handles.DrawAAConvexPolygon(...). Shouldn't we instead have a way to more directly send the mesh to be rendered? Or is DrawAAConvexPolygon exactly what we should be doing?
Is the GL class the appropriate approach when wanting to draw arbitrary meshes in an editor control? It is certainly capable of drawing, but is it bad practice? In particular, the GL.Viewport(Rect) method seems to work very strangely within a GUI. One cannot simply give it a GUI Rect and thereby have a viewport in the same place we'd have a GUI control if we gave it that same Rect. We need to calculate the Rect that will put the viewport in the appropriate place, and even then we have to determine the coordinate system within the viewport. Based on the documentation for Viewport(Rect) one might expect the viewport to be (0, 0) to (Screen.width, Screen.height), but it does not always work out that way exactly, and it all gives the impression that GL is not designed to be used within Editor GUI. The documentation for GL.Viewport has it used in an OnPostRender method, so is it misguided to try to use GL in other places?
If we should not be using the GL class, then what is the technique for drawing within custom Editor controls?
You may wanna look at Unity Graph view if you want to make a Node Based Editor in Unity.
It use UXML and USS with is close to HTML and CSS.
Making it pretty easy to customise as you wanted.
Unity Video on UXML and USS: Customize the Unity Editor with UIElements!
https://www.youtube.com/watch?v=CZ39btQ0XlE&t=98s
Here are 3 Github you can download and look at.
https://github.com/rygo6/GTLogicGraph
https://github.com/rygo6/GraphViewExample
This one is made by me.
https://github.com/KasperGameDev/Dialogue-Editor-Tutorial/tree/Dialogue-Prototype-Bonus
so I am a beginner at unity and cannot grasp how you are supposed to have a pattern or architecture with unity.
I am currently making a platform game which has a character that is supposed to stay on moving platforms and not fall off the screen (very basic). On the platform there are "monsters". If you touch these monsters you also lose. There is also some trees and such on the platform.
This is what I have so far:
In the "manual gameobject list" or whatever you call it:
Directional light
Main camera
Background (just a sprite that is always showing)
Player (contains a JS script that has character specific code for jumping and such)
Platformspawner (Contains only a c# script. This script spawns multiple platform gameobjects, these gameobjects then use a script called platform.cs. This class spawns monsters and the trees on each platform. The monsters and trees each use their own c# file that keeps track of collisions and such.)
For me this is pretty obvious code and I do not know how to organize it much better. Any tips? I tried following an MVC tutorial but it seems like there is not much gameobject spawning in those tutorials which is what I have to do, so they confuse me.
Your hierarchy (the area of the editor where all of your GameObjects are stored) looks pretty solid. You typically don't need much organization in there if your program is pretty small, but of course putting things into folders (for example, putting multiple canvases into a large Canvas folder) can't hurt.
As for your project, where all of your assets are stored, I believe that folders are paramount for good organization, because if you combine all of your assets it'll be hard to distinguish them. I recommend having base folders for different types of assets (/Scripts/, /Materials/, /Prefabs/, etc.) and storing individual assets in there (and of course adding more folders as you see fit). You should almost never have to have an asset directly in the /Assets/ folder.
Of course, that is only my opinion and my method of organization. Everyone has a different method of managing their project, but what I've described above is the basic system of organization. Happy coding!
i recently downloaded "Tiled Map Editor" - because i heard it was a great tool for making maps. I also got a .tmx "compiler", well, something that made the .tmx usable in XNA.
I've created a map and imported it and it worked fine, but now the tricky part comes...
If i add a collision layer in "Tiled" and adds a tile that indicates block part, how would i get data and values, and how would i be able to use it in XNA? And how would i make so that the player spawns in a certain location, and also, how do i add things as events, and movable objects?
You don't have to tell me everything that, but it would be cool if you could give me an idea on how to get data and values from the .tmx and convert it into rectangles or such things^^
Thanks in advance!
I know nothing about tmx file but a little about collision.
I'm going to take a punt that your ".tmx "compiler"" is something that allows files of this type to be included in the content pipeline. Somewhere in this build process will be the vertex data that you can use to construct the collision primitives (shapes) for collision detection later.
ASIDE: it took me ages to get my head around the content pipeline - not for the faint hearted but the way to go. They are samples on the XNA website to get you going
I am currently programming a very simple 2d game in C# with XNA.
I was wondering how to implement a console-type interface in a game or graphical software like there is in Skyrim or Counter-strike or some many more games?
These "consoles" can allow you through various command to change many parameters directly in-game.
I find this very interesting for debugging purposes and I was hoping to implement something similar in my program. Is there a particular way to achieve this?
https://gamedev.stackexchange.com/ might be able to help. As far as I know, XNA does not offer any kind of pre-made dev console tool or class.
The simplest way to do this is just to throw a few sprites up on the screen - a black box, and some lines of white text. XNA already has methods for drawing strings of text onto the screen in whatever color and font you want. Throw in some code to detect keypresses and construct a string as it's typed.
The slightly harder part is parsing and executing the user's command. Taking a look at old adventure game text parsers might be relevant.
As for how to actually modify the various parameters of the code, you've just got to include the necessary getters and setters for your various properties, and have your text parser call the right methods.
I have made a terrain that is generated from a height map file where each pixel (black to white) represent the height of the terrain at the corresponding location.
Now, my question is how would one make a map editor for something like that? I can think of two general ways:
1) The map editor modifies the height map file and regenerates the terrain based on that.
2) The map editor directly alters the vertices of the map, and later upon saving process it generates a height map based on those vertices.
Do you have any good tutorials or resources as to how to get either one to work? I have no idea where to begin.
Check out the XNA Terrain Editor by Eric Grossinger.
I've played around with this thing a little bit and it's pretty slick and should, at the very least, give you some ideas if not an out-right solution.
This book: Building XNA games is an excellent reference and has a great overview of how to create your map editor. The only downfall is it's in XNA 2.0 so you would have to do some converting, but the idea remains the same.