Performance - Store cache of the world for lower loading times
planned
Durdin
I have realize that the times between zones in VV always take the same time to load. No matter if you are entering a new zone, if you have entered it before or not.
Based on what other games with Real time does, even if they are not linked to the blockchain. Re-load the map each time is not a good approach. Even more for such a big game!
They use to have a local cache with how the world, graphics, and buildings look(maybe a huge JSON. I dont know how devs manage this at the moment).
Idea of steps to achieve this:
- Save the current map/buildings/data on cache when you log in. All the data possible that "may" not change.
- Add a timestamp to each map zone(arcadia, boreas...) which updates each time anyone saves/updates a new building.
- With that data we can compare the local stored data with the "last building modification". On that way you know if u need to download map again. if the map dont need an update you will save A LOT of time.
- This could be optimized a lot saving timestamp for each plot and compare all of them. It should not be hard to have a map of <Timestamp, Plot> and download individually only the updated plots data. Instead of all the map each time.
I dont know how this is approached right now. But If we would have an API that gives us something like
getPlotData(plotId)
I would see something like:- After log in, download only the timestamp of last modification of all the plots from the zone you are starting.
- Match them with the ones in cache, and remove the ones that match. On that way we have now the IDs of the plot which were mutated since we went online last time
- Download only those plots and update the world(to even better performance this could be done on background while the game is already running) Think about World of Warcraft. When you go to a huge new zone, the first time you see yourself and a lot of assets are missing or changing during the first seconds.
I have multiple ideas of how to achieve this. Feel free to reach me in Discord! Thanks for all your work!
Alexander Logunov
planned
Alexander Logunov
Good day, with regards to what you said, this problem is that the approach you mentioned will increased RAM usage, and for now locations are unloaded to the HDD instead, which means the loading time depends on the device you use. If user will use SSD it will drastically increase loading speed between locations.
Because of this we have decided not to use dynamic caching which you have mentioned. The approach you are suggesting in the computer science called as naive, because it is trading off resources for speed instead of real optimisation.
There are a way of modern approaches to resolve this issue which we are working on.
I wouldn't dive into details of the issue, but the one I would like to mention is if you cached the plot data and plot data changed, user will load old data instead of new now, and than he can report it as a bug. How often this should be updated?
There is much questions like this.
We are currently working on a better solution for this problem and this solution is planned to be delivered a bit later, because we need first to test things out.
With regards,
Vulcan Verse development team.
p.s In your case specifically you are trading networking traffic for optimisation, but what if data fetching will take more time, than loading or the connection isn't stable? How would you get the diff between states, because to compute it you need to share your chunk, which means all the users will spam their chunks to the server, or if you are gaining the data from server individually, it means you can simply replace it, comparison is not needed because the server is always right, which leads to excessing operations.
Durdin
Alexander Logunov: thanks for your answer Alexander!
Also thanks for point out the tech part from my idea. Im not a game developer, I just throw and idea about how I would do it on a conventional application for local cache. But an API painter app is not the same than a game.
Sorry if it sounded like "im trying to give u a lesson or this could be done better". I just pop a problem and though about an easy approach has an example. didnt wanted to sound rought or anything!
Thanks for your hard work and keep going!
Alexander Logunov
Durdin:
Thank you for the poiniting the issue as well, the reason of the detailed answer that I wanted to show that we aware of that specific issue and further posters can see details on it.
You haven't sounded like you have tried to lesson me, it is fine to exchange opinions with each other. The main goal is for a free space where everyone can share their opinion.
We are open to discuss and share opinions. The problem you have announced is highly relevant, so I hope everyone who has questions on loading speed can see our discussion and upvote this thread, so based on the votes priority of the issue will be increased.
With regards,
Alexander & Vulcan Verse development team.