Skip to content

Commit eca9288

Browse files
committed
initial sphinx docs
1 parent 1a6b4ca commit eca9288

File tree

20 files changed

+255
-27
lines changed

20 files changed

+255
-27
lines changed

.github/workflows/sphinx.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Sphinx"
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
permissions:
7+
contents: write
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
persist-credentials: false
12+
- name: build html
13+
uses: ammaraskar/sphinx-action@master
14+
with:
15+
docs-folder: "sphinx/"
16+
- name: upload artifacts
17+
uses: actions/upload-artifact@v4
18+
with:
19+
name: html-docs
20+
path: sphinx/build/html/
21+
- name: deploy
22+
uses: peaceiris/actions-gh-pages@v3
23+
if: github.ref == 'refs/heads/master'
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
publish_dir: sphinx/build/html

README.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,2 @@
11
# uwapi
2-
Language bindings for writing AI bots for Unnatural Worlds
3-
4-
Language-specific instructions are in the respective folders.
5-
6-
## Troubleshooting
7-
8-
> Unable to load DLL 'unnatural-uwapi-hard'
9-
10-
> OSError: cannot load library 'unnatural-uwapi-hard'
11-
12-
Make sure you have installed Unnatural Worlds in Steam.
13-
14-
If your steam games are in non-default location, define environment variable `UNNATURAL_ROOT` to the directory containing the library.
15-
Eg. `C:\Program Files (x86)\Steam\steamapps\common\Unnatural Worlds\bin`.
16-
17-
> failed to initialize steam api
18-
19-
Make sure that Steam is running and logged in.
20-
It must run under the same user.
21-
22-
On linux: avoid using flatpack for Steam.
23-
24-
> Linux laptop with switchable GPUs
25-
26-
```bash
27-
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia your_program
28-
```
2+
Language bindings for writing AI bots and scripts for Unnatural Worlds.

sphinx/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

sphinx/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

sphinx/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

sphinx/source/bots/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Bots
2+
====
3+
Guide on writing custom AI/bots for Unnatural Worlds.
4+
5+
You can write your bot in any language, as long as it can load a dynamic/shared library (.dll/.so).
6+
The shared library is distributed together with the game.
7+
The uwapi repository contains c/c++ headers for all functions and structures provided by the library.
8+
9+
The uwapi repository also contains convenient wrappers for Python and for C# for quicker start of writing your bot.
10+
11+
.. toctree::
12+
troubleshooting
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Troubleshooting
2+
===============
3+
4+
.. warning::
5+
Do *not* use Flatpak for Steam on Linux.
6+
7+
.. dropdown:: Unable to load DLL 'unnatural-uwapi-hard'
8+
9+
Make sure you have installed Unnatural Worlds in Steam.
10+
11+
If your Steam games are in a non-default location, define the environment variable ``UNNATURAL_ROOT`` to the directory containing the library.
12+
Example: ``C:\Program Files (x86)\Steam\steamapps\common\Unnatural Worlds\bin``
13+
14+
.. dropdown:: OSError: cannot load library 'unnatural-uwapi-hard'
15+
16+
Make sure you have installed Unnatural Worlds in Steam.
17+
18+
If your Steam games are in a non-default location, define the environment variable ``UNNATURAL_ROOT`` to the directory containing the library.
19+
Example: ``C:\Program Files (x86)\Steam\steamapps\common\Unnatural Worlds\bin``
20+
21+
.. dropdown:: Failed to initialize Steam API
22+
23+
Make sure that Steam is running and logged in.
24+
It must run under the same user as the program.
25+
26+
.. dropdown:: Linux laptop with switchable GPUs
27+
28+
To run using nvidia gpu:
29+
30+
.. code-block:: bash
31+
32+
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia your_program
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Clusters
2+
========

sphinx/source/concepts/ecs.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ECS
2+
===

sphinx/source/concepts/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
General Concepts
2+
================
3+
Glossary and explanation of concepts used throughout this documentation and in the game.
4+
5+
.. toctree::
6+
tiles
7+
clusters
8+
prototypes
9+
ecs

0 commit comments

Comments
 (0)