In 2015, I set out to create a game using only Vanilla Java. Heavily inspired by the existing game Project Zomboid, it was a great challenge for me to create a game that runs smoothly and efficiently under these constraints.
To make the rendering engine efficient, I implemented cache-managers for individual chunk layers, tiles and sprites. This helped avoid excessive reading times. I also pre-rendered chunks in a spiral pattern around the player to help reduce lag when entering new ones. Furthermore, only chunks that have been changed are re-rendered.
I also implemented a system that generates worlds, as well as being able to load and save them.
Sped up 5x