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 [2010-11-16 13:45]
carsten [How do I locally clone the Cafu source code repository?]
general:developer_faq [2017-02-06 11:43] (current)
Carsten [How can I clone the Cafu source code repository?]
Line 8: Line 8:
   * Will we able to implement our car racing game with Cafu?   * Will we able to implement our car racing game with Cafu?
  
-We would love to provide you with a clear and authoritative "​yes"​ or "​no"​ answer to these questions, ​but that is easier said than done:+While we would love to provide you with a clear and authoritative "​yes"​ or "​no"​ answer to these questions, that is easier said than done:
  
-When you ask one of these questions, you usually have a clear mental image already on how your game should look like -- an image that we don't have, because often we know way too little about your project: your plans, your team, your skills (modelling, mapping, scripting, programming,​ ...), your deadlines, etc. Not knowing what you //really// want and if you're ready to -- for example -- making changes to the C++ source code is what makes this question difficult to answer.+When you ask one of these questions, you usually have a clear mental image already on how your game should look like -- an image that we don't have, because often we know way too little about your project: your plans, your team, your skills (modelling, mapping, scripting, programming,​ ...), your deadlines, etc. Not knowing what you //really// want and if you're ready to -- for example -- writing material shaders or making changes to the C++ source code is what makes this question difficult to answer.
  
 However, there is an alternative that is much better than any statement we could make: However, there is an alternative that is much better than any statement we could make:
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? ===== 
 + 
 +/* 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]]). */ 
 + 
 +You can /*now*/ clone the Cafu source code repository like this: 
 +<code bash> 
 +> git clone --recursive https://​bitbucket.org/​cafu/​cafu.git Cafu 
 +</​code>​ 
 + 
 +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. 
 + 
 +===== How do I start a new game (MOD) project? ===== 
 + 
 +This is now explained in its own section in the documentation:​ 
 +See [[cppdev:​startnewgame]] for details. 
 + 
 + 
 +===== How do I dynamically reload the map script in-game? ===== 
 + 
 +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 it. This avoids the normally required cycle of leaving and re-starting the map.
  
-When you start working with Cafupicking up the source ​code from a compressed archive or from the Subversion repository is sometimes not enough:+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
 +Then, at the [[usermanual:running#​the_command_console|Cafu in-game console]], enter 
 +<code lua> 
 +runMapCmd('​reloadScript()'​) 
 +</​code>​ 
 +to dynamically reload the script.
  
-Many developers prefer to manage their project in their ownlocal version-control system, but also wish to integrate ​the latest changes ​(e.gbug-fixes or new featuresfrom the official Cafu repository into theirs from time to timeThis synchronization of the projects code with the original Cafu source code should be as convenient ​and automatic as possible.+In theoryyou 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 optimalSuggestions for making this more convenient ​are welcome.)
  
-One way to achieve ​this is to use Git: +Note that if you use this technique, it can be helpful (but is not required) ​to understand how it worksThe 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.
-  * http://​stackoverflow.com/​questions/​796991/​fork-and-sync-google-code-svn-into-github +
-  * http://​jpz-log.info/​archives/​2010/​08/​04/​howto-fork-a-subversion-project-with-git/ +
-  * http://​git-scm.com/ -> http://​git-scm.com/​course/​svn.html+
  
-(TODO: Provide Cafu-specific instructions.) 
  
 ===== Where can I learn more about 3D programming or game engines? ===== ===== Where can I learn more about 3D programming or game engines? =====
general/developer_faq.1289911500.txt.gz · Last modified: 2013-01-07 12:07 (external edit)