Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UE String Classes page, more Open Source Examples, discord ref fix #306

Merged
merged 5 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
*** xref:Development/UnrealEngine/Editor/index.adoc[Unreal Editor]
**** xref:Development/UnrealEngine/Editor/MainWindow.adoc[Main Window]
*** xref:Development/UnrealEngine/CoreRedirect.adoc[Core Redirects]
*** xref:Development/UnrealEngine/StringClasses.adoc[String Classes]

** xref:Development/Satisfactory/index.adoc[Satisfactory]
*** xref:Development/Satisfactory/Inventory.adoc[Inventories and Items]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For this documentation example, you can use `DocMod` as the mod reference.
When you start on your own mod, you will have to create a new plugin
with a mod reference other than this.

You can fill out the "Descriptor Data", or leave it blank, as we can edit that later.
Optionally, fill out the "Descriptor Data" section, or leave it blank since it can be edited later.

[WARNING]
====
Expand Down
106 changes: 106 additions & 0 deletions modules/ROOT/pages/Development/OpenSourceExamples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,109 @@ _Notable Satisfactory Features Used:_
_Notable Mod Loader Features Used:_

* Access Transformers, to be able to change otherwise inaccessible member variables.

[id="CableChoicesPlus"]
== Cable Choices {plus}

Adds a number of new variants of existing buildings (power cables and poles) as well as some buildings with custom functionality.

_Source Code_: Linked on the https://ficsit.app/mod/AB_CableMod[Mod Page]

_Mod Type_: Hybrid Blueprint/{cpp}

_Notable Techniques Used:_

* Custom models that follow the Satisfactory style
* Building icons generated with xref:CommunityResources/IconGenerator.adoc#_beavers_icon_generator[Beaver's Icon Generator]
* GitHub repository that contains additional files (the source models) in a clean structure
* Custom UI/UX
** Settings panel to reorganize build menu
* Base game content modifications
** Adds an additional recipe for the existing FICSMAS powerline lights
** Injects some unlocks into existing milestones

_Notable Satisfactory Features Used:_

* Customizer
** Skins (Power Cables)
** Building Materials (Power Cables)
* xref:Development/Satisfactory/BuildableHolograms.adoc[Buildable Holograms] with custom logic
** Snapping a power connector to spline based rail tracks
** Snapping power towers to each other with simple rules
** Behaviors for well aligned wall/foundation snapping (Delay Switch)
* Building interaction UIs
** Completely new UIs with source (Delay Switch)
** Retrofitted vanilla UIs to function elsewhere (Rail Power Box)

_Notable Mod Loader Features Used:_

* Mod Configuration
** Settings panel to reorganize build menu

[id="FluidExtras"]
== Fluid Extras

Adds a number of new variants of existing fluid junctions as well as several buildings with custom functionality.

_Source Code_: Linked on the https://ficsit.app/mod/AB_FluidExtras[Mod Page]

_Mod Type_: Hybrid Blueprint/{cpp}

_Notable Techniques Used:_

* Custom models that follow the Satisfactory style
* Building icons generated with xref:CommunityResources/IconGenerator.adoc#_beavers_icon_generator[Beaver's Icon Generator]
* GitHub repository that contains additional files (the source models) in a clean structure
* Custom Building Logic
** Custom fluid building that deletes input and animates based upon it (Exhaust)
** Custom building that detects input and selects recipes based on it (AI Packager)
* Custom UI/UX
** Settings panel to reorganize build menu

_Notable Satisfactory Features Used:_

* xref:Development/Satisfactory/BuildableHolograms.adoc[Buildable Holograms] with custom logic
** New and expanded behaviors for Junctions (in development)
** Modified Water Extractor that can snap to foundations (in development)
** Building that can snap to pipes and walls (Exhaust: Unreleased but pushed)
** Complex placement tolerance rules (Exhaust: in development)
* Building interaction UIs
** Completely new UIs with source (Exhaust)

_Notable Mod Loader Features Used:_

* Mod Configuration
** Settings panel to reorganize build menu

[id="Beavers Ficsmas Booster"]
== Beaver's Ficsmas Booster

Adds a number of new customizer building material and complex decorative parts. Uses seasonal toggles and several new from scratch materials.

_Source Code_: Linked on the https://ficsit.app/mod/AB_XMASBooster[Mod Page]

_Mod Type_: Hybrid Blueprint/{cpp}

_Notable Techniques Used:_

* Seasonal development each year
* Custom models that follow the Satisfactory style
* Building icons generated with xref:CommunityResources/IconGenerator.adoc#_beavers_icon_generator[Beaver's Icon Generator]
* GitHub repository that contains additional files (the source models) in a clean structure
* New Content
** Complex shader/mesh combo to create seamless gingerbread pieces when built
** Freeform spline buildings unlike other decorative parts (Icing)

_Notable Satisfactory Features Used:_

* Seasonal Events
** Many schematics and recipes are hidden behind the event check
* Customizer
** Building Materials (Gingerbread)
** Custom render material that still respects foundation decals (Gingerbread)
* xref:Development/Satisfactory/BuildableHolograms.adoc[Buildable Holograms] with custom logic
** Multi stage, Multi mode; Spline drawing hologram (Icing)

_Notable Mod Loader Features Used:_

* None
65 changes: 65 additions & 0 deletions modules/ROOT/pages/Development/UnrealEngine/StringClasses.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Unreal String Classes

Unreal offers different storage types for strings, each with its own use case.

This page serves as a brief overview of the 3 main string classes available in Unreal Engine 5
and how they relate to modding.

For more detailed information about these classes, check out the
https://dev.epicgames.com/documentation/en-us/unreal-engine/string-handling-in-unreal-engine?application_version=5.2[Unreal Engine documentation].

## String Classes

### FText

If you are displaying a string to the end user, 99% of the time you want to be using this string type.
It is mutable, provides nice formatter methods, and has built in engine localization support.
In memory, FTexts store localization keys that point to external data providing the string's contents.

Special edits have been made to the modding engine to enable mods to take advantage of Unreal's localization system at the per-plugin level.
Read more about how to use it on the xref:Development/Localization.adoc[Localizing Mods] page.

Read more on the
https://dev.epicgames.com/documentation/en-us/unreal-engine/ftext-in-unreal-engine?application_version=5.2[UE docs page for FText].

In modding, FText should be used for any string you plan to display to the user.
For example, schematic names, item descriptions, UI text, predefined chat messages, etc.

### FName

FNames are designed to be more efficient in cases where you are using a string as an identifier.
They are case-insensitive and immutable.
The actual string contents of an FName are stored once in a global data table.
In memory, they are a 4 byte identifier that can be used with this table to retrieve the related string.

FNames are useful as keys in maps because checking their equality is fast regardless of the length of the string.

Read more on the
https://dev.epicgames.com/documentation/en-us/unreal-engine/ftext-in-unreal-engine?application_version=5.2[UE docs page for FName].

In modding, FNames should be used in identifier, keys, or any other string you deem its optimizations beneficial.

### FString

FStrings are generic mutable strings with no additional context.
They take up as much memory as they have characters and offer the "typical" string operations like find and replace, substring, concatenation, comparison, etc.

Read more on the
https://dev.epicgames.com/documentation/en-us/unreal-engine/fstring-in-unreal-engine?application_version=5.2[UE docs page for FString].

In modding, FString is generally used for log messages, strings that change contents often, or strings that doesn't benefit from the features of FText or FName.

## Conversion

Although **it is possible to convert between all of the string types**,
doing so usually results in **missing out on features or optimizations** offered by that type,
and you lose the information about the original type of the string.
For example, going from an FText to an FString loses you the context of its localization key,
meaning you can't go "back" to the same FText you started with, even if you never changed the underlying string.

To perform "typical" string operations on FText and FName you may need to convert them to FStrings first
- just remember that going back is either unsafe or impossible.

If you're trying to make a hardcoded value in one of these types,
make sure to use the "Literal" syntax for creating it rather than one of the conversion functions.
For example, use the `Make Literal Name` blueprint node instead of the `String to Name` conversion function.
2 changes: 1 addition & 1 deletion modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ or Lua xref:Development/BeginnersGuide/overwriting.adoc#_tweakit[(TweakIt)].
If you're looking to write your own mods, we suggest you start with
making blueprint mods first rather than C++ mods.
Check out the xref:Development/BeginnersGuide/index.adoc[Getting Started Guide]
and consider picking up the `Aspiring Modder` role in our https://discord.ficsit.app[Discord]'s `#rules` channel.
and consider picking up the `Aspiring Modder` role in the "Channels & Roles" section of our https://discord.ficsit.app[Discord].

If you're looking to make models, it's best to learn how to put a mod together first.
Once you've completed the `Buildable` step in `Beginners Guide`, then check out our xref:Development/Modeling/index.adoc[Modeling Guide].
Expand Down