SabreCSG
SabreCSG copied to clipboard
Non-Destructive Editing
This suggestion is to implement a non-destructive editing system.
Problem: Imagine you clip a brush, or bezel an edge, or want to make a series of identical brushes. In all these cases, editing the geometry of the resulting brush(es) becomes more difficult. For instance, if you want to change the geometry of a window you duplicated many times in a row, you now need to edit the geometry of all the duplicates instead of being able to edit the original and propagate the change.
Solution: Implement a stackable 'modifier' system that allows editing the original geometry instead of the more difficult process of modifying geometry after changes are applied.
Possible Implementation: I imagine this as an object in the scenegraph with children of brushes and/or other modifier objects. The modifier would apply its change during CSG build-time. Ideally it would also preview the result before CSG build-time so you could see where your brushes are ending up (perhaps in a gray outline?).
Possible modifier tool ideas:
- Array
- Clip
- Chamfer Edge
- Mirror
- Others?
Reference:
Value:
- Allows for faster & greater iteration -- a non-destructive level design workflow is faster for making changes, particularly for when enacting changes later in development to game levels after receiving player feedback. The further along the level, the more likely brushes are no longer simple boxes but have been clipped, etc.
- To my knowledge, other level solutions for Unity do not provide much/any non-destructive functionality, so it would be a good differentiator.
I'm fairly certain you can use prefabs to achieve much of this... Ie. The window example, just prefab the window geo and subtraction and then modifications will ripple across all instances. But perhaps I'm overlooking those other use cases.
On Sat, Aug 25, 2018, 7:52 AM RobbyZ [email protected] wrote:
This suggestion is to implement a non-destructive editing system.
Problem: Imagine you clip a brush, or bezel an edge, or want to make a series of identical brushes. In all these cases, editing the geometry of the resulting brush(es) becomes more difficult. For instance, if you want to change the geometry of a window you duplicated many times in a row, you now need to edit the geometry of all the duplicates instead of being able to edit the original and propagate the change.
Solution: Implement a stackable 'modifier' system that allows editing the original geometry instead of the more difficult process of modifying geometry after changes are applied.
Possible Implementation: I imagine this as an object in the scenegraph with children of brushes and/or other modifier objects. The modifier would apply its change during CSG build-time. Ideally it would also preview the result before CSG build-time so you could see where your brushes are ending up (perhaps in a gray outline?).
Possible modifier tool ideas:
- Array
- Clip
- Chamfer Edge
- Mirror
- Others?
Reference:
- Quark Macro-Objects http://quark.sourceforge.net/infobase/maped.tutorial.advanced.html#duplicators
Value:
- Allows for faster & greater iteration -- a non-destructive level design workflow is faster for making changes, particularly for when enacting changes later in development to game levels after receiving player feedback. The further along the level, the more likely brushes are no longer simple boxes but have been clipped, etc.
- To my knowledge, other level solutions for Unity do not provide much/any non-destructive functionality, so it would be a good differentiator.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sabresaurus/SabreCSG/issues/164, or mute the thread https://github.com/notifications/unsubscribe-auth/AU8jxQrYPZt-ktloYipelbTJPWiFOYuGks5uUHW3gaJpZM4WMCij .
Prefab would cover some of this for the window case (Array modifier), however, it has the following drawbacks:
- No way to change the distance between windows
- No way to change number of windows
- Can't nest prefabs (imagine you had a window hole subtractive brush and then a separate non-sabrecsg window mesh prefab and wanted both to be duplicated for each window)
Prefabs also wouldn't be applicable to the other modifier tools
You can now use nested prefabs in Unity!
If I recall correctly, brushes don't serialize as prefabs anyway (broken script references). However, this can be achieved with the 2D shape editor projects. Still more work than a non-destructive workflow.
It is possible to prefab the meshes, but you'd have to have a separate CSGModel instance for each different mesh, and at that point you may as well be importing from an external package.
This would require a significant change in how the brush tools work as the built geometry will no longer match the brush polygons. That makes it extremely difficult to store changes in materials and UVs. For example new faces introduced by chamfers and clips will lose their materials and UVs every time the world is built.
I have been thinking about it for weeks and there's just no straightforward solution, from a programming standpoint, to make this work seamlessly and reliably.
there's just no straightforward solution, from a programming standpoint, to make this work seamlessly and reliably
It's definitely possible as Quark supported this a decade ago -- however, it may not easily fit into Sabre's existing data model. Regardless, I believe the Quark source is publicly available and might be worth investigating for ideas?