Taking a deep dive into the source code: Where to start?

Do you want to help out with Freeciv development? Then check out this forum.
Post Reply
ConquestCola
Posts: 1
Joined: Wed Jan 03, 2024 9:38 pm

Taking a deep dive into the source code: Where to start?

Post by ConquestCola »

I'm interested in learning the ins and outs of the FreeCiv source code. The problem is, I have a very hard time grasping the basics of such large code bases on my own. I'm mostly interested in the offline, single player source code and learning about the AI. Using C and Lua in and of itself is not the issue. I have problems figuring out how everything works together. That's what I want help with.

I've looked at a few of the resources online, yet I haven't really found anything that explains things in depth. Maybe I haven't looked hard enough. The Holy Grail of FreeCiv documentation for me would be to find something that explains the AI's reasoning in more or less plain English. References to the specific source code would be a plus, but even that is not necessary.

The dream is something like this, which was written covering an open source version of Master of Orion:
https://explorminate.co/a-very-detailed ... ion-1s-ai/

I would pay real money for an equivalent of this for FreeCiv, if that didn't go against the espirit de corps of the open source community surrounding the game.

If hoping for something like this is a pipe dream, please let me know. Otherwise, I would appreciate advice on how to approach the task of understanding the source code and the AI specifically, as would befit a mid-level programmer who has never had to be personally responsible for grasping the nuances of such a large code base. Thank you very much in advance for anything you can offer.
Elefant
Hardened
Posts: 217
Joined: Sat May 28, 2022 3:55 am

Re: Taking a deep dive into the source code: Where to start?

Post by Elefant »

Check out the doxygen docs. They are the best docs I have been able to find for the source code. Otherwise, you'll need to look at the code patch by patch to figure out what is going on.
Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
Elefant
Hardened
Posts: 217
Joined: Sat May 28, 2022 3:55 am

Re: Taking a deep dive into the source code: Where to start?

Post by Elefant »

Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
cazfi
Elite
Posts: 3111
Joined: Tue Jan 29, 2013 6:54 pm

Re: Taking a deep dive into the source code: Where to start?

Post by cazfi »

ConquestCola wrote: Wed Jan 03, 2024 9:57 pmsomething that explains the AI's reasoning in more or less plain English.
Though outdated, README.AI is the best document about high level principles of the AI functionality.
Post Reply