1 Star 1 Fork 1

肖红 / WFC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Wave Function Collapse

An infinite, procedurally generated city, assembled out of blocks using the Wave Function Collapse algorithm with backtracking.

Read more about this project here and about the WFC algorithm here.

Play

Download the game on Itch.io: https://marian42.itch.io/wfc
Currently, there is no gameplay, you can only walk around and look at the scenery.

Keyboard Controls: WASD for walking, Space to jump, Shift to run, Ctrl to jetpack.
XBOX Controls: Left Stick for walking, right stick for looking around, A to jump, LB to run, RB to jetpack

Flight mode: Use M to toggle between flight mode and normal mode. In flight mode, you fly across the world, without any controls.

Editing the module set

By changing the module set, you can make some changes to the world generation without writing code. You can disable or enable modules, change their spawn probability, their connectors, their neighbor rules or you can add new ones. Here is how to do it:

  1. Open the Prototypes scene.
  2. Edit the blocks in the scene. You'll mostly change values in the ModulePrototype components.
  3. Select the "Prototypes" game object in the hierarchy and apply your changes to the prefab (Overrides -> Apply all).
  4. Select the file "ModuleData" in the asset folder.
  5. Click "Create module data".
  6. Optional: Click "Simplify module data". This takes some time, but will make world generation faster.
  7. Save your work and go back to the Game scene. You can now use your updated module set.

Generating worlds in the editor

There are different ways to generate worlds in the editor:

  • Select the Map object. In the MapBehaviour component, select a size and click "Initialize NxN area".
  • Select the "Area Selector" object. Move and scale it to select an area, then use the "Generate" button to generate a map.
  • Use the "Slot Inspector" object to show details about a single position. It shows you which modules can be spawned at that position and lets you select modules manually.

If you want to enter Play mode without losing your map, disable the "Generate Map Near Player" and the "Occlusion culling" script. Note that none of the components serialize, so you can't change the map once it has been serialized. That means that you can't change your map in Play mode unless you initialized it in Play mode.

MIT License Copyright (c) 2020 肖红 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于波函数坍缩算法的程序化随机生成 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/xiaohong_13922365801/WFC.git
git@gitee.com:xiaohong_13922365801/WFC.git
xiaohong_13922365801
WFC
WFC
master

搜索帮助