What goes into the pre-load and cache?

Discussion in 'Card Hunter General Chat' started by Deepweed, Mar 24, 2016.

  1. Deepweed

    Deepweed Thaumaturge

    I wonder, what files are included when the games loads? I play on Kongregate, and it seems that every board is downloaded at the start of each game. The item art and game sound seem to be downloaded only on-demand, too. So what exactly goes into the cache?

    I was wondering if the case was the same whether I was playing on Kongregate or on Steam. I might just move to Steam if the game's image and sound files are stored in the computer there.
     
  2. Kalin

    Kalin Begat G'zok

    Steam stores the images and sounds locally. It does not store boards, monsters, or your inventory.
     
  3. Obernoob

    Obernoob Hydra

    It would be nice if the adventures would be stored in the cache. But playing one adventure again and again is not the most common use case.
     
  4. Kalin

    Kalin Begat G'zok

    Performance-wise, the big thing would be caching your inventory. For us collectors, loading that can take longer than the battle itself. Note that the code already knows how to handle things when the server and the client disagree about what you own (the server wins).
     
    DupleX likes this.
  5. Galvatron

    Galvatron Orc Soldier

    Does it basically mean that steam version can perform better than browser one? Did anyone ever compare it (performance wise)?
     
  6. Farbs

    Farbs Blue Manchu Staff Member

    The browser version should theoretically cache these assets too, just like it does for any images etc that you load via your browser. In reality the effectiveness of this varies by browser, OS, and phase of the moon.
     
  7. Galvatron

    Galvatron Orc Soldier

    If I remember well, more than year ago I was using Chrome Pepper Flash player and it performed best for Card Hunter. But right now I can't use Chrome anymore, so I am down to Adobe ActiveX/NPAPI Flash version. Both do almost same, but both definitely download everything each time I access any shop. As for browsers I've tried many IE9/Gecko based ones but differences are minor. Hence I wonder should I try steam client.
     
  8. Obernoob

    Obernoob Hydra

    Maybe I should try some other browsers.

    With Firefox in Windows 7 Against the Cockroaches takes currently 18 seconds to load, which is more time, than I need to finish the first map. After restarting the browser it only takes 7.5 seconds till the first screen, which is reproducible. So at least the map itself does not go into the cache. Rather it takes more time to load the longer I have been playing.
    With Firefox in Windows 10 Against the Cockroaches needs 6.5 seconds to load. Edge in Windows 10 also need 6.5 seconds.
    Firefox in Lubuntu does not start Cardhunter, but I doubt it will be faster, since it is an old machine.

    Interestingly it takes also 7.5 seconds after clicking the onward button. Guess at that point the client loads the next adventure.

    It would be great to have a replay button for the first adventure, which would keep the first and second adventure in the cache. This would also release the stress after abandoning the adventure, in order to prevent another adventure to load.

    Fun fact is it even takes 9.5 to load Sharl's Seconds. Maybe the time above is needed to load the collection and not for loading the adventure? The other shops need only around 8 seconds to load.
     
    Last edited: Apr 2, 2016
  9. Galvatron

    Galvatron Orc Soldier

    The question is, is it flash or browser caching causing slowdowns. If cache, and you have enough RAM you can try making RAMDisk and running browser from it.
     
  10. Galvatron

    Galvatron Orc Soldier

    I have downloaded portable version of old Firefox and configured it to download all cache to disk, not to remove cache at all and also preffer to load things from cache over loading things from web. This did not really speed up anything much if at all, so I've decided to copy whole portable Firefox to RAM Disk that is at least 20 times faster than my hard disk. Apparently no noticeable differences, even when I checked that cached files are actually being accessed. Perhaps it's server that wants to update images every time or perhaps I configured something not how it should be?

    The size of a cache after watching my collection can grow to something beteween 64-128MB which is probably size of downloaded images and sounds.
     
    Obernoob likes this.
  11. Obernoob

    Obernoob Hydra

    Thanks for your experiments. I wish there was a way to speed up things.
     
    Magic Elves likes this.
  12. Galvatron

    Galvatron Orc Soldier

    After more testing I came to conclusion that while stuff is cached game redownloads all images and sounds every time, at least on my Firefox. When files are in cache for some reason Firefox/game(?) reads them but then rewrites those over and over again. I have tried Chrome/IE too but did not find any performance improvement.
     
  13. Galvatron

    Galvatron Orc Soldier

    Further observation led to conclusion that the only thing that recally gets cached is game main file that is around 20MB. Rest - graphics/sounds - gets loaded from server.
     
  14. Obernoob

    Obernoob Hydra

    That is unfortunate.
     
  15. Farbs

    Farbs Blue Manchu Staff Member

    Those assets can be cached by some browsers sometimes, and are definitely cached for the Steam client.
     
  16. Galvatron

    Galvatron Orc Soldier

    They are also cached by Firefox, at least with proper configuration. Someone might need to set cache size big enough as some Firefox builds are having too small cache (for example from what I know currently automated setting limits it to around 50MB dependant on version). Point is, even when cached it's not some blasting reduction of load times. On the other hand it does not affect gamplay so I don't believe it's relevant.
     
    Last edited: Apr 15, 2016

Share This Page