百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

territory

> 编程语言
开源

3D渲染的 proc-gen 世界测试。用于代理驱动的程序化生成/世界模拟的 C++ 自制体素引擎

392 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

3D渲染的 proc-gen 世界测试。用于代理驱动的程序化生成/世界模拟的 C++ 自制体素引擎

territory

3D rendered proc-gen world test

C++ homebrew voxel engine for intelligent agent-driven (NPC) procedural generation / world simulation.

Blog: https://nickmcd.me

Compiling

Use the make file to compile the binary.

make all

Tested on Ubuntu 18 LTS. I have been informed that on Ubuntu 19, the install folder for libnoise is different and needs to be fixed in the 'territory.h' header file.

Dependencies

  • gcc
  • SDL2 (core, image, mixer, ttf)
  • OpenGL3
  • GLEW
  • Boost (Serialization, System, Filesystem)
  • DearImgui
  • libnoise

Usage

./territory [world_name] [SEED]

If the world name doesn't exist, it will generate a world with the specified seed. If it does, it will load the world (and ignore the seed input).

By default, the world generation occurs using the SimpleHydrology system (described a separate repository). This can take a little bit, as it simulates erosion and then extracts the voxel data from the terrain.

Controls

Mouse and Keyboard Inputs:

- View Control Panel: ESC
- P: Toggle Pause (**PAUSED BY DEFAULT - BOTS ARE VERY FAST**)
- M: Play Music
- Change Camera Position (Move): WASD
- Move Camera Up / Down: Space / C
- Change Horizontal View Angle: Scroll Left / Right
- Cycle Vertical View Angle: UP- / DOWN-ARROW (for flat and top-down view)
- Zoom: Scroll Up / Down
- Right-Click: Select Block (and give task at that location using the panel)
	- Drag and Release: Select Block Region
	- V: Toggle See-Through Region (for building debugging)
- Fn+F11: Toggle Fullscreen

Panel

In-simulation control panel allows for manipulating the simulation.

- Tab: Simulation:
	- Control the Simulation Speed
	- View Position
	-	 Toggle Debug Messages
- Tab: Population
	- Observe individual bots
		- Follow Bots
		- Check their Task Queue
			- Manipulate their Task-Queue
		- Check the Memory
		- Check their Inventory
			- Manipulate their Inventory
		- Check their Sprite and Animation
	- Interrupt Bots
	- Kill Bots
- Tab: View
	- Change to perspective projection
	- FPS Counter
	- Change Skybox Color
	- Change Lighting Color
	- Change Picker Color
	- Change Render-distance (move out of current chunk to reload chunks)
	- Toggle Rendering Options

Screenshots

Perlin world generation, example of what the rendering looks like and what the control panel looks like. This is in fullscreen mode.

Dense forest world gen. The leaf colors are varied using bezier curves, parameterized by the hashed block position in world-space (see my blog for more information).

Example of a "village" (which is really just a spot in the desert where I had the bots build a bunch of houses). It wasn't like this at world gen, but rather the bots built this 100% from scratch. Then I took the screenshot. There are tons of bots in this image.

If you turn the camera just right, your 3D projection becomes this pseudo-isometric projection and looks really nice. Here is an example of a watery world-gen. Again using hashed bezier parameters for color variation.

And zoomed out a bit.

Updated world generation using the SimpleHydrology system

And zoomed in a bit.

Source

Reading

In the wiki, there is a dedicated page to reading and understanding the source code.

You may not be interested in all aspects of this project. In that case, reading certain portions of the source code can give you insight into the system. This is also listed on the wiki page.

Features

A description of features and future plans for various elements of the simulation can be found in the wiki also.

I will try to keep the feature list as complete as possible.

Contributing

If you are interested in contributing to this project, with ideas or source code, please let me know.

I could particularly benefit from experience in the areas of:

  • 3D Rendering with OpenGL / Fast Shader Programming
  • GUI Programming (I am using ImGUI but would like to switch to a custom HUD!)
  • Voxel Data Storage / Large World Storage

There are lots of possibilities to include generative systems for the simulation, so if you have a nice concept I would be happy to see it.

Currently, this is 100% solo.

License

This software is available under the Mozilla Public License. Still, I don't want to clutter the source with header text, so I hope that's ok. Feel free to use and modify the source of this project.

The music and artwork used in the project (everything in /resource/) is not open source. That content was made specifically for this version of this project. If you plan on distributing your own variant of this software, you must use your own music and artwork, or contact me. Using the artwork and music yourself for personal use is fine of course.

Please see the copyright notice on my website for more information.

Articles

For the interested, there are some writeups on the various elements of this project on my blog, explaining the systems and the thought process behind their design:

  • Original Task-Bot Concept
  • Voxel Engine
  • Task-Bots in the Voxel Engine
  • Markov Chains for Procedural Buildings

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++artworkopenglopengl3procedural

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言