www.jpct.net

jPCT - a 3d engine for Java => Projects => Topic started by: ToddMcF2002 on May 19, 2007, 05:05:58 am

Title: DevKit / Level Editor
Post by: ToddMcF2002 on May 19, 2007, 05:05:58 am
OK so, I've got the basic mechanics complete.  Here is where I'm at:

- Multiple Object Selection and Visual indicator
- Apply change to multiple selection
- Delta tracking of changes from initial values
- Dynamic Object Loading (3DS single, multipart)
- Load from XML persistence
- Orbital camera with zoom, pan, etc
- Floating FengGui UI

To do's:
- Better camera tracking (it is still chasing Werdy).
- Marker placement for object spawning (see that Marker Toggle button? in marker mode you set a marker on the terrain and the load will occur there)
- Persistence to XML across the board
- custom property extentions per object for game content
- Texture Loader (right now I'm just using my XML texture loader for Werdy)

So what you are seeing in the pic: 
I selected 3 of the tree canopy sections and altered the transparency as a group - notice the ones not affected.  Also I detached Werdy's head and messed with the rotations and translations.  If you select the various objects on the screen you can see all the property delta's in the floater screen - and use the "Stepping" box to get back if necessary.  No undo feature yet.  Its hard to see in the pic but right above the "key" label there is a ComboBox which is always in the context of selected objects - so just the 3 canopy objects are in the list since they are highlighted.  You can lock object selections by using the "Select Toggle" which gives you a special cursor.  Turn it on, select some objects and turn it off and the objects will be locked highlighted.  A regular cursor does nothing but show terrain coords on mouse move. 

(http://i187.photobucket.com/albums/x132/ToddMcF2002/screenshot.png)



 
 
Title: Re: DevKit / Level Editor
Post by: eye1 on May 19, 2007, 11:28:30 am
great work! Looks very nice.
Title: Re: DevKit / Level Editor
Post by: Remo on May 19, 2007, 12:07:26 pm
That's really nice! you are doing a great job :D.
Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on May 19, 2007, 02:09:56 pm
Are people going to want the source when its done?
Title: Re: DevKit / Level Editor
Post by: eye1 on May 20, 2007, 05:24:31 pm
I would be very happy if you do so. Especialy the part, where you are combining the fenggui with jpct (lwjgl). And how you managed to do the mouse and key mapping. Hopefully in some near future i will also implement menu in my application and put it one the web via webstart. But at the moment my project is paused, because I must finish some stuff for school and some other things must be done at work before that.
Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on May 21, 2007, 02:02:52 am
Send me a PM with your email and I'll send a zip over.

Hmmmm I was hoping this would generate some significant interest???

If you look at some of the other engines out there such as Ogre3D there are tons of plugins and productivity tools and a bunch are a collaborative effort.  Sure I'm building this for my two games (Werdy and my ToEE'esque game) but there won't be anything specific in the code for those games. 

I'm sure there are lots of cool things that could be incorporated into this that would make it really useful for everyone given a bit of thought.  Not to mention - make JPCT more popular?  If everyone sits around and writes there own tools that's not so productive.  Anyway, just my two cents.  If anyone is interested, wants to help out or has suggestions or whatever I'm all ears.




 





 
Title: Re: DevKit / Level Editor
Post by: Remo on May 21, 2007, 12:46:06 pm
As far as I know most people will use this silently (would not contribute or tell you that they are using it) so probably there won't me a lot of collaboration to it.
Ill gladly give it a look and contribute to it in a couple of weeks when I have a little more time on my hands!
Title: Re: DevKit / Level Editor
Post by: Melssj5 on May 21, 2007, 04:40:01 pm
If you have no problems on sharing the code then you could publish it on the download section of jpct for everyone to download it.
Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on May 21, 2007, 05:19:09 pm
Fine. I can do that in a few days once I clean things up a bit so its more usable.  I would rather send it to folks like Remo initially so something more polished can be produced first - but if there is limited interest I'll just post the code and move on.



Title: Re: DevKit / Level Editor
Post by: EgonOlsen on May 21, 2007, 06:51:10 pm
I'm sure that people would appreciate it if you release the sources. At least i would. I can host them if you like as i'm already doing it with Cyberkilla's skeletal animation API.
Title: Re: DevKit / Level Editor
Post by: raft on May 22, 2007, 12:06:08 am
nice and promising work  :)

..If you look at some of the other engines out there such as Ogre3D there are tons of plugins and productivity tools and a bunch are a collaborative effort...

...I'm sure there are lots of cool things that could be incorporated into this that would make it really useful for everyone given a bit of thought.  Not to mention - make JPCT more popular?  If everyone sits around and writes there own tools that's not so productive...

impossible to disagree with this
Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on May 22, 2007, 02:57:07 pm
I got Werdy out of there last night and replaced him with a small 3DS model of a camera.  That is the focal point for the JPCT camera.  It will always look at it, pan and zoom around it using the arrow keys and F1 F2 for pitch.  If you go into "select mode" and select the camera like you would any other object in the kit, those arrow keys move the camera object around the level instead, with F1 and F2 controlling the Y-Axis.  That way you simply put it where you are working on the X, Y, Z plane, unselect it, and pan/zoom/pitch around the new location.

The class I wrote stubs out using multiple cameras with the idea being you could create a bunch and toggle around the level at will but I'm going to move on to XML persistence instead so I can get the code out as planned.  After I distribute the code I'll be using this thing pretty heavily myself for Werdy level design so I'll enhance as I go.

There are two additional things I want to add:

1.  PROXY OBJECTS
For example - Spawn Points and Portal Points and Trigger Point.  They will be colored cubes in the editor basically.  A Spawn Point would have a few name/value pairs to go with it like type=npc, name=my_game_specific_creature_name, file=/my/lame/model.3ds.  I will have an XML template that defines the names and you can just change it to suit.  When the XML persists they will save with it.
A Portal Point will define an area that triggers a terrain swap for the World.  You can use it for a hard unload/reload of a level or a simple transition from outdoor to indoor. 
A Trigger Point is just an object to define an area that is intended to cause some effect - such as automatically opening a door as something approaches.

2.  LIGHTING PROXY OBJECTS Like the old UnrealEd.  Place a torch in the world as a proxy for a light, specify the RGB etc.

 

Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on May 25, 2007, 04:13:30 am
OK - got it all done.  Just got the XML Save / Load working.  Lights, proxy objects, regular objects all in there.

Documentation and packaging is all that is left.  You really will have to read the doc to make use of this thing.  Not that it is overly complicated or anything - just that there are a few behaviors that might seem odd (or outright rediculous) at first.

Reminder though - I havent used this thing in practice yet.  I'm sure I'll find annoyances too and fix them as I go.

I'll try to post doc during the day tommorrow in this thread and the package in the next day or two.  I want to make sure it runs out of the box with some test models so you can follow with the document.  Yes the source code will be with the package.

Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on May 25, 2007, 05:44:04 pm
Here is some real basic user guide stuff.  I'll going to do a separate install doc.

(http://i187.photobucket.com/albums/x132/ToddMcF2002/pic2sm.png)

(http://i187.photobucket.com/albums/x132/ToddMcF2002/pic3sm.png)

(http://i187.photobucket.com/albums/x132/ToddMcF2002/pic4sm.png)

(http://i187.photobucket.com/albums/x132/ToddMcF2002/pic5sm.png)
Title: Re: DevKit / Level Editor
Post by: EgonOlsen on May 25, 2007, 07:39:38 pm
Very cool! I've added the Editor as an extra project to the projects page.
Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on May 26, 2007, 05:30:03 am
I'm preparing the package now.  I'm trying to distribute a version with a functional XML file sample and test models.  I put this test together a few minutes ago.  I was able to rotate the fence pieces easily and build the coral and stuff.  That's nifty.  The camera is proving to be a MAJOR liability though  >:( - I've got to rethink what I'm doing there.  Its really annoying.  I mean reeeaaaallly annoying.   I'll fix it.  A few more days.  Other than the camera though - this thing really works well!

(http://i187.photobucket.com/albums/x132/ToddMcF2002/screenshot-1.png)




Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on May 28, 2007, 07:46:49 pm
Folks, I've sent the release to Egon (with source code).  Here is a test scene I created with the revised Camera code.  Note the stacked crates and trees of various scale etc.  It only took me about 10 minutes to create the scene.  Once you get used to the tool manipulating objects and lighting is pretty easy.  The camera is still slightly annoying but its much better than before.  I've included this scene in the release (just load "final.xml" in the load XML dialog).  Load that up and select the various objects and check out the settings on each.  Before you try it out though - please read the notes below the image.

BTW - all the models were free downloads from Turbosquid - so you can do whatever with them.

(http://i187.photobucket.com/albums/x132/ToddMcF2002/test_scene.png)

CHANGES TO THE CAMERA:
The functionality is largely unchanged from what I wrote above, but I did redo the camera.
The controls are as follows:
FOCAL POINT MOVE FORWARD - VK_UP
FOCAL POINT MOVE BACKWARD - VK_DOWN
FOCAL POINT ROTATE LEFT - VK_LEFT
FOCAL POINT ROTATE RIGHT - VK_RIGHT
FOCAL POINT UP - F1
FOCAL POINT DOWN - F2
FOCAL POINT ZOOM IN - VK_PAGE_UP
FOCAL POINT ZOOM OUT - VK_PAGE_DOWN
CAMERA ANGLE UP - VK_HOME
CAMERA ANGLE DOWN - VK_END

A FEW QUIRKS:
- I noticed when I switched machines that depending on the machine the zoom can be really slow.  You can tweak the zoom
factor in CameraManager.java.
- When you place a marker it is best to get out of "place marker" mode, since selecting in the Fenggui interface can
cause the marker to move.
- Trees that are based on planes can only be selected from one side!  Annoying...


INSTALL:
This release assumes you are extracting the zip to "c:".  All the paths in the XML are specified as c:\devkit2...

If that is not acceptable you'll have to change the following files:

c:\devkit2\build.bat

c:\devkit2\build\resources\devkitConfig.xml

c:\devkit2\build\user\xml\final.xml


RUNNING THE FIRST TIME:
Just run it and load the XML file I've released with the kit.  Select the various objects in the scene and check out the settings.

HOW TO START YOUR OWN SCENE:
I havent put any file explorers into the GUI yet - so here are the workarounds to get going.  Its pretty painless.

Not that Models, terrain and xml persistence directories are specified in C:\devkit2\build\resources\devkitConfig.xml. 
(the "textures" directory in you'll see in that file is not functional). 

1.  To save as XML, you'll need to create a blank XML file in the save directory - which right now is
C:\devkit2\build\user\xml.  I know its cheesy but that's as far as I've gotten. When you go to save the
list box will see your file and you can select it. 
2.  Put any models you want to use in the models directory.
3.  Put any terrain you want to use in the terrain directory.
4.  All textures are loaded from C:\devkit2\build\resources\textureConfig.xml.  Any textures you want to access
in the devkit need to be precached from that file.  I'll be adding a texture explorer at some point.   
5.  The property extensions config file is C:\devkit2\build\xml\ext_template.xml.  Note that once you start a scene
it will be dependent on that file's state, so you should just change it once!


If you have any problems, suggestings or whatever please post them here and I'll try to help. 

Thanks!
- Todd
Title: Re: DevKit / Level Editor
Post by: EgonOlsen on May 28, 2007, 08:50:15 pm
I've uploaded it to www.jpct.net/others/devkit2.zip (http://www.jpct.net/others/devkit2.zip). I'll add a proper download link with a little description on the download-page and update the projects-page later this week.
Title: Re: DevKit / Level Editor
Post by: Klaudiusz on May 29, 2007, 02:08:40 pm
Thank You Todd, that's awesome

I'll buy You a pack of beer :)
Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on May 29, 2007, 05:34:57 pm
Thanks.  One feature that needs to be implemented is a "Disable DevKit Ambients" button to kill the ambient lighting that the DevKit is using.  Once you get into lighting your own level you want to add your own ambients not the default ones.  Right now you can't get a "true" picture of what your lighting looks like.  An oversight on my part.

Another cool feature would be a JCPT Config window - to control a bunch of the JPCT's Config functions realtime.   Fog, lighting, glTransparency etc. 



Title: Re: DevKit / Level Editor
Post by: terry on June 08, 2007, 04:57:02 am
Cool!!!
Great Todd!
It's just something i looking for
Thanks! ;D
Title: Re: DevKit / Level Editor
Post by: Kearnan on June 30, 2007, 07:06:25 am
I just discovered JPCT yesterday (June 28, 2007 ) through www.lwjgl.org.  I would have liked to have found more examples of the use of JPCT but what I did find was very impressive and I can see the code is very nice to work with.  DevKit is a great work.  I'm an experienced, although amateur (of 25 years),  C/C++ and Java programmer and I'll be doing some trial work with JPCT for a while to see what I can come up with.  If you'd like any help with the DevKit, please post your needs.  To attract other programmers, it may be helpfull to have a regularly updated developer log, and perhaps a daily or, at least, regular build download like the ones on java.sun.com so we can get a feel for where things are at and what's needed.  It's always great to see what's going on with a project on a regular basis so you can make sure that you're not either reinventing the wheel or spinning them.  And, sad but true, a lot of projects get dropped simply because interested programmers don't know where to focus their efforts.  From what I've been able to find so far, your efforts are fantastic and I'm lookng forward to helping the progress.
Title: Re: DevKit / Level Editor
Post by: cyberkilla on July 08, 2007, 03:56:42 am
Welcome!

And, I'm trying to get this working in linux, but I'm having openGL wrapper errors.
Ill report back later.
Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on July 12, 2007, 08:51:03 pm
Thanks for the kind words.  I have not touched this code since I released it but keep this in mind:

The biggest weakness is the hardcoded ambient/world lighting inside the devkit.  There needs to be a checkbox to disable any "free" lighting you get when you are configuring a scene.  Otherwise - how would you ever get a true picture of your lighting?  It was a dumb oversight on my part and easily changed.  Better yet the ambient light should probably be configurable and persist with the level so there would be no hardcoded ambient lighting in your game either. 

If I recall, the ambient/world lighting is configured right in the main DevKit class.
Title: Re: DevKit / Level Editor
Post by: zammbi on July 08, 2008, 02:34:36 pm
Is this still being worked on?
This looks really nice and should help me heaps once I figure everything out.
Title: Re: DevKit / Level Editor
Post by: zammbi on October 04, 2008, 02:19:58 pm
Finally got the chance to start building maps, but currently having trouble using the XML file it creates.
How am I meant to set it up in my game to load this XML file correctly?
Title: Re: DevKit / Level Editor
Post by: Guyon on January 28, 2009, 07:47:27 pm
I am a noob so go easy...
But this does not work in Vista 32

I extracted under c:\devkit2
but when I click on the build.bat  the widow opens and menu flickers so badly that it can not be used.  Ecs works to close out.

Am I doing anything wrong?
Is this project still continuing?
Title: Re: DevKit / Level Editor
Post by: RhoX on August 09, 2011, 05:07:54 am
Hey, guys, what a very nice project!

I'm developing for Android, using the jPCT-AE port and I am wondering if it is possible to use this Level Editor somehow to help me with my apps. What do you think about that? Like viewing the models distribution or making some kind of parser/analyzer..?

Thanks in advance!!

RhoX
Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on October 10, 2011, 03:46:19 pm
Hi guys.  I haven't looked at the code since 2007.  Suffice to say its open for anyone who wants to advance it or simply use the source for their own projects / ideas.  If I recall I used JDOM for XML parsing and I developed this on XP.  I also used a GUI rendering package (LWJGL / FENGUI) for the floating menu.  I'm sure the whole thing needs to be rebuilt with updates from those sources.  The build.bat is pretty simplistic, assumes file permissions and assumes you have Java in your path.

I'd love to say I can help but I'm just a manager now, you know how that goes.  Half my brain atrophied when I stopped developing in 2008 and was replaced with PowerPoint skills :)
 
Title: Re: DevKit / Level Editor
Post by: ToddMcF2002 on October 10, 2011, 03:54:12 pm
And someone PM'ed me about the source code - it is in the src directory in the zip file.
Title: Re: DevKit / Level Editor
Post by: Johnston on November 15, 2011, 07:49:21 am
I finally got around to downloading the Spark editor, and it's amazing!!  I'm starting to realize how hard it is to get the little bugs out that make things look funny sometimes, but there is so much I was able to do just after playing with it for an hour. 

First map, made a room, figured out lights and props, how to move, resize and rotate stuff.. then I built a long very dark corridor and then placed a very tall square room at the end which I then tried to build in a slightly more artistic fashion.

Does anyone know if it's possible to turn off the wireframes of the lights temporarily?  They really break the mood of every scene I try to create.
I'd love to see anything anyone has come up with playing around on their own.  The *.level files are small enough that they're easy to share via email, etc.