Development:Main: Difference between revisions
m Replacing page with 'Outlined below is information on assisting with the development of the Spring source itself. ::<small>NOTE: For information about developing a mod (units, maps, etc.) see the ...' |
Someone go ban BvtDul now! Reverting his cut is getting tiresome. |
||
| Line 3: | Line 3: | ||
::<small>NOTE: For information about 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> | ||
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 | 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 will need | |||
#The latest version of the source | |||
#A good code manipulation program | |||
#Compiling your modified source | |||
== Keep track what others do == | |||
If you develop with others, you need to know what they do. Fisheye is a very handy svn helper, we currently use: | |||
http://spring.clan-sy.com/fisheye | |||
===Source Code Documentation=== | |||
A good place to start is the source code documentation, which can be found here: [http://taspring.clan-sy.com/doxygen/ doxygen] | |||
An explanation on how the code is executed in game can be found in the [[Spring Engine Code]] | |||
page. | |||
===Obtaining the Source=== | |||
Update: the latest SVN is at: [https://taspring.clan-sy.com/svn/spring https://taspring.clan-sy.com/svn/spring] | |||
Another 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 subversion (SVN) repository. This will also allow you to make a patch out of the changes you make to the code, and send it to one of the developers with SVN access. | |||
windows SVN clients : [http://subversion.tigris.org Subversion] (Win32-Console), | |||
[http://www.syntevo.com/smartsvn/index.jsp SmartSVN] (Java) and [http://tortoisesvn.tigris.org TortoiseSVN] (MSI). | |||
assuming that you are using the Subversion svn client you can download the latest SVN source with | |||
<code>svn.exe checkout https://taspring.clan-sy.com/svn/spring/trunk</code> | |||
it will create a trunk subdirectory in the directory from where you ran it, which will contain the source code root directory which will be later referred to as /taspring | |||
===Learning C++=== | |||
You will need to know C++ to modify or understand Spring's source code. If you are interested in learning C++, see [[Learning_CPP]] | |||
However please note that badly designed code (code created by a C++ novice for example), even if working will likely not be included in the spring code. Spring is a large project, and therefore it is necessary to stay away from hack jobs and create general solutions to problems. | |||
===Modifying and Compiling the Source=== | |||
The build environment on Windows changed a few releases ago to SCONS/mingw | |||
If you will be developing on Windows you are recommended to use SCONS/mingw, using the SVN version. | |||
See [[Development_IDEs]]. You have either to use the SCons build system that is multi platform, or use the vcproj for building spring in Visual Studio 2003 or Visual Studio 2005. | |||
A list of required libraries as well as pre-built packages of these follows. | |||
*[http://www.boost.org Boost C++ library] | |||
*[http://www.openal.org OpenAL Audio library] | |||
*[http://glew.sf.net GLEW (OpenGL extension loading)] | |||
*[http://www.winimage.com/zLibDll/ zlib + minizip] | |||
*[http://www.libsdl.org SDL] | |||
*[http://openil.sf.net DevIL (Image loading)] | |||
*[http://www.freetype.org Freetype font rendering] | |||
*[http://taspring.clan-sy.com/phpbb/viewtopic.php?p=49257#49257 Pre-Built packages of most of the dependencies]. | |||
*[http://taspring.clan-sy.com/phpbb/viewtopic.php?p=56846#56846 Pre-Built boost for VS8]. *note - probably not needed | |||
*[http://msdn.microsoft.com/directx/sdk/ DirectX SDK] (Windows, Visual Studio C++ only) | |||
*PlatformSDK (Windows, Visual Studio C++ Only) | |||
The following are for building with SCONS/MinGW | |||
*[http://prdownloads.sourceforge.net/dev-cpp/devcpp-4.9.9.2_setup.exe Dev-Cpp installer] / [MinGW] Though I would not advise mingw because you have to set it up your self, and this is harder than it sounds. Note that Code:Blocks mingw setup is not sufficient. *note - dev-cpp seems to have been abandoned | |||
*[http://www.python.org/ftp/python/2.4.2/python-2.4.2.msi Python 2.4 installer] | |||
*[http://prdownloads.sourceforge.net/pywin32/pywin32-208.win32-py2.4.exe?download Python win32 extensions installer] | |||
*[http://prdownloads.sourceforge.net/scons/scons-0.96.1.win32.exe Scons installer] | |||
====Development System Setup==== | |||
See [http://spring.clan-sy.com/phpbb/viewtopic.php?p=49257 Compiling spring (mingw and visual studio 7/8)] and [[Installing Visual C plus plus]] for instructions. | |||
*Make sure C:\Python24 and C:\Dev-Cpp\bin are in your PATH environment variable. | |||
*Make sure a MINGDIR environment variable with value C:\Dev-Cpp exists. (Change paths where appropriate.) | |||
**Set environment variables by: Start -> Settings -> Control Panel -> System -> Advanced -> Environment variables (for Windows XP). | |||
*Checkout the TA Spring SVN repository into your working area. | |||
*You will also need the [http://spring.clan-sy.com/dl/spring-mingwlibs.exe MinGW/DevCPP libs] extracted to your source directory obtained from SVN. ie your-working-path/source/trunk/mingwlibs. Therefore mingwlibs is at the same directory level as AI, lua and the omni directories. | |||
====Running SCONS Configure==== | |||
*Open a console (Start -> Run -> cmd.exe -> Run) | |||
*cd /where you checked it out in the previous step, if you use checked it out on a different drive make sure to change drives with DriveLetter:<enter> first | |||
*type "scons configure"<enter> | |||
Gotchas: | |||
*if you get an error message starting with "EOFError: : env = Environement...", try deleting the file build/scons_signatures.dblite | |||
*if you get an error message stating "ImportError: No module named win32file:", you have probably not installed the python-win32-extensions. | |||
If all proceeds as intended you will see a message similar to: | |||
"Everything seems OK. Run `scons' now to build." | |||
====Compiling Spring==== | |||
* Open a console (Start -> Run -> cmd.exe -> Run) | |||
* cd /path-to-where you checked it out in the previous step, if you use checked it out on a different drive make sure to change drives with DriveLetter:<enter> first | |||
* type '''scons configure'''<enter>, followed by '''scons'''<enter> | |||
** Refer to '''scons --help''' for options that can be passed to scons configure | |||
* Wait, this will take a while | |||
* Copy over data files and stuff from official spring to the game dir (where spring.exe is created) | |||
* Copy missing DLLs from mingwlibs/dll | |||
* Start developing | |||
If you are using Linux, refer to the [[SetupGuide]] to build Spring and get it running. | |||
==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. If you do edit the code, please add [[Doxygen style comments]] to the code, which will then enhance the source code documentation. | |||
===How to get your code included=== | |||
If you create something that you think should be included in the official source tree, you can send an email to the development mailing list shown at [[Linux]] page. Sending your code in the form of a patch (also known as a .diff file), will make the chances of including it in the main code. Many patches are submitted to [http://spring.clan-sy.com/mantis Mantis]. | |||
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. | |||
==Spring Engine TODO list== | |||
There is a TODO list for developers who want to contribute to the engine itself: | |||
[[SpringEngineTODO]] | |||
See [[Glossary]] | |||
[[Category:Development]] [[Category:Source development]] | |||
Revision as of 16:34, 22 September 2007
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.
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 will need
- The latest version of the source
- A good code manipulation program
- Compiling your modified source
Keep track what others do
If you develop with others, you need to know what they do. Fisheye is a very handy svn helper, we currently use:
http://spring.clan-sy.com/fisheye
Source Code Documentation
A good place to start is the source code documentation, which can be found here: doxygen
An explanation on how the code is executed in game can be found in the Spring Engine Code page.
Obtaining the Source
Update: the latest SVN is at: https://taspring.clan-sy.com/svn/spring
Another 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 subversion (SVN) repository. This will also allow you to make a patch out of the changes you make to the code, and send it to one of the developers with SVN access.
windows SVN clients : Subversion (Win32-Console), SmartSVN (Java) and TortoiseSVN (MSI).
assuming that you are using the Subversion svn client you can download the latest SVN source with
svn.exe checkout https://taspring.clan-sy.com/svn/spring/trunk
it will create a trunk subdirectory in the directory from where you ran it, which will contain the source code root directory which will be later referred to as /taspring
Learning C++
You will need to know C++ to modify or understand Spring's source code. If you are interested in learning C++, see Learning_CPP
However please note that badly designed code (code created by a C++ novice for example), even if working will likely not be included in the spring code. Spring is a large project, and therefore it is necessary to stay away from hack jobs and create general solutions to problems.
Modifying and Compiling the Source
The build environment on Windows changed a few releases ago to SCONS/mingw
If you will be developing on Windows you are recommended to use SCONS/mingw, using the SVN version.
See Development_IDEs. You have either to use the SCons build system that is multi platform, or use the vcproj for building spring in Visual Studio 2003 or Visual Studio 2005. A list of required libraries as well as pre-built packages of these follows.
- Boost C++ library
- OpenAL Audio library
- GLEW (OpenGL extension loading)
- zlib + minizip
- SDL
- DevIL (Image loading)
- Freetype font rendering
- Pre-Built packages of most of the dependencies.
- Pre-Built boost for VS8. *note - probably not needed
- DirectX SDK (Windows, Visual Studio C++ only)
- PlatformSDK (Windows, Visual Studio C++ Only)
The following are for building with SCONS/MinGW
- Dev-Cpp installer / [MinGW] Though I would not advise mingw because you have to set it up your self, and this is harder than it sounds. Note that Code:Blocks mingw setup is not sufficient. *note - dev-cpp seems to have been abandoned
- Python 2.4 installer
- Python win32 extensions installer
- Scons installer
Development System Setup
See Compiling spring (mingw and visual studio 7/8) and Installing Visual C plus plus for instructions.
- Make sure C:\Python24 and C:\Dev-Cpp\bin are in your PATH environment variable.
- Make sure a MINGDIR environment variable with value C:\Dev-Cpp exists. (Change paths where appropriate.)
- Set environment variables by: Start -> Settings -> Control Panel -> System -> Advanced -> Environment variables (for Windows XP).
- Checkout the TA Spring SVN repository into your working area.
- You will also need the MinGW/DevCPP libs extracted to your source directory obtained from SVN. ie your-working-path/source/trunk/mingwlibs. Therefore mingwlibs is at the same directory level as AI, lua and the omni directories.
Running SCONS Configure
- Open a console (Start -> Run -> cmd.exe -> Run)
- cd /where you checked it out in the previous step, if you use checked it out on a different drive make sure to change drives with DriveLetter:<enter> first
- type "scons configure"<enter>
Gotchas:
- if you get an error message starting with "EOFError: : env = Environement...", try deleting the file build/scons_signatures.dblite
- if you get an error message stating "ImportError: No module named win32file:", you have probably not installed the python-win32-extensions.
If all proceeds as intended you will see a message similar to: "Everything seems OK. Run `scons' now to build."
Compiling Spring
- Open a console (Start -> Run -> cmd.exe -> Run)
- cd /path-to-where you checked it out in the previous step, if you use checked it out on a different drive make sure to change drives with DriveLetter:<enter> first
- type scons configure<enter>, followed by scons<enter>
- Refer to scons --help for options that can be passed to scons configure
- Wait, this will take a while
- Copy over data files and stuff from official spring to the game dir (where spring.exe is created)
- Copy missing DLLs from mingwlibs/dll
- Start developing
If you are using Linux, refer to the SetupGuide to build Spring and get it running.
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. If you do edit the code, please add Doxygen style comments to the code, which will then enhance the source code documentation.
How to get your code included
If you create something that you think should be included in the official source tree, you can send an email to the development mailing list shown at Linux page. Sending your code in the form of a patch (also known as a .diff file), will make the chances of including it in the main code. Many patches are submitted to Mantis. It's also considered standard practice to post one's modifications in the development forum and get feedback.
Spring Engine TODO list
There is a TODO list for developers who want to contribute to the engine itself: SpringEngineTODO
See Glossary