A script to build custom shaped 3d floors
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.
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.
-
- Posts: 1557
- 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
Ok, just one question: How do I do it? I downloaded the maps, but it just don't tell anything on how to duild this, or how to script it...
-
- 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
There's a text file in there, 3dFloors_Extrude.txt
Sorry, I should have mentioned that
Sorry, I should have mentioned that
-
-
- Posts: 26539
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: A script to build custom shaped 3d floors
And with the tiniest bit of post-generation editing...
Pretty easy to use so far.
Honestly, I just made my source map, called it input.wad, dumped it into the 3dFE folder, and used right-click "run in powershell" on 3dfloors_extrude.ps1 to generate the map using default settings (i.e. I didn't actually bother configuring anything for this first attempt).
Afterwards, all I did was set the floors to be fully opaque and made them thinner (front to back) so that the letters could be read more easily. Literally 30 seconds of editing.
[edit]Heh:
[/edit]
[edit2]
Minor convenience suggestion - autoflag control sector lines as not shown on map and control sector floors to not show on the textured automap. Not that big a deal because it doesn't take that long to edit these in after map generation but it would be nice for it to happen automatically (perhaps via a cfg setting).
Not sure why the floors default to translucent either. Again, that strikes me as something that would make sense as a CFG option.
[/edit2]
[edit3]
I didn't actually expect this to work at all, so the fact that I got something that is recognisably MAP01in 3D floors is pretty cool.
[/edit3]
Pretty easy to use so far.
Honestly, I just made my source map, called it input.wad, dumped it into the 3dFE folder, and used right-click "run in powershell" on 3dfloors_extrude.ps1 to generate the map using default settings (i.e. I didn't actually bother configuring anything for this first attempt).
Afterwards, all I did was set the floors to be fully opaque and made them thinner (front to back) so that the letters could be read more easily. Literally 30 seconds of editing.
[edit]Heh:
[/edit]
[edit2]
Minor convenience suggestion - autoflag control sector lines as not shown on map and control sector floors to not show on the textured automap. Not that big a deal because it doesn't take that long to edit these in after map generation but it would be nice for it to happen automatically (perhaps via a cfg setting).
Not sure why the floors default to translucent either. Again, that strikes me as something that would make sense as a CFG option.
[/edit2]
[edit3]
I didn't actually expect this to work at all, so the fact that I got something that is recognisably MAP01in 3D floors is pretty cool.
[/edit3]
-
- 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
Yeah, there isn't really much to configure. The script runs fine right out of the box. The main reason for the config file was for the script to keep track of it's sector tags and output files. The rest I just threw in for convince.Enjay wrote:Honestly, I just made my source map, called it input.wad, dumped it into the 3dFE folder, and used right-click "run in powershell" on 3dfloors_extrude.ps1 to generate the map using default settings (i.e. I didn't actually bother configuring anything for this first attempt).
Good call, that will be easy enough to addEnjay wrote:Minor convenience suggestion - autoflag control sector lines as not shown on map and control sector floors to not show on the textured automap. Not that big a deal because it doesn't take that long to edit these in after map generation but it would be nice for it to happen automatically (perhaps via a cfg setting).
The 3d floors get their translucency from the source sector lightlevel. If you want them opaque, set it to 255 or higher. UDB calls it brightness on the sector properties panel.Enjay wrote:Not sure why the floors default to translucent either. Again, that strikes me as something that would make sense as a CFG option.
I could put in a config option to turn that feature off entirely.
That will work better when I get the script to recognize 2-sided walls. But it'll never give you a real side-view of a level, because of the polar difference between sectors and floors. Sectors are negative space to move around in, while 3d floors are positive space to block movement.Enjay wrote:I didn't actually expect this to work at all, so the fact that I got something that is recognisably MAP01in 3D floors is pretty cool.
I'm thinking of writing another script that will do the opposite of this one. Where ever it sees a sector, it will leave it as open space, and will only build a 3d floor where it sees void between 2 sectors. That would let you play a map sideways. A neat "wow factor" but I don't know how useful it would be to a level designer.
-
-
- Posts: 26539
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: A script to build custom shaped 3d floors
Cool, thanks. Like I said, it's really not hard to do manually (especially as the util lines the control sectors and control lines up in a way that makes them easy to select) but it will be a nice thing to have.Sir Robin wrote:Good call, that will be easy enough to add
Honestly, I don't think there is any need. Now that I know the light level sets it (I did wonder - given that all mine came out at 192 - i.e. the Doombuilder default light level - (and, yes, I know it's in the docs too - that's what I get for skim-reading them)) that actually gives a lot of control via how the mapper sets up the initial input.wad. Doing it it via the config file would be less easy and unnecessary duplication of a feature IMO.Sir Robin wrote:I could put in a config option to turn that feature off entirely.
Almost no use whatsoever I imagine. I only did it to see if anything would come out at all. It is likely to have very little, if any, real world use.Enjay wrote:A neat "wow factor" but I don't know how useful it would be to a level designer.
Thanks for this tool. It is very neat.
-
- 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
Already done. The bulk of a project like this is coming up with the algorithm and the 3d math to do the conversion. Setting a property to a default value is super-easy by comparison. Literally 1 line of code. Done.Enjay wrote:Cool, thanks. Like I said, it's really not hard to do manually (especially as the util lines the control sectors and control lines up in a way that makes them easy to select) but it will be a nice thing to have.
And lining up all the controls sectors like that into nice easy-to-understand blocks that are easy to edit - yeah, totally did that on purpose. You're welcome!
I changed it to use the alphafloor property - in UDB that's called the floor portal alpha. The difference is since that one defaults to 1.0, nobody forgets to set it by mistake, like the lightlevel. So I think that's more convenient and sensical.Enjay wrote:Honestly, I don't think there is any need. Now that I know the light level sets it (I did wonder - given that all mine came out at 192 - i.e. the Doombuilder default light level - (and, yes, I know it's in the docs too - that's what I get for skim-reading them)) that actually gives a lot of control via how the mapper sets up the initial input.wad. Doing it it via the config file would be less easy and unnecessary duplication of a feature IMO.
I can think that if someone was doing a platformer type game and wanted a tall area with lots of platforms, imagine like one of the vertical shaft areas in a Metrovania game, then that script might be useful to them. but really unless there are a ton of platforms, I can't see it being any faster or easier that just building them by hand.Enjay wrote:Almost no use whatsoever I imagine. I only did it to see if anything would come out at all. It is likely to have very little, if any, real world use.
I'll probably do it eventually anyway, just for the "oh wow I did it" factor.
And I threw it a rudimentary fix for the 2-sided linedefs. As I said in the doc it breaks the texturing, but gives you the proper shapes:
Spoiler:
-
- 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
...and the texturing is fixed
I'm gonna clean up a few things and post a new package here in a bit
Spoiler:So the script now works with 2-sided lines and textures them appropriately. I was holding off on that, I really thought those features would be harder to add. Now I'm kinda proud of it.
I'm gonna clean up a few things and post a new package here in a bit
-
- Posts: 817
- Joined: Thu Apr 25, 2013 12:21 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
- Graphics Processor: nVidia with Vulkan support
- Location: The Corn Fields
Re: A script to build custom shaped 3d floors
This is really impressive work!
-
- 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
Thanks!SanyaWaffles wrote:This is really impressive work!
-
- 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
I'm dropping a new release. I'll put the link in the first post.
-
- 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
Now, for practical applications, you can use this script to create stairs:
What my script will be useful for is for creating non-rectangular stairs with more interesting shapes:
Get creative and make things like stepping stones:
Spoiler:But basic rectangular stairs aren't difficult to do. You could probably create those by hand almost as fast as you could with my script.
What my script will be useful for is for creating non-rectangular stairs with more interesting shapes:
Spoiler:Look at the bevels at the tops and the points at the bottom. Yeah you could still do that by hand, but it's kind of a pain. This script does most of that work for you.
Get creative and make things like stepping stones:
Spoiler:
-
-
- Posts: 26539
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: A script to build custom shaped 3d floors
I just tried the new version - big improvements over the initial release. It seems like it is now in a state where very little, if anything (I didn't spot anything that turned out in an unexpected way), will confuse it or create something that doesn't work.
Given that any genuinely useful structure is unlikely to be as complex as some of my tests, I think anything that a mapper might actually want to create will work.
This is a really valuable addition to the mapper's arsenal.
Given that any genuinely useful structure is unlikely to be as complex as some of my tests, I think anything that a mapper might actually want to create will work.
This is a really valuable addition to the mapper's arsenal.
-
- 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
@Enjay - Yeah, I didn't think anyone would ever need to create a 3d floor from the map of DOOM2 MAP01, but that was a good benchmark. I figure if it can work with something as big and complex as that without choking on it, it can easily handle the smaller stuff.
-
- 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
About to drop another version - So you can create cool 3d floors now, but if you can't get them to sync up with your real geometry, they're just kinda isolated.
For example if you draw a half-pipe:
So the script now creates another sector with "mating templates" in it:
You can copy and paste these at the ends of your extrude path to get different effects. For example, use 2 ceiling matings to make it look like your half-pipe is hanging from the ceiling:
For example if you draw a half-pipe:
Spoiler:That's a cool 3d floor, but what to do with it? It's just kinda floating out there on it's own. You need to attach it to your level so it looks like it fits in.
So the script now creates another sector with "mating templates" in it:
Spoiler:Notice there are two templates, one that attaches to the floor and one that attaches to the ceiling. Both of them match up to the geometry of your 3d floor, one above and one below.
You can copy and paste these at the ends of your extrude path to get different effects. For example, use 2 ceiling matings to make it look like your half-pipe is hanging from the ceiling:
Spoiler:Or use the floor matings to make it look like it's supported on the ground:
Spoiler:You can get clever with it, make the pipe look like it's embedded in a higher floor:
Spoiler:Or coming out of a wall:
Spoiler:I think this will be pretty useful, looks way better than just sticking your 3d floor up against a flat surface.
-
- 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
Better than screenshots, here's an example:
PipeFactory.wad
This was done with a simple extrusion (a half-pipe) and some copy-pasting of the mating templates
PipeFactory.wad
This was done with a simple extrusion (a half-pipe) and some copy-pasting of the mating templates