.
Results 1 to 7 of 7

Thread: A question on asynchronous route streaming

  1. #1
    Join Date
    Nov 2006
    Location
    Canberra, ACT, Australia
    Posts
    7,835
    Blog Entries
    30
     

    Default A question on asynchronous route streaming

    I have a question given to me in the Content Creation Discord channel.

    quote
    So the wiki mentions that Objects nearby a train are made resident as soon as possible.and that Objects requested by scripts are made resident when possible, up to certain throughput limits.Can we get some numbers on this, when objects nearby a train get loaded and what the request limit for manual loading is?

    would be interesting to know in order to design scripts with this in mind that I can make sure I don't hit the limits or if something already activates far enough from trains to be used

    end quote

    I know the quote is from this WiKi page but cannot answer the question myself.



    Paul


  2. #2
    Join Date
    Nov 2006
    Location
    Australia, QLD, Brisbane
    Posts
    6,994
     

    Default

    Quote Originally Posted by pcas1986 View Post
    Can we get some numbers on this, when objects nearby a train get loaded and what the request limit for manual loading is?
    No. It's build-specific, and the exact numbers shouldn't matter if you're coding properly. The game streams in things as they are requested, so preloading really only affects access latency, not the final result.

    In terms of limits, the main point is "if you abuse the system by trying to load everything on the route, expect to be slowed or even have your requests delayed indefinitely". For normal usage (ie. occasionally loading a few tiles while searching along a track) you can expect not to hit any limits. Again, it's build- and situation- specific as to what limits might be applied.

    chris

  3. #3
    Join Date
    Nov 2006
    Location
    Canberra, ACT, Australia
    Posts
    7,835
    Blog Entries
    30
     

    Default

    Thanks Chris. I'll pass it on.

    Paul


  4. #4
    Join Date
    May 2008
    Location
    Germany, Nordrhein Westfalen, Moenchengladbach
    Posts
    126
     

    Default

    I would revive this topic on Route Streaming

    In many cases I have a group of objects on the route that work together:
    My workflow in script is:
    1. Storing GameObjectIDs in the object's properties
    2. Loading GameObjectIDs from the object's properties
    3. Try loading them first by "Router.GetGameObject", if not succeeded loading it aynchronously.

    And here is the point: it may take some time to load the objects, but in most cases I just need to know, if the given GameObjectIDs are still valid on this route (e.g. the corresponding GameObjects has been deleted in Surveyor). I found no other way to check this than to load the objects and wait for the results.
    I'd like to load them when I really need them, not for only checking if they could be loaded.

    I can't imagine that Trainz won't know if a GameObjectID is still valid (or in other words: if it is loadable) even when it's currently not loaded.
    I think I missed something

  5. #5
    Join Date
    Nov 2006
    Location
    Australia, QLD, Brisbane
    Posts
    6,994
     

    Default

    Quote Originally Posted by callavsg View Post
    And here is the point: it may take some time to load the objects, but in most cases I just need to know, if the given GameObjectIDs are still valid on this route (e.g. the corresponding GameObjects has been deleted in Surveyor). I found no other way to check this than to load the objects and wait for the results.
    Yep, that's the only way. Trainz has no way of knowing in advance whether the object exists. The whole point of the GameObjectID system is that trainz doesn't need to have the object, or any related parts of the world, loaded in order to refer to the object. When you want to start querying data, you'll have to go ahead and resolve that to a real object.

    We obviously don't recommend loading large chunks of the route just to check whether they've gone away; the answer is almost always "no" so you should work with that assumption until the issue becomes critical.

    chris

  6. #6
    Join Date
    May 2008
    Location
    Germany, Nordrhein Westfalen, Moenchengladbach
    Posts
    126
     

    Default

    Thanks for your reply!
    Then i'll discard any error handling until I need to load my objects

    Another question is:
    Sniffing for Messages on a GameObjectID doesn't require the object to be loaded, is that assumption correct? The hints on that method don't say anything about it's functionallity for loaded/unloaded objects.
    Last edited by callavsg; May 22nd, 2019 at 07:34 AM.

  7. #7
    Join Date
    Nov 2006
    Location
    Australia, QLD, Brisbane
    Posts
    6,994
     

    Default

    Quote Originally Posted by callavsg View Post
    Sniffing for Messages on a GameObjectID doesn't require the object to be loaded, is that assumption correct? The hints on that method don't say anything about it's functionallity for loaded/unloaded objects.
    Correct.

    You can think of these functions as automatically sniffing the object when it becomes loaded, and unsniffing it immediately prior to unloading. It's not possible to post a message to an unloaded object.

    chris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •