Search Unity

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

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

  1. Cereal_Killa

    Cereal_Killa

    Joined:
    Oct 20, 2013
    Posts:
    204
    I'm not sure if you have different people posting from this account, but this was the same account that advised me to try manually. Strange, considering the way you explained it here is simple and seems like how I would assume it to work.
     
  2. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Ahh, I see what caused the confusion. For SECTR STREAM, it's tricky use combine procedural generation and streaming, but SECTR VIS has no problem with procedural spaces.
     
  3. Cereal_Killa

    Cereal_Killa

    Joined:
    Oct 20, 2013
    Posts:
    204
    I intend to use mostly stream and audio (the sound occlusion and propagation were big selling points for me).
    I didn't intend to use vis at all (for a 2d platformer).

    Is this still possible with sectr?
    I can code my own streaming system easily enough and I could make a propagation system based on which rooms are between the player and the sound (hallways adding echo, closed doors clamping pitch etc), but with onscreen effect occlusion I can only think of a raycasting solution which would be very expensive with a lot of sounds and geometry in the scene..
     
  4. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    The various parts of SECTR are not very tightly coupled. You can use AUDIO without using STREAM. The only thing you need for all of the modules are Sectors and Portals (from CORE).
     
  5. Cereal_Killa

    Cereal_Killa

    Joined:
    Oct 20, 2013
    Posts:
    204
    So if I have a default starting sectr that has a portal on say the top and left sides, and a bunch of other sectr prefabs also with portals on the top and left sides, presumably they could all fit together with no overlaps and alternate nicely: portal, sectr, portal, sectr, portal, sectr from top to bottom and left to right.

    My generation algorithm will decide which sectr prefab to attach to the left and could instantiate it the first time in the correct location. So presuming I know which two sectrs I want to attach and they are already aligned correctly and have a portal between them, what code do I need to use to link the portal's left handle to the sectr on the left at runtime?

    I searched the documentation for the code but it didn't seem very through.

    Once the two sectrs are attached then the stream addon could be responsible for turning each sectr off and on again as the player moves about (presumably they are stored in some type of pooling system to avoid gc from constant deleting and instantiating).

    And of course the audio system will need to know where sectrs are located on the map so it can start playing sounds when the new sectrs are instantiated initially or loaded via stream.

    Presumably the core code keeps a map/graph/tree of how each sectr is linked and this info is used by stream and audio to decide what to do with these rooms/sounds. After instantiating the room the very first time and linking it to it's neighbour do I then need to call something to update the core map, or will this be done automatically when the sectrs are linked?

    Again, I did search all of the documentation but could not see any info on this..
     
    Last edited: Jan 11, 2017
  6. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    105
    Hi im using DunGen to generate my levels, but my levels are from a top view like isometic perspective, does this package works with this type of games also?
     
  7. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,855
    IMO, SECTR should work fine. You might have different considerations to make when setting it up (as anyone would, since all projects are a little different). Where there might be a tricky part is where SECTR:VIS integrates with DunGen, and you'd have to see if that works out of the box the way you want it to, or if you need to make some sort of change. But that's within the realm of customization that everyone would have to do for their own game / look.

    SECTR is mainly a convenient way of streaming additive scenes, so you don't have to have all your assets loaded into the scene at the same time. You get audio and OC features along with that if you buy the full kit.

    If you have a specific situation that you're concerned about, give a bit more detail. But there's nothing conceptually that I can think of that would prevent SECTR from working for you, as you could use it for a 2D game, sectors could contain just UI or just audio or just data ... it's really just a handy and helpful way of implementing additive scenes, so pretty much whatever you could do with additive scenes, you can do with SECTR.
     
  8. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    105
    Grea! thanks a lot, will be my next buy, will report back if i encounter any problem.
     
  9. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,855
    Just so you know, I'm not the SECTR dev. If you want an official opinion on it, hold off till @MakeCodeNow responds. ;)
     
  10. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Sorry for the slow reply, but you just need to set the FrontSector and BackSector properties in the portal. That's it!
     
  11. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Your answer is spot on. Thanks!
     
  12. Cereal_Killa

    Cereal_Killa

    Joined:
    Oct 20, 2013
    Posts:
    204

    Great (and I managed to track down the API too), so if all my sectr prefabs are as above with a portal connected to the top and left sides with each portal connected to it's parent sectr via the back of the portal (so each portal is essentially facing to the top or left and is saved as a part of the prefab), after instantiating an adjacent sectr prefab for the very first time via my own procedural gen script to the left (for example) I will just need to connect the front of the existing portal (on the left of the existing sectr) to the new sectr that was generated on the left with:
    Code (CSharp):
    1. SECTR_Sector FrontSector [get, set]
    2.  
    In this case I would need to pass the newly generated sectr to the set method of the left portal of the existing sectr.
    And from then onward sectr stream would be able to load and unload the required sectrs as the player moves about depending on the sectrs to load value.


    Also, is it possible to use:
    Code (CSharp):
    1. SECTR_Sector LeftTerrain
    Or is the terrain code only for unity terrains and not to be used for prefabs?

    Thanks!


    Also, as a seperate question, if I want to have a teleporter sectr, for each teleporter sectr discovered by the player, after instantiating and connecting the relevant portals to neighbouring sectrs, would I be right in assuming I also just need to add this sectr to the grouploader:
    Code (CSharp):
    1. class SECTR_GroupLoader
    Which, when the player is in this room, will load all of the teleporter rooms as well as the number of adjacent rooms as defined by sectrs to load.
    So when the player steps through the teleporter and selects their destination it will already be loaded even if it is miles away.
    If I have too many teleporters this could be problematic so I may need to limit a max of 2 teleporters that can be linked to each other.


    And finally, the last question: If we have a really large world, does sectr stream update the world coords of the current sectr to 0,0,0 every so often (similar to other assets like worldstreamer), to prevent floating point errors when the player navigates too far from their spawn location? (presuming that the spawn is at 0,0,0)
     
    Last edited: Feb 1, 2017
  13. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    It sounds like you're generally using the API correctly. You can set the Left/Right/Top/Bottom terrain but then you need to call SECTR_Sector.ConnectTerrainNeighbors() which will then make the Unity API calls necessary to fix up the seams.

    I don't totally understand your teleporter use case, but you can definitely use a GroupLoader to associate rooms that aren't physically adjacent. Just make sure to manage your unloads properly. In SECTR you can also code up your own Loader subclasses, and it might be worth your time to write a TeleporterLoader class or some such.

    PS - SECTR does not do coordinate recentering.
     
    Cereal_Killa likes this.
  14. Zymes

    Zymes

    Joined:
    Feb 8, 2017
    Posts:
    106
    How does this work with a massive open world. Say I have a terrain that is 10x10 km. I do not want to load all that obviously, but I still want the player to see mountains far away in the background, but do not want to load all the game objects that are more than 1 km away. Such as trees, animals and other stuff they can't see.

    How can this be done?
     
  15. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    SECTR has a Mesh Proxy feature, so you can build a custom very low poly/simple mesh for each grid of the terrain and tell SECTR to show that when the grid cell is unloaded (e.g. the player is far away).
     
  16. henriqueam

    henriqueam

    Joined:
    Mar 30, 2017
    Posts:
    13
    Hello, how would I go about to implement Sectr Vis with an isometric game where the camera is way high in a distance?
    Thank you
     
  17. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    You can enable simple culling in the culling camera. That will do an basic frustum vs sector AABB test, which can be a nice win in isometric games as long as you have a reasonable set of sectors.
     
  18. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    276
    Sorry, newbie questions from a new buyer (delighted to get COMPLETE on sale)...

    I'm trying to get my head around the difference between the DoorStream and the CompleteWorld demos. The first asked me to 'Export All' but the other didn't. Is it because the CompleteWorld demo isn't streaming? (it looks like it is but I can't find the Chunks folder, is it just using the VIZ culling?)

    Also, having done the Export for streaming, how do I go about continuing to work on my level when everything is in different scenes (the Chunks) Is there a recommended workflow for this? From what I can work out, Import reloads the chunk(s) and Revert hides them again. But when should I click Export rather than Revert? Is it after I've made any changes?

    It would be really good to have a few more video tutorials - the quick start ones are good but very basic. The docs are useful but cover high-level concepts. Some real-world examples would be ideal, especially ones that tie in some of the other SECTR components. Some ideas:
    - how to handle a player teleporting to a different part of the map,
    - a walkthrough of setting up lightmaps (I can't work out if I should create a single lightmap before chunking, or 'Lightmap all sectors' after the export.)
    - using hibernators (and/or relying on VIZ culling?) to handle particles and fog (i.e. ideally a tutorial that explains how STREAM and VIZ relate to each other)
     
    boysenberry likes this.
  19. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I'm away from my computer but here's the basics...

    The open world scene is, I think, already exported. Generally speaking you need to export yourself before running, so door steam is more representative.

    After you export, simply import the pieces you want to work on, make changes, then expert again. Reverting discards any changes you made.

    With most loaders, teleporting should just work.

    The manual has instructions on lightmaps, but you export all then press the button for 5.x.

    Particles can be streamed or culled or both. You can use stream or vis or both together, though if your game is amenable to streaming, sometimes culling doesn't help that much.
     
  20. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    276
    Thanks, that makes some sense.
    From what I can work out CompleteWorld demo isn't meant to be streamed. I tried exporting all and it broke everything.

    I did read the manual(s) but still a little unclear whether the lightmap is best done pre-export, or as you suggest post-export ('Lightmap all sectors') Or, for example if I'm converting an already lightmapped scene should I re-build after export?

    As I said, some additional video walk-throughs would be supper useful :)

    Thanks for a great asset.
     
  21. voncarp

    voncarp

    Joined:
    Jan 3, 2012
    Posts:
    167
    Is there a way to find out what current sectr an object is in?
     
  22. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    When you say CompleteWorld, there is OpenWorld in the Demos/Complete folder and CompleteScene in the Demos/Complete folder. Both should work fine w/ streaming once they are exported. Which one is causing problems for you?

    Regarding lightmapping, in Unity 5 it's post-export.
     
  23. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yes. The SECTR_Member component has a Sectors property which will return the list of Sectors that GameObject is in.
     
    voncarp likes this.
  24. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,489
    What happens to game objects that aren't included in sectors? Will they just always render no matter where the camera is or are they culled from the scene?
     
  25. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Generally speaking SECTR will ignore any objects that are not a child of a sector or member component. It's kind of a "first, do no harm" design.
     
    magique likes this.
  26. Mathy

    Mathy

    Joined:
    Jan 19, 2013
    Posts:
    1
    Hi,

    I want to do "wow, it's bigger on the inside!" kind of rooms. More specifically, I want to be able to place two doors right next to each other that both lead to each their separate rooms - rooms so big they would overlap in reality. Is this possible?

    If not, I'm thinking of doing a small transition room behind each door, in which I teleport the player to an identical transition room (without the player noticing they've been teleported). The identical room could then be placed far enough away from everything that the size of the room it leads to wouldn't matter and the illusion would work. But my problem is then, that I would either 1) need both the transition room and its clone to be in the same Sectr scene, or 2) have the cloned transition room be in a separate Sectr scene (maybe together with the room it leads to), but then how do I get a reference to it from the previous Sectr scene so I can properly teleport the player to it? I'd prefer solution 2, but I'm not sure how to do it elegantly...

    I hope it makes sense...
     
  27. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Hi, good question. This is actually pretty tricky, though an invisible teleport like you describe is the most common way to do it.

    Assuming you are using SECTR Stream, I encourage you to take a look at the Group Loader. This will allow you to link Sectors together so that when one loads the other loads, even if they aren't next to one another in space. You could also write your own Loader component if you wanted more custom behavior.

    In the case of SECTR VIS, there isn't really support for this pattern and you'd have to modify source if you wanted culling to cross over the gap.

    In both cases, the teleport should be fine as the system is designed to such that small movements and large movements should both work fine.
     
  28. AlteredPlanet

    AlteredPlanet

    Joined:
    Aug 12, 2013
    Posts:
    430
    Hi,

    you keep updating the package 1.3.3 ,1.3.2

    but the release notes are the same, whats going on with that?
     
  29. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Minor updates are small bug fixes.
     
  30. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    293
    Hi, thanks for great systems. I have 2 questions.

    1. I use occluders, if set "Auto Orient" to None, it does not work ( as much as I can see in cam ). However if set to any axis, XZ, XY, etc.. it works. Why would "None" options does not work ? I have a building and I need occluder to be stable.

    2. About occluders performance, what kind of calculations goes behind occluders. Is it bad to use many occluders ? When I use them my avg vertex/tris in scene goes half, also draw call lessen around %40-50, it is great, however script ms goes abit higher. Would you suggest many occluders or not in a open scene ?

    Regards.
     
  31. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Good questions.

    1) Occluders in SECTR intentionally only work from one side, kind of like polygons with back face culling. The auto orient settings guarantee that side (mostly) faces the camera. Occluders still work without auto orient, just from fewer angles.

    2) With culling in general you need to make sure that the CPU spent doing extra culling is more than offset by the amount of stuff culled. Occluders are some of the more expensive culling primitives in SECTR, so while they are powerful I'd generally recommend you use them judiciously.
     
    MoribitoMT likes this.
  32. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    125
    Last edited: Aug 4, 2017
  33. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    378
    You don't seem to have a thread for "Core" so i'm just going to post this here.

    I was hopeful when I saw there was a new release today for Core, because I just started using it 2 days ago and there was one bug annoying me. But it seems this new 1.3.4 didn't fix it. So i'll just point to this here:



    For some reason the package uses white text on the white button backgrounds, making it pretty much unreadable. This is in Unity 2017.1. Hopefully at some point it can be fixed.
     
  34. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Thanks for the bug report. That's a dumb styling bug that must have broken in 2017.1. I'll take a look at a fix soon.
     
    syscrusher likes this.
  35. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    337
    Question before I buy the complete package: can SECTR Audio be used to simulate volumetric ocean sounds being occluded by the terrain itself, in addition to distance from the closest points (not point, points) of the shore?
     
  36. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yes. SECTR supports a variety of volumetric sources (including spline which is great for coastlines) as well as raycast based occlusion (which works with terrains).
     
    syscrusher and PeterB like this.
  37. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I have a fix for this now and it'll be in the next update. If you want to fix it yourself, just open SECR_PortalEdtior.cs and remove the lines that set some textColor's to white.
     
    syscrusher and ceebeee like this.
  38. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    378
    Thanks. :)
     
  39. BluetheFox

    BluetheFox

    Joined:
    Sep 11, 2016
    Posts:
    8
    I can not for the life of me figure out how to open a door. i looked at the demo scenes and there are no triggers that i can find or anything- the doors seem to just open by themselves without any way of knowing that the player is aproaching.

    so can sombody answer this probably quite dumb question:

    how to i get a door to work?
     
  40. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    If you open the DoorStreamer demo scene and select any loading door object, you'll see a BoxCollider with IsTrigger set to true, so yes, there are triggers. It's also important that the triggers be set to the right layer for the player (and probably not for other entities in the scene).
     
  41. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    328
    Good afternoon. I switched to the beta version of unity. This had to be done for the needs of the project. When creating a build, there are 2 errors. How to solve them? I look forward to hear from you.
     

    Attached Files:

    • 77.jpg
      77.jpg
      File size:
      318.3 KB
      Views:
      315
  42. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Betas are not supported because this kind of breakage is common. I suggest you comment out those lines or replace them with the equivalent API in 2017.3.
     
  43. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    328
    That helped. its OK now
     
  44. BluetheFox

    BluetheFox

    Joined:
    Sep 11, 2016
    Posts:
    8
    need some help with an issue- i am using asynchronous scene loading in the script i made for level transitions. Each level in my game has a separate scene, and each scene has a sector defined in it for the purpose of culling things for optimization. the issue is that the sectr of the previous level never unloads, resulting in it buggily merging with the next scene. i've figured out that something is causing the sectr to become a "dontdestroyonload" on runtime. how do i adjust it so this doesnt happen?
     
  45. BluetheFox

    BluetheFox

    Joined:
    Sep 11, 2016
    Posts:
    8

    EDIT: fixed it myself. the solution was to move all the stuff that has a dontdestroyonload to be outside of the sector game object.
     
    hopeful likes this.
  46. BV123

    BV123

    Joined:
    Dec 7, 2016
    Posts:
    33
    Hi, I'm hoping someone can help me with this. I keep getting this error in the console when I install SECTR Complete in a clean project in Unity 2017.2.0f3. It keeps endlessly repeating 999+ times unless I'm connected to the internet first.

    XmlException: Document element did not appear. Line 1, position 1.
    Mono.Xml2.XmlTextReader.Read ()
    System.Xml.XmlTextReader.Read ()
    System.Xml.XmlReader.MoveToContent ()
    Mono.GeneratedSerializers.Literal.GeneratedReader.ReadRoot_IntroData ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader)

    SECTR Complete seems to be functioning properly and I can use it and build projects but I can't seem to get this error to stop.
     
    GamerPET likes this.
  47. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    158
    Had the exact same error; thanks for pointing out that it was internet related - it helped narrowing to the issue.

    Goto SECTR_IntroWindow.cs file, and comment out code in static SECTR_IntroWindow().. it should look like following.

    static SECTR_IntroWindow()
    {
    //EditorApplication.update += InitSequence;
    }

    That's it; no more spam.
     
    BV123 likes this.
  48. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Glad you figured it out. That is in fact the correct fix :)
     
  49. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Sorry you ran into this. The bug will be fixed in the next SECTR update, but until then ranaUK's workaround is fine.
     
    BV123 likes this.
  50. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    293
    Hi,

    I have this occluder problem. I want set multiple occluders around my city to reduce draw meshes behind the buildings. I want occluders to be static and not auto rotating.

    You can see example in below. If I chose auto orient to "NONE ", occluder stops working, behind objects drawen. I want it to stay as it is. If I choose any oritent, occluder starts working again.

    Is this a bug ?

    Regards

    Occluder auto oritent: None
    Screen Shot 2017-10-23 at 13.11.45.png

    Occluder auto oritent: any orient
    Screen Shot 2017-10-23 at 13.07.21.png
    Screen Shot 2017-10-23 at 13.06.52.png