Update: 2D Godot Tilemap Game with Non-Chunking, Seamless World of Millions of Tiles.
Вставка
- Опубліковано 16 жов 2024
- In this video, Eyesgood shares his findings on improving the performance of his Godot 2D game's tilemaps using an implementation that doesn't have chunking, yet can support map sizes of over a million tiles. Have a look and offer up your suggestions on making this implementation even faster!
Trying to do this same tile setup for my own project, looking forward to seeing you expand on its potential.
Hello. Thank you for your interest. I have found my solution, which is using a dictionary to store tile data and re-drawing the view when the player moves from one tile to another works the best for a turn-based scenario where physics is not being used to move the player from tile to tile. Godot 4.3 now has 2D physics interpolation, but I have not yet tried it to see if the jitter has been reduced or eliminated. But since I am not going in that direction now, please reply here if you have any success with that implementation.
@@Bound2bCoding I happen to stumble across it looking through your blog on the process and found it very helpful. I really enjoyed your posts covering your progress and found it helpful for less experienced programmer like myself.
Thanks for your help 😃
I am happy you found it helpful. I have set my blog aside for the time being so I can focus on my game and doing videos. Please feel free to follow along here on UA-cam. I will be publishing more frequently on both the progress of my game and my Godot instructional videos. Your feedback is always encouraged and appreciated. Thanks.
Why does the entire viewport have to be refreshed like that? Could you not just get the new tiles in the direction of player movement and delete the tiles opposite? I think you wouldn't lose 130-odd frames from zooming around the map if you were only refreshing the edges as opposed to the entire viewspace.
You are absolutely correct. It doesn't need to refresh everything. This video is a year ago and my code has definitely been refactored and improved. However, I have not changed that particular implementation for a few reasons. I have decided to make my game turn-based. I have also scaled down to region-based maps (250^2) so that I can have a world size that is hundreds of times larger than what you see in this video. Given these changes coupled with the raw speed of Godot 4, C#, my custom autotile system, and the use of C#8 dictionaries, I can render the entire viewport in a few milliseconds. Basically, I don't need to think about that inefficiency at this time. That is not to say I will not consider it in the future. But for now, I am very happy with the performance. Stay tuned. I will be doing a Region feature video and you will be able to see just how fast the rendering now is. Thanks for your comment!
i wonder if you can use the player in another window overlayed on the project (like a HUD) and simply run the proper animation on the sprite while the rest of the level renders. the position could remain static entirely or you could add a slight amount of offset to emulate motion. also possibly tween from one scene into the other view. slowly fade the one level in and fade the other out.
this project seems awesome. would you make a tutorial on how to index and render tiles this way? or provide some of your code for us to play with?
Thanks for the feedback. I will consider creating a tutorial.
+1
Hi there! I am also working on a project with tiles in pygame. And I encountered the same problem with stuttering. It is kind of still playable, and you can stop paying attention to that at some point but it is a little frustrating. I tried using perfect_counter but still not much has changed. Have you figured out the solution for this problem already? In my case I use for loops and add all that to a group
Hello. In comparing my Godot 3.x version with Godot 4.x, the stutter was hardly noticeable in the 3.x version. This led me to believe the problem has to do with physics interpolation. Godot 3 has it, but as of this post, Godot 4 does not. However, I am watching a post in which the devs are actively working to get physics interpolation into Godot 4 for 2D. I am hopeful it will be included in Godot 4.3 or sooner. When that feature gets added to Godot 4, I am also quite confident that stutter will be as unnoticeable as Godot 3. In fact, with the added speed of C#, performance should be much better. Thanks for your interest. Best wishes on your project.
Nice
Thank you. I should have an update soon on my Godot3 to Godot4 conversion.
my god
"trading" with the indians
well yeah people didn't just get there and nuke everything
make tutorial pls
Hello. Currently, I am migrating the project to Godot 4. This will include not just the engine upgrade, but I am also moving from GDScript to C# and from using resource files to using JSON files for data storage. Once this is done, I will seriously consider doing a tutorial. Thanks for your interest.
@@Bound2bCodingwaiting :D
Expect...