Level editors - Modeler manipulation or Build yourself?

I’ve gathered (from a thread here, I think, although I forget which it was) that there is no standard level editor for Panda because of the variation between projects, each having its own desired features - and this makes sense to me.

However, my current project is not intended to be very big, and so I question the wisdom of devoting time to putting together even a hacked editor specifically for this game. On the other hand, placing everything in code, from objects to patrol route nodes, seems a little clumsy to me.

I’ve heard, I think, of using one’s 3D modeller as a level editor - is this a good idea, and if so, how might one go about it? (For editor-specific elements, I’m using Blender 2.46.

I’ve managed to encode a starting position as an empty mesh with the name
“start_pos” (I think that it was), as suggested in a recent thread.

Naturally, I could include enemy starting positions and patrol route nodes as further such empty meshes, but that seems to leave me, in-game, with using “find” to hunt for further nodes to add to a given path. Is there not a simpler way? Perhaps a way to extract vertices from an object found using “find”, allowing me to create a single object containing the full track, in sequence, which could then be deleted after the nodes are extracted?

Objects such as houses and fences I could place in the editor easily enough, but what if I want to instance them? Should I use “find”, removing and instancing any found of a particular object until there are none left?

Finally, what about level logic, such as puzzle solutions? That’s easier to create in code than physical elements, I would say, but it would be nice to keep level editing in one place, and simply place loading code in the game itself.

Finally, in case I’ve missed something, does anyone have any further or better suggestions, and if so, what are they?

My thanks for any and all help given! :slight_smile:

you could take a look at the level editor of panda3D that is on the svn.
Their is interesting thing on it.

The Panda3D Engine - Python Scripting for Game and Simulation Development

Hmm… I’d guess that it’s probably a bit of an overkill for my purposes, but, depending on the download size (and any permission-for-use requirements ^^; ), I may give it a shot - thank you. :slight_smile:

As to SVN, I seem to have found a CVS link, but it only seems to refer to itself as a CVS site, and doesn’t mentioned Subversion, either by the full name or as SVN - is this link the correct one, or is there a another link somewhere that I’ve missed?

ThunderZ was referring to CVS, not SVN. The editor in question is in direct/src/leveleditor. It has the same license as the rest of Panda, which is to say, do with it as you will.

However, I don’t think it is likely to be terribly useful to you. That leveleditor is really very specific to editing Toontown levels, and much of the code that it requires isn’t even included.

You might do well off to dig up the old SceneEditor (search the forums for the reference; I believe it’s also within the Panda CVS tree somewhere) and polish it up to get it back to a working state.

The SceneEditor was originally developed as a student project to make a simple, generic level editor for Panda. It achieved these goals to some extent, but unfortunately has fallen into disrepair because (a) most people wanted something more specific, and (b) the original author has moved on, and no one stepped up to maintain it.

David

Fair enough, and thanks - I’ll dig around for the SceneEditor. It does sound more likely to be useful to my purposes than the ToonTown editor, and having a reasonably decent, even if generic, editor to hand could well come in handy for some future projects. :slight_smile:

[edit]
After some digging, I don’t seem to be finding the Scene Editor, and have found plenty of indications that it might not be worth fixing.

For now, I think that I’ll fall back on Blender as my “level editor”, and extract positions from empty meshes.

Are there any concerns that I should be aware of in taking this path?

Back on the Scene Editor, I may have another hunt, but I doubt it, at this point, unless more information comes to light that suggests that it’s worth doing so.

Ho yes sorry my fault.
:stuck_out_tongue:

Panda is on CVS :wink:

If you don’t want to hardcode an entire game there are several options. You can always code your own. I don’t want to be terribly specific about my project, because its umm top secret :slight_smile:. Anyways, at the core its a grid based strategy rpg but also has exploration elements. The big thing is though all of the data from individual scene info to event handling to battles is saved out to data files and loaded in when the actual game runs. This is done with the intention of making the program data driven and easy to create an editor for. So right now I’m working on the engine for it but will later create an editor to build the actual game using the engine. It is quite nice and easy because cPickle lets you save entire classes out to file

The SceneEditor directory can just be found at the root directory of the cvs root. (the doc/ dir on the online cvs.) Here:
panda3d.cvs.sourceforge.net/pand … eneEditor/
I don’t know where it can be found on the default distribution, if its there at all.

PS. Most people here have their own hacky in-game level editor for placing objects etc. Like when you run the game in a special ‘developer-mode’ and you can press like B to insert an object or so.

I do not recommend cPickle or pickle at all, since its very unsafe, especially for storing levels. I just store my level using nodepath.writeBamFile().

If you don’t mind me asking in what way is it unsafe? I don’t write out full scenes to file, but just enough information for them to be assembled when running (meaning i dont store unit or model class info in the scene file itself).

It is possible to ‘pickle’ malicious python code that get executed when you unpickle that data – it will get executed right when unpickling. That makes it possible to very easily create a virus that is stored within the level files.
If you search the web for it, I’m sure you will get plenty of information about this ©pickle weakness.

As I believe that I said in my first post, my current game doesn’t seem large enough to me to warrant the creation of an editor specifically for it.

Aah, so that’s where it was! I searched through a variety of directories, but I think that I considered a “doc” folder to be an unlikely place to find it. ^^;

Thank you for pointing it out - I may take a look at it at some stage. :slight_smile:

I don’t think that the Scene Editor was packaged with 1.5.2, at least - both hunts through the directory structure and a more general search (for “sceneeditor”, I believe) failed to turn it up. This also correlates with some of the comments that I seem to recall reading while searching this forum for information on the Scene Editor.

That’s a good idea, actually - and I feel rather silly for not having thought of it. ^^;

That might work as a nice compromise, actually, since I doubt that I’ll be wanting many terribly complex level editing functions for this project - thank you again. :slight_smile:

Hmm… I suppose that item interactions (along the lines of “use x on y to gain access to z, or set flag w”) will still be coded in text, but that should be fine. :slight_smile:

Mine currently is not either so I just write the info to files instead of an editor. It helps to not clutter up the actual classes with hard coding

@pro-rsoft
But in the case of what I’m doing, i’m saving to disk entire classes. Among these classes being saved, none of the data deals with nodes or uses Panda3D stuff…so I dont think I use writeToBam do I?

But from where? Where are you performing the placement of objects and suchlike before saving them out to file?

True, and I agree - although admittedly doing so with Python seems to be more “soft-coding”, so to speak, than hard-coding, being a scripting language, depending of course on where you place the sections in question.

If you were referring to the suggestion of the inclusion of level editing features in the game itself, then I think that doing so is a minor concession, at least for a sufficiently small game.

I have a separate .py that all the data is put in at the end i save it out to several files which I call databases. I run that to save it all to file separately from the main game. Then in the main game the databases are loaded in and I select what i need to generate models objects positions etc. This is admittedly a slight pain to do, but it does separate the data from the main program and is done with the intention of later replacing the data generating py with a full blown editor to write the files. I don’t save anything Panda specific to the files either. Just things like position info, route positions, model file names, etc. Its been working quite splendidly

Ah, fair enough - on reflection it occurs to me that if you intend to convert your program into an executable (instead of leaving it as a variety of .py files) then using external, engine-converted files does make sense.

(If you don’t, then it seems to me that there’s no problem with using .py files, as recompilation shouldn’t be called for.)