I was working on my own procedural generator and finished making it. Here is how I did it, generate the entire world at the beginning, store info about spawn positions and tiles positions into arrays and data structures
Now obviously, I have to loop through all the arrays, to render/update stuff, this is creating problems, I tried dealing with this problem by applying a condition that if any object is visible, only then render update else don't, but it does not make much of a difference.
my TILE_SIZE is 1 world units
so when my world size was a)500 by 500,fps was 60 b)2000 by 2000, fps was 50 c)5000 by 5000 fps decreased further and so on
If only I could know how Terraria does it, or any way it done, would really help thanks.