I am making a game in pygame, and would like to add infinite World generation. I already have implemented the drawing mechanism, and the randomGen method, which I will list here. I am wondering if there is a way to do infinite world generation.
Absolutely. Python doesn't have a built-in upper limit on memory, so you could just use a seed to calculate points on the world and commit them to memory -- maybe in a dict. Then, you'd just need to store any changes separately. When you save the gamestate, you'd actually only need to save the changes, and the original seed.
First, create the level manually, as if you were to create it for the entire world, but only go a few chunks out in each direction.
Second, look at the objects/entities that are actually in the overall level, controlling loading.
Third, set up a function on your own that creates more of those when needed, and removes those that are no longer needed.
I am using the lastest version (1.0.8), and the windows for creating a world does not show the option to select infinite or old world and so an old world is created every time - and yes I have scrolled to the bottom on the windows. I cannot find anyone complaining of this issue. Can someone please help?
In fantasy works, it can be interesting to imagine an infinite world. It means you can travel in any direction for as long as you want, always discovering new lands, new cultures, new landscape, etc.
It is clear that given all that, the world can not be flat, because if it was, the sun would never disappear behind the horizon. It is possible to give some kind of curvature to the world to avoid this, but then the question of seasons arise.
If you are okay with breaking every laws of physics, simply get rid of euclidean geometry and get "overlapping" space. Your world can be the size and shape of Earth. You start on point 0, walk to East, at some point if you trust stars and such you are back at your starting point, but in fact you got to a second point, overlapping with point 0.
"Infinite" is really a big, big word. If you want to keep any semblanceof physics, consider a world that is finite, just really big. Even a mundane Niven ring is big enough for all practical purposes - at 1AU radius, to walk around it would take about 20 thousand years of nonstop walking (and that still leaves several Earth worth of width unexplored). And there are bigger structures possible - an Alderson disk is much, much bigger and if the Sun is made "bobbing" through the hole, you'll have reasonable day/night cycle, and with some rotation, you'll have seasons. And you can make Niven ring or Alderson disk around Betelgeuse or a quasar for (much) more habitable space.
Another possibility - the world is an infinite sheet, with a hole in it through which the sun passes back and forth. This also gives you a reason for different societies affected by the temperature at different distances from the sun-gap.
This also adds some additional interesting elements into the world, since there has to be, by necessity, regions on this infinite plane that obtain close to zero sunshine (the dark zones). These zones may be inhabited by different creatures.
The fraction of the world which is habitable is infinite. - This is kind of trivial, since as long as the percentage of habitable surface is nonzero, the total habitable surface would also be infinite.
The habitable surface is essentially along the convex side of a parabola. This can either be just a parabolic ribbon, or preferably along the center of a hyperbolic paraboloid (See the second image at wikipedia, or this image, in which the habitable area is on the upper side of the red arrow), just because I think infinitely tall mountain ranges would be a cool bonus feature.
As you suggested, there are multiple suns (actually infinitely) that pass over the land in a slightly wider parabola. The suns move most slowly at the apex, and move faster and faster at the extremes, so that creatures living on the apex of the parabola experience normal Earth-like days with one Sun which rises and sets, whereas creatures living in the extremes experience "days" that approach an infinitesimally short over-head passage of the sun - with the leading side of the parabola instead having the infinitely many approaching suns placing it in an eternal dawn, and the trailing side of the parabola having the infinitely many receding suns placing it in an eternal dusk.
This would be an excellent discovery - one could start out in an Earth-like world, and as they travel further "West" (toward the setting sun) the days grow shorter and shorter and the dusk longer and longer until at one point they see for the first time a sun rising while one is still setting. Eventually they reach a land of eternal dusk that stretches on forever... an excellent place for vampires and the like.
Consider more dimensions. For simplicity, let's assume the planet is a five dimensional hypersphere (there are some good reasons why the number of spatial dimensions has to be odd). The hypersurface is a 4D closed hyperspace. There are 3-dimensional cracks (or just boundaries between geological objects) on the surface, just hairline thick (or maybe planck length wide). Each of these cracks hosts 3-dimensional beings that somehow got into this world, and they are quite unaware of their universe (at least until they start building modern physics theories). The seepage of 5D photons and energy into the 3D subworld could provide some truly fantastic possibilities, there is a lot of 3D subvolume, especially if the cracks are fractal like, and if you somehow manage to cross the extra dimensions, you can get into neighbouring world (which might be just millimetres away in any of the two remaining axis). Yes, this gives extra planes of existence on a scientific basis.
If you want to eliminate the "where did they come from" aspect you could say it's a geometric ray rather than line (only expending infinitely in one direction) and at the top of the world there's a super star or star forge type of thing that spits these out.
This cylinder could be orbiting around a cylinder star; if your world's axis tilt slowly back and forward that could give you seasons, but the more you go in one extremity or the other, the more extreme the seasons will be (in both case, your distance to the cylinder star would close to infinity).
Another options would be to have an infinity of small stars orbiting around your cylinder. That would have more possible variations for seasons as you may have them orbiting on an ellipse (a little like comets around our sun), but not be synchronized with each other. Also their distances, sizes, and orbiting speed can vary, which would allow you to have areas with different day length or seasons cycles (you could travel for a few thousands km on a cold/arctic world, then arrive in a tempered or tropical area, etc...).
Here, we have things like a constant speed of light. There, why not the appearance of a constant angle to the "sun", regardless of ones position on the plane? It seems as if light rains down from an infinite-distant source, being parallel rays. But there is no source: it's a field of radiation as infinite as the world. An observer with eyes or photographic equipment would image a point at some specific angle, like an infinite-far star, that moves over the course of a day. But there is no star; just incoming radiation that's always in transit.
That is, imagine a spherical planet that goes around its sun much like our Earth does, but imagine the people living on its surface are infinitesimally small. Then for them the surface they are on is infinite, but up in the sky they can see the sun (and, if you wish, moon, stars, other planets etc.) behaving in just the same way that we see on Earth.
This world is quite different from ours, not just in terms of physics but also in terms of mathematics. There are mathematical systems in which the concept of "infinitesimal" makes sense, such as the hyperreal numbers and the surreal numbers, but it is not currently thought that these are relevant to the physics in our universe. (At least, not as far as I know.) But for a fantasy world I think it could make sense.
If you don't like nonstandard analysis, you can approach this in a more "classical" way by taking the limit of larger and larger planets. That is, suppose you can create a planet and star as big as you like, while adjusting the laws of physics so that normal-sized people can still live on its surface. (Gravity will have to become weaker, obviously, and the speed of light will have to become faster if you don't want the planet's orbit to be relativistic.) Then imagine a sequence of larger and larger planets, and by taking the limit of this sequence you can consider a planet of infinite size.
As Radovan Garabik said, you don't really need infinite so long as it's bigger than you can travel in a lifetime. So long as you are limited to low tech transport that means structures at star-system scales are big enough.
Now, a sun moving above the plane at constant height will eventually disappear behind the horizon, not due to curvature but due to gravitational lens effect. Thus, the world needs an infinite stream of suns, spaced at suitable intervals and moving at suitable speed to provide a day cycle. The path taken by the suns can vary between times of the year to provide seasons.
If I was to make an infinite world in an imaginary realm there would be no singular sun. Imagine a blanket of star, similar to our own sky, but with more color variation. Now imagine these "stars" grow and fade in brightness (each in their own rhythm). Some might brighten to the point of a typical sunny day but fade back within minutes. They could flare to brilliance almost instantly or slowly like a dawn. They could fade to pricks of light of vanish completely. They could be different sizes, colors, intensities and positions. Of course there is nothing to say only one would grow bright at a given time. You might have 2, 3 or even a dozen producing light at a given time.
aa06259810