Author Topic: Learning the codebase  (Read 232 times)

Offline DanielPBak

  • Zombie Food
  • *
  • Posts: 2
    • View Profile
Learning the codebase
« on: November 28, 2016, 08:43:27 PM »
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?

Dan

Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3484
    • View Profile
Re: Learning the codebase
« Reply #1 on: November 28, 2016, 10:00:29 PM »
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.

Offline DanielPBak

  • Zombie Food
  • *
  • Posts: 2
    • View Profile
Re: Learning the codebase
« Reply #2 on: November 28, 2016, 10:05:00 PM »
Are there any starter / newbie bugs? I can't find any tagged starter bugs on the repo.

Offline Zanos

  • Zombie Food
  • *
  • Posts: 28
    • View Profile
Re: Learning the codebase
« Reply #3 on: November 28, 2016, 10:41:10 PM »
There's an "easy fix" tag on the github issues, but they may or may not actually be easy to fix.


Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3484
    • View Profile
Re: Learning the codebase
« Reply #4 on: November 28, 2016, 10:51:18 PM »
Simple to fix:

https://github.com/CleverRaven/Cataclysm-DDA/issues/17790
Find monster::process_turn and wrap the part that emits field with an "if( !is_hallucination() ) { ... }"

https://github.com/CleverRaven/Cataclysm-DDA/issues/18585
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).