Тёмный

Recording of my infinite voronoi generator in java 

Gregary Pergrossi
Подписаться 11
Просмотров 563
50% 1

The loading is a simulation of a chunk loader for infinite 2d terrain. I have purposefully slowed it down so you can see it load using my "stochastic priority queue". I am currently using this infinite voronoi code to break up an infinite world into non-square cells.
Here are some details on the construction:
- It uses an infinite grid of square tiles.
- Each tile has a seed computed by hashing its x,y coordinate.
- The seed is used to roll a random point inside the tile.
- Then I compute the polygon for each tile by constructing a voronoi diagram using the points for a 5x5 tile area surrounding it
- I use fortune's algorithm and throw away a lot of the work (keeping only one polygon)
- A 5x5 area is the smallest area I found that guarantees that the central tile's polygon is the same as it would be in an infinite grid
The chunk loader prioritizes chunks by their proximity to the center of the screen. Since these priorities change pretty often I couldn't use a regular priority queue/heap. I settled on each thread picking a small number of possible chunks from a list and loading whichever has the highest priority currently.
It's not very efficient, but I was sort of testing the multithreaded chunk loader and I uploaded it because it looked cool.
Source code: github.com/gpergrossi/java-vo...
I am aware of some rare geometry bugs and the fact that I have over-complicated my implementation of fortune's algorithm, which is related to the bugs.

Наука

Опубликовано:

 

18 июн 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 4   
@Dactarium
@Dactarium Год назад
I love it ^^ , I will make a game using this algorithm. I'm so hyped thinking about possible game ideas
@FICHEKK
@FICHEKK 6 лет назад
Can you please explain how you calculated this? Or upload the source code?
@gregarypergrossi7474
@gregarypergrossi7474 6 лет назад
I added an explanation and a link to the source code to the description. Thanks for your interest. I'm amazed someone found and watched this video!
@FICHEKK
@FICHEKK 6 лет назад
Gregary Pergrossi And I am even more amazed that you actually explained it and uploaded the source! Thank you, helps out a lot!
Далее
Voronoi Diagrams and Procedural Map Generation
15:36
Просмотров 38 тыс.
A simple algorithm for 2D Voronoi diagrams
3:27
Просмотров 3,4 тыс.
I Made a Neural Network with just Redstone!
17:23
Просмотров 676 тыс.
Why Does Scrum Make Programmers HATE Coding?
16:14
Просмотров 497 тыс.
Google Data Center 360° Tour
8:29
Просмотров 5 млн
How A Steam Bug Deleted Someone’s Entire PC
11:49
Просмотров 908 тыс.
Enums considered harmful
9:23
Просмотров 195 тыс.
Marvelous & Voronoi
0:40
Просмотров 120 тыс.
Functional Programming & Haskell - Computerphile
9:19
Просмотров 660 тыс.