godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add CSG Stairs shape #2166

Open Braboware opened 3 years ago

Braboware commented 3 years ago

Describe the project you are working on

I am working on a third person action game.

Describe the problem or limitation you are having in your project

I want to blockout and visualize levels in-engine faster.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Stairs are currently tedious for blocking out levels, requiring the use of external modeling software or the use of many CSGBoxes.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

The CSG shape should have properties for the width, height, and depth as well as a property for the number of stairs. The functionality in mind is similar to the Blender Stairs addon for Blender.

If this enhancement will not be used often, can it be worked around with a few lines of script?

A CSGPolygon ramp can be a quick substitute, but stairs are a part of almost every building so it should see regular use.

Is there a reason why this should be core and not an add-on in the asset library?

Stairs are a common enough shape to see use in many projects, and should not be a one-off shape.

Calinou commented 3 years ago

I started working on an add-on that adds a CSGStaircase node. It works by procedurally generating a CSGPolygon shape. Using a single CSGPolygon node also provides better performance than using many CSGBox nodes.

That said, I wrote it for the current master branch instead of 3.2.x, which means it would have to be rewritten for 3.2.x to be usable there.