Positionign enemies etc.

Blitz3D Forums/Blitz3D Beginners Area/Positionign enemies etc.

lauri(Posted 2010) [#1]
What is best way for position (and rotate) enemies, glasses, wehicles etc. to levels?

I'm noob.


Drak(Posted 2010) [#2]
Build yourself an editor within your program. It will save hours and hours of tedious hardcoding and give you lots of programming experience at the same time. It's really not that complicated if you break down the needs of an editor.

1. It must be able to place models.

2. It must be able to "pick" those models, or entities if you will.

3. It must be able to modify, move, scale, delete, etc those "picked" entities.

4. It must be able to save each entities data into an external file that can then be loaded again as well.

5. It should be built right into the game/program and allow for toggling edit mode on and off to allow testing. Such as enemy ai would not be exocuted during edit mode.

That's basically all an editor is, but point 5 should actually be point 1. If you try it, start simple, using say cubes or whatever until you can successfully save and load them into your program. Complete the steps/functions one at a time to save confusion.

You could always buy a premade level/world editor as well, but they're not always easy to use because they were made by someone else. I've bought 2 over the years and don't ever use either one.


BLaBZ(Posted 2010) [#3]
Just wanted to emphasize Draks step 5, it truly is incredible important/convenient making the editor and program 1,

in the past, i've typically given the editor it's own loop, disabled all updates and enabled all manipulation controls(such as placing enemies)


Kryzon(Posted 2010) [#4]
Build yourself an editor within your program. It will save hours and hours of tedious hardcoding and give you lots of programming experience at the same time. It's really not that complicated if you break down the needs of an editor.

I'm against that (I hope you don't take it personal, as it's not like that at all).
You are proposing to build a navigation system that is actually equal to or better than one of the various 3D packages out there such as Maya, 3DS Max and XSI.
These are professional software that have been around for years and received nothing but improvements from time to time. Truly an invaluable, accumulated work.

You have much more control in those. You might as well place everything in them, then align dummies to them and export the dummies (conveniently named so that you can automatically replace them with the correct entities when back in your game \ test-level \ playground \ sandbox).

Programing a level editor is most likely going to slow down your developing process and drain the "productive-juice" we all reserve for a project, without posing an equivalent benefit (exchanging the hours and hours of hardcoding for hours and hours of testing and application design, if you want a good navigation system, interface and functionality).
If you can solve a problem by using already-made tools you should do so, even if it's not a perfect but acceptable fit. My opinion.


Matty(Posted 2010) [#5]
I agree with Kryzon - set up your level in your 3d package, export, and include nulls/pivots named in such a way that you can iterate through them and place your emitters, and other entities easily.


Drak(Posted 2010) [#6]

You are proposing to build a navigation system that is actually equal to or better than one of the various 3D packages out there such as Maya, 3DS Max and XSI.

Programing a level editor is most likely going to slow down your developing process and drain the "productive-juice" we all reserve for a project, without posing an equivalent benefit (exchanging the hours and hours of hardcoding for hours and hours of testing and application design, if you want a good navigation system, interface and functionality).



No, I think you misunderstood me. I proposed a simple set of entity editor commands, not some fancy "world" or level editor.


BLaBZ(Posted 2010) [#7]
Definitely depends on how much precision you need, I'm building a grid based RTS and a built in map editor saves so much time compared to using one of the various 3D packages,

it all depends on what works best for you


Zmatrix(Posted 2010) [#8]
I use a built in "Dropper/placement editor" also, They arent hard to code and do save alot of time.

if im running around in my level and decide i need to add or remove some tree's , grass , enemies or anything.
i just hit ~ that breaks the game loop and enters the edit loop.
load an entity or pick and existing one from the map for cloning.
Place or remove what i want, dump the co'ords to the entity file and thats it ,back to game loop.

I don't own , max, maya or xsi , but Im sure they are more than up to the task.
but the poor coders way works also..lol

In the end, aslong as you can get the job done and keep the project going is what matters.

best of luck

Sam


jfk EO-11110(Posted 2010) [#9]
In my opinion those pro apps, max, maya, xsi etc. are really needed for the 3d design. They are complex tools and the have a steep learning curve to get into it. They also cost a lot. A professional 3d designer should have it.

When you're a bedroom industries inc. coder then you often work with models that were purchased. A simple level editor may take nomore than 5% of the total game work, unless you are GUI-Maniac.

In most cases it's a good idea to integrate the editor right in the game engine. But you should be careful not the create the engine too static, only to be able to edit everything during the game.
There may also be some speed problems when you try to do all the fx and editor handling at the same time (involves diffrent cameraranges, pickabilties, alpha-stuff, eg. helper-geometry that is invisible in game mode, but must be managable in editor mode). Am other example is the grass system that I added to my game project. In the game engine there are lots of animated quads, arrangend in grouns, alphasorted and so on. THis would take centuries to position all the grass. So I added a feature that allows to position a primiive, eg. a box at a place where grass should grow. I then label it "isgrass" and the engine will display it as grass, but hide the box completey. Switching this feature int he engine is not so easy since the grass system is using some sort of VIS optimation, has a fixed Quad contingent etc. Well this is just an example.

No matter if you integrate the editor and have to switch certain things when you go into editor mode, or if you use two apps, one an editor and the other one the game exe (where of course at some point in time the one was a simple copy of the other one) that will force you to update the editor from time to time, actually, whenever there's something new in the engine that should be displayed, in the end of the day it will be some work to do.

Oh, and PS, for enemies I even have a third editor :). It allows the player to walk around in the level and records his way (waypoint list). In the engine an enemy will then patrol along this way. I am using a small game window (640*480) to get a steady, high framerate for a better recording quality (smooth turns etc.).

Last edited 2010


jhocking(Posted 2010) [#10]
The approach I'm taking with my current game is I wrote a simple script for Maya that simply dumps the name, position, and rotation of all the objects in the scene into an XML file (and then just for the hell of it I ported the script to Blender, even though I don't use Blender myself.) Then the game simply reads this file and places objects throughout the level based on that data. I'm sure I could have written this script just as easily for 3ds max too. Does XSI have script support?

This was easy cheesy. For a more in-depth game I'd want to do something more seamless like they are describing, where I can switch between playing the level and editing it, but for my needs it was much more efficient to simply bust out a quick XML dumping script for Maya. Took me maybe an hour to write the script, and that includes the time spent learning the Maya API calls I needed to use.

Last edited 2010


lauri(Posted 2011) [#11]
The approach I'm taking with my current game is I wrote a simple script for Maya that simply dumps the name, position, and rotation of all the objects in the scene into an XML file (and then just for the hell of it I ported the script to Blender, even though I don't use Blender myself.)


Can you give me the blender script and source for reading from XML, please?