Ideal Development Platform for FreeCiv

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
bradltl
Posts: 2
Joined: Mon Mar 24, 2014 8:22 pm

Ideal Development Platform for FreeCiv

Postby bradltl » Mon Mar 24, 2014 8:59 pm

So, first off, I've been a fan of Freeciv for years. Thank all of you for your contributions and efforts.

I've recently really wanted to start "tinkering" with some of the programming, mostly to satisfy my own curiosity but maybe eventually growing into a mod or other contribution.

I'm wondering if your ideal dev environments and tools. I'm not a well seasoned developer, so I don't have any real bias one way or the other. I have Windows, Mac, and Linux computers already resident on my desk... so where should I start?

Thanks!
Brad

sveinung
Elite
Posts: 469
Joined: Wed Feb 20, 2013 4:50 pm

Re: Ideal Development Platform for FreeCiv

Postby sveinung » Tue Mar 25, 2014 12:38 am

If the below is a reply to the wrong question I would like you to clarify some things. Are you just new to changing Freeciv or are you new to programming in general? If you are new to programming in general: Is your prime motivation to change Freeciv or to learn how to program? If you are new to changing Freeciv: Are you aware that parts of Freeciv, like most rule set files, are in the section (".ini") file format? Do you wish to do things that require C programming or are Lua programming or section file changes interesting too?

One possible reply. Assumptions: You are new to changing Freeciv or has modifying it as your primary goal. You are aware that Freeciv, unlike the toy problems most programmers starts with, is big and has a lot of stuff that interacts with each other. You are interested in changing stuff that can't be changed in a rule set. You know enough to compile Freeciv from source code. You know how to read source code. You know what a version control system is. Let me know were I was wrong.

bradltl wrote:I'm wondering if your ideal dev environments and tools. I'm not a well seasoned developer, so I don't have any real bias one way or the other. I have Windows, Mac, and Linux computers already resident on my desk... so where should I start?

If you are going to modify the Freeciv C source code using GNU/Linux will probably be the easiest option. (If it isn't Android it's probably GNU/Linux) What specific tools you will find easiest may be different from what I find easiest. I may also be unaware of some superior option.

Personally I use Debian testing when I develop Freeciv. In Debian (and Debian derivatives like Ubuntu) the command

Code: Select all

apt-get build-dep freeciv
will download and install all that is required to compile the Freeciv version that comes with the distribution. You may need to install other things to build trunk (the most recent Freeciv version). If you send us a patch it should be against trunk. At the moment Freeciv trunk is Freeciv 2.6. The stable version is Freeciv 2.4.

A good text editor will highlight the source code so it is easier to understand. It will also reveal simple mistakes. An integrated development environment (IDE) will do that and more. Examples are pointing out more complicated mistakes, take you to a symbol's definition and list all places it is used. Personally I use an IDE called QtCreator when I program in C or C++. It doesn't understand that a Freeciv specific macro will turn our specenums into enums so it won't take you to their definition. Its normal text search will have to do in those cases.

A good version control system (like Git (a bit complicated in the beginning), Bazaar (practically dead) and Mercurial (I don't know it)) will let you have more than one change locally. I used Bazaar until its Svn support broke. Now I use Git. If you don't have a good version control system viewer installed locally there is one at http://repo.or.cz/w/freeciv.git. It is a git mirror of the latest version of the Freeciv source code. You can use it to search for and view previous changes. That makes it easy to find changes similar to what you are trying to achieve. That helps you understand what systems you may need to touch. It also let you find the history of each line in a source code file so you can understand why it is there.

bradltl
Posts: 2
Joined: Mon Mar 24, 2014 8:22 pm

Re: Ideal Development Platform for FreeCiv

Postby bradltl » Tue Mar 25, 2014 12:53 pm

That is an excellent reply. Thank you!

I'm not new to programming, just not focused on it daily. It has always been a hobby, not a profession. As such, I've written apps/programs in Objective-C, Python, JavaScript, Visual Basic, etc. Each time has been with a different environment, tool, and/or methods. So, I've used Visual Studio, XCode, Notepad++, SublimeText2, Eclipse, IntelliJ....

Ugh...

Anyways, what has captured my interest is the underlying mechanics of the game. How the world progresses, how the AI understands and acts, etc. My initial goal is really just to learn how things interact and come together. I'll probably start by going bug hunting (fixing things is the best way to learn how they work) and move on from there.

Thanks again!