Update README (WIP)

This commit is contained in:
2022-07-01 17:23:03 +01:00
parent 952d1d5871
commit 76c0e35980

View File

@@ -2,7 +2,19 @@
Several Lua-based wiring components for the game [Barotrauma](https://barotraumagame.com/). Requires the [Lua for Barotrauma](https://steamcommunity.com/workshop/filedetails/?id=2559634234) mod to be installed.
The components are mainly designed to improve the performance of an advanced custom submarine called Daedalus but can be easily adapted to other submarines.
They are mainly designed to improve the performance of an advanced custom submarine called Daedalus by replacing large collections of vanilla components with a single Lua-based component.
## Design Considerations
You might notice some weird design decisions in the code as well as in-game. These decisions are summarized below.
### Usage of sub-components in item XML
As far as I know, Barotrauma does not have an easy way to store arbitrary variables in items. Instead, most custom component mods use a global Lua table that stores variables indexed by the item IDs they belong to. However, that comes with an important drawback: Lua tables are very slow, especially when accessed 60 times per second.
This is where the sub-components come in. They are used to store arbitrary values in their attributes, so editing them in-game is not recommended.
Specifically, the following sub-components are used depending on the stored variable type:
## Useful Resources