From cd0c08dc7ce754473178ad3f32f7740a1dddc1eb Mon Sep 17 00:00:00 2001 From: Vaino Kauppila Date: Thu, 2 Jul 2026 22:58:25 +0300 Subject: Initial import: LibreForts (M0-M5 in progress) Open-source Forts clone: custom C++20 engine + data-driven (Lua) 2D physics artillery RTS. - Building: node/strut graph on a stiff mass-spring solver (canon Forts model), triangulation rigidity, axial + 30-degree angle-stress breaking, cascading collapse, fire (DoT + spread), ground destroys debris. - Weapons (M4): cannon (ballistic) + laser (beam/ignite) with select-and-aim-in- arc UX; splash / beam damage; bg-brace passthrough. - Devices + economy (M5): reactors + win/loss + restart, mines/turbines/battery, metal deposits, storage caps, per-shot energy cost. - Data-driven via Lua/sol2 with a layered mod loader; enemy-fort scenario mod. - Renderer: SDL3 + textures + ImGui dev UI. stb_image + ImGui vendored. - Assets: CC0 placeholders only; real game art loaded at runtime from the user's own install via forts: paths (bring-your-own; nothing copyrighted committed). See README.md / CLAUDE.md and research/ + requirements/ for detail. --- data/devices.lua | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 data/devices.lua (limited to 'data/devices.lua') diff --git a/data/devices.lua b/data/devices.lua new file mode 100644 index 0000000..e5309dc --- /dev/null +++ b/data/devices.lua @@ -0,0 +1,48 @@ +-- Device catalog (reactor / mine / turbine / battery). Values scaled from Forts' +-- devices/*.lua. `texture` may use a "forts:REL" path to load real art from your +-- own Forts install at runtime (nothing copyrighted is stored in the repo); if +-- the game isn't present it falls back to the flat `color`. + +DeviceDefs = +{ + { + name = "reactor", is_core = true, -- the core: lose it and the round ends + hp = 100, -- Forts reactor HP 100 (fragile) + energy_rate = 100, metal_rate = 5, -- also the base generator + half_w = 0.7, half_h = 0.9, + texture = "forts:devices/reactor/reactor_core01.tga", + color = { 0.3, 1.0, 0.5 }, + }, + { + name = "turbine", wind = true, -- energy scales with height above ground + hp = 60, wind_max_rate = 16, wind_max_height = 22, + half_w = 0.5, half_h = 1.3, + cost_metal = 30, cost_energy = 50, + texture = "forts:devices/windturbine/base.tga", + color = { 0.6, 0.8, 1.0 }, + }, + { + name = "mine", needs_deposit = true, -- only produces on a metal deposit + hp = 80, energy_rate = -5, metal_rate = 4, -- Forts mine: -5 e, +4 metal + half_w = 0.6, half_h = 0.5, + cost_metal = 0, cost_energy = 100, + texture = "", + color = { 0.75, 0.55, 0.2 }, + }, + { + name = "battery", -- energy storage + hp = 100, energy_storage = 2000, -- Forts battery cap 2000 + half_w = 0.6, half_h = 0.6, + cost_metal = 20, cost_energy = 100, + texture = "", + color = { 0.9, 0.85, 0.3 }, + }, +} + +function IndexOfDevice(name) + for i, d in ipairs(DeviceDefs) do if d.name == name then return i end end + return nil +end +function FindDevice(name) + local i = IndexOfDevice(name); if i then return DeviceDefs[i] end; return nil +end -- cgit v1.3