jval Posted February 21, 2021 (edited) DOOMTREE DOOMTREE is a tool that creates procedural generated trees. The trees can be saved as Doom sprites with out of the box actor definition for ZDoom, DelphiDoom and RAD. It's a continuation of PTree and it is based on proctree. Downloads (latest version 1.0.3.18) Executable: https://sourceforge.net/projects/doom-tree/files/DOOMTREE_1.0/DOOMTREE_1.0.3.18_bin.zip/download Source code: https://sourceforge.net/projects/doom-tree/files/DOOMTREE_1.0/DOOMTREE_1.0.3.18_src.zip/download Repository: https://github.com/jval1972/DOOMTREE Sourceforge site: https://sourceforge.net/projects/doom-tree/ Inside the binary distribution there are many trunk & twig textures (Public Domain License, source: nobiax.deviantart.com) Why I did this? A few days ago I received a message from a doom mapper, who was using my PTree application to create some tree sprites to put them on his map. His efforts had some difficulties like align the view, and obviously the whole procedure was not automated. In order to make the procedure easy I decided to create DOOMTREE. I didn't add the sprite export as a feature to PTree, since this is outside of the scope of the application and also I conside PTree as completed. So I cloned PTree and DOOMTREE was born :) Note: PTree and DOOMTREE share the exact same save format for the trees. (files with .tree extension). Files created with PTree can be opened with DOOMTREE and vice-versa. Using DOOMTREE In the left panel of the application there are various input parameters that control the procedural generation. There are 3 tabs: Properties: Set the random seed and the mesh creation variables Thunk Texture: Select the trunk texture Twig Texture: Select the twig texture If you feel lost by the number of input parameters, just play around with the seed, to create numerous tree meshes and see what you can get. If you mesh a lot with the parameters and the result does not satisfy you, you can use either the Undo function, or just select New to start over. Spoiler To generate a WAD file with the sprite and the actor definition select from the menu File/Export/Sprite to show the Sprite Export Dialog: The dialog's functions are separated with group-boxes: General: Set the sprite name prefix Script: Select the script output. Note that the DECORATE script is compatible with the lastest DelphiDoom also (but not compatible with RAD). Script Parameters: Set the name, Editor Number (DoomBuilder Thing #), Radius & Height. Patch Palette: The preview is in true color depth, you have to set the target game. Radix is for RAD. Preview: Use the sliders & the "+" & "-" buttons to accurately change the camera view. This affects the output sprite, since what you see in the Preview is what you get in the sprite. Contents of the produced WAD file: The output WAD file contains the tree sprite (1 angle), the script and a DOOMTREE lump. The DOOMTREE lump is a small binary file that contains the parameters of the created tree. You can save it with as file with extension .tree and open it with DOOMTREE. The DECORATE/ACTORDEF script. ACTOR Tree1 10000 { Health 10000 Radius 32 Height 128 Mass 100000 +SOLID States { Spawn: TREE A -1 } } Note: If you want a bigger tree, edit the script and add the appropriate scale parameter, eg add "Scale 1.5". Voxel Export You can also save the tree as a voxel, by using the File/Export/Voxel menu item. (Slab6's vox & DelphiDoom ddvox formats) The voxel export options: Sister projects OpenGL Procedural Tree models for DelphiDoom: https://sourceforge.net/projects/delphidoom/files/Tools%2C maps and examples/v2_EXAMPLE_16_DLL_PROCTREE.zip/download Screenshot of some trees that I "planted" in the "Industrial Zone" :) :) Screenshot of the main's application window: Spoiler Edited March 6, 2021 by jval 45 Quote Share this post Link to post
holaareola Posted February 21, 2021 (edited) Holy hell man, another useful tool from you-- where are you getting your 30-hour days from? Your pace is insane! Nice work as always. Being a garden-variety app/web/back end dev, I'm in awe. I could bin off sleep and live on coffee and amphetamine injections and I'd still not be as productive in the, oh, two days or so before death :) Edited February 21, 2021 by holaareola 6 Quote Share this post Link to post
ReX Posted February 22, 2021 Yes, an insane pace! Best wishes and more power to you @jval 2 Quote Share this post Link to post
Redneckerz Posted February 22, 2021 ... amazing. I should rather start worrying when you don't develop something! 2 Quote Share this post Link to post
Martin Howe Posted February 22, 2021 Amazing, will have a look when back home from work. Now, if it could be ported to ZScript ... :) 1 Quote Share this post Link to post
jval Posted February 22, 2021 1 hour ago, Martin Howe said: Now, if it could be ported to ZScript ... :) Do you mean replacing the DECORATE script with ZScript or recreate the entire random generation algorithm with ZScript? 0 Quote Share this post Link to post
NeedHealth Posted February 22, 2021 I was thinking about this YESTERDAY. 3 Quote Share this post Link to post
SilverMiner Posted February 22, 2021 3 minutes ago, NeedHealth said: I was thinking about this YESTERDAY. Thoughts are material 2 Quote Share this post Link to post
Stupid Bunny Posted February 22, 2021 I was just gonna go asking around for good tree sprites Apparently this is no longer necessary 4 Quote Share this post Link to post
Martin Howe Posted February 22, 2021 4 hours ago, jval said: Do you mean replacing the DECORATE script with ZScript or recreate the entire random generation algorithm with ZScript? I meant porting the algorithm to ZScript; I was only thinking random population of trees at level start, but after writing it, this would mean trees (or other plants) that grow as time progresses! That would be an awesome idea. I was only half serious, as I haven't looked at the code yet and ZScript does have some limitations. 0 Quote Share this post Link to post
jval Posted February 22, 2021 23 minutes ago, Martin Howe said: I meant porting the algorithm to ZScript; I was only thinking random population of trees at level start, but after writing it, this would mean trees (or other plants) that grow as time progresses! That would be an awesome idea. I was only half serious, as I haven't looked at the code yet and ZScript does have some limitations. Are you interesting for Tree sprites or models? The algorithm actually makes 3d models, DOOMTREE has an extra step to create the sprites. Does ZScript support DLL function calls? I have encapsulated the algorithm in a DLL for the DelphiDoom OpenGL example in which random tree models are actually rendered by the DLL code. The example is static but it can be converted to dynamic with little effort. If you find Pascal difficult, the algorithm can be found in other languages: C++ -> https://github.com/jarikomppa/proctree JavaScript -> https://github.com/supereggbert/proctree.js/ 1 Quote Share this post Link to post
GRAU Posted February 22, 2021 Does this software GENERATES new tree graphics? If yes - you are genious. How about creating a procedural generator for VOXEL trees or at least bushes, with configurable ammount of empty spaces in each layer to make the bushes and trees look a but pransparent here and there? 1 Quote Share this post Link to post
Martin Howe Posted February 23, 2021 (edited) 17 hours ago, jval said: If you find Pascal difficult, the algorithm can be found in other languages: C++ -> https://github.com/jarikomppa/proctree Oddly enough, I do, but only because I haven't used it for years; for me it is nostalgia, as it was the main teaching language in university when I was there (Cardiff, 1985-88); in fact, I wrote my first doom launcher in Turbo Pascal and had to convert some chunks of DeuTex into Pascal to get sprite/flat append working :) Nowadays I use C or C# for desktop and ZScript & ACS for ZDoom. Edited February 23, 2021 by Martin Howe 1 Quote Share this post Link to post
Mr.Rocket Posted February 23, 2021 (edited) Used jval's DD_Terrain to make the terrain and added some trees in with DoomTree: Haven't used WadPaint on this yet.. The flat grassy spots closest the the player will have some WadPaint stuff eventually. Plan to have some creek side area back in there on some of the flat area/swimmable.. Is totally WIP atm. btw, the sky is just Doom2's default sky with inverted color. ;) ~ it's likely how they made the sky to begin with heh. Edited February 23, 2021 by Mr.Rocket 9 Quote Share this post Link to post
inkoalawetrust Posted February 24, 2021 19 hours ago, Mr.Rocket said: btw, the sky is just Doom2's default sky with inverted color. ;) ~ it's likely how they made the sky to begin with heh. It actually isn't, the origin of Doom 2's first sky texture is an actual photograph of a beach that was then scaled down to fit inside Doom 2. 1 Quote Share this post Link to post
Mr.Rocket Posted February 24, 2021 (edited) So the sky was brown/tan at the beach that day? I don't think so.. What I was saying was that I inverted the color, which made the sky blue. So that's what I was saying, likely they inverted the color, from blue to brown/tan. (This was of course after they took a picture of the sky!) :D Edited February 25, 2021 by Mr.Rocket 0 Quote Share this post Link to post
inkoalawetrust Posted February 25, 2021 7 hours ago, Mr.Rocket said: So the sky was brown/tan at the beach that day? I don't think so.. What I was saying was that I inverted the color, which made the sky blue. So that's what I was saying, likely they inverted the color, from blue to brown/tan. (This was of course after they took a picture of the sky!) :D Here is the original photo that Doom 2's RSKY1 was made from, with the original texture overlaid on the same location it was taken from. You aren't wrong about them taking a picture of the sky, but it definitely wasn't a blue sky. 4 Quote Share this post Link to post
Mr.Rocket Posted February 25, 2021 Ah! I see, apologies for not looking into the history of the sky. ;) I assumed it would have been blue to begin with as it looks rather natural after inverting the color. Thanks for the info! 0 Quote Share this post Link to post
jval Posted February 25, 2021 (edited) On 2/22/2021 at 11:49 PM, GRAU said: How about creating a procedural generator for VOXEL trees or at least bushes, with configurable ammount of empty spaces in each layer to make the bushes and trees look a but pransparent here and there? Here it is, version 1.0.2.17 with voxel export support. (File/Export/Voxel menu item) Voxel types supported: Slab6 vox files DelphiDoom ddvox files Downloads Executable: https://sourceforge.net/projects/doom-tree/files/DOOMTREE_1.0/DOOMTREE_1.0.2.17_bin.zip/download Source code: https://sourceforge.net/projects/doom-tree/files/DOOMTREE_1.0/DOOMTREE_1.0.2.17_src.zip/download The Export Voxel dialog: Inside the game: Exported voxel opened in the SLab6 editor: Spoiler Exported voxel opened in DD_VOXEL editor: Spoiler Edited February 25, 2021 by jval 9 Quote Share this post Link to post
Mr.Rocket Posted February 25, 2021 Holy Voxels Batman, now this is off the hook! 1 Quote Share this post Link to post
Peccatum Mihzamiz Posted February 25, 2021 I love this so much! I searched for all sorts of tree sprites for quite a while and then stumbled on Ptree last month. I liked Ptree a lot and have progressed quite a bit with my big forest level. But this.... just wow! Thank you for making this! Please never stop creating cool software like this! 1 Quote Share this post Link to post
ketmar Posted February 26, 2021 5 hours ago, Peccatum Mihzamiz said: Please never stop creating cool software like this! i think we'll need a straitjacket to stop him. and i don't think we have one. 4 Quote Share this post Link to post
NiGHTMARE Posted February 26, 2021 Fantastic work! I look forward to seeing the kind of things people come up with when combining this and the Terrain Generator (even more so if a procedural rock generator is added to the mix at some point) :) 4 Quote Share this post Link to post
ENEMY!!! Posted February 27, 2021 (edited) Inspired by how well the new rock generator works with OTEX source textures, I decided to try an OTEX tree using OTEX wood textures for the trunk and OTEX vine textures for the twigs. Again I'm pretty impressed with the results: Spoiler I get the impression that for better results though the OTEX textures need to be edited to create transparent/black areas around the edges. Edit: done! Spoiler Edited February 27, 2021 by ENEMY!!! 5 Quote Share this post Link to post
GRAU Posted March 5, 2021 (edited) On 2/25/2021 at 7:42 PM, jval said: Downloads Executable: https://sourceforge.net/projects/doom-tree/files/DOOMTREE_1.0/DOOMTREE_1.0.2.17_bin.zip/download Source code: https://sourceforge.net/projects/doom-tree/files/DOOMTREE_1.0/DOOMTREE_1.0.2.17_src.zip/download The Export Voxel dialog: Inside the game: OH, man, you are genious! Thius tool could save tinns of time in some of my projects. Can i use generated with this software voxels in my tc for (Q/L)ZDoom? Actually i thought to use sprite trees or may be some sector+texture combinations for large, high trees in the woods. But this thing looks far more interesting. The only question is HOW MUCH PERFORMANCe I WILL LOSE with such big voxels. But abyway i could use it for some small bushes for example. Edited March 5, 2021 by GRAU 1 Quote Share this post Link to post
jval Posted March 6, 2021 4 hours ago, GRAU said: OH, man, you are genious! Thius tool could save tinns of time in some of my projects. Can i use generated with this software voxels in my tc for (Q/L)ZDoom? Actually i thought to use sprite trees or may be some sector+texture combinations for large, high trees in the woods. But this thing looks far more interesting. The only question is HOW MUCH PERFORMANCe I WILL LOSE with such big voxels. But abyway i could use it for some small bushes for example. Thanks @GRAU. The voxels can be exported in vox format and then you must manually convert them with slab6 to kvx in order to use it with ZDoom family ports. In the screenshot the voxels are 256x256x256 in size. In case of performance loss you can choose to export as 128x128x128 or lower and use scale. The performance depends mostly on close to the camera voxels (far voxels use mip-mapping and occupy small amount of pixels in screen to worry about), so unless you put dozens of them in front of the player view, or make a distant forest with hundreds of them, there shouldn't be any problem. 1 Quote Share this post Link to post
GRAU Posted March 6, 2021 (edited) i allready have done some tests. It is not ideal - trees are alway very aymetric on nearly anny settings and seed. but it is still easier to enerate something i would nmore or less like and then - to postprocess it manually like i have done with one tree today))) Yes - when i did put over 30 trees in front of player i got heavy fps drop but it still a reliable thing, i just will use half-resolution and put less trees somewhere in the streets will look very nice! Spoiler Edited March 6, 2021 by GRAU 1 Quote Share this post Link to post
GRAU Posted March 6, 2021 (edited) But i found a thing i need. May you give an advanced option when exporting to voxel -an ability to choose the .pal file (game palette) so i could create trees allready in my special palette, and not in doom one. And a question - can i load textures with 32bit colordepth for twigs and trunc? Another export option that can be really usefull - export to .md2 nodel and it's special composite skin file. Edited March 6, 2021 by GRAU 1 Quote Share this post Link to post
jval Posted March 6, 2021 1 hour ago, GRAU said: But i found a thing i need. May you give an advanced option when exporting to voxel -an ability to choose the .pal file (game palette) so i could create trees allready in my special palette, and not in doom one. Done! Version 1.0.3.18 (20210306) This is a small update to allow to use custom palette for exported slab6 voxels. Downloads: Executable: https://sourceforge.net/projects/doom-tree/files/DOOMTREE_1.0/DOOMTREE_1.0.3.18_bin.zip/download Source code: https://sourceforge.net/projects/doom-tree/files/DOOMTREE_1.0/DOOMTREE_1.0.3.18_src.zip/download This is the new look of the Export Voxel dialog, in which you can specify an external palette to use. In order to be able to select a palette you must choose to save as slab6 vox format (DelphiDoom's ddvox format is true color) and select the "Custom" radio item from the "Palette" radiogroup. For convenience, DOOMTREE will remember the last used palette every time you run the application. If you select "Custom" palette but you forgot to specify the filename, then the defaulf Doom palette will be used. Note: The palette must be in the Doom palette format. 1 hour ago, GRAU said: And a question - can i load textures with 32bit colordepth for twigs and trunc? Yes, of course, you can use jpg, bmp, png and tga images with any color depth. In fact, the tga format support is limited to only 24 & 32 bit uncompressed files. 1 hour ago, GRAU said: Another export option that can be really usefull - export to .md2 nodel and it's special composite skin file. There are some limitations and technical problems for that: It needs 2 md2 models to export the whole model (twig & trunc). The 2 textures can not be combined to one. Does md2 allows for transparent textures (needed for twig) ? 1 Quote Share this post Link to post
ketmar Posted March 6, 2021 can i recommend you Vampyre Imaging Lib? FOSS, knows alot of gfx formats (reading and writing), doesn't require external dlls or non-pascal code. 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.