broken_seals/README.md

438 lines
20 KiB
Markdown
Raw Normal View History

2019-11-22 17:29:10 +01:00
# Broken Seals
A 3D third person RPG. With both multiplayer, and singleplayer capabilities.
The main gameplay-loop goal is to create an experience with enough complexity and depth, that can rival the more old-school MMO- and action rpgs, because nowadays I feel like that is something that got lost.
2020-06-10 17:15:05 +02:00
I want the game to run on every platform, but the game design is PC first. From the testing I've done this is not going to be an issue.
2022-01-09 23:21:51 +01:00
This project uses a custom version of ![godot (3.x branch)](https://github.com/godotengine/godot/tree/3.x) as it's engine.
2022-01-09 23:19:05 +01:00
2020-09-03 14:56:13 +02:00
#### On Desktop
2020-06-10 17:15:05 +02:00
2021-08-08 21:20:21 +02:00
![Broken Seals desktop](pictures/screenshot_desktop.jpg)
2020-09-03 14:56:13 +02:00
#### On Touchscreens
![Broken Seals on touchscreen](pictures/screenshot_touchscreen.jpg)
2019-11-22 17:29:10 +01:00
## Status
2022-01-11 20:41:04 +01:00
On the technical side almost everything has been set up the way I think will work in long term. \
Improvements will be needed obviously, but I don't expect core reworks anymore for the forseable future.\
2022-01-11 20:41:04 +01:00
[Here's a list of some of the more prominent features](#features).
2022-01-11 20:44:18 +01:00
Currently I'm working to finish / make the content creation tools usable without any issues.
2022-01-11 20:44:18 +01:00
The Mesh Data Resource Editor will need the most amount of work by far, as it needs some of it's core tools implemented.
The rest only needs undo-redo to fix most of their remaining usability issues.
Character mesh generation, and it's setup will probably get refinements soon, after the mesh data resource editor
editor plugin is done, as it definitely needs some work. This might require some api changes, other than this
I don't expect big changes anymore.
2022-01-11 20:46:02 +01:00
I only have a minimum amount of content, only enugh to figure out things like look, colors, style, and technical stuff etc.
2022-01-11 20:44:18 +01:00
I'll start working on it properly after the content creation tools are done. \
Hopefully it won't take long to have something that's actually playable.
Note that things like the spell system already has most of the required core features for even complex spells,
2022-01-11 20:44:18 +01:00
which might be strange at first sight, especially if you know agile development. This is because this project
was originally developed in unity (for about 3 years), and then eventually due to constant issues, bugs,
2022-01-11 20:44:18 +01:00
and annoyances I ported it to godot (while fixing the design issues that I was forced to do because of c# / unity).
Then eventually I went open source with it. Since I already had a prototype that let me mess with classes for a while,
I decided to just focus on the technical stuff, and make that as good as I can first.
## Features
### Content creation tools
2022-01-11 20:46:02 +01:00
Note: I'm currently focusing on these.
2022-01-11 20:46:02 +01:00
- World Generator: It contains resources that can handle world generation, and an interface for easy editing. Needs undo redo.
- Mat Maker GD: [RodZill4's Material Maker](https://github.com/RodZill4/material-maker) ported to the cpu. Needs undo redo, and about 60 nodes.
2022-01-11 20:49:33 +01:00
- Mesh Data Resource Editor: Needs some core features (Like mesh face creation, deletion, edge split, merge etc). Also needs undo redo.
I also have these added to the project.
2022-01-11 20:46:02 +01:00
- Color palette addon from https://github.com/EricEzaM/godot-color-palette
- Godoxel addon (An in godot image editor.) from https://github.com/aaronfranke/GraphicsEditor
### Multiplayer
Multiplayer was broken for quite a while, so currently it has a lot more bugs than it used to.
Most of these should be relativelty easy to fix.
2022-01-11 20:49:33 +01:00
- Authoritative server implementation. (Except for movement. Can be done though, I'll do it eventually, but it's usual for these kind of games to not have authoritative movement.)
- You can create, and join to servers.
2022-01-11 20:49:33 +01:00
- Movement works. Although the animations are not yet implemented for client players.
- Targeting works.
- Spell casting works. Although auras have some issues for now.
- Inventory management should work.
2022-01-11 20:49:33 +01:00
- Stuff like vendors, trainers should all work. I think except for crafting (I think just some methods need to be marked as RPCs, and they might need to need to call eachother via rpcs).
### Characters
- Main and secondary stats all work, they are also customizable in the project settings. They also have built in maint stat -> secondary stat conversion support.
- Character resources all work and scriptable. (Like health, mana, speed, energy etc) Also you can dynamically add it and remove it from a character.
- Tab targeting support.
- Spells, and auras are fully scriptable, and networked.
- Actionbar, actionbar profiles support.
- Spell learning support.
- Talent support, with multiple talent trees.
- Loot.
2022-01-11 20:56:43 +01:00
- Equipment support including weapons, clothes, and also other attachments. Although starter gear support is not yet finished.
- Support for changing clothes via texture merging.
2022-01-11 21:02:34 +01:00
- Support for changing parts of models via clothes. Also support for alternative bodyparts.
- Character models are using merged meshes and textures, with generated LOD. (This is also multi threaded, with fallback when no threads are available.) This system is using MeshDataResources.
- Generic attach point support for the character skeletons. (Spell cast particle effects, spell effects, also the same system can be used for weapons.)
- Interaction support.
- Vendors, Trainers, Crafting.
- Fully scriptable ai support.
- Control over characters can be easily changed by the server, and the character bodies are scripted to act accordingly automatically. For example mind control effects can be implemented with this system.
2022-01-11 20:56:43 +01:00
Missing:
- Character customization support (like selecting hairtyles). It's mostly there, but some crucial features are still missing.
- Temporary character model change support. Think of polymorph effects, toys etc. Needs the character customization support first.
### Terrain
2022-01-11 21:02:34 +01:00
- Multi threaded chunk generation. It will even work when no threads are available, also in this case the work gets distributed over multiple frames (although one of the steps is a bit too long, so it still needs some tweaks).
- Prop system. You can serialize scenes into a more efficient format than scene files. These can contain lights, meshes, rooms and portals, etc. The system is scriptable. Scene hierarchies also work.
- PropInstance node, which can mesh and put props into the scene.
- Per chunk material support, even for props.
- Terraman: prop support, even with mesh (and texture) merging. If you look at the trees on the screenshot, they are merged together per chunk, and they all share the material, and shader. Also if you serialize lights into props, they are added as vertex lights.
- Terraman and PropInstance: Vertex light support. You can add vertex lights (via code, or the prop system), and the meshes will be colored with it.
- Terraman:Vertex colors are also used to achieve the main style. (RAO).
- Terraman:Vertex color based ambient occlusion support.
- Terraman and PropInstance: LOD support, even for prop meshes.
- Terraman and PropInstance: LOD generation is scriptable.
2022-01-11 21:06:31 +01:00
- Dungeon generation support via a separate prop based system. Dungeons are generated below ground, with teleporters to them. Also support for turning off the terrain engine while the player is inside a dungeon.
2022-01-11 21:03:37 +01:00
- Procedural world generation. [See here](#terrain-generation).
### UI
- Menu and game ui.
- Actionbars with keybind support. Also the icons that you drag to the actionbar actually gets merged into the ui's texture to reduce drawcalls.
- Character, talent, spellbook, crafting, inventory, loot, vendor, trainer windows are all implemented.
- Easily scriptable options dialog.
- The menu has full support for keyboard / controller navigation. (The game itself misses it at the moment though.)
- Touchscreen controls. It will also make the buttons bigger if it detects a touchscreen.
- Keybind window.
2022-01-11 21:02:34 +01:00
- About window.
2022-01-09 23:19:05 +01:00
## Project overview
2019-11-22 17:29:10 +01:00
2022-01-09 23:19:05 +01:00
As stated in the opening section the project uses a custom version of the godot engine.
2019-11-22 17:29:10 +01:00
2022-01-09 23:19:05 +01:00
The project's workflow has been set up so you can easily compile this version for yourself if you want to.
2022-01-09 23:22:49 +01:00
2022-01-09 23:19:05 +01:00
See the [Compiling](#compiling) section if you want to know how to do this.
2020-07-09 20:08:26 +02:00
2022-01-09 23:19:05 +01:00
### Engine
2020-07-09 20:08:26 +02:00
2022-01-09 23:20:57 +01:00
Currently [my fork](https://github.com/Relintai/godot) of godot is used as a base for the engine (3.x). \
2022-01-09 23:22:49 +01:00
This contains a port of [TokageItLab's SkeletonEditor pr](https://github.com/godotengine/godot/pull/45699).\
2022-01-09 23:19:05 +01:00
The original godot source will likely work too if you want that for some reason.
2022-01-09 23:24:08 +01:00
The engine needs to have some engine modules built in. For example:
2019-11-22 17:29:10 +01:00
2022-01-09 23:24:08 +01:00
- Except for a few scripts, entities, spells and auras are handled by the
2022-01-09 23:19:05 +01:00
[entity_spell_system](https://github.com/Relintai/entity_spell_system)
2022-01-09 23:24:08 +01:00
module, on the c++ side.
- Threading is handled by [ThreadPool](https://github.com/Relintai/thread_pool).
- The terrain is handled by [Terraman](https://github.com/Relintai/terraman.git).
- Most of the models are imported as MeshDataResources, these are meshes that are meant to be merged.
2022-01-09 23:19:05 +01:00
These come from the [MeshDataResource](https://github.com/Relintai/mesh_data_resource) module.
2022-01-09 23:26:43 +01:00
(Currently I'm working on the mesh_data_resource_editor addon that will enable these to be edited directly inside the editor.)
2022-01-09 23:19:05 +01:00
Actually [here's the full list](#the-required-engine-modules).
### Game
The [/game](https://github.com/Relintai/broken_seals/tree/master/game) folder contains the game's code and assets.
This is the folder you are supposed to open in the editor.
2022-01-09 23:29:35 +01:00
The game's folder structure should be (hopefully) mostly self explanatory.
2022-01-09 23:19:05 +01:00
#### Game Modules
2022-01-09 23:26:43 +01:00
I designed the game's code to be highly modular, so I created a [loader module](https://github.com/Relintai/broken_seals/tree/master/game/scripts/game_modules). \
It will look for files named ` game_module.tres ` and call methods on them on certain events.\
2022-01-09 23:19:05 +01:00
This system uses the [DataManager](https://github.com/Relintai/broken_seals/blob/master/game/scripts/game_modules/DataManager.gd) singleton.
2022-01-09 23:26:43 +01:00
For example this is how the ui initializes itself:
2022-01-09 23:19:05 +01:00
2022-01-09 23:31:50 +01:00
The player's [body](https://github.com/Relintai/broken_seals/blob/master/game/player/Body.gd) script requests the ui nodes from the [DataManager](https://github.com/Relintai/broken_seals/blob/master/game/scripts/game_modules/DataManager.gd) singleton (like ` var ui = DataManager.request_instance(DataManager.PLAYER_UI_INSTANCE) `). And then the data manager will instance it's ` player_ui ` scene, and call all module's ` on_request_instance ` methods, while also passing the newly instanced scene to them.
2022-01-09 23:19:05 +01:00
2022-01-09 23:31:50 +01:00
These module scripts are also responsible for collecting all spells and then setting them into the ESS singleton, so they are actually castable.
2022-01-09 23:26:43 +01:00
2022-01-09 23:31:50 +01:00
This is the [module](https://github.com/Relintai/broken_seals/blob/master/game/modules/entity_classes/naturalist/game_module.tres) for the naturalist, and it's [ResourceDB](https://github.com/Relintai/broken_seals/blob/master/game/modules/entity_classes/naturalist/resource_db.tres), which will be merged into a central resource db for ESS.
2022-01-09 23:19:05 +01:00
Note that the module resources are sorted by their resource paths, so spells should always get the same id, on every platform every time.
This is to optimize networkd spell casts.
Most of the game assets ended up under the modules folder [here](https://github.com/Relintai/broken_seals/tree/master/game/modules) for this reason,
however these might get moved, if I find a better arrangement.
#### Terrain generation
The terrain generation is now handled by the new [world_generator](https://github.com/Relintai/broken_seals/tree/master/game/addons/world_generator)
addon.
2022-01-09 23:31:50 +01:00
Right now the terrain is only going to be pseudo-random, as generating proper connected worlds are kind of super difficult,
2022-01-09 23:38:12 +01:00
especially if you also have to mesh them in 3d. \
2022-01-09 23:36:22 +01:00
I think this solution can be extended later to be able to do a full continent / world randomization / generation.
2022-01-09 23:19:05 +01:00
2022-01-09 23:38:12 +01:00
For now the idea is that we have a World resource, this contains Continents, those zontain Zones, and those contain SubZones.
2022-01-09 23:36:22 +01:00
The position and size is predetermined by the designer. And then when a chunk needs to be generated it gets put into this world, and then these generate it's data.
2022-01-09 23:31:50 +01:00
- World does mostly nothing on it's own for now, except for holding continents.
2022-01-09 23:36:22 +01:00
- Continents handle things like oceans, and big mountains.
2022-01-09 23:31:50 +01:00
- Zones generate proper terrain, and add props. They need to blend into continents.
2022-01-09 23:36:22 +01:00
- SubZones can be used as spawners, prop spawners, or they can even do terrain modifications.
So when a chunk needs to be generated, first the world gets it, then all continents which intersect with it's position,
then all zones which intersect with it's position, then all subzones which intersect with it's position.
2022-01-09 23:19:05 +01:00
The editor contains an addon to help with editing the world.
## Editing the game
Grab an engine with the required modules and then open the project inside the `game` folder.
After the initial import it might need an editor restart, however everything should work after that.
If you want to use master, you will likely need to build the editor for it if the c++ side had breaking changes since the last release.
2019-11-22 17:29:10 +01:00
## Compiling
2022-01-09 23:19:05 +01:00
First make sure, that you have everything installed to be able to compile the godot engine. See: See the [official docs for compiling Godot](https://docs.godotengine.org/en/latest/development/compiling/index.html) for more info. My setup/compile script uses the same tools, so
you don't need to install anything else.
2020-06-10 10:44:18 +02:00
Now let's clone this repository:
``` git clone https://github.com/Relintai/broken_seals ```
cd into the new folder:
``` cd broken_seals ```
Now let's run the project's setup script, by calling scons without arguments.
``` scons ```
2019-11-22 17:29:10 +01:00
2020-06-10 17:15:05 +02:00
This will clone and setup the engine, and all of the required modules into a new `engine` folder inside the project, using http.
2019-11-22 17:29:10 +01:00
2020-06-10 10:44:18 +02:00
(If you want to use the github's ssh links append `repository_type=ssh` like ``` scons repository_type=ssh ```)
2019-11-22 17:29:10 +01:00
2022-01-09 23:19:05 +01:00
Once it is done you can compile the engine.
To build the editor on windows with 4 threads run the following command:
``` scons bew -j4 ```
To build the editor on linux with 4 threads run the following command:
``` scons bel -j4 ```
2022-01-09 23:38:12 +01:00
I call this feature of the setup script build words. [See](#build-words).
2019-11-22 17:29:10 +01:00
2022-01-09 23:19:05 +01:00
Once the build finishes you can find the editor executable inside the `./engine/bin/` folder.
For convenience there is a provided `editor.sh`, or `editor.bat` for running it from the project's folder.
These will create a copy, so you can even compile while the editor is running.
Alternatively if you don't want to use build words, you can also just go into the engine folder:
``` cd engine ```
And compile godot as per the [official docs](https://docs.godotengine.org/en/latest/development/compiling/index.html).
2019-11-22 17:29:10 +01:00
2020-06-10 10:44:18 +02:00
### Build words
2020-06-10 17:15:05 +02:00
The project's setup script contains support for "build words". These can be used from the root of this project.
2020-06-10 10:44:18 +02:00
For example to build the editor for windows with 4 threads you can use:
``` scons bew -j4 ```
The first argument must start with b (build), then it needs to be followed by a few abbreviations (the order does not matters)
The rest of the arguments will be passed directly to godot's scons script.
#### Editor
2020-06-10 17:15:05 +02:00
Append `e` to build with `tools=yes` a.k.a. the editor.
2020-06-10 10:44:18 +02:00
``` scons bew -j4 ```
if you omit `e`, the system will build the export template for you. For example:
2019-11-22 17:29:10 +01:00
2020-06-10 10:44:18 +02:00
``` scons bw -j4 ```
2020-06-10 10:44:18 +02:00
This will be the `release_debug` windows export template.
2020-06-10 10:44:18 +02:00
#### Platform abbreviations
2020-06-10 17:27:57 +02:00
`l`: linux \
`w`: windows \
`a`: android \
`j`: Javascript \
`i`: iphone (Not yet finished, use `build_ios.sh`, and `build_ios_release.sh`) \
2020-06-10 10:44:18 +02:00
Mac OSX: Not yet finished, use `build_osx.sh`
2020-06-10 10:44:18 +02:00
#### Target abbreviations
2020-06-10 18:24:31 +02:00
By default the system builds in release_debug.
2020-06-10 10:44:18 +02:00
2020-06-10 17:15:05 +02:00
Append `d` for debug, or `r` for release.
2020-06-10 10:44:18 +02:00
``` scons bewd -j4 ```
build editor windows debug
``` scons bwr -j4 ```
build windows release (this will build the windows release export template)
#### Shared modules
Note: This only works on linux!
append `s` to the build string.
Optionally you can also make the build system only build a target module, by appending one of these:
2020-06-10 17:29:21 +02:00
`E`: Entity Spell System \
`T`: Texture Packer \
`V`: Voxelman \
`W`: World Generator \
2020-06-10 10:44:18 +02:00
`P`: Procedural Animations
Example:
``` scons belsE -j4 ```
build editor linux shared (Entity Spell System) with 4 threads
2020-06-10 18:24:31 +02:00
Note: to easily run the editor you can use the `editor.sh` or `editor.bat` in the root of the project.
2020-06-10 10:44:18 +02:00
#### Other
Append `v` to pass the `vsproj=yes` parameter to the build script. This will generate Visual Studio project files.
#### Postfixes
There are a few postfixes for the build words. These are more complex options. You have to append them to your build word with an underscore.
You can use as many as you want.
For example:
``` scons bel_slim_latomic -j4 ```
##### slim
With this postfix you can build a slimmed down version of the engine. This disables quite a few unneeded modules.
``` scons bel_slim -j4 ```
##### latomic
If you get linker errors while building the game/editor about undefined referenced with atomic related functions you can use this postfix.
It will add the ` -latomic ` command line switch to the linker flags.
I ran into this issue while building on a raspberry pi 4 with the x11 platform. It might be related to the recent reworks to threading.
``` scons bel_latomic -j4 ```
##### strip
Appends `debug_symbols=no` to the build command, which will strip the resulting binary from debug symbols.
``` scons bel_strip -j4 ```
2022-01-28 14:14:51 +01:00
##### threads
Appends `threads_enabled=yes` to the build command. Useful for building the editor for html.
``` scons bej_threads -j4 ```
2020-06-10 10:44:18 +02:00
#### Scons cache, and sdk locations
In order to use scons cache and to tell the build system where some of the required sdks are located you usually
2020-06-12 10:50:26 +02:00
have to use environment variables. Most of the time you might just want to add them globally,
howewer this is sometimes unfeasible (e.g. you don't have administrator access, or you just want to have
multiple sdk versions installed).
2020-06-10 10:44:18 +02:00
In order to solve this a build config file was added.
2020-06-10 10:44:18 +02:00
If you want to use the config simply rename the provided `build.config.example` to `build.config`, and customize
the settings inside.
2020-06-10 10:44:18 +02:00
2022-01-09 23:19:05 +01:00
### Manual Setup
If you you don't want to use the setup script (or just want to know what it actually does),
this section will explain how to set everything up manually.
First clone godot. Either my fork (recommended at the moment):
``` git clone https://github.com/Relintai/godot.git ```
or the official 3.x master:
``` git clone https://github.com/godotengine/godot.git -b 3.x ```
go into engine's modules fodler.
``` cd godot/modules/ ```
Now go ahead and get every single required engine module from [here](#the-required-engine-modules).
``` cd ../../ ```
Now if you look at the [HEADS file](https://github.com/Relintai/broken_seals/blob/master/HEADS).
It contains the commit hashes for that particular revision for every module and the engine.
You need to go through them and checkout the proper commits.
Now you can go ahead and compile godot normally.
#### The required engine modules
2022-01-09 23:38:12 +01:00
These are the required engine modules, they are listed here for completeness`s sake, the project's setup script will install these for you automatically! See the [compiling](#compiling) section.
2022-01-09 23:19:05 +01:00
https://github.com/Relintai/entity_spell_system.git \
https://github.com/Relintai/ui_extensions.git \
https://github.com/Relintai/texture_packer.git \
https://github.com/Relintai/godot_fastnoise.git \
https://github.com/Relintai/mesh_data_resource.git \
https://github.com/Relintai/props.git \
https://github.com/Relintai/mesh_utils.git \
https://github.com/Relintai/broken_seals_module.git \
https://github.com/Relintai/thread_pool.git \
https://github.com/Relintai/terraman.git
2020-06-10 10:44:18 +02:00
## Pulling upstream changes
2020-06-10 17:15:05 +02:00
First pull the changes by calling
``` git pull orgin master ```
Then just run `scons`, to will update the modules.
2020-06-10 10:44:18 +02:00
## Upgrading the modules
2020-06-10 10:44:18 +02:00
Note: this is how to update the HEADS file. Normally you don't need to do this.
2020-06-10 10:44:18 +02:00
If you want to update the modules, and the engine to the latest, you can use (`action=update`):
2020-06-10 10:44:18 +02:00
``` scons a=u ```
2020-06-10 10:44:18 +02:00
You can also update different targets: `all`, `engine`, `modules`, `all_addons`, `addons`, `third_party_addons`
2022-01-09 23:19:05 +01:00
For example to update the engine to the latest: ``` scons a=u target=engine ```