Amulets & Armor is a 1997 first person role playing game released as open source. The codebase is written primarily in C and builds for both DOS and Windows.
Artwork/
– icons and related artworkBuild/
– build scripts for DOS (MAKEFILE
) and Windows (Visual Studio projects)Exe/
– packaged binaries, game data and formsInclude/
– header files for all modulesLib/
– third-party libraries such as SDL and debug helpersSource/
– main game source codeUtils/
– small helper tools
The DOS version uses the legacy Watcom makefile found under Build/DOS
. Windows builds are set up with Visual Studio projects in Build/Windows/VC2010
and VC2013
. SDL provides input, video and networking for the Windows port.
The entry point for the game is Source/TESTME.C
. It initializes configuration, sets up subsystems, then runs the main loop. The source directory is divided into many modules such as graphics, input, networking and UI. Each .c
file begins with a short header describing its purpose, and has a matching header in Include/
.
Networking originally supported modem, serial and IPX connections through a layer called "Direct Talk" (DITALK.C
). Later a synchronization layer (CSYNCPCK.C
) was added so all clients advance in lock step. Random numbers come from a shared table to keep simulations deterministic.
During a synchronization round the client waits until it has received a sync packet from every active player. Once all packets are present, ClientSyncUpdateReceived()
processes them and advances the synchronized time.
SYNCTIME.C
maintains a global synchronized clock. Other modules read it when scheduling events, and networking code advances it after each synchronization round.
A large number of modules make up the game. Examples include 3D rendering (3D_VIEW.C
), creature logic (CRELOGIC.C
), object movement (OBJMOVE.C
), the packet queue (CMDQUEUE.C
) and the server/client code (SERVER.C
, CLIENT.C
). The Doxygen configuration in the repository can generate full documentation listing every module.
3D_COLLI.C
- 3D collision routines3D_IO.C
- 3D map loading/unloading3D_TRIG.C
- 3D math utilities3D_VIEW.C
- 3D rendering systemACTIVITY.C
- Processing of map script activitiesAREASND.C
- Area-based sound effectsBANKUI.C
- Bank user interfaceBANNER.C
- Bottom banner UIBUTTON.C
- Generic UI button componentCLIENT.C
- Player actions and top-level controlCLI_RECV.C
- Client side packet receptionCLI_SEND.C
- Client side packet sendingCMDQUEUE.C
- Networking command/packet queueCOLOR.C
- Palette color controlCOLORIZE.C
- Palette colorization helpersCOMWIN.C
- Communications window UICONFIG.C
- CONFIG.INI handlingCONTROL.C
- Mouse input in gameCRELOGIC.C
- Creature logic/AI routinesCSYNCPCK.C
- Synchronized packet handlingDBLLINK.C
- Double linked list utilitiesDEBUG.C
- Debug call stack systemDEBUGBOR.C
- Borland C debug utilitiesDITALK.C
- Direct Talk systemDOOR.C
- Door control codeEFFECT.C
- Item and spell effectsEFX.C
- Special effects in 3D worldFILE.C
- File I/O helpersFORM.C
- Generic form UI componentGRAPHIC.C
- Graphic UI component helpersGRAPHICS.C
- Low level drawing systemGUILDUI.C
- Guild user interfaceHARDFORM.C
- Hard form UI game systemHOUSEUI.C
- Housing user interfaceINIFILE.C
- INI file parserINNUI.C
- Inn user interfaceINVENTOR.C
- Inventory user interfaceKEYBOARD.C
- Keyboard controlsKEYMAP.C
- Key remapping systemLIGHT.C
- Map lighting tablesLOOK.C
- "Look" user interfaceMAINUI.C
- Character creation main UIMAP.C
- Map interfaceMAPANIM.C
- Map animation configurationMEMORY.C
- Memory allocation/freeingMESSAGE.C
- Message renderingMOUSEMOD.C
- OS-level mouse interfaceNOTES.C
- Notes banner windowOBJECT.C
- Objects in the worldOBJGEN.C
- Object generatorOBJMOVE.C
- Object movement subsystemOBJTYPE.C
- Object type definitionsOVERHEAD.C
- Overhead map viewOVERLAY.C
- Overlay animationsPACKETDT.C
- Packet communicationsPEOPHERE.C
- "People here" windowPICS.C
- Picture resource loaderPLAYER.C
- Player objectPROMPT.C
- Prompt status bar UIRANDOM.C
- Random number generatorRESOURCE.C
- Resource file systemSCHEDULE.C
- Event schedulerSCRFORM.C
- Script-based formsSCRIPT.C
- Script systemSERVER.C
- Server/world codeSERVERSH.C
- Code shared with serversSLIDER.C
- Sliding wall/door systemSLIDR.C
- UI scroll bar componentSMACHINE.C
- Generic state machine systemSMCCHOOS.C
- Character selection state machineSMCPLAY.C
- In-game state machineSMMAIN.C
- State machine top levelSOUND.C
- Sound systemSPELLS.C
- Spell logicSTATS.C
- Player statisticsSTORE.C
- Store user interfaceSYNCMEM.C
- Synchronization memory utilitiesSYNCTIME.C
- Synchronized time moduleTESTME.C
- Main entry point and loopTEXT.C
- Text UI componentTICKER.C
- Timer/ticker systemTOWNUI.C
- Town user interfaceTXTBOX.C
- UI text box componentTXTFLD.C
- UI text field componentUI.C
- UI top-level controlUIBUTTON.C
- UI button implementationUITEXT.C
- UI text helpersUPDATE.C
- Miscellaneous updatesVIEW.C
- Map view drawingVM.C
- Virtual memory helpersDOS/DOSDTALK.C
- DOS implementation of Direct TalkWin32/WINDTALK.C
- Windows implementation of Direct TalkWin32/ipx_client.*
- IPX networking over UDP (Windows)
- Run Doxygen using
Doxyfile
to browse module documentation. - Examine
Build/
to see how the DOS and Windows versions are compiled. - Start with
TESTME.C
and follow calls into the various subsystems to understand game flow. - Explore the assets under
Exe/
to learn how content is organized.