Development: Difference between revisions

From Spring
Jump to navigationJump to search
Improved multiplatform development part
Line 1: Line 1:
Outlined below is information on assisting with the development of the Spring source itself.
Outlined below is information on assisting with the development of the Spring source itself.


::<small>If you're interested in developing a mod (units, maps, etc.) see the [[Mod Development]] page.</small>
::<small>NOTE: For information about developing a mod (units, maps, etc.) see the [[Mod Development]] page.</small>


You will need to know C++ to modify or understand Spring's source code. If you're interested in learning C++, check out these links:
You will need to know C++ to modify or understand Spring's source code. If you're interested in learning C++, check out these links:
Line 8: Line 8:
*[http://www.amazon.com/exec/obidos/tg/detail/-/0130384747/002-6409742-5712035?v=glance C++ How to Program] Although it's a commercial volume, it is an excellent introduction to the language.
*[http://www.amazon.com/exec/obidos/tg/detail/-/0130384747/002-6409742-5712035?v=glance C++ How to Program] Although it's a commercial volume, it is an excellent introduction to the language.


Below you can find information on how to work with the Spring source in the current mainline (Windows platform) if you like to work on another platform (Linux & Mac) please look at the bottem of this page under "Multiplatform development"


==Starting Development==
==Starting Development==
Line 33: Line 34:
Before starting to make modifications to the source, take a look at the [[development guidelines]] which outlines some important things to think about. To find something interesting to work on, look at the list of [[example projects]]. You can also check the list of [[whois doing what]] to see what others are doing.
Before starting to make modifications to the source, take a look at the [[development guidelines]] which outlines some important things to think about. To find something interesting to work on, look at the list of [[example projects]]. You can also check the list of [[whois doing what]] to see what others are doing.


===Making something "official"===
===How to get your code included===
If you create something that you think should be included in the official source tree, you can submit a patch (also known as a .diff file) to Spring's [http://sourceforge.net/tracker/?group_id=137982&atid=739725 SourceForge]] page. It's also considered standard practice to post one's modifications in the [http://taspring.clan-sy.com/phpbb/viewforum.php?f=12 development forum] and get feedback.
If you create something that you think should be included in the official source tree, you can submit a patch (also known as a .diff file) to Spring's [http://sourceforge.net/tracker/?group_id=137982&atid=739725 SourceForge]] page. It's also considered standard practice to post one's modifications in the [http://taspring.clan-sy.com/phpbb/viewforum.php?f=12 development forum] and get feedback.


==Misc.==
==Multiplatform development==
If you would like to work on the Linux port please look at the [[Linux]] page.
The Spring code is made portable in a separate branch at BerliOS.<br>
At this moment the Linux porting effort is a separate branch of the code tree and not affiliated directly with the Swedish Yankspankers.
We intent to merge the (portable) code into mainline once it's stable.<br>
At this moment our goal is to make Spring run on Linux, if you would like to work on the Linux port please look at the [[Linux]] page.<br>
A [[Mac]] version is possible if enough developers like to port it.<br>
Although we advise to wait with full mac development until the Linux port is merged into mainline.<br>
Chris Han leads the [[Linux]] porting effort and this is done in cooperation with the lead "Windows" developers.<br>
Once the two versions are merged the terms Windows and Linux developers will probebly disapear as all developers will be working on the same portible Spring codebase.<br>





Revision as of 15:43, 16 October 2005

Outlined below is information on assisting with the development of the Spring source itself.

NOTE: For information about developing a mod (units, maps, etc.) see the Mod Development page.

You will need to know C++ to modify or understand Spring's source code. If you're interested in learning C++, check out these links:

Below you can find information on how to work with the Spring source in the current mainline (Windows platform) if you like to work on another platform (Linux & Mac) please look at the bottem of this page under "Multiplatform development"

Starting Development

To start development, you'll need

  1. The latest version of the source
  2. A good code manipulation program
  3. Compiling your modified source

Obtaining the Source

One option is to manually download it along with the latest released version of the game. However, for serious developers, a better way would be to download the source straight from the CVS. The CVS is updated nightly, and is considered "bleeding edge" because it may or may not work properly. However, the CVS will always have the most up-to-date version of the source code. Look at this CVS tutorial for instructions on how to get the source code from the CVS.

Properly Modifying the Source

Although it is theoretically possible to use Notepad or Crimson Editor to modify the source, it is pragmatically unsound. The Spring engine is highly complex, and any serious developer will want to use a proper IDE such as Microsoft's Visual Studio .NET 2003 or Dev C++. Although the ad-hoc standard is Visual Studio, it is extremely expensive. Dev C++ is a widely-used free and legal alternative to pirating Visual Studio .NET.

The bulk of the game engine is found inside the /rts/ folder. The AI and Lobby subsystems are located in respective folders. Take a peek and see where everything is.

Compiling the Source

Compiling the source will make it into a playable .exe. The very same IDEs previously mentioned can compile the source, so see the appropriate documentation for the program you are using to compile properly. Make sure that you are in Release mode and not Debug mode when you compile.

If you don't have access to this compiler, it should be possible to use the free version of Visual C++ instead. Look at the end of this forum thread for more information. Hopefully this will be turned into a Wiki guide by someone who has gotten this to work.


Development Suggestions

Before starting to make modifications to the source, take a look at the development guidelines which outlines some important things to think about. To find something interesting to work on, look at the list of example projects. You can also check the list of whois doing what to see what others are doing.

How to get your code included

If you create something that you think should be included in the official source tree, you can submit a patch (also known as a .diff file) to Spring's SourceForge] page. It's also considered standard practice to post one's modifications in the development forum and get feedback.

Multiplatform development

The Spring code is made portable in a separate branch at BerliOS.
We intent to merge the (portable) code into mainline once it's stable.
At this moment our goal is to make Spring run on Linux, if you would like to work on the Linux port please look at the Linux page.
A Mac version is possible if enough developers like to port it.
Although we advise to wait with full mac development until the Linux port is merged into mainline.
Chris Han leads the Linux porting effort and this is done in cooperation with the lead "Windows" developers.
Once the two versions are merged the terms Windows and Linux developers will probebly disapear as all developers will be working on the same portible Spring codebase.


See Glossary