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
cppdev:gamecodeoverview [2017-05-08 11:10]
Carsten deleted obsolete section (it's superseded by the component system)
cppdev:gamecodeoverview [2017-05-08 11:15]
Carsten deleted obsolete section (it's superseded by the component system)
Line 35: Line 35:
  
 The following sub-sections list and explain most of these "​fixed"​ files and directories. The following sub-sections list and explain most of these "​fixed"​ files and directories.
- 
- 
-==== EntityClassDefs.lua ==== 
- 
-File ''​EntityClassDefs.lua''​ defines all entity types that can occur in the game. 
-The file is read both by the world editor CaWE and the actual game code. 
-For each entity type, it specifies details like names, dimensions, properties, etc. 
  
  
Line 104: Line 97:
   * The map script is //not// compiled along with the ''​.cw''​ file: You can change it at any time, and the changes become effective as soon as the world is loaded/​restarted the next time. In fact, it is even possible to [[general:​developer_faq#​how_do_i_dynamically_reload_the_map_script_in-game|update a map script while the game is running]], that is, //without interrupting it//.   * The map script is //not// compiled along with the ''​.cw''​ file: You can change it at any time, and the changes become effective as soon as the world is loaded/​restarted the next time. In fact, it is even possible to [[general:​developer_faq#​how_do_i_dynamically_reload_the_map_script_in-game|update a map script while the game is running]], that is, //without interrupting it//.
  
- 
-===== The game source code ===== 
- 
-The source code for the game library is in ''​Code/'',​ inside which you can organize and arrange the source files at will. 
- 
-To get familiar with the code, a good start is to check out the 
-[[http://​api.cafu.de/​c++/​classcf_1_1GameSys_1_1GameI.html|cf::​GameSys::​GameI]] interface, 
-and its implementation in ''​GameImplT'',​ and to continue from there. 
- 
-The core engine will call the methods of the ''​cf::​GameSys::​GameI''​ interface, e.g. those to have new entities created after a map file has been loaded or when another player joins the game, and it's the job of the game code to provide implementations for these methods. 
-See the code for class ''​GameImplT''​ in order to see how it was done for the DeathMatch game. 
- 
-With the ''​GameEntityI''​ pointers to newly created entities, the engine will also call the virtual methods in the ''​GameEntityI''​ interface, in order to let entities know about events or to have them carry out tasks. 
-These methods too are supposed to be overridden by the concrete entity implementation,​ and are in fact the essence of implementing a game: 
-An entity is considered a state machine that lives in a virtual world, interacting with the world and other entities, and for example its ''​GameEntityI::​Think()''​ method is expected to update it over a small amount of time whenever the method is called (by the server code inside the engine). 
  
  
cppdev/gamecodeoverview.txt ยท Last modified: 2017-05-08 11:15 by Carsten