Dungeon Siege Source Code Dungeon Siege was the game which popularized the entire composition-over-inheritance concept to the wider audience, thanks to the widely cited 2002 presentation:
https://www.youtube.com/watch?v=Eb4-0M2a9xEthere is also a few notes about how it all gets put together
https://dungeonsiege.fandom.com/wiki/Guide:_Siege_University_-_301:_Introduction_to_Dungeon_Siege_ArchitectureAnyway, back in 2023 the historic source code was leaked, apparently by one of the developers:
https://rpgwatch.com/forum/threads/dungeon-siege-source-code-leaked-online.54525/It has a lot of boilerplate, but the engine code is buried in
DungeonSiege/projects/tattoo/world/Go*.{h,cpp}
With the Go.h and GoBase.h being at the root of everything.
Compared to the Ultima Underworld and Dark Engine, Dungeon Siege's engine doesn't implement a true ECS, where an entity consists solely out of id (primary key).
Instead Dungeon Siege's objects are instances of your usual class, holding a list of components inside of them. Similar to modern Unity and Dwarf Fortress.
ComponentColl m_ComponentColl; //collection of owned components, server components first, clients second
Beside this list, the object has a ton of other garbage making it especially bloated and scary.
It does have an id (m_Goid), but it is used for your usual OOP nonsense.
Some objects also have m_Scid, which stands for "static content id", or using modern terminology a prefab or prototype.
Other objects are produced dynamically and don't have m_Scid.
For memory management, a reference counting scheme is employed.
In other words, it is unsuitable for finer objects, like particles, voxels and even larger terrain cells.
Dungeon Siege is a small step above traditional OOP, and still maintains most of its deficiencies.
TLDR: painful to read.
Current Mood: amusedCurrent Music: Richard Band - Descent to Undermountain OST