How wwr-12/terraria-source-code works
This repository is a collection of decompiled Terraria source snapshots (1.2.4.1, 1.3.5.3, and a partial 1.4.5.6 tree), presented for study and reuse. The principal product workflow is gameplay: the game loop advances players, NPCs, projectiles, and world simulation, while networking synchronizes multiplayer state and rendering presents the result. The tree also shows world generation and persistence, chat, achievements, and social integrations. Most implementation files were not sampled, so uncertain links are dashed and uncited; the supplied excerpts for several 1.4.5.6 files are not present in the tree.
Main entry points: Main.cs Game loop · Netplay.cs Network runtime · WorldGen.cs World generation · MessageBuffer.cs Message handling
Components 20
Game runtime
- Player state
1.3.5.3/Terraria/Player.cs - NPC simulation
1.3.5.3/Terraria/NPC.cs - Projectile simulation
1.3.5.3/Terraria/Projectile.cs - Game loop
1.3.5.3/Terraria/Main.cs
World systems
- World generation
1.3.5.3/Terraria/WorldGen.cs - Generation framework
1.3.5.3/Terraria.World.Generation/WorldGenerator.cs - World persistence
1.3.5.3/Terraria.IO/WorldFile.cs - World map
1.2.4.1/Terraria/Map.cs - Tile state
1.3.5.3/Terraria/Tile.cs
Multiplayer
- Network runtime
1.3.5.3/Terraria/Netplay.cs - Message handling
1.3.5.3/Terraria/MessageBuffer.cs - Network messages
1.3.5.3/Terraria/NetMessage.cs
Player features
- Chat rendering
1.3.5.3/Terraria.UI.Chat/ChatManager.cs - Achievements
1.3.5.3/Terraria.Achievements/AchievementManager.cs - Social services
1.3.5.3/Terraria.Social/SocialAPI.cs
Presentation
- Localization
1.3.5.3/Terraria.Localization/LanguageManager.cs - Screen effects
1.3.5.3/Terraria.Graphics.Effects/FilterManager.cs - Waterfall rendering
1.3.5.3/Terraria/WaterfallManager.cs
Other components
- Player
- Remote players
Connections 19
- Player → Game loop: plays
- Game loop → Player state: advances
- Game loop → NPC simulation: advances
- Game loop → Projectile simulation: advances
- World generation → Generation framework: uses
- Game loop → World generation: starts
- Game loop → World persistence: loads world
- Game loop → World map: updates
- Game loop → Tile state: simulates
- Game loop → Network runtime: starts networking
- Network runtime → Message handling: dispatches
- Message handling → Network messages: uses
- Remote players → Network runtime: connects
- Game loop → Chat rendering: presents chat
- Game loop → Achievements: updates progress
- Game loop → Social services: uses services
- Game loop → Localization: uses text
- Game loop → Screen effects: renders effects
- Game loop → Waterfall rendering: renders water