test_world_generation.py 801 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env python3
  2. import sys
  3. sys.path.append("../ServerCore")
  4. from WorldManager import WorldManager
  5. from pycallgraph import PyCallGraph
  6. from pycallgraph.output import GraphvizOutput
  7. def main(nchunks=10):
  8. raw_noise_cell_size = 32
  9. raw_noise_chunk_size = 4
  10. world_seed = 42
  11. # create world:
  12. wm = WorldManager(raw_noise_cell_size=raw_noise_cell_size,
  13. raw_noise_chunk_size=raw_noise_chunk_size,
  14. world_seed=world_seed)
  15. for x in range(nchunks):
  16. for y in range(nchunks):
  17. for z in range(nchunks):
  18. wm.createEmptyChunk(x, y, z)
  19. wm.applyPerlinToChunk(x, y, z)
  20. # print(x,y,z)
  21. if __name__ == "__main__":
  22. with PyCallGraph(output=GraphvizOutput()):
  23. main(10)