Skip to content

GlaireDaggers/Open-World-Builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open World Builder

Open source level editor toolkit built on FNA+ImGui.NET

Goal

An open-source generic 3D level editor designed to be integrated into any game or engine. Inspired by the way LDTK, Ogmo, and Tiled serve as generic 2D tile based editors, and also taking inspiration from Unity Editor, Godot, and Trenchbroom.

Screenshots

Screenshot of OWB Editor scene viewport - editing a convex brush shape Screenshot of OWB Editor scene viewport - editing a point light Screenshot of OWB Editor scene viewport - editing a custom generic entity Screenshot of OWB Editor project settings - editing a generic entity definition

Dependencies

Open World Builder requires the .NET 7.0 SDK to compile.

It depends on FNA, SDL2-CS, ImGui.NET, and NativeFileDialogSharp.

Compiling Open World Builder

Clone Open-World-Builder then:

  1. Run git submodule update --init --recursive to fetch all submodule dependencies
  2. Open the src subfolder in a terminal
  3. Run dotnet build --configuration Release /p:Platform=x64
  4. Find the built executable in src/bin/x64/Release/net7.0/[linux-x64|win-x64]

Quick Start

  1. After opening OWB, save a new project by going to File → Save Project
  2. Open the project settings (Window → Project Settings) and set your new project's content path (recommended to put a "content" folder next to the project file you saved and set this as your project's content path). This is where all visual assets will reside for level editing (meshes, textures, etc)
  3. To save a new level, open the Hierarchy (Window → Hierarchy) and the Inspector (Window → Inspector), change the name of the level by selecting the root node in the Hierarchy and changing it's name in the Inspector, and then press CTRL-S or File → Save Level. The saved level will appear in the Project Browser (Window → Project Browser) under the "Levels" dropdown, on-disk as levels/[level_name].owblevel next to the project file.

Using OWB files in your game/engine

OWB outputs three types of files: .owbproject, .owblevel, and .raw. The first two are simply JSON files, and the last is used to save both heightmap and splatmap information for terrains. A schema describing this format can be found in the schema folder in this repository, and example .CS files for use with Newtonsoft.JSON matching this schema can be found in this folder as well.

Note that several types are represented as formatted strings rather than JSON objects (mostly vectors, quaternions, & colors). Wherever applicable, these are annotated with a comment in the .schema.json files.

As far as heightmap/splatmap .raw files, the formats are as follows:

  1. For heightmaps, this stores a headerless blob of 32-bit floating point values (heightmapRes * heightmapRes)
  2. For splatmaps, this stores a headerless blob of 8-bit RGBA values (heightmapRes * heightmapRes)

Heightmap/splatmap files are given a consistent naming convention for loading. For heightmaps, they are stored in the levels folder as {level name}_{terrain node guid}_heightmap.raw. For splatmaps, they are stored in the levels folder as {level name}_{terrain node guid}_splatmap{index}.raw. There will be one heightmap per terrain, and one splatmap per 4 textures per terrain.

About

Open source level editor toolkit built on FNA+ImGui.NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published