What’s new:
-should not crash when hightmap is missing
-walk maps
Layer #0 in the texture paint mode has now a special use. It’s just another gray-scale image/mask and you can’t select a texture for it, by itself it does exactly nothing, but the image can be used to determine what parts of the map are walkable. There’s a good example on the forum on how it can be used: Limiting the terrain that an actor can walk on
It’s even a bit simpler if you use a geomipterrain the worlds X and Y map exactly to the maps X and Y coordinates.
Isn’t available the possibility to load an already existent map into the editor?
UPDATE:
added these 4 lines at the end of init make the map load in case there is a name specified via command line:
# if there are additional args then load map
# else create a new map
if len(sys.argv) >1:
self.loadMap(sys.argv[1])
2nd UPDATE:
I found an annoying bug I paint on a first layer. Then i switch to the second and paint there, switch back to 1st layer and paint. I lost all the previous modifications I did to the first layer.
Hi wezu, is there a way to get the brush to behave more like an airbrush than a stamp? Currently holding down the mouse button doesn’t paint continuously like expected.
Not at this point in time. I’m working on something else now (indiedb.com/games/scratch-the-surface), but I want to get back to the editor sometime in the future (after pyweek, at End-o-may-or-so-but-don’t-quote-me) and do a major rework.
OK, I see. Anyway, it already has enough functionality for me. It even has the same concepts I had in mind when tried to make a similar editor in Dark Basic. Thank you for the tool!
I have a new version. It’s still work in progress, but some parts are working ok.
Changes:
-90% of the code rewritten. I’ve split the code into 4 classes, it should be easier to edit or reuse parts of it if someone wants to roll an editor of his own.
-The heightmap is applied in a shader, so drawing it is 5-30x faster (with a 512x512 map), so the height map can be drawn with a click-hold-drag technique and not a click-wait-click technique like it was earlier.
-The camera is controlled with the mouse, and (some) brush settings are controlled from the keyboard, the default keys look like this:
[A] and [D] -scale brush
[Q] and [E] - rotate brush
[W] and [S] - scale brush strength (height/alpha)
[+] and [-] or [mouse wheel] - camera zoom
[mouse3] or [alt] - pan camera (on mouse move)
[mouse2] or [ctrl] - rotate camera (on mouse move)
[mouse1] - paint
[f1] - paint height map mode
[f2] - paint texture mode
[tab] - switch between razing and lowering the terrain in height map paint mode
-The color texture is one big texture (2048x2048) plus some crazy details - the crazy details are controlled with a widget in the bottom left corner with 3 sliders (do experiment, you’ll get it). Not sure if I’ll keep it I may revert to some sort of texture splatting in the end.
-Saving works, but more as a proof of concept, it always saves to 3 files in the save directory
How does one download this file from Sendspace? I can’t find a download link at the site. I have the same problem with the other files to which you’ve linked at that site.
I’ll admit that I’m not a fan of Sendspace’s seeming tendency to half-cover the download page with other links, some of which can easily appear to be the download link. I fear that it can be easy to miss the actual download link, or mistakenly click on one of the other links.
More on-topic, this is looking good–well done, I do believe.
Sendspace used to be good, but now it has all them false links and signup/pay/buy/whatnot… I call it the imageshack syndrome.
I’ll try to put up a project page on github or sourceforge in a day or two.
A bit of an update:
-proper saving and loading menu (but don’t bug me for a file browser)
-grass painting
The grass painting uses hardware instancing and I’m not sure I’ve got the shader right. My driver (ati) will eat almost any GLSL shader, so I can’t be sure it’s 100% correct. Wouldn’t mind if someone would test it
Hmm, yeah the grass instancing isn’t working for me on nvidia. Errors relating to casting ints / floats:
:display:gsg:glgsg(error): An error occurred while compiling shader shaders/grass_v.glsl
0(4) : warning C7572: OpenGL requires extension names to begin with 'GL_'
0(20) : error C7011: implicit cast from "int" to "float"
0(30) : error C7011: implicit cast from "int" to "float"
0(30) : error C7011: implicit cast from "int" to "float"
0(35) : error C7011: implicit cast from "int" to "float"
Had a brief look and fixed those, but then got to problem with anim_data not being sent to the shader.
I think I’ll keep the terrain texture painting as it is. The 80 texture samples are much more then I could have with any sort of texture splatting, and there’s nothing standing in the way of adding 80 more if I need to. The size of the grass that I made is such that a map should be ~50m not 5km, so I think I’ll change the size of the details and leave it at that. One other thing I may add is that the scale of the texture used for painting will stay the same (more or less I hope) even if the size of the brush is changed (the texture gets blurred now) - it won’t be pixel perfect, not with rotating the brushes but I think it will be better then it is now.
I also think I’ll get rid of the shader I used for painting the hight map and always display the level textured and ‘grassed’ that should make things easier… or add a button somewhere to switch it on and off if someone wants to use the editor only for editing heightmaps, not as a level editor.
I’ve added the option to drop objects into the map, and also a ability to pick them up later (for this to work the models need to have collision geometry under a node/group named ‘collision’ ).
The models/objects dropped are organized into a quad tree, that should help with collisions, but it also should make things simpler to flatten.
The editor can also generate a collision mesh that is just like the visible geometry (more or less) and also organized into a quad tree. This is more accurate then checking the heightmap.