Results 1 to 7 of 7

Thread: Caching does not work for objects with states

  1. #1

    Caching does not work for objects with states

    It seems that caching does not work for objects saved as states.

    I created a game that contains a "control panel" which is a custom board with buttons on it. It has two states for different pages / options and every time I switch them, the board has to reload the image (and strech itself to the correct aspect ratio) which is quite annoying.

    The first time I created the control panel it worked perfectly. When switching states it was instant for me but for a friend in the same server it had to load the custom board every time.

    Steps to reproduce:
    - Create an object with states using custom objects (stuff to load should be large enough to notice a delay)
    -> For you it should have either no delay/loading at all when changing the state or a very minimal one
    - Have someone else join your server and switch the states
    -> For this person it will need to load every time

    Often the problem even occurs for another player when they are present while the object with states is created.

    Remarks:
    My control panel does have buttons and scripting for each state but that does not seem to be the issue. We tried this also with some very simple objects (building cost card, buildings) and had the same problem.

    If you need any more information or a demonstration please let me know. I really like to have "pages" instead of one huge switchboard.


    OS: Win 7 64bit
    TTS Version: 7.4.1
    Last edited by Huffel; 06-07-2016 at 08:55 AM. Reason: forgot to add OS/version

  2. #2
    Join Date
    Jan 2014
    Posts
    985
    Did he have mod caching turned off in the configuration menu?

  3. #3
    Thanks for the quick response.
    No, it was turned on. We also tried it the other way around: my friend created an object with states using the exact same custom boards and I had the loading issue. And I have it turned on for sure.

  4. #4
    Join Date
    Apr 2016
    Posts
    174
    Are you referring to the non-host having to reload the table and not being able to complete the load with white loading text?

  5. #5
    No, the problem is not that the game is stuck loading something. I attached a screenshot of the problem:
    1) switch to page 2: it has to load the image
    2) switch back to page 1: it has to load the image
    3) switch to page 2 again: it has to load the image

    For me the loading period is less than a second but for others it is quite long. When I first created this panel switching states was absolutely instant.

    The problem should exist for everyone who uses the mod:
    http://steamcommunity.com/sharedfile.../?id=694025908

    My object contains scripts and I guess a simpler example would be better: I have found a game made by someone else that has a handbook with states where me and my friends have the same issue.
    http://steamcommunity.com/sharedfile.../?id=646356452
    (the handbook is in the large bag)


    Edit:
    Just saw that i totally forgot my OS and Version:
    OS: Win 7 64bit
    TTS Version: 7.4.1
    Attached Images Attached Images

  6. #6
    Join Date
    Mar 2016
    Posts
    182
    Not sure it helps resolve your problem, but in case it isn't clear, as you switch to each state it has to spawn a completely new object/collider (and apply UV and bumpmap images) each time. It's not just switching an image. That can make the lag between a local load (host) and a remote load (players) more significant.

  7. #7
    Hi dig,
    thanks for the response. Yes, I know that it is spawned as a new object but I still think that there is something broken with the caching since I know the game can do much better. When I tested this with a friend he created an object with the two custom boards as states. For him the response when changing was instant (as it was for me when I did it the first time). For me it had to load every time. He was so happy about the quick response that he switched back and forth very fast which nearly caused my client to freeze.
    So for him it was instant for me there was nearly a second delay when loading even though we both were in the server while he "merged" the objects.

    Edit:
    I did some more tests:
    While I have duplicates of the individual state objects present, the states work perfectly for me: I press two and the change is absolutely instant.
    When I delete the duplicates I have a minor load (less than a second) without the custom board changing aspect ratio.

    I thought I had my workaround but for a friend in my server the custom board still showed a white image and had to stretch itself to the proper aspect ratio every time she changed the states even with the duplicates around (with mod caching enabled).
    Last edited by Huffel; 06-09-2016 at 01:29 PM.

Posting Permissions

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