|
Post by hypevosa on Aug 19, 2013 1:17:06 GMT -5
This thread is for suggesting ways to optimize GRID12 to ultimately make it less laggy and more enjoyable to play. Please list things you've noticed cause bad lag for you, and suggested fixes. Example:
Problem: Zooming in and out causes a severe lag spike for me as the game is having trouble loading all the red shapes, Xs, and towns fast enough from all the chaotic clearing and exploring.
Suggested Solution 1: Have teleporting to a player (i.e. /goto XXXXX or clicking on a yellow tank icon) zoom the player in to the point they can see all their field of view, skipping the loading and unloading of red shapes/towns/Xs and reducing chances of dying on teleport. Normal teleports to towns (/teleport) should leave you zoomed out so that you can easily choose your next town to teleport to, or a player.
Suggested Solution 2: Instead of creating Xs over top of red shapes, adding to the number of things to be rendered, perhaps we should just change the shape's color from red to yellow/orange to indicate it is a bordering structure. This should reduce the lag spikes considerably.
Suggested Solution 3: Do not Render red shapes until the player is within X distance of them as well - there is no purpose to rendering shapes so small they cannot be properly identified anyways, and this would also significantly decrease the number of things rendered, reducing lag.
|
|
|
Post by amitp on Aug 19, 2013 10:04:57 GMT -5
More technical suggested solutions to the problem you see: The network layer should measure the latency/lag and rate limit any non-critical messages (like the data for the zoomed-out map). If the map takes a while to load, that's ok. It should never feel laggy; it should feel crisp, but with some data popping in later. The client and server also need to work together to remember what data the client already has, what it has never gotten, and what's out of date. The graphics layer, in theory, should be able to render zoomed out maps. It's a bit of work but if infinite zooming is a key part of the game it is probably worth doing at some point. I built a proof of concept that renders a 4 billion pixel map (262,144 tile shapes). Try it and see if it feels smooth when zooming in and out. Grid12 has nowhere near 262,144 tile shapes when you zoom out so I am optimistic this technique would work reasonably well. However there are some artifacts in my proof of concept that would need to be cleaned up. Basically, this demo shows that the number of sprites doesn't matter if they're arranged in a grid, and if you're clever about drawing them (you don't want to draw them one at a time like Grid 12 does). It can probably support 16 million tiles but I haven't tried that.
|
|
|
Post by hypevosa on Aug 19, 2013 18:40:36 GMT -5
<3 amitp, using your proof of concept is interesting, I like the spinning circles when you zoom in enough.
If we can mimic that, it would certainly be alot better.
|
|
|
Post by hypevosa on Aug 23, 2013 19:05:30 GMT -5
I hope you don't mind, I'm bumping this, because I would like to play grid12 on my laptop again
|
|