Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
90ac295
Port over animation pre rework README
Lilaa3 Oct 1, 2024
8a6f9cb
Fixed some weirdness
Lilaa3 Oct 1, 2024
452635f
How animations work, in engine
Lilaa3 Oct 2, 2024
2942e6d
reorder
Lilaa3 Oct 2, 2024
6d28431
DMA tables
Lilaa3 Oct 2, 2024
6c86f91
Fix some index stuff
Lilaa3 Oct 2, 2024
28e76ec
Tables
Lilaa3 Oct 2, 2024
a978bb3
WIP v2.4.0 import docs
Lilaa3 Oct 2, 2024
afd3b78
Some formatting and small tweaks
Lilaa3 Oct 2, 2024
9eca8c2
Update v24.rst
Lilaa3 Oct 2, 2024
a0f4593
Fix transparency
Lilaa3 Oct 2, 2024
9dbc4d0
Documented binary imports
Lilaa3 Oct 3, 2024
e28d2a1
importing c and binary
Lilaa3 Oct 4, 2024
a8d0b8a
finally happy with the import docs
Lilaa3 Oct 4, 2024
20d4d35
Rom
Lilaa3 Oct 4, 2024
c5c7e0a
Update formatting
Lilaa3 Oct 4, 2024
eb4ea44
Cleaned up a bit
Lilaa3 Oct 5, 2024
82e05dc
Add exporting docs file
Lilaa3 Oct 5, 2024
32679ca
Update dma_table.rst
Lilaa3 Oct 5, 2024
c52a24e
Shorten names
Lilaa3 Oct 5, 2024
43ec16f
WIP
Lilaa3 Oct 6, 2024
ea15672
Update exporting.rst
Lilaa3 Oct 6, 2024
f275f51
images
Lilaa3 Oct 6, 2024
b03b855
C how to export
Lilaa3 Oct 6, 2024
b26d616
I'm done tbh
Lilaa3 Oct 6, 2024
192975d
Update v24.rst
Lilaa3 Aug 18, 2025
50f3f0f
Update v23.rst
Lilaa3 Aug 18, 2025
b062224
Update exporting.rst
Lilaa3 Aug 18, 2025
e4a4c9b
Merge remote-tracking branch 'upstream/main' into animation-rework-docs
Lilaa3 Aug 19, 2025
76054a9
minor annoyance
Lilaa3 Aug 20, 2025
3f6883c
Make the exporter section look nicer
Lilaa3 Aug 20, 2025
95ec2dd
first draft
Lilaa3 Aug 20, 2025
daf0094
add repo settings info
Lilaa3 Aug 20, 2025
f929310
fix math
Lilaa3 Aug 20, 2025
31b3e71
some small tweaks
Lilaa3 Aug 21, 2025
d5726f8
add interlace
Lilaa3 Aug 21, 2025
494d17d
Add example use case
Lilaa3 Aug 21, 2025
21ee545
Fix binary types
Lilaa3 Aug 21, 2025
2a0b7d6
actually write out expression
Lilaa3 Aug 21, 2025
8053295
fix versions (why doesn´t git recognize it's a file rename?)
Lilaa3 Aug 21, 2025
1437e6e
Separately
Lilaa3 Aug 21, 2025
d2208e8
Seperate
Lilaa3 Aug 21, 2025
b9328b5
playback
Lilaa3 Aug 21, 2025
673bcfe
Custom flags
Lilaa3 Aug 21, 2025
2a847f4
Below
Lilaa3 Aug 21, 2025
d0e666c
Merge remote-tracking branch 'upstream/main' into custom-commands-docs
Lilaa3 Aug 21, 2025
32404bd
Merge branch 'custom-commands-docs' of github.com:Lilaa3/fast64-docs …
Lilaa3 Aug 21, 2025
88607bd
why did it do that
Lilaa3 Aug 21, 2025
c3e7f78
another below
Lilaa3 Aug 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This whole documentation repository is licensed under CC0-1.0, see the LICENSE.r

Fork this repo, edit what you want, and open pull requests!

See instructions below for setting up locally.
See instructions bellow for setting up locally.

The documentation source is written in reStructuredText and Markedly Structure Text, a simple and well-defined markup language. To learn about it, check out or copy-paste from:
- https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
Expand Down
6 changes: 5 additions & 1 deletion _static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,8 @@ The minimun number of colors or backticks for a block directive is 3 (except for
::: ; this ends the tab
:::: ; this ends the tab set

*/
*/

img.no-shrink {
max-width: none !important;
}
3 changes: 2 additions & 1 deletion common/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Documentation not specific to a game (SM64/OoT64).
:maxdepth: 1
:caption: Other:

updater/updater
updater/updater
repo_settings/repo_settings
Binary file added common/repo_settings/repo_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions common/repo_settings/repo_settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Repo Settings
=============

.. image:: repo_settings.png

Repo settings can be used to save common settings in fast64, each gamemode can support extra settings.

.. note:: Currently only supported by SM64

| Supported game modes will attempt to load fast64.json from the repository folder if auto load is enabled in the file.
| Game mode specific settings can be found in the respective tabs.
| General fast64 settings and save/load operators can be found in the **Fast64** tab in the **Fast64 Global Settings**

If you want to stop a value from being set on loading the settings, you can remove it from the json.
Binary file added sm64/custom_commands/binary_type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sm64/custom_commands/boolean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sm64/custom_commands/color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
328 changes: 328 additions & 0 deletions sm64/custom_commands/custom_commands.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,328 @@
Custom Commands (2.5.0+)
========================

| Custom commands are a way to define custom macros for level scripts, geolayouts and "special" collision.
| They can inherit basic properties of their owners (e.g. level empties can inherit all transforms, bones can inherit geometry, transforms (excluding scale) and layers).
| They can be exported in either binary or C.

Example Use Cases
-----------------

| `Lighting engine <https://github.com/HackerN64/HackerSM64/tree/base/lighting-engine>`_
implements custom commands for lights.
| In the previous implementation of custom commands, you'd have to specify each parameter.
| Now, you can use :download:`presets! <example_lighting_engine.json>`

.. list-table::
:widths: 50 50
:header-rows: 0
:align: center

* - .. image:: example_lighting_engine_presets.png
- .. image:: example_lighting_engine_empty.png

Using custom commands
---------------------

| You can use custom commands in object empties and bones by selecting **Custom**.

.. list-table::
:widths: 50 50
:header-rows: 0
:align: center

* - .. image:: empty_no_preset.png
- .. image:: empty_no_preset_bone.png

| You can then select a preset, or use the default No Preset mode.
| See `Adding new custom command presets`_ or skip to `Configuration`_.

Adding new custom command presets
---------------------------------

| You can create reusable commands that can be applied across multiple objects or bones.
| To do this, go into the SM64 tab, in **SM64 General Settings**, press the add button under **Custom Commands**.
| See `Configuration`_.
| These will be saved with :doc:`Repo Settings <../../common/repo_settings/repo_settings>`!

.. list-table::
:widths: 33 33 34
:header-rows: 0
:align: center

* - .. image:: empty_preset_edit_geo.png
- .. image:: empty_preset_edit_level.png
- .. image:: empty_preset_edit_special.png

Configuration
-------------
Some settings are only available when creating presets.

.. _command-name:

**Name**: *(Exclusive to presets)*
The name that will appear in the preset dropdown

.. _command-type:

**Type**:
- *Level*: Commands for level scripts, shows up in empties.
- *Geo*: Commands for geometry layouts, shows up in empties and bones
- *Collision*: Commands for collision data (Special, sometimes used for warps and a few objects), shows up in empties

.. _command:

**Command**::
The macro name or numeric ID of the command

.. _skip-eval:

**Skip Eval**:
When enabled, skip expression evaluation outside of binary mode

Level
~~~~~

.. image:: empty_preset_edit_level.png
:align: left

.. raw:: html

<div style="clear: both"></div>

.. _section:

**Section**: (Exclusive to presets, always **Hierarchy** without a preset)

- .. _section-hierarchy:

*Hierarchy*: Adds before areas if parented to level, otherwise in respective area

- .. _section-area:

*Area*: Adds to area (errors if parented to level)

- .. _section-level:

*Level*: Adds to level (errors if parented to area)

- .. _section-force-level:

*Force to Level*: Forces addition to level even if parented to area

Geolayout Presets
~~~~~~~~~~~~~~~~~
.. image:: empty_preset_edit_geo.png
:align: left

.. raw:: html

<div style="clear: both"></div>

.. _children-requirements:

**Children Requirements**: *(Exclusive to presets)*

- .. _children-requirements-none:

*None*: No requirements for child nodes, can optionally have children

- .. _children-requirements-must-have:

*Must Have Children*: Requires at least one child node, errors otherwise (like ``GEO_SWITCH``)

- .. _children-requirements-no-children:

*No Children*: Errors if node has children nodes (like ``GEO_ASM``)

.. _children-requirements-children:

**Group Children**:
Use ``GEO_OPEN_NODE``/``GEO_CLOSE_NODE`` to group child nodes

.. _displaylist-option:

**Displaylist Option**:

- .. _displaylist-option-none:

*None*: Doesn´t inherit geometry, deform disabled for bones

- .. _displaylist-option-optional:

*Optional*: Can inherit geometry, if no geometry can be inherited it uses ``NULL`` or the :ref:`Displaylist Command <displaylist-command>`.

- .. _displaylist-option-required:

*Required*: Must inherit geometry or export will fail

.. _displaylist-command:

**Displaylist Command**: (Exclusive to :ref:`Displaylist Option being set to Optional <displaylist-option>`)
| Command to use when geometry can be inherted. Will add an extra displaylist argument at the end.
| This is seen in vanilla with for e.g. ``GEO_TRANSLATE_NODE``, with the displaylist variant is ``GEO_TRANSLATE_NODE_WITH_DL`` (under the hood these use the same ID)

.. _is-animated:

**Is Animated**
Include animation data on animation export

Arguments
~~~~~~~~~

| Arguments define the parameters your custom command will include.
| In presets, you can set a name that will be displayed. The toggle to the left of the name enables its visibility in the UI, but the argument will be appended to the comman either way.
| To create a new argument, press the plus button.

.. _`expression`:

**Expression**: (Binary or with "Skip Eval" disabled)
Defines a basic python expression that will run on the final values being passed. Pre generated examples will not take these into accounts

.. note::
The expressions are limited in functionality to prevent abuse, as custom commands get loaded automatically from repo settings.

Example:

.. image:: eval_example.png
:align: left

``(round(y * 255) for y in x[:3])``

We are taking the final RGBA color in base 1, isolating RGB, scaling each value to 0-255 and rounding.

.. raw:: html

<div style="clear: both"></div>

Supported builtin python functions:
``round``, ``abs``, ``len``, ``min``, ``max``, ``sum``, ``sorted``, ``all``, ``any``, ``enumerate``, ``tuple``, ``list``, ``set``, ``dict``, ``range``

Additional functions:
* ``flatten(x)``:
| Flattens a nested list/tuple into a single tuple.
| ``flatten([1, 2, [3, 4]])`` -> ``[1, 2, 3, 4]``
* ``cast_integer(value, bit_count, signed)``:
Clamps an integer to the valid range of a specific bit count and signness.

.. math::
Min =
\begin{cases}
-(2^{\text{bit_count} - \text{signed}}) & \text{if signed} \\
0 & \text{if not signed}
\end{cases}

.. math::
Max = 2^{\text{bit_count - signed}} - signed

.. _binary-types:

**Export Types**: *(Exclusive to binary)*
| Bellow the eval expression, an option for the final types is available. Each argument type has its own appropriate default type.
| These are standard 64 bit types, as in, int is 32 bit, long is 64 bit, float is 32 bit and double is 64 bit.

.. image:: binary_type.png

.. _common-options:

**Common Options**:

- **Use Relative Transformation**:
Use the local (relative to parent) transformation instead of the world transformation
- **Blender to SM64 Scale**:
Multiply by Blender to SM64 scale value
- **Inherit**:
Inherit values from owner, like transformations or geometry.

.. _argument-types:

.. list-table:: Types

* - .. image:: parameter.png
:class: no-shrink
- **Parameter**

Basic string, binary will try to evaluate this

* - .. image:: boolean.png
:class: no-shrink
- **Boolean**

True/false

* - .. image:: number.png
:class: no-shrink
- **Number**

- *Is Integer*: Whole numbers
- *Min/Max* (Preset Only): Value limits
- *Step* (Preset Only): Increment/decrement amount

* - .. image:: color.png
:class: no-shrink
- **Color**

Base 1 RGBA color

- **Round to Conventional Units**:

| Uses singular argument, each value corresponds to the bit count of R, G, B, A.
| If 0 the element is removed.

* - .. image:: enum.png
:class: no-shrink
- **Enum**

Dropdown selection of user defined options

* - .. image:: translation.png
:class: no-shrink
- **Translation**

- **Round to Conventional Units**:

Rounds to signed 16-bit

* - .. image:: rotation.png
:class: no-shrink
- **Rotation**

- **Rotation Type**:

- *Euler*: Euler rotation in degrees
- *Quaternion*: Quaternion representation
- *Axis Angle*: Axis and angle representation

- **Rotation Order**:

| Order to convert to.
| ZYX is the default for level objects, XYZ is the default for geolayout commands.

* - .. image:: scale.png
:class: no-shrink
- **Scale**

Not available in bones

- **Round to Conventional Units**:

Rounds to x * ``0x10000``

* - .. image:: matrix.png
:class: no-shrink
- **Matrix**

4x4 transformation matrix

* - .. image:: layer.png
:class: no-shrink
- **Layer**

If geometry can be inherited this is overridden

* - .. image:: displaylist.png
:class: no-shrink
- **Displaylist**

- **Encode to Segmented Address**: (Binary only)
Encode address with the segment of the export level's segment
Binary file added sm64/custom_commands/displaylist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sm64/custom_commands/empty_no_preset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sm64/custom_commands/empty_no_preset_bone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sm64/custom_commands/empty_preset_edit_geo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sm64/custom_commands/empty_preset_edit_level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sm64/custom_commands/enum.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sm64/custom_commands/eval_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading