Today i did a checkout of some open-source projects just out of curiosity. So after a while i was looking at the code of OTTD (http://www.openttd.org/), i just didn't know where to start looking or how to understand the project. I know you cant get familiar with such big projects in one or two days, but how do you guys handle such things where do you begin what do you look for etcetera etcetera..
Docs for the source of OpenTTD: http://docs.openttd.org/ , they will be helpful.
Also, dev wiki: http://wiki.openttd.org/Development .
How to get familiar?
First, try compiling. Compile it to your platform and make sure it's running correctly.
Then, pick up a bug or something from to-do list and try to implement it, or just play the game and think about adding/changing something simple. Of course you can fail and want to change your task, but every try will be a step into understanding a structure of a project.
For me, the compiling part is most annoying part. I think it's because I'm on Windows :-) I've hardly ever managed to compile something from scratch without days of thinking and spamming people etc. But I quickly get used to many projects which aren't needed to be compiled, such as written in PHP or Python or JavaScript.
I just did something with the code. Changed some important constants :-) Writing plugins. Whatever. And one day I understood that now, If I choose almost any task from issue tracker, I'll be able to find out at least where the problem located.
If you're just reading code, you aren't gonna know it well! Even (good) fiction books can't be understood fully only by reading them again and again.
Download the code.
Set it up in your favorite IDE so that it builds and runs.
Set a breakpoint at the beginning of main()
Spend some quality time stepping through in the debugger :)
Gives you a good feel for how things are put together, where the dependencies are, and what happens when you do things in the app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With