Comments (18)
i THINK it is how some one had planned to generate terrain ... but i dont think that it ever went any where.
from minecraft.
Terrain.py is a terrain generation algorithm. It uses 2D Perlin Noise to generate a random height map(Minecraft uses 3D Perlin Noise).
from minecraft.
I just tested the new terrain generation algorithm in terrain.py and now it seems to be able to generate some minecraft style terrains:)
from minecraft.
@Jimx-
from minecraft.
@Jimx- 👍 That is Awesome!
from minecraft.
@Jimx- How can I make this the default terrain generator?
from minecraft.
Consider this as a question from everyone :)
from minecraft.
Glad it is not just me :) I have been trying to figure out how to make this the default for an hour now...
from minecraft.
I think Jimx has far more locally than he's committed, theres nothing that interfaces with the rest of the engine in .generate_chunk yet. Also, attempting to run just the PerlinNoise.fBm function once per block took a good 6 seconds for a single Region. His current design runs that at least 5 times per block, so this implementation is currently not possible for realtime generation.
from minecraft.
Is anyone else having terrain issues? i did git pull today... and terrain land (flat) generates past the wall... and up in the sky. is this just me, or am i so dense that i am missing obvious code changes?
from minecraft.
Yes, I added that in #60, to show that the wold is now infinite. If you want to try inventing a generator, the flat grass is from world._show_sector
from minecraft.
???? I don't think we still have a proper terrain generator…
from minecraft.
Oops sorry, misclicked! Did not mean to close this.
from minecraft.
So far it takes a long time to generate the terrain...So I don't think it's a good idea to make it the default terrain generator.
from minecraft.
but it would be nice to see how it works...
from minecraft.
Yes, it could be cool if you explain us how to get it working!
from minecraft.
maybe if we reduce the height map from what looks to be 40 blocks to 20, or 15, the terrain would generate faster. I am sure that all of us would much rather have this generator than the current one... not that anything is bad with the current one, just... this one has the potential to be so much better :)
from minecraft.
Sorry for not replying earlier...I have to go to school...
Notch wrote a post about the terrain generation in Minecraft here: http://notch.tumblr.com/post/3746989361/terrain-generation-part-1
To generate the terrain, this generator first uses PerlinNoise to generate some smooth random values, and adds them up to get a density. If a block has a density lower than 0, it will be air. And if a blocks has a density >= 0, it will be ground. I currently use 6 Perlin Noise Generators: one for base terrain, two for river/ocean, two for mountain/hill and one for cave. The formula is:
density = -y + (((32.0 + base_terrain * 32.0) * self._clamp(river + 0.25) * self._clamp(ocean + 0.25)) + mountains * 1024.0 + hills * 128.0) * flatten
-y
makes sure that the bottom layer is solid but the top isn't. Because density will be smaller and smaller as y increases.
(((32.0 + base_terrain * 32.0) * self._clamp(river + 0.25) * self._clamp(ocean + 0.25))
generates the base terrain, if ocean and river are both small values, it will generate river or ocean.
mountains * 1024.0 + hills * 128.0
generates mountains and hills, it will generate some blocks at higher positions if mountains and hills are positive.
And here are the lines with which I generated the terrain:
tg = TerrainGenerator(seed)
c = tg.generate_chunk(0, 0, 0) # generate the chunk at (0, 0, 0)
for x in range(0, CHUNK_X_SIZE):
for z in range(0, CHUNK_Z_SIZE):
for y in range(0, CHUNK_Y_SIZE): # set blocks
self.init_block((c.world_block_xpos(x), y, c.world_block_zpos(z)), c.get_block(world_block_xpos(x), y, world_block_pos(z)))
This is how the terrain generator works. And I just found that math.floor() is much faster than my fast_floor()...
from minecraft.
Related Issues (20)
- AttributeError: 'NoneType' object has no attribute 'height' HOT 1
- I broke a flower and then tried to place it back HOT 1
- Disconnected from server even before the first packet was sent HOT 3
- ValueError: Can only assign sequence of same size
- Sky upside down???
- MemoryError HOT 2
- 'ImageData' object has no attribute 'texture' HOT 3
- problem running setup.py HOT 2
- cant download zip HOT 2
- 'ImageData' object has no attribute 'texture' HOT 11
- self.packetreceiver.send_movement(momentum, self.player._position) AttributeError: 'GameController' object has no attribute 'packetreceiver' HOT 1
- Everywhere
- AttributeError: 'module' object has no attribute 'getoutput' HOT 3
- Python3 support??
- World generation speedup??
- Issue with removing blocks
- Generate water pools
- Better documentation
- Split stacks of blocks
- Synchronise celestial bodies HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minecraft.