-
-
Notifications
You must be signed in to change notification settings - Fork 50
Tile retention #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Tile retention #260
Conversation
|
I think it is an achievement to come this far tho I have one bug report and a few concerns over this feature. The bug report is that your (0, 0) gets reset after flight (and same after VOG jump and teleport). The saved biome map should be cleared. And the concerns: 1) some players report frame rate drop when they zoom out, especially in "developed" area. This is because of the sprites count. Having to draw the biome of all these extra tiles will contribute to this problem. 2) It is mildly confusing as to whether an empty area is really empty or out-of-range since the range doesn't necessarily center on the character/or even rectangular at all. I can see a "mist of war" kind of grey overlay may mitigate this. I will keep this PR open and up to date to see what I can do with it. Thank you for the work! |
I put some clearing code into
Actually, I don't think this will be an issue. The blank tiles were also drawn each frame. I think the number of draw calls will be pretty similar in both cases though I haven't measured it nor know how to do it. Slow downs might appear due to looking for the correct chunk each frame (linear search in the array) but I think this operation is relatively fast.
Yeah, I agree with this.
The pleasure is mine. Being able to contribute to the game is great and rewarding. Thank you for your time testing and reviewing. |
|
I've hopefully fixed the flight bug. I don't know if the fix is good enough or not. As far as I tested, it resets the map after flights. |
|
If you have an initial idea of how the fog should work, maybe put it in first for testing and tweaking. There are a few more issues I noticed during my tests: |
|
Sometimes the edge of loaded area stops to blend in softly with the white background, but becomes a sharp edge, see the right-edge at the end of the video. 23.mp4Steps to reproduce:
|
|
While the fix for resetting the remembered tiles after flight works, it is also triggered in other cases in normal gameplay. I don't have a way to consistently reproduce it but only a way via VOG.
|
|
Performance-wise, the game becomes laggy as the number of remembered tiles grows. Please consider the improvement below. If I'm understanding it correctly, for each remembered tile, you are saving |
|
On the setting of eveStartingAge, there is already a |
|
Thank you for trying to solve such an annoying problem. It really bothered me those white things. However, I think maybe that's not the most efficient way to solve the problem. You propose a way for the game to remember the tiles the player saw, but only the biomes. As you are caring only about the biomes a change in the server code so it would be possible to send to the client a bigger portion of the biome wouldn't be more interesting? You'd still not load it, it would not load the objects or players (preserving server resources) and you could even keep the white effect as instead a transparent black overlay that darkens it to show that portion of the map is not actually loaded. |
Yes, I am aware. Remembering other things (like floors, which are quite similar) would require more changes from me, I just didn't bother to do it yet. I mentioned this in my original pr message.
No, I think a client-side solution is good enough. I just need to implement a hashmap storage instead of a vector. It'll be faster, I think.
I didn't understand this. I don't quite understand how the server would send the boimes but the client wouldn't load them. |
|
Avoiding a change to the protocol in this case would be preferred. If this feature is implemented, the client having to discover the regions would be sufficient. |
|
|
||
| delete [] mMap; | ||
| delete [] mMapBiomes; | ||
| for(int i = 0; i<mRememberedChunkCoordinates.size(); i++){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need a way to iterate through values of a HashTable. Didn't find anything appropriate in HashTable.h and didn't bother writing it myself. Ability to iterate could enable us to get rid of mRememberedChunkCoordinates.



Implements #259.
Changes include moving from constant mapBiomes consiting of mMapD * mMapD tiles to a SimpleVector of chunks each of which is of size mMapD * mMapD.
This PR only covers Biomes (and not objects or other things, not even floors which are quite similar). But still it greatly enhances immersion because it removes white noisy background and provides the game with a fog of unknownness of some sort (tiles are still white if the player didn't go there)
Also have in mind that I am not a C programmer and I may not know know best (or even better) practices or style.
I also didn't test changes of performance with these additions. My game didn't lag and the number of drawn tiles is probably the same as before (although there are some new calculations of chunk positions and linear lookup in the array)
Pics:

