From 76c0e359802759fdfdabdd36171cf1c13b7c5ffb Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Fri, 1 Jul 2022 17:23:03 +0100 Subject: [PATCH] Update README (WIP) --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 37cc47a..9659cb4 100644 --- a/README.md +++ b/README.md @@ -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