User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
general:developer_faq [2012-11-01 11:49]
Carsten [How do I start a new game (MOD) project?]
general:developer_faq [2017-02-06 11:43] (current)
Carsten [How can I clone the Cafu source code repository?]
Line 18: Line 18:
  
 Not only will you become familiar with the Cafu details, you will also be able to form a very competent opinion about Cafu's suitability for your project. Not only will you become familiar with the Cafu details, you will also be able to form a very competent opinion about Cafu's suitability for your project.
 +
 +
 +===== Where are the Visual Studio project files? =====
 +
 +In the development of Cafu, an important consideration is the build process that turns the source code into executable programs.
 +This build process is a challenge in its own right, because it must work
 +  * on all supported platforms (currently Windows and Linux, soon MacOS, too),
 +  * with several compilers (and several versions of each),
 +  * in several variants (32- and 64-bit; debug, profile and release),
 +  * possibly with multiple combinations of the above, simultaneously on the same computer,
 +  * with all external libraries,
 +  * in changing environments (e.g. variable number of game libraries),
 +  * flexibly, robustly and easily configurable for our fellow developers and users.
 +
 +Achieving these goals with Visual Studio solution files on Windows (and possibly Makefiles on Linux) is a maintenance nightmare that borders on the impossible. For these reasons, we have chosen to use [[http://​www.scons.org/​|SCons]] as the build system for the Cafu Engine. SCons meets the above requirements,​ and it can still be used automatically and conveniently from most [[cppdev:​ides]].
 +
 +Alas, we realize that having true Visual Studio project and solution files (and similar native files for other IDEs) would still be nice to have. We therefore started looking into these programs:
 +  * [[http://​industriousone.com/​premake|Premake]]
 +  * [[https://​github.com/​vslavik/​bakefile|Bakefile]]
 +  * [[http://​www.cmake.org|CMake]]
 +These all look very promising, but each has problems of its own, and until today nobody ever finished a complete, working solution. If you would like to help improving the situation, it would be very welcome. Until then, please use one of the solutions described in [[cppdev:​ides]].
  
  
Line 31: Line 52:
  
  
-===== How do locally ​clone the Cafu source code repository? =====+===== How can I clone the Cafu source code repository? =====
  
-When you start working with Cafu, picking up the source code from a compressed archive or from the Subversion ​repository is sometimes not enough:+/* We have recently completed our migration ​from Subversion ​to Git (detailed report: [[http://​forum.cafu.de/​viewtopic.php?​f=14&​t=1090|Part 1]], [[http://​forum.cafu.de/​viewtopic.php?​f=14&​t=1092|Part 2]]). */
  
-Many developers prefer to manage their project in their own version control system, but also wish to integrate ​the latest changes (e.g. bug-fixes and new features) from the official ​Cafu repository ​into theirs from time to timeThe synchronization of the projects code with the original ​Cafu source ​code should be as convenient and automatic as possible.+You can /*now*/ clone the Cafu source code repository ​like this: 
 +<code bash> 
 +> git clone --recursive https://​bitbucket.org/​cafu/​cafu.git ​Cafu 
 +</code>
  
-One way to achieve this is to use Git: +Also see [[cppdev:gettingstarted]] for more details and https://bitbucket.org/cafu/cafu, where you can browse the repository online, create forks, submit pull requests, and find additional help texts.
-  * http://git-scm.com/​ +
-  * http://​progit.org/book/ch8-1.html+
  
-Our plan is to provide an official Cafu Git repository at later time. Until then, you can use ''​git svn'',​ a very good bridge between Git and Subversion. This tool allows you to use Git for your own project ​and at the same time pull changes from the official Cafu Subversion repository.+===== How do I start new game (MOD) project? =====
  
-This set of commands imports ​the entire Cafu Subversion repository into a local Git repository:+This is now explained in its own section in the documentation: 
 +See [[cppdev:​startnewgame]] for details.
  
-<code bash> 
-> git --version 
-git version 1.7.9.msysgit.0 
  
-> type authors.txt ​   # You have to create this file in a text editor! +===== How do I dynamically reload the map script ​in-game? ​===== 
-Carsten ​Carsten Fuchs <carsten.fuchs@cafu.de>+ 
 +While you're developing a script for one of your maps, it can be a very helpful shortcut to reload the map script while the game is running, without interrupting itThis avoids the normally required cycle of leaving and re-starting the map.
  
-> git svn clone "https://srv7.svn-repos.de/​dev123/​projects/​cafu" ---authors-file=authors.txt cafu_git ​+As a preparatory step, add a function like this to your map script: 
 +<code lua> 
 +-- This function reloads and runs this script again. 
 +-- It is useful for working with and testing the script "​online"
 +-- i.e. while the game is running and without reloading the map! 
 +function reloadScript() 
 +    ​-- Adjust the path in the next line as required! 
 +    dofile("​Games/​DeathMatch/​Worlds/​BPWxBeta.lua"​);​ 
 +    Console.Print("​Reloaded the map script.\n"​);​ 
 +end
 </​code>​ </​code>​
-Please refer to the Git documentation for more details. +Then, at the [[usermanual:running#​the_command_console|Cafu in-game console]], enter 
-See [[http://​www.cafu.de/​forum/​viewtopic.php?​f=6&​t=1081|this forum post]] for Cafu on GitHub.+<code lua> 
 +runMapCmd('​reloadScript()'​) 
 +</​code>​ 
 +to dynamically reload the script.
  
 +In theory, you could combine these two steps into one, using something like ''​runMapCmd('​dofile("​..."​)'​)'',​ but that is even harder to type than the version above, and less flexible. (We realize that the entire ''​runMapCmd(...)''​ business is not optimal. Suggestions for making this more convenient are welcome.)
  
-===== How do I start new game (MODproject? ===== +Note that if you use this technique, it can be helpful (but is not required) to understand how it works: The map script "​lives"​ inside ​Lua state that is initialized together with the map. (The in-game console has an entirely separate Lua state, which is why ''​runMapCmd(...)'' ​is needed.) The above commands essentially run ''​dofile(...)'' ​in the context of the maps Lua state, which in turn re-runs ​the map script.
- +
-This is now explained ​in its own section ​in the documentation:​ +
-See [[cppdev:​startnewgame]] for details.+
  
  
general/developer_faq.1351766958.txt.gz · Last modified: 2013-01-07 12:07 (external edit)