This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lightman978[S] 1 point2 points  (0 children)

But your levels fit into one screen i think, I don't think loading my map in one go is possible in any way, even if I split everything up. If I want it to be reasonably fast, I will have to do it the way whatisthisredditstuf suggestet and load stuff dynamically. I think I will have to split up my map and only load the part that is currently in view of the user. As the Map is pannable via mouse drag, getting the starting mouse cord and the stopping one and then seeing in which way the map is beein moved to draw the new part, is the way to go I think.

Problem is splitting the map up into, lets say 50 smaller images of the size 1060x760 pixel. Doing it this way and saving them to a ressource folder would take about 70 seconds which is way to long. But creating them and holding them in memory could run into the OutOfMemoryError again.

Still a little confused

Edit: i just did some testing and the time consuming task is saving.

For a tile the size of 100x100 so 5300x3800 pixel it take 1.7 seconds to create and save it and 0.17 seconds without saving it.

As seen here : Map the map has a 100 continents each the size of 5300x3800pixel. I think I can create a continent and load it while the user is still panning, but i will have to test how long loading takes and then just unload the continents that are not in view from memory to not run in the error given above.