Learning the codebase

Hi guys,

I’m a CS student who hasn’t participated in a large-scale project before, and I find the CDDA codebase quite intimidating. Do you guys have any tips or strategies about the more important portions of the codebase? Is there any documentation apart from the /doc/ folder?


Doxygen (all classes, namespaces and comments for many of them): http://dev.narc.ro/cataclysm/doxygen/

In general it’s the best to pick a simple problem and track it down to the bottom. That helps with understanding everything along the way.
Simple parts are weather (except for weather generation math), sounds, monster attacks. Those are mostly hardcoded and defined in 1-2 places.
Complex parts are items, characters, map, submaps. Those are either handled all over the place (items), involve caches (characters, map) or just plain hard to understand (submaps, mostly due to coordinates).

Trying to understand it all at once is neither necessary nor a good idea. Many sections are incredibly important yet rather small, while others are lengthy but don’t do anything.

Are there any starter / newbie bugs? I can’t find any tagged starter bugs on the repo.

There’s an “easy fix” tag on the github issues, but they may or may not actually be easy to fix.

Simple to fix:

Find monster::process_turn and wrap the part that emits field with an “if( !is_hallucination() ) { … }”

Doesn’t need any C++ changes or compiling, just json changes.
Would require finding the json for jumper cable installation and removal, then changing them from the old version to the new one, that specifies time and skills explicitly.

Balancing professions can be done with jsons only. Many professions are unbalanced (generally too weak for their point costs).