Skip to content

Commit

Permalink
chore: cleanup/refactor docs
Browse files Browse the repository at this point in the history
  • Loading branch information
derkork committed Sep 12, 2024
1 parent ea4fd48 commit f67eaf0
Show file tree
Hide file tree
Showing 31 changed files with 259 additions and 151 deletions.
4 changes: 0 additions & 4 deletions docs/.circleci/circle_urls.sh

This file was deleted.

50 changes: 0 additions & 50 deletions docs/.circleci/config.yml

This file was deleted.

7 changes: 3 additions & 4 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ ruby RUBY_VERSION
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.2.2"
# gem "jekyll", "~> 4.2.2"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
# gem "minima"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
#gem "github-pages", group: :jekyll_plugins
gem "github-pages", group: :jekyll_plugins

# If you have any plugins, put them here!
# group :jekyll_plugins do
# gem "jekyll-github-metadata", "~> 1.0"
# end

gem 'wdm', '>= 0.1.0' if Gem.win_platform?

gem 'wdm', '>= 0.1.1'
gem "webrick", "~> 1.8"
2 changes: 0 additions & 2 deletions docs/Makefile

This file was deleted.

15 changes: 6 additions & 9 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# in the templates via {{ site.myvariable }}.

title: Godot State Charts
email: your-email@domain.com
author: derkork, Jan Thomä
email: info@godotneers.com
author: Jan Thomä
description: > # this means to ignore newlines until "baseurl:"
A state charts extension for Godot 4.
# DO NOT CHANGE THE LINE OF THIS FILE without editing .circleci/circle_urls.sh
baseurl: "/godot-statecharts" # the subpath of your site, e.g. /blog

# This is mostly for testing
Expand Down Expand Up @@ -61,8 +60,7 @@ themeColor: red # purple, green, blue, orange, purple, grey
fixedNav: 'true' # true or false

permalink: /:year/:title/
markdown: kramdown
exclude: [_site, CHANGELOG.md, LICENSE, README.md, vendor]
exclude: [ _site, CHANGELOG.md, LICENSE, README.md, vendor ]

# Collections
collections:
Expand All @@ -77,15 +75,14 @@ defaults:
type: "docs"
values:
layout: page
-
scope:
- scope:
path: ""
type: "pages"
values:
layout: "page"
-
scope:
- scope:
path: "posts"
type: "posts"
values:
layout: "post"

14 changes: 7 additions & 7 deletions docs/_data/toc.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
- title: "Home"
url: ""
- title: "Instalation"
- title: "Installation & Updating"
url: "installation"
- title: "Usage"
url: "usage"
links:
- title: "States"
url: "usage/states"
- title: "Nodes"
url: "usage/nodes"
- title: "Events and transitions"
url: "usage/events-and-transitions"
- title: "Debugging"
url: "usage/debugging"
- title: "Stepping Mode"
url: "stepping-mode"
- title: "Tips & Tricks"
url: "tips-and-tricks"
- title: "Stepping Mode"
url: "usage/stepping-mode"
- title: "Tips & Tricks"
url: "usage/tips-and-tricks"
- title: "Appendix"
url: "appendix"
- title: "FAQ"
Expand Down
6 changes: 3 additions & 3 deletions docs/_docs/installation.md → docs/_docs/01_installation.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
layout: page
title: Installation
title: Installation and Updates
permalink: /installation
description: "Here you can find the installation instructions for the plugin."
---

# {{ page.title }}

## Index
## Table of Contents
- [Requirements](#requirements)
- [Installation with the Godot Asset Library](#installation-with-the-godot-asset-library)
- [Manual installation](#manual-installation)
Expand All @@ -33,7 +33,7 @@ After you installed it, make sure you enable the plugin in the project settings:

## Installation with C#

If you want to use this library with C#, make sure you are using the .NET version of Godot 4. This can be downloaded from the [Godot download page](https://godotengine.org/download). The standard version of Godot 4 does not support C#. If you got Godot from Steam, you have the standard version and need to download the .NET version separately from the Godot website. There are additional installation steps for the Godot .NET version, so make sure you follow the instructions on the [Godot documentation](https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_basics.html).
If you want to use this library with C#, make sure you are using the .NET version of Godot 4. This can be downloaded from the [Godot download page](https://godotengine.org/download). The standard version of Godot 4 does not support C#. **If you got Godot from Steam, you have the standard version and need to download the .NET version separately from the Godot website.** There are additional installation steps for the Godot .NET version, so make sure you follow the instructions on the [Godot documentation](https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_basics.html).

After you installed the plugin as described above, you may need to initialize your C# project if you haven't already done so. You can do this by going to the menu _Project_ -> _Tools_ -> _C#_ -> _Create C# solution_.

Expand Down
4 changes: 2 additions & 2 deletions docs/_docs/appendix.md → docs/_docs/02_appendix.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "Here you can find the appendix of the documentation."

# Appendix

## Index
## Table of Contents
- [Order of events](#order-of-events)
- [Generic event handling rules](#generic-event-handling-rules)
- [Example](#example)
Expand All @@ -28,7 +28,7 @@ Whenever an event occurs, the state chart will try to find transitions that reac
### Example
For this example we will use the following state chart:

![Example state chart for the order of events]({{ site.baseurl }}/assets/img/manual/order_of_events_chart.png)
![Example state chart for the order of events]({{ site.baseurl }}/assets/img/manual/order_of_events_chart.png){:class="native-width centered"}

When the program starts, state _B_ is active. Since it is a parallel state, it will automatically activate its child states, _B1_ and _B2_. This is the starting position.

Expand Down
4 changes: 4 additions & 0 deletions docs/_docs/faq.md → docs/_docs/03_faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ description: "Below you can find some common questions and answers related to th

Make sure you enabled the plugin in the project settings. In the menu go to _Project_ -> _Project Settings_. This opens the project settings dialog. There select the _Plugins_ tab and tick the _Enable_ checkbox near the _Godot State Charts_ plugin.

### How can I find the currently active state?

In a state chart multiple states can be active at the same time. In general, you should avoid tracking active states in your code - this is the responsibility of the state chart. Your code is responsible for _what_ happens, while the state chart is responsible for _when_ it happens. If you need to know whether a certain state is active, you can get a reference to that state's node (using Godot's built-in `get_node` or `GetNode` functions) and then check the `active` property of that node.

### Can you backport the library to Godot 3?

I'm afraid not. While it technically would be totally possible to do so, I don't have the bandwidth for maintaining two versions of the library. I prefer to focus on the latest version of Godot, which is currently 4.
Expand Down
10 changes: 6 additions & 4 deletions docs/_docs/usage/index.md → docs/_docs/usage/01_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ description: "The plugin adds a new node type called State Chart."

# {{ page.title }}

## Index

## Table of Contents
- [General usage](#general-usage)
- [Examples](#examples)

The plugin adds a new node type called _State Chart_. This node represents your state chart and is the only node that your code will directly interact with.
## General usage

The plugin adds several new node types to Godot. The main node is the [_State Chart_]({{site.baseurl}}/usage/nodes#the-state-chart-node) node. This node represents your state chart and is the only node that your code will directly interact with.

Below this node you can add the root state of your state chart, this will usually be a _Compound State_ or a _Parallel State_. You can add as many states as you want to your state chart, but you can only have one root state. Below each state you can add _Transition_ nodes. These nodes define the transitions between states. You can add as many transitions as you want to any state.

Expand All @@ -29,7 +31,7 @@ The new UI supports undo/redo, so you can undo the addition of a node or transit

## Examples

The plugin comes with a few examples. You can find them in the `godot_state_charts_examples` folder. To run an example, open and run it's main scene. The examples are:
The plugin comes with a few examples. You can find them in the `godot_state_charts_examples` folder (if you have chosen to import this folder into your project). To run an example, open and run it's main scene. The examples are:

- `ant_hill` - a rudimentary ant hill simulation. The ants are controlled by a state chart that handles the different states of the ants such as searching for food, carrying food, returning to the nest, etc. This example shows how state charts can simplify a lot of the if-else logic that is often needed to implement AI.
- `automatic_transitions` - an example that shows how to use automatic transitions that react to changes in expression properties.
Expand Down
Loading

0 comments on commit f67eaf0

Please sign in to comment.