Cafu engine

from Wikipedia, the free encyclopedia
Cafu engine

Cafu Engine Logo.png
A network game with the Cafu Engine
A network game with the Cafu Engine
Basic data

developer Carsten Fuchs Software
operating system platform independent
programming language C ++ , Lua
category Graphics engine , game engine
License GPL or optionally commercial
www.cafu.de

Cafu Engine is a graphics and game engine . Its goal is to support the developers of games or other 3D applications by providing them with a comprehensive foundation for graphics, sound, physics, networking, portability and many more areas. Cafu is platform-independent and runs under Windows and Linux , the adaptations for Mac OS run.

The source code of the Cafu Engine is available to everyone as free software under the GPL , but the developers can also purchase it under a commercial license.

features

graphic

The core of the Cafu Engine revolves around realistic 3D graphics in real time, which are implemented using numerous program modules:

A factory building in the Cafu Engine

The Cafu Material System enables users and level designers to easily and quickly design their own and new materials with which the surfaces of the objects are represented in the 3D worlds. For this to be material scripts used also with a hand or shortly material editor can be created with a graphical user interface. The material browser built into CaWE enables a quick overview of all available materials.

The implementation of the material system is very flexible and modular in renderers . A Cafu renderer can use any programming interface such as OpenGL or DirectX . Currently there are renderers for OpenGL 1.2, OpenGL with Cg with NV2X profiles, OpenGL with Cg with NV3X profiles, and OpenGL with the " vertex and fragment programs" extension. Writing additional renderers is relatively easy, and renderers for OpenGL 3.x and DirectX 11 are currently in development. Every time the program is started, the Cafu Engine decides which renderer is best suited to the existing hardware and then loads it for graphics output. With this technology, Cafu is able to optimally support both very old systems (e.g. with OpenGL 1.2) and the very latest (e.g. with DirectX 11), and even future systems will need nothing more than a new one Renderers to ensure full support.

The Cafu BSP and PVS programs recursively subdivide the geometry of the levels and calculate in advance which rooms can be visible from each room. In this way, Cafu can decide very quickly which parts of the level need to be drawn when rendering.

Cafu can use two independent lighting techniques:

  • The radiosity method based on a physical simulation of the propagation of light , which delivers very realistic results. The calculation results are saved in "Lightmaps" which have been expanded to include directions. The radiosity color values ​​and direction information can be rendered by the renderer together with the normal map information of the materials "per pixel", thus combining the advantages of radiosity and per-pixel rendering with normal maps at optimal speed (only one render pass required).
  • At the same time or as an alternative, Cafu can also use dynamic light sources and calculate associated shadows using the stencil method. Normal maps, specular maps and many other parameters are taken into account.

Both lighting technologies can easily be combined and used at the same time. Future versions of Cafu should also be able to handle dynamic lighting of outdoor areas and projected shadows.

Sound and music

The sound system from Cafu is just as modular as the material system: 2D and 3D sound effects and pieces of music are defined as sound shader scripts, which are played by the sound system best suited to the computer. Cafu includes sound system implementations for both OpenAL and FMOD .

Multiplayer and network

A network game with the Cafu Engine

The core of the Cafu Engine is designed for multi-player play over a network such as the Internet or a LAN . It contains both a game server , which manages the game centrally, as well as a client that a player uses to connect to the server and thus enter a game.

For the connection, Cafu implements its own slim and efficient network protocol based on UDP , which efficiently compresses the transmitted data and can also cope with slow or fluctuating connection speeds.

A distinctive feature of the Cafu network protocol is the ability to predict the server's response to a player's input while it is still on the network. This allows the player to move smoothly through the game worlds without delays or jerking due to server responses arriving later.

Portability

Cafu largely dispenses with programming constructs and libraries that only work with certain operating systems, compilers, processors or graphics cards. Where this is not possible in individual cases, the code is kept modular so that specific program parts can easily be exchanged for others.

The Cafu source code can be compiled both as 32-bit software (ILP32 type model) and as native 64-bit software (LP64 type model) with all common compilers . It currently runs under Windows (from Windows 2000 ) and numerous Linux distributions . The developers are also aiming to port it to Mac OS soon ; in the long term, support for game consoles is also planned.

Scripting

In order not to have to define details in the program code that are difficult to change, the Cafu Engine uses scripts in many program parts . Specifically, materials, sounds, configuration settings, GUIs (user interfaces) and the behavior of entities (e.g. opponents) are all defined with scripts. Lua is always used as the scripting language (except for the material and sound definitions) .

Physics simulation

In order to simulate moving objects such as boxes, barrels, vehicles and many others in a physically correct manner when they are moved, tilted, bumped into or shot or are subjected to any other force, Cafu uses two methods at the same time:

  • A Cafu-owned simulation deals exclusively with the movements of the characters of the human players in order to meet the high requirements that come with it: The calculations must be very fast and very exact for the network protocol and, despite rounding errors, repeatable as often as required with the same result Players should never get stuck in walls or the floor, volume tests for triggering triggers should be able to be performed quickly, and the entire state must be resettable and repeatable for the future prognosis of the network protocol.
  • Everything else is simulated with the free physics library Bullet .

Both methods run independently of one another, but are compared with each other by Cafu for each frame.

Another aspect is that Cafu can apply physics effects on the server as well as on the clients: physics effects that run on the server are synchronized with the clients over the network, i. H. a falling box is seen the same by every player and has the same effect on the game for everyone. This variant is used in Cafu z. Mainly used at the moment, but has the disadvantage that the display of the objects from the player's point of view can be afflicted with jerking due to the latency and limited bandwidth in the network. Alternatively, physics effects can only run on the clients. Every player experiences such physics effects independently of everyone else. They are mainly used for visual presentation and have no influence on the game.

Editors and tools

At the Cafu Engine is part of the graphical editor Cawe , whose name stands for " Ca fu W orld E is ditor". CaWE combines the map editor, the GUI editor, the font wizard, the material browser and the model editor in one program, and thus contains all the important tools to create new levels, GUIs, fonts and models for the Cafu engine.

Map Editor

Editing of a terrain located in a map

The map editor is used to create new maps. In accordance with the CSG principle , the user can use the basic building blocks of brushes ( polyhedra ), Bézier surfaces (curved surfaces), terrains (large areas), models and vegetation objects, which can be placed and shaped as required. All objects can be combined into units or freely grouped.

GUI editor

The main menu is edited in the GUI editor

The GUI editor is used to create the graphical user interfaces (GUIs) that are used within the Cafu Engine. These graphical user interfaces are used for all conventional 2D menus (e.g. for the main menu, the built-in console and all dialogs) and for the 3D GUIs in the game worlds with which the player interacts while the game is running (e.g. to open doors, call elevators, etc.).

A special feature of the GUI editor is its ability to let the user edit the GUIs graphically, but at the same time to support their true nature as Lua scripts: The GUIs are loaded from Lua scripts and saved as such, and the operator of the editor can directly access the Lua Enter the program code that is responsible for the interaction with the player.

Material browser

The built-in Material Browser shows the materials known to the Cafu Material System in a representation similar to that of Windows Explorer.

Font wizard

The font wizard makes it easy to load most fonts and convert them into a form that can be used by Cafu GUIs.

Model editor

The Model Editor is currently being developed and will be presented for the first time with the next release. It enables detailed geometric models, e.g. B. for objects or people from numerous 3D modeling programs to import, view and prepare for further use in the Map Editor and the Cafu Engine.

Licensing

The source code of the Cafu Engine has been available to everyone as free software under the GPL since December 2009 . The source code can be downloaded from the official download page or directly from the Git - repository with the command line git clone https://bitbucket.org/cafu/cafu.gitto be checked out.

Alternatively, it is possible to purchase the source code from the developers under a commercial license ( dual licensing ). This allows game and application manufacturers to use the Cafu source code without being bound by the restrictions of the GPL .

development

The Cafu Engine is constantly being developed. The development takes place openly about the freely accessible Git - repository .

Developers, users and interested parties can discuss general and technical questions about Cafu and its program code in mailing lists and forums .

The documentation is managed in a wiki and can therefore be supplemented or changed by the users.

For project management , Cafu uses the Trac issue tracking system , which keeps lists of reports of errors to be corrected, proposed new features and improvements, and program code to be integrated. Developers can incorporate their changes and improvements into the official Cafu source code by submitting them via the tracker. After checking by the admins and, if necessary, after consultation via the mailing lists or the forum, they are transferred to the main development branch.

Expansions that are planned in the future or are already being worked on are recorded and managed in a roadmap .

Individual evidence

  1. Cafu Engine Details on devmaster.net
  2. a b c d List of all tickets ordered by milestones List of the currently important project items currently being processed, sorted by milestones, accessed July 10, 2013.
  3. a b Cafu and Dual-Licensing in the Cafu Engine Wiki
  4. The Cafu Material System in the Cafu Engine Wiki
  5. ^ The Material Browser in the Cafu Engine Wiki
  6. OpenGL API-based Product Listing ( Memento of the original from June 7, 2011 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. on OpenGL.org @1@ 2Template: Webachiv / IABot / www.opengl.org
  7. Cafu now on 64-bit systems! News message
  8. a b c New version 9.06 released! News message
  9. Introduction to Editing in the Cafu Engine Wiki
  10. The Cafu Graphical User Interface System in the Cafu Engine Wiki
  11. Cafu is now open-source! News message
  12. Getting Started with the Cafu Source Code in the Cafu Engine Wiki
  13. Homepage for developers
  14. How to Submit Patches in the Cafu Engine Wiki
  15. Roadmap in the Cafu Engine Wiki

Web links