Skip to content

Commit

Permalink
style conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
WistfulHopes committed Jan 17, 2024
1 parent b279780 commit 03faa95
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 96 deletions.
2 changes: 1 addition & 1 deletion src/modding-bbs/bbs-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<hr>

BBS allows you to do much more than simply change damage numbers and spawn funny projectiles.
BBS allows you to do much more than simply change damage numbers and spawn projectiles.

Although it's a bit limited by the very nature of functioning inside of a fighting game framework, you can effectively achieve nearly anything you want with it, as long as you're willing to get creative.

Expand Down
81 changes: 40 additions & 41 deletions src/modding-bbs/bbs-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<hr>

The two best tutors to learn BBS from, are Arcsys and **you**. Read the vanilla game scripts, try to understand them, and also just go in and get your hands dirty. Learn by experimentation.
The two best tutors to learn BBS from are ArcSys and **yourself**. Read the vanilla game scripts, try to understand them, and go in and get your hands dirty. Learn by experimentation.

Having said that, we're not throwing you completely into the deep-end. What follows on this page, is a sort of quick overview of how BBS is structured.
Having said that, we're not throwing you completely into the deep-end. What follows on this page is a sort of quick overview of how BBS is structured.

If you want an actual glossary encompassing nearly everything BBS, check out [BBScript Documentation (Strive)](https://docs.google.com/document/d/1oVp_HDS-sjy2bEntQUHVaIk-P-4jeJx-3G89MC87xMw/edit), [DBFZ BBS doc](https://docs.google.com/document/d/1r8Uv-jz6R8VQuGp42_XV42vl4a1ZdWyxUEDlduMI3vM) or [DBFZ BBS Lookup](https://dobosken.github.io/dbfz_bbs_lookup/).

Expand All @@ -14,81 +14,80 @@ Note that the latter uses Broscar's bbscript for the `name_given` field and any

The very basis of a move. The game reads and executed a state from top to bottom. This is called the program flow.

When a state ends for a character object, that character object is returned to a neutral state by the battle state manager (`CmnActStand` while grounded, `CmnActJump` while airborne). When a state ends for an effect object, that effect object is deleted.
When a state ends for a character object, that character object is returned to a neutral state by native code (`CmnActStand` while standing, 'CmnActCrouch' while crouching, or `CmnActJump` while airborne). When a state ends for an effect object, that effect object is deactivated.

If you players to be able to enter a state directly (e.g. through user input), you'll have to register it with `addMove` and `registerMove`. However, that is not needed if you only interact with a state by jumping to it.
If you require players to be able to enter a state directly (e.g. through user input), you'll have to register it with `addMove` and `registerMove`. However, that is not needed if you only interact with a state by jumping to it.

## Subroutine

A subroutine is a bit of code in it's own block, seperate of states. It cannot contain sprites and has no real program flow, but it can contain pretty much every other function.
A subroutine (or function) is a separate block of code that can be reused in any state. It cannot contain sprites, but all other elements of BBS are usable.

When you call a subroutine in your state, you can think of it like simply copy-pasting the code from that subroutine in it's place.
Think of calling a subroutine as copy-pasting the contained code into the part of the state you call it in.

Subroutines are usually used to share one block of code with multiple different states.
Subroutines are usually used to share one block of code with multiple different states. For example, if several special moves share common code, a subroutine could be used.

If a subroutine starts with `cmn`, that means you'll find that specific subroutine inside `CMNEF`, and not inside the character's script.
If a subroutine starts with `cmn` (not case-sensitive), that means you'll find that specific subroutine inside `CMNEF`, and not inside the character's script.

## Labels

Remember that states are read from top to bottom? With labels, you can instead have the game jump to a specific point within a state.
Normally, states are run from top-to-bottom. However, with labels, you can instead have the game jump to a specific point within a state.

```bbs_o
label: s32(loop)
sprite: s32(xxx034_13), 3
sprite: s32(xxx034_14), 3
sprite: s32(xxx034_12), 3
spriteEnd:
gotoLabel: s32(loop)
Label: s32(loop)
CellBegin: s32(xxx034_13), 3
CellBegin: s32(xxx034_14), 3
CellBegin: s32(xxx034_12), 3
CellEnd:
Goto: s32(loop)
```

Congratulations, you just created an infinite loop! That's not very useful of course. Instead of `gotoLabel`, you can instead write `gotoLabelIfOperation: s32(loop), (IS_LESS_OR_EQUAL), var(ActionTime), int(60)`. Now you'll get a loop, **until** ActionTime hits 61. ActionTime is a variable that tracks how long an object is in a certain state, in game ticks. If ActionTime is 61 or more, the gotoLabel function does not trigger, and regular state flow is resumed from that point onwards.
The above code runs an indefinite loop. However, this isn't very useful by itself. Instead of `Goto`, you can instead write `ID_GotoIfOP2: s32(loop), (IS_LESS_OR_EQUAL), var(ActionTime), int(60)`. Now the loop will run **until** ActionTime hits 61. ActionTime is a variable that tracks how long an object is in a certain state in terms of frames. If ActionTime is 61 or more, the gotoLabel function does not trigger, and regular state flow is resumed from that point onwards.

You can find more functions like `gotoLabel`, by visiting [DBFZ BBS Lookup](https://dobosken.github.io/dbfz_bbs_lookup/) and clicking on the 'Flow' button next to the search bar.
You can find more functions like `Goto` by visiting [DBFZ BBS Lookup](https://dobosken.github.io/dbfz_bbs_lookup/) and clicking on the 'Flow' button next to the search bar.

## Variables

## Interrupts

Referred to as `upon` in the world of BBS. Why? Lol I dunno.
Also known as `upon` in the standard BBS dialect.

An interrupt executes a bit of code, the moment it's condition is triggered. This happens independent of program flow, meaning you can allow your objects to react to an event the moment it actually happens.
An interrupt executes a bit of code the moment its condition is triggered. This happens independent of the script flow, meaning you can allow your objects to react to an event the moment it actually happens.

```bbs_o
beginState: s32(ExampleMove) {
upon: (IMMEDIATE) {
ActionBegin: s32(ExampleMove) {
InterruptBegin: (IMMEDIATE) {
copyVar: var(act1), int(0)
upon: (IDLING) {
InterruptBegin: (IDLING) {
if: var(act1) {
addTension: 20
} endIf:
} endUpon:
upon: (RECEIVE_ATTACK) {
} InterruptEnd:
InterruptBegin: (RECEIVE_ATTACK) {
clearRegisteredUponCode: (IDLING)
} endUpon:
} endUpon:
sprite: s32(avp022_01), 1
sprite: s32(avp022_02), 1
sprite: s32(avp022_03), 1
copyVar: var(act1), int(1)
sprite: s32(avp022_04), 1
spriteEnd:
} endState:
} InterruptEnd:
} InterruptEnd:
CellBegin: s32(avp022_01), 1
CellBegin: s32(avp022_02), 1
CellBegin: s32(avp022_03), 1
OpCopy: var(act1), int(1)
CellBegin: s32(avp022_04), 1
CellEnd:
} ActionEnd:
```

When you register an interrupt, you simultaneously define what code runs when it is triggered. As you can see, calls to set interrupts can also be nested.
When you register an interrupt, you also define what code runs when it is triggered. As you can see, calls to set interrupts can also be nested.

In the code above, `upon: (IMMEDIATE)` activates **before** everything else, even before the first sprite is drawn. It also registers 2 new interrupt. `IDLING` runs every game tick.
In the code above, `InterruptBegin: (IMMEDIATE)` activates **before** everything else, even before the first sprite is drawn. It also registers two new interrupts. `IDLING` runs every game tick.

Can you guess what this entire bit of code does?
As an extra challenge, try to understand what this entire block does.

## CMNEF

`CMNEF` is a special BBS file, used to share states and subroutines among all objects in the game. This makes it extremely potent for applying changes that affect all characters and all spawned effect objects.
However, if you alter it, it means your mod becomes incompatible with any other mods that change it.
`CMNEF` is a special BBS file used to share states and subroutines among all objects in the game. This makes it extremely potent for applying changes that affect all characters and all spawned effect objects.

In short, if you're creating a single custom character, you're better off not changing it.
However, if you alter it, it means your mod becomes incompatible with any other mods that change it.

If you're making a complete overhaul / balance patch, use and abuse it.
In short, if you're creating a single custom character, you're better off not changing it. If you're making a complete overhaul / balance patch, use and abuse it.

## Signals

Expand All @@ -103,7 +102,7 @@ Here is a document listing several techniques and how one can choose to implemen
[google doc]()

TODO: Split off the BBS snippets from the DBFZ Google Doc into their own document.
- Armour
- Armor
- Locking out moves
- Revive on death

Expand Down
64 changes: 32 additions & 32 deletions src/modding-bbs/bbs-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,45 @@

## Generic states

The battle state manager looks for, and uses, several default states. This means the developers don't have to explicitly handle generic state transitions.
The native code of the game looks for, and uses, several default states. This means the developers don't have to explicitly handle generic state transitions.
If a standing move ends, characters start looping `CmnActStand`. If a character gets hit, they'll go into the state that matches the hit reaction.

The battle state manager is also able to affect program flow within those default states.
Native code is also able to affect script flow within those default states.
```bbs_o
beginState: s32(CmnActJump) {
label: s32(_Upper)
label: s32(upperloop)
sprite: s32(kfs021_00), 3
sprite: s32(kfs021_01), 3
sprite: s32(kfs021_02), 3
spriteEnd:
gotoLabel: s32(upperloop)
label: s32(_UpperToTop)
sprite: s32(kfs021_03), 2
sprite: s32(kfs021_04), 2
sprite: s32(kfs022_00), 2
sprite: s32(kfs022_01), 2147483647
label: s32(_Top)
sprite: s32(kfs022_02), 2147483647
label: s32(_TopToDown)
sprite: s32(kfs022_03), 3
sprite: s32(kfs022_04), 2147483647
label: s32(_Down)
label: s32(downloop)
sprite: s32(kfs022_05), 3
sprite: s32(kfs022_06), 3
sprite: s32(kfs022_07), 3
spriteEnd:
gotoLabel: s32(downloop)
} endState:
ActionBegin: s32(CmnActJump) {
Label: s32(_Upper)
Label: s32(upperloop)
CellBegin s32(kfs021_00), 3
CellBegin s32(kfs021_01), 3
CellBegin s32(kfs021_02), 3
CellEnd:
Goto: s32(upperloop)
Label: s32(_UpperToTop)
CellBegin s32(kfs021_03), 2
CellBegin s32(kfs021_04), 2
CellBegin s32(kfs022_00), 2
CellBegin s32(kfs022_01), 2147483647
Label: s32(_Top)
CellBegin s32(kfs022_02), 2147483647
Label: s32(_TopToDown)
CellBegin s32(kfs022_03), 3
CellBegin s32(kfs022_04), 2147483647
Label: s32(_Down)
Label: s32(downloop)
CellBegin s32(kfs022_05), 3
CellBegin s32(kfs022_06), 3
CellBegin s32(kfs022_07), 3
CellEnd:
Goto: s32(downloop)
} ActionEnd:
```
As you can see, there are several different labels in this `CmnActJump` state, but you won't ever find a function that actually jumps to `_TopToDown`. Instead, the battle state manager does so itself when the proper conditions are met (e.g. airborne, Y-speed less than 0).
As you can see, there are several different labels in this `CmnActJump` state, but you won't ever find a function that actually jumps to `_TopToDown`. Instead, the native code does so itself when the proper conditions are met (e.g. airborne, Y-speed less than 0).

The battle state manager can also add function calls whenever it detects certain active state names. For example, DBFZ's `CmnActMikiwameMove` (Vanish) will initiate a worldStop, even if all relevant calls in the script have been deleted.
Native code can also add function calls whenever it detects certain active state names. For example, DBFZ's `CmnActMikiwameMove` (Vanish) will initiate a worldStop, even if all relevant calls in the script have been deleted.

## Generic subroutines

The battle state manager is also able to call a subroutine for an object on it's own accord. Here are a few notable ones:
Native code is also able to call a subroutine for an object of its own accord. Here are a few notable ones:

| Subroutine | Functionality |
| ----------------------------- | ----------------------------- |
Expand All @@ -52,4 +52,4 @@ The battle state manager is also able to call a subroutine for an object on it's
| `OnGuard` | |
| `OnFrameStep` | Called every game tick, no matter which state the object is in.<br />Not affected by worldStop. |

For DBFZ, OnIdling is called even for assist characters that are off-screen.
For DBFZ, OnIdling is called even for assist characters that are off-screen.
8 changes: 4 additions & 4 deletions src/modding-bbs/bbs-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<hr>

Movesets are defined on a per-character basis in a custom scripting engine developed by Arcsys. These scripts are called BBS.
Movesets are defined on a per-character basis in a custom scripting engine developed by Arc System Works. These scripts are called BBScript, but are often abbreviated to **BBS**.

Although the core battle state manager of Arcsys games is still somewhat of a mystery to us, BBS has since been blown wide open, allowing us to not just alter characters, but create entirely new ones as well.
BBS is a very well-documented and understood format, allowing us to not just alter characters, but create entirely new ones as well.

<br />

We highly recommend you read [A Sketch of the Arc System Works Engine Script](https://web.archive.org/web/20221115035259/https://pangaea.neocities.org/post/sketch-of-arcsys-scripting/), by pangaea, first.
We highly recommend you read [A Sketch of the Arc System Works Engine Script](https://web.archive.org/web/20221115035259/https://pangaea.neocities.org/post/sketch-of-arcsys-scripting/), by Pangaea, first.

For the sake of consistency, all example code uses internal Arcsys nomenclature. Game-specific code might be included where deemed necessary.
For the sake of consistency, all example code uses internal ArcSys nomenclature. Game-specific code might be included where deemed necessary.
4 changes: 2 additions & 2 deletions src/modding-bbs/bbs-io.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ TODO: Upload generic versions of Broscar's DBFZ scripts

### Bulk extracting all BBS from the game

Open the game's pak in Fmodel, and open the package search window (ctrl+shift+f). Type in `BBS_`.
Select all items in that window (ctrl+a), right click, and select 'Export Raw Data (.uasset)'.
Open the game's pak in FModel, and open the package search window (Ctrl + Shift + F). Type in `BBS_`.
Select all items in that window (Ctrl + A), right click, and select 'Export Raw Data (.uasset)'.

The files will appear in the 'Output' directory, but with their original folder structure intact, which can be time consuming to work with.
To consolidize all of these BBS files, you can slap any of these scripts into your FModel directory. When you run it, it'll copy all BBS files into a single folder named 'bbs'.
Expand Down
2 changes: 1 addition & 1 deletion src/modding-bbs/bbs-pergame.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

Although the concept of BBS is shared among all modern Arc System Works games, their exact implementation still differs per title.

In this section, you'll find various bits of information pertaining BBS in their respective games. This includes tweaks, bugfixes, and other bits of documentation managed by the community.
In this section, you'll find various bits of information pertaining to BBS in their respective games. This includes tweaks, bugfixes, and other bits of documentation managed by the community.
22 changes: 16 additions & 6 deletions src/tools/blender.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

Several tools were created to make Blender compatible with modding Arc System Works games.

## Modified gltf plugin
## Modified glTF plugin

[Download the modified gltf plugin](https://cdn.discordapp.com/attachments/856713078128771112/1074927094385094666/io_scene_gltf2_ue4.zip)
[Download the modified glTF plugin](https://cdn.discordapp.com/attachments/856713078128771112/1074927094385094666/io_scene_gltf2_ue4.zip)

Fire up Blender, go to your Preferences > Add-ons. Type `gltf` into the search bar. If it doesn't show up, make sure you're in the 'Official' tab.

Expand All @@ -21,15 +21,15 @@ For Windows, this can be found in:

Next, fire up Blender and go back to the Add-ons menu. If all went well, you'll find a new entry in there called `Import-Export: glTF 2.0 format - For Unreal Engine Modding`. Simply enable it, and you're good to go.

You can now import gltf meshes & skeletons via `File > Import > glTF 2.0 (.glb/.gltf) - Unreal`.
You can now import glTF meshes & skeletons via `File > Import > glTF 2.0 (.glb/.gltf) - Unreal`.

## Aerthas' custom materials & shaders

[Download BLENDER-Arc-System-Works-Shader](https://github.com/Aerthas/BLENDER-Arc-System-Works-Shader)

Not strictly needed for modding these games, but superb for preview models and textures within Blender itself.
While not strictly needed for modding, the shader is highly recommended for previewing models and textures within Blender itself.

Aerthas made a ton of practical videos on how to actually use his shader. Although the YouTube playlist is linked on that very Github page, [don't mind if we link it here as well](https://www.youtube.com/playlist?list=PLCkHUM_E60CSi1HowXR3v4uVWNqUDsl9l).
Aerthas made a ton of practical videos on how to use his shader. [Here is a link to a playlist containing said videos](https://www.youtube.com/playlist?list=PLCkHUM_E60CSi1HowXR3v4uVWNqUDsl9l).

## Scripts

Expand All @@ -39,4 +39,14 @@ The most useful scripts have their own [wiki pages](https://github.com/SaitsuP/A

## A note on Blender FBX export into UE4

Vanilla Blender FBX export is kinda icky. If you're willing to pay up, consider [Better Fbx Importer & Exporter](https://blendermarket.com/products/better-fbx-importer--exporter) instead.
The default Blender FBX exporter, while usable, is not preferred for Unreal Engine 4 modding. If you're willing to pay up, consider [Better FBX Importer & Exporter](https://blendermarket.com/products/better-fbx-importer--exporter) instead.

If you are modding Guilty Gear -Strive- or a game newer than it, there is also [Epic Games' very own Send to Unreal addon](https://github.com/EpicGames/BlenderTools/releases/tag/20220216152539). **The linked release is the last one that works on UE4.25. Newer releases only support UE4.27 and above, and the most recent releases only supports UE5.**

Note that you must have connected your GitHub account to your Epic Games account in order to view this page. [Click here for more information.](https://www.epicgames.com/help/en-US/epic-accounts-c5719348850459/connected-accounts-c5719351300507/how-do-i-link-my-unreal-engine-account-with-my-github-account-a5720369784347?sessionInvalidated=true)

If you are *not* using the Better FBX addon, there is one step that must be followed in order to export an FBX to Unreal:
- The Armature for your model *must* be named Armature. **If it is named anything else, skeletal mesh imports will not animate correctly.**

Additionally, if you are not using the Send to Unreal addon, there is one more step that must be undertaken:
- Under the Scene tab of the Properties menu, set the Unit Scale to 0.01. You will also need to scale your model proportionately (100 times).
6 changes: 3 additions & 3 deletions src/tools/get-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<hr>

The usual stuff aside, several key pieces of software are used for nearly every aspect of modding these games. We recommend just getting all of them from the get-go.
- [Fmodel](https://fmodel.app)
- [Umodel](https://www.gildor.org/en/projects/umodel)
Besides Unreal Engine 4 itself, several key pieces of software are used for nearly every aspect of modding these games. We recommend just getting all of them.
- [FModel](https://fmodel.app)
- [UModel](https://www.gildor.org/en/projects/umodel)
- [AssetEditor](https://github.com/kaiheilos/Utilities)
- [UAssetGUI](https://github.com/atenfyr/UAssetGUI/releases)
- [Blender](https://www.blender.org/download/)
Expand Down
Loading

0 comments on commit 03faa95

Please sign in to comment.