A script to build custom shaped 3d floors

Any utility that assists in the creation of mods, assets, etc, go here. For example: Ultimate Doom Builder, Slade, WadSmoosh, Oblige, etc.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

A script to build custom shaped 3d floors

Post by Sir Robin »

I've been dinking around with 3d floors - is there any good tool for building those? I've been drawing them out on paper and then putting them in by hand. I wanted to write a script to help me do that faster and easier, so this is what I came up with.

Basically you start a new map, draw sector(s) in the shape that you want your 3d floor(s) to look like from the "front". Then run the script and it takes that XY drawing and flips it up to XZ and extrudes it into the Y axis and saves it as a 3d floor. You can then copy and paste that into your working map.

So for example you could draw a ring and have it extruded into a pipe:
Spoiler:
Or draw the DOOM logo:
Spoiler:
It applies the same textures that you drew the original sector with, and also uses the light level to set the opacity of the 3d floor, but I've notice that only seems to work on flat floors with no slopes, so I don't know how useful that is. Also that software mode can only see flat floors, but collision detection does still work even if you can't see them.

Anyway, is that useful for anyone? It's just a stand-alone script, I wrote it in PowerShell. But maybe if there's some interest in it I could slap an interface on it or put it as a plug-in for UDB or something?

EDIT: My script is posted here.
Here is the latest download link: 3dFloors_Extrude.zip
Important file in the package:
3dFloors_Extrude.ps1 - The main script file
3dFloors_Extrude.cfg - The configuration settings file
3dFloors_Extrude.txt - The readme file. Have a look at this if this is your first time using this script.

Last updated 2022/01/18
The script now handles 2-sided lines properly, and I fixed the texturing. I fixed and tweaked a bunch of small things, and added better error handling.
The control sectors are marked not to show on the textured automap and the lines are set not to show on the regular automap. Thanks Enjay for the suggestion.
The lightlevel property no longer controls floor translucency, I moved than functionality over to the flooralpha property.
Last edited by Sir Robin on Tue Jan 18, 2022 12:26 am, edited 1 time in total.
User avatar
Logan MTM
Posts: 678
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: A script to build custom shaped 3d floors

Post by Logan MTM »

Holly Hell! :shock:
User avatar
Enjay
 
 
Posts: 26540
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: A script to build custom shaped 3d floors

Post by Enjay »

Sir Robin wrote:Anyway, is that useful for anyone?
Is the pope a bear? Do Catholics poop in the woods? ;)

Seriously, that looks like an amazingly useful script and having it as a UDB plugin would be very welcome.
User avatar
Nash
 
 
Posts: 17455
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: A script to build custom shaped 3d floors

Post by Nash »

Hi, is it possible to have this be a UDBScript?

In case you are unfamiliar with UDBScript: https://biwa.github.io/udbscript-docs/

That said, UDBScript or not; what you made appears to be VERY useful. I'd certainly love to use it. :)
User avatar
SeventhSentinel
Posts: 10
Joined: Thu Jun 09, 2016 7:48 pm
Location: Ohio

Re: A script to build custom shaped 3d floors

Post by SeventhSentinel »

Now that SRB2 has rudimentary UDMF support, our development team would find that extremely useful as a UDB plugin.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: A script to build custom shaped 3d floors

Post by Sir Robin »

@Logan MTM - now that's a reaction I like to get! :D

@Enjay - what's that? The pope shit on a bear in the woods? :lol:

@Nash - Thanks for the link. Looks like JavaScript. I'll see what it takes to port it over.

@SeventhSentinel - these floors need UDMF line type 160, sector moreids, floorplane_*, and ceilingplane_*, so if you're implementing all that then it should work for you.

So this script is working all well and good, but I'm thinking of what can be even better. I'm thinking I can break the input object into layers, and toggle those layers on and off along the extrusion path, to create more complex shapes.
Then you could cut a hole in the top of that pipe to jump down into:
Spoiler:
Put a fitting around that hole:
Spoiler:
(Yes I know that fitting is clunky looking, I just threw in it real quick as a proof-of-concept)
Cut a hole in the side of the pipe to jump out of:
Spoiler:
And I know I said sloped 3d floors can't be translucent, but if I split it to layers, can you make a layer without slopes and make that translucent and then merge it back in:
Spoiler:
None of this is in the script yet, it's just done by hand as a proof-of-concept. I'm pretty sure I can make it work though.

I'll polish it up and bit and then throw it into github and post a link here - Anyone who wants to try it out in native PowerShell can give it a go.
boris
Posts: 751
Joined: Tue Jul 15, 2003 3:37 pm

Re: A script to build custom shaped 3d floors

Post by boris »

Sir Robin wrote:@Nash - Thanks for the link. Looks like JavaScript. I'll see what it takes to port it over.
That's because it is JS ;)
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: A script to build custom shaped 3d floors

Post by Sir Robin »

Here is some maps to play with
User avatar
Enjay
 
 
Posts: 26540
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: A script to build custom shaped 3d floors

Post by Enjay »

These are very cool indeed.
User avatar
ramon.dexter
Posts: 1558
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: A script to build custom shaped 3d floors

Post by ramon.dexter »

Brav brave sir robin!

..he created 3d floor script...
Brave sir robin
He showed us how to use it...
Brave sir robin...

Great work indeed!
User avatar
Nash
 
 
Posts: 17455
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: A script to build custom shaped 3d floors

Post by Nash »

Excellent work.

Not trying to be pushy or insistent, but I believe this is a perfect use-case for UDBScript, since this is considered an editing aid, and UDBScript was designed to allow this kind of power for users. :)

But of course, using it as an external tool is also fine. Thanks for doing this for the community. :)
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: A script to build custom shaped 3d floors

Post by Sir Robin »

Nash wrote:Excellent work.

Not trying to be pushy or insistent, but I believe this is a perfect use-case for UDBScript, since this is considered an editing aid, and UDBScript was designed to allow this kind of power for users. :)

But of course, using it as an external tool is also fine. Thanks for doing this for the community. :)
I hear ya, and I agree, absolutely. But that is going to require me to learn javascript, learn the interface to UDB, and convert or rewrite my code. So "Get this thing into a UDB plug-in" is a "nice to have" goal, while my immediate goal is "get this thing into the hands of the community ASAP". The path to that goal is to polish up the PowerShell script, document it, and get it uploaded. I'm planning to get that done today.
User avatar
Nash
 
 
Posts: 17455
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: A script to build custom shaped 3d floors

Post by Nash »

Of course, you're right. :) Looking forward to test it!
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: A script to build custom shaped 3d floors

Post by Sir Robin »

OK! Here it goes. Not perfect, but posting it up as is to see what you folks can come up with.

3dFloors_Extrude.zip
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: A script to build custom shaped 3d floors

Post by Sir Robin »

gah, pretty obvious bug, I can't believe I didn't test for this. It seem if you have more than 2 heights, it breaks the texturing. So for example the ring has 2 heights, the bottom part and the top part. But for example a figure 8 would have 3 heights, and that seems to be what is breaking the texturing part of the script. The rest of it works, it creates the floors properly, just doesn't texture them.

You can still do that by hand for now - just select all the dummy sectors and make sure they have a floor and ceiling texture set.

Return to “Creation, Conversion, and Editing”