documentation work
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-03-06 19:04:20 -05:00
parent 5356b3e325
commit 3e6d918f16
22 changed files with 724 additions and 11 deletions

View File

@ -2,3 +2,10 @@
[TOC] [TOC]
- @subpage serverSceneManagement - @subpage serverSceneManagement
- @subpage fluidsimindex
- @subpage worldstorageindex
- @subpage uiarch
# What is this section
All pages under this section should detail high level organization of code. Where other documentation may document design principles, goals, code examples, processes, etc., the pages within this category should be specifically detailing architecture decisions and why they were made. Ideally flow charts and graphs can visually demonstrate how things connect.

View File

@ -0,0 +1,3 @@
@page audioengine Audio Engine
TODO

View File

@ -0,0 +1,7 @@
@page fluidsimarchoverview Fluid Simulation Architecture Overview
# Summary of Parts
The fluid sim begins with a function to create a running threadpool for calculations.
Once the current server frame gets to the point that it should start calculating the fluid frame (we want to put this at the beginning of the server frame if possible), it calls a function that propagates all current fluid chunks to the threadpool.
The threadpool then distributes the chunks amongst the threads and performs simulation for a frame.
This simulation periodically has to synchronize data between the chunks.

View File

@ -0,0 +1,4 @@
@page fluidsimindex Fluid Simulation Architecture
[TOC]
- @subpage fluidsimarchoverview

View File

@ -0,0 +1,3 @@
@page uiarch UI Architecture
TODO

View File

@ -0,0 +1,25 @@
@page worldstorage World Storage
# Uses of Data
- Generating actual terrain for player to walk around on
- Pathfinding in macro phase
- Placement of objects in macro phase
# On Disk
```
For things like elevation map, there are different sizes we can store
If 1000x1000 is approximately 1MB
10000x10000 is gonna be 100MB
4000x4000 is ~16mb
```
Types of data we need:
- Elevation map for surface
- hydration
- temperature
- wind speed
- magic (?)
# In Memory

View File

@ -0,0 +1,5 @@
@page worldstorageindex World Storage
[TOC]
- @subpage worldstorage
- @subpage macroWorldPartitioning

View File

@ -0,0 +1,4 @@
@page creaturesindex Creatures
[TOC]
- @subpage creaturemechanicsideas

View File

@ -0,0 +1,3 @@
@page creaturemechanicsideas Mechanics Ideas
If/when fluidsim is a part of the engine, have a creature that constantly keeps a bubble of water around itself (drawing from nearby sources as it approaches them). When it runs up to regular creatures to try to attack them, it will force them into swimming state or outright kill them.

View File

@ -1,5 +1,10 @@
@page highleveldesignindex High Level Game Design @page highleveldesignindex High Level Game Design
[TOC] [TOC]
- @subpage biomesindex
- @subpage macroWorldPartitioning - @subpage macroWorldPartitioning
- @subpage terrainOrganization - @subpage terraingenerationideas
- @subpage streamintegrationideas
- @subpage magicindex
- @subpage creaturesindex
- @subpage macrosimtimeline

View File

@ -0,0 +1,289 @@
@page biomeideas Biome Ideas
# Basic
## Plains
- Regular
- Floral
- Windy with lots of boulders
## Forest
### Variants
- Temperate
- Cherry Blossom
- Permanent Fall
- Permanent Spring
- Crystal
- Taiga
- Megatree (extra tall trees)
- Overgrown (dense)
- Mushroom
- Jungle
## Rolling Hills
## Rivers
## Lakes
- Magic Lake
- Vortex Lake
- Murky Lake
- Dead Lake (full of undead beneath the surface)
## Ponds
## Mountains
- Classic Mountain
- Overgrown Mountain
- Magnetic Mountain
## Ruins
# Ocean
## Oceans
## Coral Reefs
## Island
- Tropical
- Cursed
- Snowy
- Icy
- Magma/Volcano/Volcanic
- Hidden
- Floating island JUST above the surface with spooky/unhinged stuff on top
## Beach
## Atolls
## Cenote
## Rainbow Ocean
## Murky Ocean
## Deep Sea Currents
# Caves/Underground
## Small Caves
- Small clefts in the side of mountains or shallow tunnels into the earth
## Mega Caves
- Massive hollows deep underground
variants:
- Regular
- Raised platform where the upper part is well lit and everything off the side of the cliffs is dark and not well visible (then hide dangeerous stuff in the dark parts)
## Catacombs
## Crypts
## Abandoned Dungeons
## Mushroom/Fungal Caves
## Magma Caverns
## Underground Forest
## Underground Lake/Ocean
## Frozen/Icy Caverns
# Very Dry
## Deserts
## Savanas
## Badlands
# Very Cold
## Permafrost
## Glacier
# Swampy
## Swamps
- Regular
- Poison :)
## Mangroves
# More Magical
## Smoke Badlands
Blasted/Barren badlands with large, constant jets of smoke towering high into the air
## Ashen Plains
Beneath the foot of an active volcano, permanent ash falling
## Submerged Coastal Ruins
Ruins on a large beach that are partially submerged in the surf
## Micro Mountain Range
Region with lots of very short, tall mountains with relatively flat ground around them
## Flame Planes
Plains with lots of fire
## Thunder Planes
Constant Thunderstorms and lots of lightning strikes

View File

@ -0,0 +1,6 @@
@page biomesindex Biomes and Locations
[TOC]
- @subpage biomeideas
- @subpage largelocationideas
- @subpage macrolocationideas

View File

@ -0,0 +1,6 @@
@page largelocationideas Large Location Ideas
### Natural Colosseum
###

View File

@ -0,0 +1,39 @@
@page macrolocationideas Macro Location Ideas
### Volcano
-
### Mega Crystals
- Massive crystals of some type that are solid through
### World Tree
- Generated out of marching cubes terrain (leaf type, bark type, wood type)
- Make it large enough to generate rooms inside the tree and, for example, stairs leading all the way up the tree
- Will need to place objects, communities, or something inside the tree. People are going to be very disappointed if there's nothing inside the tree. Also need to write logic for characters roaming around the top of the tree. Could maybe make it flying-creature-only types just in case.
### Storm Columns
- Marching cubes "solid cloud" surrounded by swirling particles
- Place civilizations, bosses, dungeons, etc up there
- Columns of cloud currents lifting or lowering from the roof/floor of the inside of the cloud
- Plasma currents/channels of energy/lightning
### Ocean Voids
- A giant, hollow column of stone that leads just to the surface of the ocean. Water slowly trickles over the side
- Put late game bosses inside the column
### Niagara Communities
- Massive waterfalls with outcrops sticking out between them that have points of interest on them
### Pillars to Gods
- Massive pillars of some type of material that serve as dungeons
### Split Mountains
- A mountain split into two or more parts down the center
- Loot at the base, or a big boss or something
### Massive Opaque Magic Spheres
- Inside is a radically different biome (like something extremely magical, or evil, or good, or something)
- IDK if this should be made out of marching cubes or particles or what
### Massive Ruins
- For instance sticking out of the side of a mountain and of comparable size to said mountain

View File

@ -0,0 +1,13 @@
@page macrosimtimeline Macro Simulation Timeline
## Age of Gods
## First Interregnum
## Age of Exploration
## Early Age Collapse
## Age of Empire
## Age of Industry

View File

@ -0,0 +1 @@
@page magicindex Magic Index

View File

@ -0,0 +1,4 @@
@page streamintegrationideas Stream Integration Ideas
A neat stretch goal for the engine would be to support integration with youtube/twitch streams to allow streamers to do stuff with their viewers/chat.
An idea is if we have dungeons in separate realms that the player is going to while exploring, have a loading screen for 15-30 seconds (that is optionally skippable). During this loading screen allow the chat to vote for a combat challenge, puzzle, etc.

View File

@ -1,9 +1,9 @@
@page terrainOrganization Terrain Organization @page terraingenerationideas Terrain Organization
``` ```
generate 200 x 200 generate 200 x 200
interpolate x 10 in each direction interpolate x 20 in each direction
this map will be 1 km resolution this map will be 0.25 km resolution
Useful for macro sim Useful for macro sim
``` ```
@ -11,11 +11,10 @@ pick points to place mountains at
use curves to generate rivers in data use curves to generate rivers in data
``` for gameplay:
for gameplay, - interpolate x 100 in each direction in memory for local areas to player
interpolate x 100 in each direction in memory for local areas to player - finally chunks are 16 x 16 x 16
finally chunks are 16 x 16 x 16
```
``` ```
sines going in x sines going in x

View File

@ -0,0 +1,291 @@
@page renderertodo TODO
# DONE
(6/10/2023)
Scene
- Generic entity & btree grouping mechanism
Server Data Cell
- Wrapper around scene used by server to manage server scenes and players associated with them
Realm
- Manages server data cells including rudimentary spin up/down
Realm Manager
- Manages all realms + provides constructors for types of realms
Data Cell Manager
- Interface defining method for laying out cells and querying for cells based on real or world coordinates
Gridded Data Cell Manager
- Implementation of Data Cell Manager that manages a grid of data cells if using terrain engine
Data Cell Location Resolver
- Takes a vector3d and an entity and figures out what data cell that should correspond to
- Breaks the above resolver relationship out of cells so that can support different "worlds"
Entity Data Cell Mapper
- Takes an entity and gives the data cell that entity is inside of
- Breaks this out from data cell manager to support multiple worlds
Data Cell Physics Manager
- Breaks the physics generation for chunks out of the data cell manager
Data Cell Search Utils
- Combine the above classes to provided utilities for searching cells nearby a location for groups of entities
Client Scene Wrapper
- Wrapper around scene used by client
- Specifically adds translating server/client entity IDs to one another
Loading Threads
- Separate client and server versions of loading threads to different files
Server Bone Loader
- Server bone loading for server only collision simulation
Instancing support
Server Scene Management
- Creating and simulating entities per chunk
Server Terrain Management (specifically for collision)
- Generation collision meshes
- Also generate texture array
Terrain Chunk Shader
- Procedural textures for eg rock and dirt
Client Terrain Entity Management (specifically creation/teardown for client)
- Do the basic query stuff for getting terrain
Diagnose weird walking physics
- Character terrain collision messiness
Upgrade terrain editing user experience
- Sphere pallete
- Gradual updates
- Terrain Deletion
Upgrade Terrain Chunk
- Fully connect world chunks
Terrain Editing
- Server interface for editing terrain
- Ability to request terrain change from client
Voxel Data Storage
- Store metadata about types of voxels (rgb offsets, foliage placements, etc)
Foliage Manager upgrades
- Place foliage based on voxel type
- Use timeout queueing system to evaluate voxel locations to place foliage
- Destroy foliage on voxel edit
- Regrow foliage on empty cells after timeout
- Gradually regrow
Chunk Saving System
- File that maps world position to chunk file
- Save chunks to compressed files
- Server load chunks as needed
- Unload chunks after 100 frames of not being used
- Save chunks on unload
Convert client and server terrain entity composition to use 8 chunks instead of 1
Server Diagnose Physics potentially broken
- Server physics calculation not happening <-- hard to test bc gravity tree might not actually be updating client to turn off or something
Foliage Manager upgrades
- Fix popping
(2/25/2024)
Generate Tree Entities
- Generate leaf blobs container entity
- Attach individual leaf blob entities to container entity
- Sways in the wind
- Synchronize creation on server and client
- Synchronize swinging on server and client
- Tree types configurable via files
Scene Streaming (streaming state of a scene to client)
- Solidify the work that has already been done in this space and PARTICULARLY add good high level documentation
Server Content Engine
- On first loading a new-to-server chunk, generate all content (foliage, terrain objects (boulders), structures, etc) entities for the chunk
(2/28/2024)
Improve Fonts
- Support multiple fonts in engine
- Leverage https://github.com/SilverTiger/lwjgl3-tutorial/wiki/Fonts to load fonts with java
(2/29/2024)
Properly prioritize close trees over far trees
Implement proper Frustum Culling
- Regular Actors
- Instanced Actors
# TODO
Bake in imgui
Build a lod system
- Could potentially be held at actor level
- Link different models based on LOD level
- LOD trees aggressively
Fluid Dynamics System
- Basic transparent voxels for fluid
- Fluid simulation algorithm
- Vectorize/JNI fluid simulation
- Separate fluid chunks
- Networked fluid chunk transportation (including force vectors for generating particles on client)
- Save fluid chunks
Ray Traced Audio Engine
Documentation Pass on as many files as you can stomache
Overhaul mesh class
- remove unused stuff
- private constructor
(this is going to require changing a lot of dependencies)
Generate Tree Entities
- Generate stem
- Ability to specify central stem
- Cubic function for limb dispersion over length
- Generate branch starters from trunk that are not full length
Fix Character creation preview not working
Marching Cubes Texture Overhaul
- Detect opengl max image size
- Construct texture atlas of max size
- (target 256x256 resolution initially, should give ~1000 types for 8192x8192)
- Prebake all textures into atlas
- Rewrite marching cubes shader to leverage this atlas
Terrain Interface Positional Access Interface
- Ability to get terrain at point for interactions with game world eg placing grass/water collision
Foliage Manager upgrades
- Place foliage intelligently
Server Micro/Macro transitioning (turning entity into character in macro simulation and vice-versa)
Macro level content tracker
- Keep track of chunks that would have trees and include this in the data passed to client
Season tracking
- Have a concept of seasons as loaded from assets/data
- Have a season manager that keeps track of seasons at the macro scale
- Maybe make it per biome or something in data?
- Create interface for querying and updating season in a given chunk
- Update foliage system to transition models and colors based on the current season (update maybe every minute in game or something?)
Weather tracking
- Keeps track at macro level of wind direction and level
- Keeps track at macro level of cloud coverage and structure (ie transmits same cloud to client as server)
- Keeps track at macro level of temperature
- Keeps track at macro level of precipitation
Foliage Manager upgrades
- Add wind simulation if relevant
Client Terrain Entity Management (specifically creation/teardown for client)
- Also queries for far out chunks to load far away terrain
Server Terrain Management (specifically for collision)
- Handles communicating far out LOD chunks to client as well
Upgrade Terrain Chunk
- Implement Transvoxel Algorithm
Server Content Engine
- On reloading a chunk with macro objects like structures, apply appropriate modifiers to align micro object with macro object
- EG if a building is damaged in macro simulation, regenerate the micro one to be damaged before marking chunk as valid
Upgrade terrain editing user experience further
- Leveling tools
- Lock to axis tools
- Server validation for client request to change terrain
# Ongoing
Upgrade terrain generation algorithms
- This one should be an ongoing process in general as it is a matter of taste
# Eventually
Automatic Scene unloading
- Tree structure inside scenes for tearing down groups of entities
- Entity decomposition
- Server handling
- Client handling when scene should be unloaded
Light Manager
- Creates and manages light entities
- Uses priority queue mechanism like foliage manager to only draw the most important lights
- Support "flickering" somehow
- Eventually support spot lights?
- Point shadows ???
Generic collision engine to support different instances of engine (eg hitboxes vs terrain vs liquids, etc)
- Major refactoring to happen here
Procedural Cliff Texture
- Uses noise or fractals or something to generate infinite textures in shader
Terrain Chunks:
- Scale textures to be 1 texture per unit of terrain
- Texture atlasing (512x512)
Render pipeline updates to support multiple pipelines defined in different files
- Grouping meshes together independent of actor so don't have to rebind shader programs or VAOs to redraw
Gameplay:
- Swordsman with movement abilities
- Archer with movement abilities
- Mage with elemental physics based abilities
# Fun pie in the sky stuff
Ability to cast spell to extinguish sun, making world permanently dark/night time
dynamic camp/house system - npcs will gradually join your camp the longer you stay there
- They also leave to go on quests and missions
- You see the composition of the camp change over time
dynamic warfare system
- Guard towers that need to be captured by factions before enabling assault on real settlements
- Raids against villages

View File

@ -17,7 +17,6 @@ public class TerrainProtocol {
protected static void handleTerrainMessage(TerrainMessage message){ protected static void handleTerrainMessage(TerrainMessage message){
switch(message.getMessageSubtype()){ switch(message.getMessageSubtype()){
case RESPONSEMETADATA: case RESPONSEMETADATA:
System.out.println(message.getworldSizeDiscrete());
Globals.clientWorldData = new ClientWorldData( Globals.clientWorldData = new ClientWorldData(
//Vector3f worldMinPoint, Vector3f worldMaxPoint, int dynamicInterpolationRatio, float randomDampener, int worldDiscreteSize //Vector3f worldMinPoint, Vector3f worldMaxPoint, int dynamicInterpolationRatio, float randomDampener, int worldDiscreteSize
new Vector3f(message.getworldMinX(),0,message.getworldMinY()), new Vector3f(message.getworldMinX(),0,message.getworldMinY()),