Hi,
I am developing a turn-based strategy game in JavaFX and I’m having performance issues when loading 60+ PNG images (each image min 300 x 300px) that represent provinces. The idea behind map generation is to use a static overall map shape and the shape of its provinces. But each province would be represented by one of four images, representing a different terrain type. Thus each time a player would start a new game the map would be changed. Also, during gameplay, province images would be changed to represent seasons change.
So, my initial idea was to have at least 60 provinces (preferably up to 100) where each province would have 4 type images and 4 seasonal images. I know … A LOT of images.
The problem I’m having is when I load more than 50 images, zooming, scrolling, and button responsiveness starts to lag on iMac. On Windows laptop, I get serious lag even with less than 30 images.
I’ve searched a lot on the internet on how to approach the programming of an image-based world map, but without success. All I could find is either hex approach or HOI or EU style approach. For now, I would like to stick with my idea of using images, so if anyone can help me solve this performance issue I would be much grateful. Or, if anyone has another idea of ho can I generate a dynamic world with provinces that can graphically change.
Also, I would like to program this myself without using game engines like Unity.
The thing is I don’t really have a much understanding of how each image and it’s size affects memory usage, so I’m basically doing a trial&error approach. And right now I’m stuck on “errors”.
Sincere thanks for all your goodwill and help!
Rach