How gamingxrelic/ratioactive works
1. This is a Godot 4 game project: a top-down shooter with a scene-driven architecture. The core runtime is the Godot engine; almost all gameplay behavior lives in GDScript attached to scenes or resources.
2. The project is split into a few major top-level domains: scenes, scripts, resources, components, and assets. Scenes define instanced game objects and screens; scripts provide behavior; resources hold data-driven weapon/bullet definitions; components encapsulate reusable gameplay modules; assets supply art, audio, shaders, and UI media.
3. The main composition root is the gameplay scene set under scenes/Game.tscn, backed by scripts/Game.gd. That scene is likely responsible for assembling the active level, player, UI, and any global game state transitions during play.
4. Global/shared state is centralized through autoload singletons in scripts/autoload: World.gd, Menus.gd, PlayerGun.gd, and WeaponList.gd. These are the cross-scene boundaries for world/game mode coordination, menu navigation, current player weapon state, and available weapon catalog access.
5. Player and enemy logic are separate entity subsystems. scenes/entities/Player/Player.tscn with scripts/player/Player.gd handles player movement and interaction; scenes/entities/enemies/Enemy.tscn with scripts/entities/enemy/Enemy.gd handles enemy behavior. Drops are also modeled as entities, including Dropped_Weapon.tscn, Ammo_Drop.tscn, and Health_Drop.tscn.
6. Combat is split into weapon, projectile, and hit-detection layers. scripts/gun/Gun.gd, Bullet.gd, and Grenade.gd drive firing and projectile behavior; scenes/weapons/bullets/Standard_Bullet.tscn and Grenade.tscn are the instanced projectile scenes. Weapon definitions are data-driven via resources/weapon/*.tres using resources/weapon/Base_Weapon.gd.
7. Reusable gameplay mechanics are factored into component scenes under components/scenes with matching scripts in components/script. The key components are health, hurtbox, attackbox, contact damage, buyable interaction, and text label support. This indicates a composition-over-inheritance style for many interactive objects.
8. The world/map layer is separate from entities. Levels live in scenes/levels, with a shared base in scripts/levels/Level.gd and level-specific logic such as Kitchen_Ramp.gd, Spawn_Room_Outlet_EE.gd, and Transparent_When_Player_Enters.gd. Map interaction objects like doors, random weapon pickups, wall guns, and enemy spawners sit under scenes/map.
9. Menu and HUD flows are isolated from gameplay. scenes/menus contains main menu, options, levels menu, and death screen scenes; scenes/UI/Game_UI.tscn and scenes/UI/pause_menu.tscn provide in-game HUD and pause overlay. Matching scripts in scripts/menus and scripts/ui keep UI logic separate from combat/world logic.
10. Audio, visual effects, and theming are content-heavy but still scene/resource oriented. Sound assets are grouped by context in assets/audio (menus, player, enemies, weapons, levels), while outlines and shader resources live in assets/shaders. This suggests most feedback effects are attached at the scene/resource level rather than handled globally.
11. The project uses data resources for balancing and content variation. Besides weapons, there are label resources like resources/labels/Dropped_Weapons_Label.tres and bullet resources like resources/bullet/Standard_Bullet.tres. This lets scenes reference tuned values and shared configurations without duplicating logic.
12. The architecture boundary is clear: scenes define runtime objects, scripts define behavior, resources define tunable content, and autoloads bridge state across scenes. For an architecture diagram, the main arrows are from global singletons into gameplay/UI scenes, from weapon/bullet resources into combat scenes, and from level/map scenes into entity and component instances.
Main entry points: Game.tscn Game · Game_UI.tscn Game UI · Enemy.tscn Enemy · Health_Component.tscn Combat comps
Components 23
Scenes
Runtime scene composition and instanced game objects
- Game · Main gameplay scene that assembles the active run, player, UI, and level flow
top_down_shooter/scenes/Game.tscn - Player · Player character scene for movement and interaction
top_down_shooter/scenes/entities/Player/Player.tscn - Enemy · Enemy actor scene for hostile behavior
top_down_shooter/scenes/entities/enemies/Enemy.tscn - Drops · Dropped weapon and powerup pickup scenes
top_down_shooter/scenes/entities/drops/Dropped_Weapon.tscn - Levels · Playable level scenes and map layout entry points
top_down_shooter/scenes/levels/Level_Kitchen.tscn - Map objects · Interactive doors, pickups, and spawners placed in levels
top_down_shooter/scenes/map/buyables/Door.tscn - Game UI · In-game HUD and pause overlay scenes
top_down_shooter/scenes/UI/Game_UI.tscn - Menus · Main, options, levels, and death screen scenes
top_down_shooter/scenes/menus/Main_Menu.tscn - Weapons · Firing and projectile scenes for guns and throwables
top_down_shooter/scenes/weapons/bullets/Standard_Bullet.tscn
Scripts
Behavior and scene logic
- Game logic · Script backing the main gameplay scene
top_down_shooter/scripts/Game.gd - Autoloads · Cross-scene singletons for world, menus, weapon state, and weapon catalog
top_down_shooter/scripts/autoload/World.gd - Player logic · Player movement and interaction behavior
top_down_shooter/scripts/player/Player.gd - Enemy logic · Enemy AI and combat behavior
top_down_shooter/scripts/entities/enemy/Enemy.gd - Gun logic · Weapon firing and projectile behavior
top_down_shooter/scripts/gun/Gun.gd - Level logic · Shared level base and kitchen-specific triggers and transitions
top_down_shooter/scripts/levels/Level.gd - UI logic · HUD and pause menu behavior
top_down_shooter/scripts/ui/Game_UI.gd - Menu logic · Main, options, levels, and death screen behavior
top_down_shooter/scripts/menus/Main_Menu.gd
Resources
Data-driven tuning and shared definitions
- Weapon data · Data-driven weapon definitions and weapon catalog entries
top_down_shooter/resources/weapon/Base_Weapon.gd - Bullet data · Bullet tuning resources used by projectile scenes
top_down_shooter/resources/bullet/Bullet_Res.gd - Label data · Shared label/config resource for dropped weapon text
top_down_shooter/resources/labels/Dropped_Weapons_Label.tres
Components
Reusable gameplay modules
- Combat comps · Health, hurtbox, attackbox, contact damage, buyable, and text label components
top_down_shooter/components/scenes/Health_Component.tscn
Connections 25
- Game → Player: instantiates · Gameplay scene composes the player entity
- Game → Enemy: spawns · Gameplay scene brings enemies into the active run
- Game → Drops: contains · Gameplay scene manages drops and pickups
- Game → Levels: loads · Gameplay scene anchors the active level
- Game → Game UI: hosts · Gameplay scene overlays HUD and pause UI
- Game logic → Game: drives · Scene script controls gameplay composition and flow
- Autoloads → Game: coordinates · Global state coordinates gameplay across scenes
- Autoloads → Menus: navigates · Menu singleton logic routes between screens
- Player logic → Player: controls · Player behavior is attached to the player scene
- Enemy logic → Enemy: controls · Enemy behavior is attached to the enemy scene
- Gun logic → Weapons: controls · Weapon logic powers gun and projectile scenes
- Weapon data → Gun logic: configures · Weapon resources tune firing behavior and stats
- Bullet data → Weapons: configures · Projectile resources tune bullet instances
- Level logic → Levels: controls · Level scripts implement shared and level-specific behavior
- Levels → Map objects: contains · Levels place doors, spawners, and pickups
- Combat comps → Player: composes · Reusable modules build player interactions
- Combat comps → Enemy: composes · Reusable modules build enemy interactions
- Combat comps → Drops: composes · Reusable modules support pickups and interactables
- UI logic → Game UI: controls · HUD and pause behavior live in UI scripts
- Menu logic → Menus: controls · Menu behavior lives in menu scripts
- Weapons → Audio: plays · Weapons use context-specific sound effects
- Game UI → Audio: plays · UI uses menu and feedback sounds
- Enemy → Audio: plays · Enemy actions use enemy audio feedback
- Game → Shaders: applies · Gameplay visuals use outline and effect shaders
- Game UI → Shaders: applies · UI and visuals share shader-based theming