How icetheys/rust-mta works
1. This is an MTA:SA server repository, not a generic app. The root contains the server runtime configuration and persistence files: mtaserver.conf, acl.xml, banlist.xml, settings.xml, vehiclecolors.conf, plus registry.db and server-id.keys. The architecture is therefore resource-based Lua scripts deployed into an MTA server.
2. The main game logic lives in resources/[STONEAGE]/gamemode. This is the authoritative core of the project and is split the MTA way: client scripts for UI/rendering/input, server scripts for game rules and persistence, and global/ modules for shared data/configuration. It is the central subsystem that orchestrates the rest of the resources.
3. The gamemode’s client side handles player-facing presentation and local interaction: HUD, main menu, inventory, tutorials, weapon visuals, damage/death feedback, temporary effects, and UI utilities. The server side handles the real game state: accounts, player state, inventory, crafting, damage, chat, attachments, furnaces, planting, research tables, and other system logic.
4. Persistence is server-owned. gamemode/scripts/server/database/ plus the separate stoneage_sql resource indicate a dedicated data layer for accounts and world objects, with permanent state likely stored through the MTA database stack and registry.db. Clients do not access persistence directly; they request actions that the server validates and saves.
5. The survival/crafting loop is implemented as a set of cooperating gameplay resources: stoneage_farms, stoneage_pickups, stoneage_recycler, stoneage_base_building, stoneage_sentrys, stoneage_vehicles, stoneage_gas_stations, stoneage_hospitals, stoneage_faint, and the crafting/furnace/research code inside the gamemode. Flow-wise, players gather resources, process them, craft items, build structures, and use the resulting equipment in the world.
6. The world is authored as separate map resources under resources/[STONEAGE]/[dependencies]/stoneage_maps and related editor dumps/backups. These resources place islands, walls, patrol/loot points, spawn zones, and military areas. Some include map editor scripting extensions and LOD streaming helpers, so static world content is packaged independently from gameplay logic.
7. Large parts of the visual world are injected through an asset replacement layer. The replaces resource ships encrypted DFF/TXD/COL assets for animals, weapons, pickups, bases, skins, objects, and vehicles. This means the rendered game content is decoupled from gameplay scripts and is delivered as streamed model/texture replacements.
8. UI and interaction are split into reusable framework resources instead of being embedded in the gamemode. Examples include stoneage_ui (widget toolkit), stoneage_interaction (context/option lists), stoneage_notifications, stoneage_scoreboard, stoneage_nametag, stoneage_compass, stoneage_loadscreen, stoneage_object_preview, stoneage_highlight, stoneage_zoom, and texNames. These are presentation-only or near-presentation subsystems used by the main game mode.
9. Administrative and operational controls are isolated in stoneage_admin, stoneage_ac, stoneage_logs, stoneage_settings, stoneage_ranking, and richpresence-id. Admin features include bans, spectate, fly mode, inventory edits, VIP/group management, and command handling. Logging is also an explicit subsystem, with server-side log handling and a Discord integration path in stoneage_logs.
10. Vehicle and transport mechanics are their own cluster. stoneage_vehicles, stoneage_enter_vehicle, stoneage_bike, _stoneage_ship, and stoneage_helicopter handle ownership/repair/engine behavior and transport-specific interactions, while stoneage_gas_stations ties vehicle usage to fuel/economy. This keeps vehicle logic outside the core survival and building code.
11. There are several auxiliary gameplay services that plug into the main loop rather than own it: dep-npc for NPC AI/tasks, stoneage_radiation_zones for environmental hazards, stoneage_airdrop for loot events, stoneage_military for gated military-area behavior, and stoneage_voice/stoneage_sound3D for immersive audio. These are event-driven support systems.
12. Overall data flow is client action → server authority → persistence/world update → broadcast back to clients. Most features are resource-isolated, connected through MTA resource metadata, shared Lua modules, and event/export-style integration. For an architecture diagram, the biggest boundary is between the central gamemode/server systems and the many independent support resources around it.
Main entry points: server Server side · client Client side · gamemode Core mode · stoneage_ac Anti-cheat
Components 23
Server root
MTA server configuration and persistence files at the repository root.
- Server files · Top-level MTA server configuration, ACL, bans, settings, and local persistence files.
Gamemode
Authoritative StoneAge game logic and shared data.
- Core mode · Central StoneAge gamemode coordinating client, server, and shared modules.
resources/[STONEAGE]/gamemode - Client side · Player-facing rendering, HUD, menus, inventory UI, tutorials, and local effects.
resources/[STONEAGE]/gamemode/scripts/client - Server side · Server-owned game rules, player state, inventory, crafting, damage, chat, and world interactions.
resources/[STONEAGE]/gamemode/scripts/server - Shared data · Global gameplay configs, object definitions, blueprints, utilities, and spawn positions.
resources/[STONEAGE]/gamemode/scripts/global - Game DB · Gamemode database access for accounts and persisted world objects.
resources/[STONEAGE]/gamemode/scripts/server/database - Craft loop · Crafting, furnaces, research tables, and item processing inside the core loop.
World content
Map resources, editor dumps, and static world placement.
- World maps · Independent map resources and editor dumps for islands, walls, spawns, patrols, and loot points.
UI/interaction
Presentation, HUD, and reusable interaction framework resources.
- UI toolkit · Reusable widget system and common UI primitives used across the project.
resources/[STONEAGE]/[dependencies]/stoneage_ui - Interaction · Option lists and contextual interaction rendering for world objects and players.
resources/[STONEAGE]/[dependencies]/stoneage_interaction - Notifications · Client/server notification delivery for player feedback.
resources/[STONEAGE]/[dependencies]/stoneage_notifications - Scoreboard · Scoreboard presentation and server-fed player information.
resources/[STONEAGE]/[dependencies]/stoneage_scoreboard
Gameplay systems
Survival, crafting, vehicles, hazards, and auxiliary gameplay services.
- SQL resource · Dedicated database resource used by the gamemode and other systems.
resources/[STONEAGE]/[dependencies]/stoneage_sql - Vehicles · Vehicle ownership, repair, engine behavior, and vehicle persistence/logic.
resources/[STONEAGE]/[dependencies]/stoneage_vehicles - Base building · Structure placement, upgrades, sync, and base-building rules.
resources/[STONEAGE]/[dependencies]/stoneage_base_building - Survival loop · Farms, pickups, recycler, sentries, hospitals, fainting, and gas stations that feed progression.
- NPC AI · NPC control, tasks, and behavior helpers for non-player characters.
resources/[STONEAGE]/[dependencies]/dep-npc - Audio support · 3D sound and voice resources used for immersion and proximity audio.
resources/[STONEAGE]/[dependencies]/stoneage_sound3D
Ops/admin
Administration, anti-cheat, logging, settings, and rankings.
- Admin panel · Bans, spectate, fly mode, inventory edits, VIP/group management, and commands.
resources/[STONEAGE]/[dependencies]/stoneage_admin - Anti-cheat · Client/server anti-cheat checks and kick-ping enforcement.
resources/[STONEAGE]/[dependencies]/stoneage_ac - Logs · Server logging with Discord integration path.
resources/[STONEAGE]/[dependencies]/stoneage_logs - Settings · Per-player settings UI and persistence-facing settings resource.
resources/[STONEAGE]/[dependencies]/stoneage_settings
Assets/replacements
Streamed models, textures, sounds, and visual replacement layers.
- Asset replaces · Encrypted DFF/TXD/COL replacements for objects, weapons, pickups, skins, animals, horses, and vehicles.
resources/[STONEAGE]/[dependencies]/replaces
Connections 25
- Server files → Core mode: boots · Server starts the central gamemode resource.
- Core mode → Client side: splits · Client presentation is one half of the gamemode.
- Core mode → Server side: splits · Server authority and state management form the other half.
- Core mode → Shared data: shares · Shared configs, objects, and utilities feed both sides.
- Server side → Game DB: persists · Server logic writes account and world state through the gamemode data layer.
- Game DB → SQL resource: uses · Dedicated SQL resource backs persistence operations.
- Server side → Craft loop: runs · Crafting, furnace, and research logic is controlled server-side.
- Server side → Survival loop: orchestrates · Core server logic coordinates survival and resource-processing resources.
- Server side → Vehicles: authorizes · Vehicle mechanics are validated and managed by server resources.
- Server side → Base building: authorizes · Building placement and upgrades are governed by the server.
- Client side → UI toolkit: renders · Client gameplay UI is built on the shared widget toolkit.
- Client side → Interaction: opens · Context actions and option lists surface player interactions.
- Client side → Notifications: shows · Client displays server-driven notifications.
- Client side → Scoreboard: shows · Client renders scoreboard state.
- Server side → World maps: spawns · Game logic consumes authored map resources and spawn zones.
- Shared data → Asset replaces: references · Shared object/item definitions align with streamed replacement assets.
- Craft loop → Asset replaces: visualizes · Craftable items and placeables use replacement models and textures.
- Survival loop → World maps: places · Gathering points, loot points, and hazard zones live in map resources.
- Admin panel → Server side: controls · Admin operations manipulate server-managed state.
- Anti-cheat → Client side: checks · Anti-cheat includes client-side enforcement hooks.
- Anti-cheat → Server side: checks · Server-side enforcement detects and reacts to abuse.
- Logs → Server side: records · Server events and administrative actions are logged.
- Settings → Client side: configures · Player settings are exposed through client UI.
- NPC AI → World maps: operates in · NPC tasks and behaviors run against authored world locations.
- Audio support → Client side: plays · Voice and 3D sounds are presented to players on the client.