|
|
| (68 intermediate revisions by 14 users not shown) |
| Line 1: |
Line 1: |
| Outlined below is information on assisting with the development of the Spring source itself.
| | {|width="100%" style="border: 0px; border-spacing:0px" |
| | |width="500px" valign="top" style="padding-left:10px; padding-right:10px"| |
|
| |
|
| ::<small>NOTE: For information about developing a mod (units, maps, etc.) see the [[Mod Development]] page.</small> | | '''[https://github.com/spring/spring GitHub and Source Code]''' |
|
| |
|
| 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"
| | Engine source code<br> |
|
| |
|
| ==Starting Development==
| | '''[[Links|Important Links]]''' |
| To start development, you will need
| |
| #To read the [[Coding_Standards]]
| |
| #The latest version of the source
| |
| #A good code manipulation program
| |
| #Compiling your modified source
| |
|
| |
|
| == Keep track what others do ==
| | Important Community and Development links to git repos & subprojects.<br> |
| If you develop with others, you need to know what they do. We have [http://spring.clan-sy.com/fisheye/ fisheye], a very handy SVN helper, and [http://spring.clan-sy.com/websvn/ WebSVN] running on the server.
| |
|
| |
|
| ===Source Code Documentation===
| |
| A good place to start is [http://buildbot.no-ip.org/~buildbot/spring/doxygen the source code documentation].
| |
|
| |
|
| An explanation on how the code is executed in game can be found in the [[Spring Engine Code]]
| | '''[[Building spring|Compiling Engine]]''' |
| page.
| |
|
| |
|
| ==Obtaining the Source==
| | How to build the Spring engine from source.<br> |
| The latest SVN is at: [https://spring.clan-sy.com/svn/spring https://spring.clan-sy.com/svn/spring]<br>
| |
| A hourly updated read-only mirror is available at: svn://caspring.org:3691/
| |
|
| |
|
| Another option is to manually [http://spring.clan-sy.com/download.php 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),
| | '''[[Development:Getting_Started|Engine Development]]''' |
| [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 one of the following commands:
| | Information regarding contributing to the source code of the Spring engine. |
|
| |
|
| <code>svn.exe checkout https://spring.clan-sy.com/svn/spring/trunk<br>
| |
| svn.exe checkout svn://caspring.org:3691/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 /spring
| | '''[[Lobby_Development|Lobby Development (Clients and Servers)]]''' |
|
| |
|
| If you're using Git rather than SVN, you need to initialize local repository and fetch using:
| | Information regarding contributing to the source code of the different lobby clients and servers available for Spring. |
|
| |
|
| <code>git-svn clone https://spring.clan-sy.com/svn/spring
| |
| </code>
| |
|
| |
|
| (this may take a while)
| | '''[[Gamedev:Main|Game Development]]''' |
|
| |
|
| To update your local repository, use:
| | Lots of links to valuable Articles and forum threads regarding Game, Mod & Unit Development. |
|
| |
|
| <code>git-svn fetch https://spring.clan-sy.com/svn/spring
| |
| </code>
| |
|
| |
|
| ==Learning C++==
| | '''[[Mapdev:Main|Map Development]]''' |
| 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.
| | Tutorials and other useful information for creating maps. |
|
| |
|
| ==Setting up your development environment==
| |
| You have either to use the SCons build system that is multi platform, or use Microsoft Visual Studio for building spring. See also [[Development_IDEs]] for some more background information about the IDE to choose.
| |
|
| |
|
| ===Visual Studio 8 (2005)===
| | '''[[Lua_Scripting|Lua Development]]''' |
| (possibly the free Express Edition)
| |
|
| |
|
| * Install the [http://xta.wolfgame.org/SimBase/vclibs.7z vclibs library package]. You need to install this in the /spring directory from the SVN checkout the zipped source. If done right, it will look like:
| | Information regarding the use of the supplementary Lua scripting language for Widgets and beyond. |
| **/spring/
| |
| **/spring/installer
| |
| **/spring/rts
| |
| **/spring/... other dirs
| |
| **/spring/vclibs
| |
| * Install the [http://msdn.microsoft.com/directx/sdk/ DirectX SDK]
| |
| * Install the PlatformSDK. I got away with unchecking the parts of the PlatformSDK that were obviously not related (IIS, web stuff). Makes for a smaller download. Make '''sure''' the Platform SDK and DirectX SDK are in the VS search/include directories:
| |
| * After installing them, open Visual C++. Click Tools >> Options >> Projects and Solutions >> VC++ Directories. Add these entries to the corresponding sections (paths just a reference, yours may be different):
| |
| **Include files:
| |
| ***$(ProgramFiles)\Microsoft DirectX SDK (August 2007)\Include
| |
| ***$(ProgramFiles)\Microsoft Platform SDK\include
| |
| **Library files:
| |
| ***$(ProgramFiles)\Microsoft DirectX SDK (August 2007)\Lib\x86 (Might need \x64 on a 64-bit platform, I don't know.)
| |
| ***$(ProgramFiles)\Microsoft Platform SDK\lib
| |
| * Open the solution. /spring/rts/build/vstudio8/rts.sln
| |
| * Start building (usually you want to select the release/no debug build, debug is really too slow and is used only when you really know what you want to test)
| |
| * Select the working directory in the project properties, otherwise spring will not work correctly
| |
|
| |
|
| ===Visual Studio 9 (2008)===
| |
| (possibly the free Express Edition)
| |
|
| |
|
| Not yet fully working as far as I know; you need at least this hotfix from Microsoft though:
| | '''[[AI:Development|AI Development]]''' |
|
| |
|
| http://support.microsoft.com/kb/946040
| | All you ever wanted to know about Skirmish AI Development for Spring, and more. This includes Skirmish and Lua AIs. |
|
| |
|
| For the rest the Visual Studio 8 instructions should apply, mostly.
| |
|
| |
|
| ===SCONS/MinGW===
| | '''[[Infrastructure:Development|Infrastructure Development]]''' |
| Code::Blocks and Dev C++ use MinGW too, so if you are using one of these IDEs, you'll want to follow these instructions too.
| |
|
| |
|
| If you do not have MinGW installed yet, the easiest way to get it, is to install it together with one of the two IDEs Dev-Cpp or Code::Blocks. They both come with MinGW 3.4, which still compiles spring correctly (June 2008). If you want a newer MinGW, you have to get it from their page directly. MinGW 4.2.1 is used for spring release builds, cross compiled on Linux, but spring can not be built with MinGW 4 on windows yet (seems to be becuase the compiler is not yet major enough).
| | Information about springs infrastructure |
| *[http://downloads.sourceforge.net/dev-cpp/devcpp-4.9.9.2_setup.exe Dev-C++ Installer (includes MinGW 3.4)]
| |
| *[http://downloads.sourceforge.net/codeblocks/codeblocks-8.02mingw-setup.exe Code::Blocks installer (includes MinGW 3.4, latest June 2008)]
| |
| *[http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=241304 MinGW (latest is 4.3, June 2008)]
| |
|
| |
|
| Get [http://spring.clan-sy.com/dl/spring-mingwlibs-v10.exe the MinGW library package]. Make sure you install it it the checkout directory, so the path is: /spring/mingwlibs. If done right, it will look like:
| | |valign="top" style="padding:0px"| |
| **/spring/
| |
| **/spring/installer
| |
| **/spring/rts
| |
| **/spring/... other dirs
| |
| **/spring/mingwlibs
| |
|
| |
|
| These programs are a must have if you want to compile Spring with MinGW, so install them now, if you don't have them already.
| | == Quick Links == |
|
| |
|
| *[http://www.python.org/ftp/python/2.5.1/python-2.5.1.msi Python 2.5 installer]
| | {|width="100%" class="" |
| *[http://downloads.sourceforge.net/pywin32/pywin32-210.win32-py2.5.exe Python 2.5 win32 extensions installer]
| | ! '''[http://spring.clan-sy.com/phpbb/viewforum.php?f=12 Development forums]''' |
| *[http://prdownloads.sourceforge.net/scons/scons-0.96.96.win32.exe Scons 0.96 installer]
| | |- |
| | | Look at the development forums for ongoing progress and discussion |
| | |} |
|
| |
|
| Oh, and quick instructions:
| |
|
| |
|
| * Grab and install the above programs.
| | {|width="100%" class="" |
| * Make sure C:\Python25, C:\Python25\Scripts and C:\Dev-Cpp\bin are in your PATH environment variable. Set environment variables by: Start -> Settings -> Control Panel -> System -> Advanced -> Environment variables (for Windows XP).
| | ! '''[http://springrts.com/mantis/ Report Bugs]''' |
| * Make sure a MINGDIR environment variable with value C:\Dev-Cpp exists. (change paths where appropriate.)
| | |- |
| * Checkout the Spring SVN repository, following the instructions above in obtaining source. (TODO:link)
| | | Submit patches and bug reports here |
| * Open a console (Start -> Run -> cmd.exe -> Run), cd \where you checked it out in the previous step, if you checked it out on a different drive make sure to change drives with DriveLetter:<enter> first.
| | |} |
| * Type scons configure<enter>. Refer to scons --help for options which can be passed to scons configure. 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."
| |
| * Type scons<enter> to start the compilation.
| |
| ** If you have Delphi installed and get an error message that the commandline params "--no-print-directory" & "-C" aren't supported, then you should remove the Delphi dirs from your <i>PATH</i> variable, because scons tried to run the delphi's make.exe instead of using mingw32-make. (this will cause that streflop can't be build!)
| |
| * Wait for the compilation to finish, this may take a while.
| |
| * Copy datafiles and stuff from official Spring installation to the /spring/game directory (where spring.exe is located, after the compilation finished.)
| |
| * 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== | | {|width="100%" class="" |
| 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.
| | ! '''[https://github.com/spring/spring/ Source Code]''' |
| | |- |
| | | View and fork the project on GitHub. |
| | |} |
|
| |
|
| ==How to get your code included==
| |
| If you create something that you think should be included in the official source tree, you can report a "bug" in [http://spring.clan-sy.com/mantis/ mantis, our BTS]. Add your patch as attachment, and put "[patch]" in front of the subject, so it is easy for us to separate patches from bugs.
| |
|
| |
|
| It's also considered standard practice to post one's modifications in the [http://spring.clan-sy.com/phpbb/viewforum.php?f=12 development forum] and get feedback.
| |
|
| |
|
| ==Spring Engine TODO list== | | {|width="100%" class="" |
| There is a TODO list for developers who want to contribute to the engine itself:
| | ! '''[https://github.com/spring/spring/commits/develop.atom Commit Newsfeed]''' |
| [[SpringEngineTODO]]. There is also a [http://spring.clan-sy.com/phpbb/viewforum.php?f=21 feature request forum], which may give you some ideas. Don't be overwhelmed by the sheer number of (silly) requests though! | | |- |
| | |View git commits as they happen. |
| | |} |
|
| |
|
| ==Development links==
| |
| * [http://planetspring.free.fr/spring/ Automatic installer builds (crosscompiled, mingw)]
| |
| * [http://developer.berlios.de/projects/taspring-linux BerliOS project page (OLD)]
| |
| * [http://spring.clan-sy.com/mantis Bug Tracking System]
| |
| * [http://buildbot.no-ip.org:8010/ Buildbot]
| |
| * [https://lists.berlios.de/mailman/listinfo/taspring-linux-commit Commit mailing list]
| |
| * [http://spring.clan-sy.com/dl/spring-vc8libs.exe Development libraries for Visual Studio 2005]
| |
| * [http://www.unknown-files.net/spring/3839/mingwlibsv10/ Development libraries for MinGW]
| |
| * [http://lolut.utbm.info/cgi-bin/mailman/listinfo/taspring-linux Developers mailing list (practically dead, use this forum instead) (DOWN)]
| |
| * [http://buildbot.no-ip.org/~buildbot/spring/doxygen Doxygen pages of the latest source (regenerated nightly)]
| |
| * [http://spring.clan-sy.com/fisheye Fisheye interface to SVN]
| |
| * [http://sourceforge.net/projects/springrts SourceForge project page (OLD)]
| |
| * [http://buildbot.no-ip.org/~buildbot/spring/stacktraceTranslator.php StackTrace Translator]
| |
| * [https://spring.clan-sy.com/svn/spring/trunk/ Subversion repository]
| |
| * [http://spring.clan-sy.com/websvn/listing.php?repname=spring&path=%2F&sc=0 WebSVN]
| |
| * [http://spring.clan-sy.com/websvn/log.php?repname=spring&path=%2F&rev=0&sc=0&isdir=1 WebSVN link to "development log"]
| |
| * [http://spring.clan-sy.com/websvn/filedetails.php?repname=spring&path=%2Ftrunk%2FDocumentation%2Fchangelog.txt&rev=0&sc=0 WebSVN link to the most recent changelog.txt]
| |
|
| |
|
| [[Category:Development]] [[Category:Source development]] | | |
| | |} |
| | |
| | [[Category: Development]] |