Search Unity

[RELEASED] SECTR COMPLETE: Spaces, and the Connections Between Them

Discussion in 'Assets and Asset Store' started by MakeCodeNow, Feb 21, 2014.

  1. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Hi

    I am planning to use this for an RPG open world game for mobile. Do you have tutorial for an open world scene?

    Thank you
     
    Last edited: Oct 2, 2014
  2. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    There's no tutorial currently but if you are basing your world on Unity Terrain, SECTR includes a tool that will auto create Sectors for you, split the terrain, etc. It also supports Terrain Composer authored worlds.
     
  3. negativecap

    negativecap

    Joined:
    Jan 27, 2013
    Posts:
    99
    Got that camera thing fixed, stupid error. I'm procedurally generating levels and VIS is working great for that, but I'm looking to further optimize and I'm wondering if I could make STREAM chunks at runtime, or if they're only pre-baked? I realize that they are scene files, but if they're pre-baked could I make them as prefabs (which is required for my procedural generator) and have them instantiated at runtime? Thanks.

    EDIT: Also, VIS doesn't seem to be culling particle systems (TC Particles). Any way around this?
     
  4. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Great, I can finally put this to use, been collecting dust since I bought it when it was on sale.
    Would be good if you can prepare a tutorial regarding how it can be used with unity terrain/terrain composer.

    Thank you
     
  5. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    It has been mentioned on the DunGen thread that it would be cool to add SECTR: Streaming to the already existing SECTR: VIS capabilities that DunGen has. I don't know if you've been contacted about this, but I've been thinking the last few weeks that it could be a neat feature for both plugins, to have that option.
     
  6. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    STREAM requires prebaked scenes. If the modules of your level could be exported into separate scenes rather than prefabs, STREAM would work, though you'll have to do some fiddly work on your side to dynamically create Sectors, Chunks, and the right config on the Chunks.

    VIS does cull particle systems, but just the ones built into Unity. If you want to, you can extend SECTR to cull TC Particles, which will mostly involve tracking that in SECTR_Member and handling it correctly in CullingCamera.
     
  7. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    As I mentioned in the previous post, its a bit trickier to get STREAM working in a procedural system like DunGen. The VIS integration was done by the DunGen team, and I can certainly help them if they want to do STREAM, too.
     
    hopeful likes this.
  8. negativecap

    negativecap

    Joined:
    Jan 27, 2013
    Posts:
    99
    Cool, thanks. I figured that STREAM would be a harder thing to integrate. I'll work on the TC Particles extension, thanks for pointing me in the right direction. On a side note, I am now doing multi-mesh combine at runtime alongside VIS and seeing some great results. The overhead of VIS CullingCamera was a bit heavy when there was a lot of subobjects to sort, but combine things judiciously and it flies... What I'm trying to do wouldn't be possible without your system, and it's looking like it just might work, so... thanks!
     
  9. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Awesome! Sounds like a really great approach.
     
  10. S-0-L-0

    S-0-L-0

    Joined:
    Nov 9, 2012
    Posts:
    163
    Does SECTR support T4M? Would there be any need for it since T4M reduces terrain to one draw call?
     
  11. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    SECTR does not explicitly support T4M but it probably works along side of it just fine.

    SECTR does a lot of things, so yes, it has uses beyond terrain rendering performance.
     
  12. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    The demo included with SECTR Complete runs perfectly on its own, but when I attempt to integrate SECTR with my own own third-person camera and movement system adapted from UFPS it completely freaks out: the camera and model both begin to vibrate uncontrollably, movement becomesdelayed and inconsistent, and it feels like I'm constantly running into invisible obstacles. The model runs smoothly in non-SECTR scenes, and I've made the following modifications to it:
    Added SECTR_culling_camera to the main camera childed to the model
    Added SECTR_Member to the parent object of the model & camera system
    Added a start loader to the parent object

    I'm still looking through the API trying to find what could be interacting with my physics & animation, but I was wondering if you had any ideas where I should start looking?
     
  13. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I'm not aware of any problem unique to UFPS as many folks have gotten SECTR and UFPS to run together. However, here are some ideas about how to narrow it down.

    First, let's try to narrow down the problem to culling or streaming. I'd start by disabling the culling camera component. I bet this will not fix the problem, but it's the easiest thing to try.

    If that doesn't fix the problem (which it probably won't) my guess is that you are somehow quickly loading and unloading and loading chunks. This could cause the kind of jitter you describe. How are you streaming as the player moves around? A Start Loader will only load the first Sector the player is in. How are you loading the rest?

    Are you doing any sort of teleportation or global scene shift/recentering?

    Lastly, I always recommend that people who are new to SECTR start simply and build up. It's tempting to try to make sectors and portals for a big level and then turn on streaming and culling and everything but it can be easy to make a mistake along the way (or for there to be a bug) and then it's really hard to find the problem. If you start with just a few rooms, then enable culling, then streaming, then other bits it makes it easier to narrow down where the problem is.
     
  14. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Wow, thank you for the lightning-fast response! :)

    I think the loaders might be the problem: disabling the culling camera didn't result in a perceivable change in behavior, and disabling the start loader after the scene loaded didn't do anything, but keeping the culling camera enabled and starting the scene with the loader disabled resulted in no bugs, after which enabling the loader (while the scene was running) caused the buggy behavior to return. I tried changing the start loader to a neighbor loader, and verified that if I switch the neighbor loader on, then turn it off again, the buggy behavior persists. The scene I'm testing this in is the CompleteScene.unity included in SECTR/demos/complete/CompleteScene.unity, as I'm 110% sure that one is set up correctly, but I've also been able to consistently replicate this behavior using the same model in a scene that has nothing but two sectors, each consisting of an empty room made out of cubes, joined by a single portal.
     
  15. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I'm a bit confused by your descriptions. You say that you can disable a loader and things are fine until you re-enable the loader. However if you disable a loader, it should unload a chunk of the world and you should probably fall.

    Anyway, I think in this case seeing will be believing. If you have a simple scene that repros, make me a package that contains the assets necessary to repro the bug and email a download link to support@makecodenow.com. Alternately, record a video of your desktop while you repro the bug and send a YouTube link. Thanks!
     
  16. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    So in building a fresh scene to demo the bug I figured out what's causing it: since I'm using UFPS, my character is an empty gameobject with a bunch of scripts, childed to which is the main camera and the model. The culling camera and member script were on the camera, but the loader was on the parent gameobject. When I move the loader directly onto the camera and disable the one on the parent, all of the errors go away.
     
  17. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Glad to know you found the issue. I'll try to repro here just to make sure there's not some deeper bug.
     
  18. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Let me know if you can't reproduce it, I'll send you my example.
     
  19. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    If you have a good simple repro, please send it along. That way I can be sure I'm looking into the same issue and not just guessing.
     
  20. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    The only problem is that it uses UFPS stuff, and I don't want to send his complete code... my change was very minimal, the only thing needed to reproduce the error is to place the third-person example character into the Complete example scene and put the loader on the parent, not the camera... since I only made changes to one object, would it help if I send a screenshot of the inspector settings for the loader and membership component?
     
  21. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    A screenshot of hierarchy and inspector would be perfect.
     
  22. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Screenshots taken and emailed, please let me know if there's anything else I can do to help. :)
     
  23. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    New SECTR update out now. Includes improvements to terrain splitting and culling, plus some Unity 5 updates.
     
  24. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Is there, by any chance, a function built into SECTR that will take a sector, and return a list of sectors within distance n? I'm basically looking for a way to restrict NPC movement within a certain number of sectors from their chunk of origin.
     
  25. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yeah. Just get the TotalBounds of the Sector, then expand it by your distance, then use Sector.GetContaining().
     
  26. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    You can also use the SECTR_Graph.BreadthWalk() if you want to get a number of Sectors away rather than a distance.
     
  27. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Oh perfect, these are both useful... am I correct in assuming that BreadthWalk() takes portals into account, so it won't return two adjacent Sectors if they aren't connected by portals?
     
  28. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yep!
     
  29. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Awesome! Thank you very much for your quick and incredibly helpful reply! :)
     
  30. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    SECTR COMPLETE is now 50% off during the Birthday Bonanza sale! Get it while supplies last!
     
  31. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    Does all of the SECTR components compatible for unity 5?, a slight looks into it throw an error at this line
    which is this line
    Code (csharp):
    1.  
    2. #if !UNITY_4
    3.          if(!nextClip.Clip.audioDataLoaded)
    4.          {
    5.            nextClip.Clip.LoadAudioData();
    6.          }
    7. #endif
    Adding directive #if !UNITY_4 || !UNITY_5 also doesn't work.
     
    Last edited: Nov 14, 2014
  32. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    They just changed that part of the API in beta 13. I'll release a fix shortly but for now just comment those lines out.
     
  33. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    Yup works as temp fix, most of functionality seems working, another thing there is a lot of this error
    Code (csharp):
    1.  
    2. type is not a enum value
    3. UnityEditor.SerializedProperty:get_enumValueIndex()
    4. SECTR_Member:_AddChildren(Transform, Boolean, Vector3) (at Assets/SECTR/Code/Core/Scripts/SECTR_Member.cs:736)
    5. SECTR_Member:_UpdateChildren() (at Assets/SECTR/Code/Core/Scripts/SECTR_Member.cs:653)
    6. SECTR_Member:ForceUpdate(Boolean) (at Assets/SECTR/Code/Core/Scripts/SECTR_Member.cs:391)
    7. SECTR_Member:OnEnable() (at Assets/SECTR/Code/Core/Scripts/SECTR_Member.cs:452)
    8.  
     
  34. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Not sure what's up with that. Might be a Unity bug actually since that code is old and stable. But I'll dig in later today. If you need an immediate fix I'd recommend rolling back to b12. Unfortunately I get beta access the same day as everyone else so there is lag on the fixes whenever they make breaking API changes.
     
  35. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    This is a bit of an obscure question, but it would be really convenient if I could use the portal objects for my spawning system, but to do that would require collision detection- am I going to blow anything up if I add a kinematic rigidbody to each portal so my player's trigger collider can see them?
     
  36. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Should be fine. You can also check out the logic in Member.cs for Portal Determined. That shows how to check for portal crossing using movement deltas and math.
     
  37. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Excellent, thank you very much for the quick reply :)
     
  38. SeanPollman

    SeanPollman

    Joined:
    Jul 10, 2012
    Posts:
    55
    I just started up a new project and imported Sectr Complete (latest version on the asset store) and I get the following error.

    Code (CSharp):
    1. Assets/SECTR/Code/Audio/Scripts/SECTR_AudioSystem.cs(345,51): error CS1061: Type `UnityEngine.AudioClip' does not contain a definition for `audioDataLoaded' and no extension method `audioDataLoaded' of type `UnityEngine.AudioClip' could be found (are you missing a using directive or an assembly reference?)
    2.  

    Any help would be great.
    Using Unity 5.
     
  39. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Unity changed some APIs in Beta 13. I'll have a fix this weekend but for now roll back to beta 12 or comment out those lines.
     
  40. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    1.1.4e is out now. Includes API fixes for U5 Beta 13 and a nice curve editor for HDR keyframes.
     
  41. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    1.1.4f is now live on UAS. Includes fixes for U5 b14.
     
  42. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    Just wanted to say in the Complete demo the DeepRumbleLoop and the SciFiLoop have audible clicks because they aren't properly seamless.
     
  43. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Thanks for the heads up.
     
  44. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    This is a bit of an offbeat question, but I'm currently working on simulating NPC navigation between sectors when the player isn't nearby, and I'm wondering if, given a reference to the node an NPC is in and the node they want to be in, there's a method already in the API to generate a list of nodes constituting the least number of sectors and chunks that NPC could navigate to travel from origin to destination?
     
  45. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yep! Just use SECTR_Graph.FindShortestPath(). Easy!
     
  46. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Wow, that doesn't involve sacrificing chickens or funny dances or anything, awesome! Thank you :)
     
  47. aegget_

    aegget_

    Joined:
    Oct 30, 2012
    Posts:
    33
    Hi, I have just started to play around with Sectr Audio and I like it a lot so far.

    Though I was just wondering, is there a way to have the sounds play faster/slower? I have different footstep sounds that are being shuffled and I would like to be able to shuffle the sounds quicker so that I can reuse the same walk sounds for running and also slow them down when sneaking.

    Also I get 3 null reference exception messages when I play and build scripts. Any Idea whats causing them?
    I'm using Sectr Complete Version 1.1.4f and Unity Pro 4.5.5f
     
  48. SkermunkelStudios

    SkermunkelStudios

    Joined:
    Dec 29, 2012
    Posts:
    156
    Hi, I seem to be having a bit of a problem in getting Loading Doors to work, Ive created a Complete Door (although I removed the Audio component as I havent really dived into SECTR Audio yet) and Ive attached a Mecanim animation controller which I set up and connected basically the same as the SpaceDoor's animation controller's settings in the Complete Demo.

    The problem is the door doesnt want to laod the Sectors on the other side, I do have all my loading doors connected to the correct Portals and the doors automatically open and close just like they should when entering and exiting the trigger, but none of the Sectos on the other side want to Load.

    I am also using Group Loader Lists for my clusters of Sectors to load at these loading doors, so that the correct entire cluster of sectors gets loaded/unloaded at the right times.

    Please any help on the matter would be greatly appreciated, thanks in advance for any advice.
     
  49. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    You can use the pitch adjustment feature to have the sounds play faster or slower. However it will also make them higher or lower pitch. It's very CPU intensive to have a sound play faster or slower without adjusting the pitch, so much so that it's not really practical to do for regular game sounds.

    Those NULL errors are some kind of Unity bug todo w/ hot reloading scripts. The only fix I know of is to restart the editor.
     
  50. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Not sure what the problem is, but try a few things:

    * Make sure the Portals are connected to the Front and Back Sectors. You need both the Door->Portal and Portal->Sector connections.

    * Disable the door loaders and the Player's Start Loader and put a Neighbor Loader on the player. Do the rooms work? If not, that suggests something is generally wrong with how those Sectors were exported.

    * Disable the Group Loaders. Does the Sector on the opposite side of the door work?

    * Try the included Stream/Door Demo. If you export it for streaming does it work properly?