Simple LEvel Editor for Panda3D (WORKING!)


#1

Version 2.0
It’s strongly suggested to use this versions, the old version is discontinued.

Git repo:
github.com/wezu/koparka
Screen:
s30.postimg.org/n4g6qggkv/koparka1.png
Video:
youtu.be/VDFHQEppq5k

Feature list:
-Create and/or edit heightmap images
-Create and/or edit texture splatting maps
-Create and/or edit grass maps (an image that shows where grass should grow)
-Create and/or edit walk maps that can be used to generate PandAI ‘navmesh’ navigation graphs (or other path finding systems )
-Automagicaly generate a collision mesh for the terrain heightmap (pre optimized into a quad tree)
-Place objects, actors, particle effects(particle editor in the ‘tools’ dir), and point lights on the map
-Save placed objects into a json file or sqlite database (just their location, rotation, scale, and a custom text field for scripting, not the model file itself) - also pre-optimized into a quad tree to easy reduce the number of nodes
-Bundled with (currently faulty) shaders for normal/gloss mapped terrain, grass and trees moving in the wind, dynamic sky dome, customizable water and some basic models (some 300+ models comming soon)

Old version:
Version 1.01 (with bugfix):
sendspace.com/file/ae0132


DOWNLOAD LINK (148 KB):
http://www.sendspace.com/file/v4k7zt

This is a very, very simple editor, it’s only function for now is painting a heightmap to use with geomipmap terrain (or suchlike).
A image is saved automatically whenever the map changes in the same directory as the p3d file (co be sure to move it from there, or rename if you want to keep it).

Key map:
W S A D - camera pan
Q E R F- camera rotation
Z X - camera zoom
1 - scale mode
2 - color mode
3 - alpha mode
4 - rotation mode
TAB or mouse3 - cycle mode
mouse1 - paint
Mouse Wheel - change the brush scale/color/alpha/rotation (according to the current mode)

This was done in on day (so far) so it’s not very advanced, still it work.

Have fun!


Level editors
How to create a complex 3D scene ?
#2

Version 0.02 is out!

Now with 16 brushes! Just click on the brush icon, to select a brush.

Screen:

DOWNLOAD LINK (138.96KB)
sendspace.com/file/2wsi8t

Next stop - texture painting.


#3

It’s awesome !!!
I have a trouble with height-map… Hope your tool can help me and other Game Developer.
Keep it working bro…


#4

Good job, but using tools like Blender drawing heightmaps already is pretty simple and powerful. Still, this might come handy for those not familiar with 3d modelling packages.


#5

That’s true, but getting that heightmap from Blender just takes to many extra steps for me. I know that Blender also has the ability to paint textures but I have tried it numerous times and never got it working. I’ve spend about two weeks looking for free (and paid) tools and I found none that I liked - this is why I’m writing this editor.

I almost got the texture painting done (just some minor quirks with saving the maps) and I’ll be adding a way to place models on the map, scale them, add tags, collision bit mask, group them for flatting and then write all that info into a file (in json format).

EDIT:
Just adding a screenshot, got a wee bit of a problem saving the images in the correct place so, no download yet.
Anyway at this point you could only edit one fixed layer, so it’s not very useful.


#6

Version 0.03 is out!

What’s new:
-show/hide grid button (bottom right)
-texture painting (wip - only one layer, can’t select textures)
-more height
-images are saved in separate directories (/maps/map0, /maps/map1, /maps/map2 and so on)
-the icons in the bottom row (scale/color/alpha/rotate mode) are now clickable

DOWNLOAD LINK (sleep3d_v03.zip ~1.00MB):
sendspace.com/file/rkbnzz

SCREENSHOT:
[in the previous post ]

The next version will be more usable and putting models in the scene is scheduled for version .05


#7

Version 0.04:
-you can paint any number of textures -it’s limited only by the amount of buttons you can fit on the screen :mrgreen:
-the texture tries to adapt its size to the current camera zoom - it’s not perfect, I know

The white arrow allows to change the texture at that layer and it also shows what layer you are editing, the big plus icon is there to add new texture layers.

If you want to use some other textures then those provided, just put them into the ‘textures’ folder.

SCREENSHOT:

DOWNLOAD LINK (sleep3d_v04.zip ~1.00MB):
sendspace.com/file/xp7hk9


#8

Hi Wezu,

Looks great so far. What’s the license and will you release your code?


#9

It’s freeware, no restrictions on the output. I’ll pack a license.txt with the next version (beer-ware license).
The sourcecode is realy ugly but I’ll publish it at some point - I don’t feel a need to add some features that other may find useful (undo, change map size, custom brushes etc.), so maybe someone will want to add something to the code.


#10

Hello!

As this seems more of a heightmap editor than level editor I’d like to integrate it in my scene editor1. What are your restrictions regarding this?

thank you :slight_smile:


#11

I’ll post the sourcecode and a new version later today (or tomorrow, can’t say for sure). If you can use my crummy code to make something better then go ahead. If you earn a million dollars with your editor I wouldn’t mind if you’d buy me a beer then :mrgreen:


#12

No problem :slight_smile: I was thinking about integrating it as a third party tool to call, use and close when needed.


#13

A bit late, but it’s here - version 0.05!

DOWNLOAD LINK:
sendspace.com/file/3ytucq

SOURCECODE PACK
(Only if you have a strong will. Trust me, it’s like a sausage factory in there):
sendspace.com/file/462n4a

What’s new:
-you can place objects on the map
-a json file is written upon exit, that has the names of the objects, their transforms, tags, bitmask and group

What’s missing:
-users manual
-load level option

I think the next version will be final-for-now.

Feedback is welcome (about the editor, not its sourcecode!)


#14

I don’t like China Goverment but
i really like this guy :slight_smile:)
It’s growing day by day … So Good


#15

Yes ! Good stuff
You offer a large number of brushes and with good terrain type shaping. Other editors I’ve see didn’t have as many brushes. I think your code looks good too. Maybe add ability to change tile size if not there already. I’m writing a scene editor (in C++) that has no terrain building (need to supply the height map), I’ve been using L3DT free version which does pretty good. I’m going to play with your editor more and hey maybe I’ll like it better…
Keep up the Great WIP


#16

I call this version 1.0!
DOWNLOAD LINK:
sendspace.com/file/fu8aqe

What’s new:
-few bugfixes
-info about the selected textures gets exported
-load option (may crash if there is no height-image to load)

I’ll write some instruction on how I think this editor should/could be used on Monday.


#17
sleep3d_v1 $ panda3d sleep.p3d 
:AppRunner: Total Panda3D disk space used: 196 MB
:AppRunner: Configured max usage is: 2048 MB
Traceback (most recent call last):
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "C:\sleep_source\main.py", line 11, in <module>
  File "VFSImporter", line 437, in load_module
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.7/json/__init__.py", line 108, in <module>
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.7/json/decoder.py", line 24, in <module>
  File "/usr/local/lib/python2.7/json/decoder.py", line 18, in _floatconstants
LookupError: no codec search functions registered: can't find encoding
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 638, in run
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/task/Task.py", line 502, in run
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/task/Task.py", line 460, in step
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "C:\sleep_source\main.py", line 11, in <module>
  File "VFSImporter", line 437, in load_module
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.7/json/__init__.py", line 108, in <module>
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.7/json/decoder.py", line 24, in <module>
  File "/usr/local/lib/python2.7/json/decoder.py", line 18, in _floatconstants
LookupError: no codec search functions registered: can't find encoding
Successfully joined thread: 0
Failure on startup.

:frowning:

UPDATE:
I’m looking in your code as the terrain edit mode and painting is amazing. I think I’ll spend next hours cannibalizing your code :smiley: I’d like to produce a playable demo of a rural scene (using your models) with an update version of my and your editor merged.

Is it a problem for you, if I act this way? :slight_smile:


#18

Take all the code you can eat :smiley:

I just don’t know why it crashes on ‘import json’ on linux (that’s what you are using, right?). I wanted to add just one more thing and broke something on the way, once I got it working again I’ll poste the source (not today) - maybe that will work.

Models are public domain, just placeholders. But the textures for them are based on yughues textures (nobiax.deviantart.com) and/or by filterforge. Sorry for not writing that, my bad.


#19

Oh ok thank you :slight_smile: I’m currently trying to adapt the code. When you’ll publish the 1.0 source I think I’ll do some kind of merge, as I really need the load terrain feature :slight_smile:. For now, I’ll make it launch always with a new terrain. And yes, I’m running on a linux mint 64. :slight_smile:

Oh, if I can do a request would be to have a console interface to open files like:

python editor.py -f path/to/terrain/dir 

Great work btw! :slight_smile:


#20

Loading the terrain is simple - the editor writes a file named ‘hf.png’ - that’s the hightmap for geomipterrain, the are also some other png like ‘1tex.png’, ‘2tex.png’ and so on - these are mask for textures, you can use them with a shader as in ‘YARR’ or the hacky way as I do with a offscreen buffer and texture projecting.