Hi guys, what’s the fastest way to render a large amount of tiles onto the screen using Slick?
In my game I have huge worlds which, when zoomed out, means that there are hundreds of tiles on screen at any given time.
At first, I drew every tile at its location on every frame, and my frame rate dropped to 1 - 2 fps.
So I tried drawing only the tiles that are on the screen, and the game would only drop to 30fps when viewed on the furthest zoom level.
Lastly, I tried drawing all the tiles onto a buffer image, then drawing that buffer image to the screen every frame, however, the world size is too big to incorporate into a single image.
So I tried creating a buffer image for just the tiles on the screen, and I’d get a wait time of about 2 seconds at the beginning, but then everything ran smoothly.
What use will this be though, if I have to update the buffer image every time the player scrolls and more of the world is revealed? I was hoping to create just one big image of the world that I can move on the x/y axis when the player moves.
In the future, I plan to include a line of sight method to only draw the tiles in the player’s line of sight, so that will probably fix my problem, but does anyone have any tips on drawing many things on the screen at once?
Thanks for your help!