I am working on a little 2D RTS engine and I am working my way up to dynamic world generation and "infinite" terrain. Currently I generate the world and split it into chunks I query via camera position. You can see how its split in this image.
Here you can see the aprin where chunks start to load in.
I was thinking I would store chunks in hash tables and dynamically size the hash table as I need more. The down side is I think that means I will have to recompute entry locations every time I resize the table. I am a little stuck how I will store and query the information in a sane way.
Another think is when I generate a tile and say I have not queried the tile next to it however the one next to it has something that extends into it, how do I handle that case? I was thinking I could tell tiles to generate much farther away than what the camera sees but that will have to extend as far as the max radius of whatever I am generating like a lake or a large biome.