Original Post
Minecraft does this. While not technically infinite, the game starts by spawning all the visible 'tiles' (cubes), then spawning more as the player explores and as necessary. This approach starts good, then lags without optimization.
Viewing the challenge as an abstract 2D tile-map, one could use a similar method to fill one screen worth of generated tiles. If you attempt to load and render a much larger number than this, it will be slow and run out of resources; thus at any time, if a game has an infinitely large map, only a tiny portion of it may exist at any time.
One way to model an infitely large map is as a very abstract algorithim, that can generate and destroy tiles on command, both to keep the map globally consistent (base algorithim to determine locations), and also to allow an infinitely-long (sort of) algorithim to generate any piece of the map on demand, and track player interaction through the tile layer into the algorithim layer.
Note that the abstract algorithmic layer will not be 1:1 with infinity tiles, however with clever coding this will not matter and be very abstract....for example, if a road is between two cities, and there are many carts on the road, and the player is far away, does it really matter where the carts are? The resources will move around as though they are really there, and if the player goes near them they will be generated from the algorithim in random locations, under the butterfly effect should be the same as actually having all the carts on earth there at the same time, instead of abstractly modeling trade between cities quickly and invisibly, and only generate the cities & carts from the algorithim if the player is nearby and it is visible....
And also if the tiles and algorithim layers are "close" together programmatically, those tiles would be stored and tracked exactly, with more powerful computers tracking more tiles, and with a weak computer or inaccurate algorithim/tile storage/compression, the road will not be exactly the same route between two matching cities each time the player wanders off and comes back...while still being similar with a good algo, and also obeying the butterfly effect of dirt-cart roads shifting a bit....but the artifacts can creep in there, however this style might allow the plant->animal->human food chain game with a large enough map that can exist in 'tiny' computer resources.
Viewing the challenge as an abstract 2D tile-map, one could use a similar method to fill one screen worth of generated tiles. If you attempt to load and render a much larger number than this, it will be slow and run out of resources; thus at any time, if a game has an infinitely large map, only a tiny portion of it may exist at any time.
One way to model an infitely large map is as a very abstract algorithim, that can generate and destroy tiles on command, both to keep the map globally consistent (base algorithim to determine locations), and also to allow an infinitely-long (sort of) algorithim to generate any piece of the map on demand, and track player interaction through the tile layer into the algorithim layer.
Note that the abstract algorithmic layer will not be 1:1 with infinity tiles, however with clever coding this will not matter and be very abstract....for example, if a road is between two cities, and there are many carts on the road, and the player is far away, does it really matter where the carts are? The resources will move around as though they are really there, and if the player goes near them they will be generated from the algorithim in random locations, under the butterfly effect should be the same as actually having all the carts on earth there at the same time, instead of abstractly modeling trade between cities quickly and invisibly, and only generate the cities & carts from the algorithim if the player is nearby and it is visible....
And also if the tiles and algorithim layers are "close" together programmatically, those tiles would be stored and tracked exactly, with more powerful computers tracking more tiles, and with a weak computer or inaccurate algorithim/tile storage/compression, the road will not be exactly the same route between two matching cities each time the player wanders off and comes back...while still being similar with a good algo, and also obeying the butterfly effect of dirt-cart roads shifting a bit....but the artifacts can creep in there, however this style might allow the plant->animal->human food chain game with a large enough map that can exist in 'tiny' computer resources.