Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can Curve Spline be used for an in game level editor.
#15
Heyo, no worries about the delay haha. Still amazing support.


(05-04-2023, 09:33 PM)_Aka_ Wrote: It is probably because you are using Curvy Splines with amsdef files. If so, short answer would be: remove the asmdef files in the ToolBuddy folder (recursively). The long answer would be: you need reference your code in the Curvy asmdef. More information here: https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html

I'm having trouble locating the assembly definition files (asdf). I actually tried to look into them before coming to you but had trouble locating them.

(05-04-2023, 09:06 PM)_Aka_ Wrote: It is automatically pooled.

I know you said the SplineGenerator was pooled in the example, but from what I saw it initialized a set amount of generators based on the segments.

For my project, I decided to attempt the approach of prefabbing the splines and generators. 
This way I could set different spline settings for my editor for different pieces. As well as customize how the generation is handled.

Currently I use two prefabs, 1 for the spline itself (with my own wrapper or facade functions), and another that generates pooled generators (also wrapped so I can spawn towers on the nodes).
I plan to use the same generator for most splines, but in cases of something different (like a railroad track) I'll have its generation be different.

Is this a recommended?

(05-04-2023, 09:33 PM)_Aka_ Wrote: Multiple spline rasterizers is the fastest to implement. If you feel that you might need modifying the logic behind defining where to put objects, then using a custom spot module would be better I believe.

And instead of having a pool generators system, would it be just better to make 1 generator handle everything I needed in 1 go? If so, where could I get started to figure this out? I simple want all the control that the standard spots volume provides, just with the ability to set padding between points based off world units.

(05-04-2023, 09:33 PM)_Aka_ Wrote: I think you should set the Range parameter (of the module that suits you) so that it sets a buffer at the beginning and end. The range is expressed as a relative distance. So if you want your range to start at 0.5u, then your range start value should be 0.5f/yourPathLength. You can access your path's length either via:

Currently I have each generator have its SplineInput range set to the points I want (always a segment). Would I still use the entire spline Length when calculating the .5 offset? Or Would I use the segment length.



Edit* Only problem I'm having with my current solution is the error StartCP/EndCP is not a part of the input spline. This is avoided if I set the Spline for the generator and then call Refresh. But it can sometimes pop up if I generate things in the editor, and then try to run the game (due to onValidate calling before) 

Is there anything I can do to avoid this? 

One possibly way is if I only needed 1 geneartor (with a custom spots), I wouldn't need to spawn the generators in anymore. And i can have 1 prefab with the spline and generator already pre-attached....  
   
Reply


Messages In This Thread
RE: Can Curve Spline be used for an in game level editor. - by Lupos - 05-05-2023, 03:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_

Forum Jump: