Difference between revisions of "Development/Architecture/KDE4/KGGZ (es)"

Jump to: navigation, search
m (translation to spanish)
m (translation to spanish)
Line 96: Line 96:
=== Prueba de juegos GZZ ===
=== Prueba de juegos GZZ ===
Connecting to the main GGZ server is not required to test GGZ games,
Conectar con el servidor principal GGZ no es necesario para testear juegos GGZ
as long as the right game server is installed in addition to the KDE game client!
, mientras el servidor correcto del juego esté instalado ademas del cliente del juego!
Just use the ''ggz-faketable'' tool from the ggz-python package.
Simplemente usa la herramienta ''ggz-faketable'' del paquete ggz-python package.
The use of ''kde4launch'' is optional of course.
El uso de ''kde4launch'' es opcional, por supuesto.
<code bash>
<code bash>

Revision as of 18:20, 16 September 2008



The GGZ Gaming Zone offers a complete free infrastructure for online games. It has always provided some sort of KDE integration, however starting from KDE 4.0, this integration has been available out of the box from the KDE Games Library (libkdegames). GGZ support is widely available on a variety of distros and gains popularity with a number of game projects.


Impatient? GGZ in KDE 4 - Status file

In the time up to the KDE 4.0 release, most of the groundwork was laid which makes GGZ development based on KDE libraries possible. Three libraries (kggzmod, kggzgames, kggznet) have been written and some CMake macros were also created. See API docs.

KDE 4.0 ships with KReversi and KBattleship which both provide a GGZ networking mode which gets activated when launching the games from a GGZ core client. KReversi running on GGZ leads to GGZ's own KReversi being renamed to KGGZReversi, something that was planned for a long time. Both will use the GGZ Reversi server. For KBattleship, a dedicated server named Submarine was written in Python and is available in GGZ SVN.

KDE 4.1 shall add KSquares, which is compatible with GGZ's Connect the Dots server (patch has been applied recently). KFourInLine support is also planned. It would therefore supersede the KDE3-based KConnectX client released with GGZ 0.0.14. Also, additional games might be ported. In KDE 4.1, better core client integration is also planned. This might include embedded core clients (i.e. games can connect to GGZ servers on their own), a port of KGGZ to KDE 4, and GGZ integration with Jabber including some Kopete widgets related to online gaming. The KGGZ port, currently dubbed KGGZ-ng, has some information available here. You can already enjoy the work on individual widgets such as player list and the list of available rooms.

icon.png icon.png icon.png


While KDE 3-based development of GGZ games requires the ggzmod library, i.e. programming in C, KDE 4 has kggzmod/kggznet/kggzgames (collectively referred to as libkggz*) and thus the libraries and all games using it will compile without any further dependencies. In order to be able to play the games from an online gaming client (the so-called GGZ core clients such as KGGZ), the game client still needs to be registered with the central GGZ game modules registry. The tool ggz-config, which is part of the ggz-client-libs package, is needed for this task. Most distributions ship it as part of a ggzcore-bin package or similar. The file module.dsc contains meta information about the game, such as its author, UI library/environment it runs in and where its executable is located. The two important values are which protocol it uses and which version of the protocol.

ProtocolEngine=TicTacToe ProtocolVersion=2

If and only if those two match the values of the game server, this game client will be offered to players! More information about this file can be found in the ggz-config readme file and in the GGZ game development guide (which contains a lot more information and should really be printed out if you want to develop for GGZ).


Adding GGZ support to KDE games is not hard at all. There are three libraries for different tasks: kggzmod which handles all GGZ-specific events and requests, kggznet that you can use for networking (but don't have to), and kggzgames for GUI integration with GGZ components.

In addition, kggzdmod for Qt4-based GGZ game server development is available as an experimental library.

Please consider re-using existing protocols for equal or similar games. The three places to look at are: KDE Games, GNOME Games, and the games shipped by the GGZ project in their various packages. On http://www.ggzgamingzone.org/engines/ there is a list of all known GGZ games.

For the time being, have a look at the API docs of kggzmod, kggznet and kggzgames, which are all part of libkdegames.

A number of tutorials were sent to the kde-games-devel list, providing additional information on top of the API docs.

Si esta información no es suficiente: Unete a #kdegames en irc.kde.org y pregunta si quieres ayudar. Si estás seriamente interesado en ehcar una mano, por favor publica tus ideas en la lista de correo kde-games-devel.


Instalación paralela

Since for developers both the installed KDE and GGZ versions might differ from the system-wide installation, there are a few issues to consider. First of all, they need to be installed into different directories. The reason is that both do not use versioned includes, and GGZ's ggz-kde-* packages are still based on KDE 3. Here's a typical development setup (a receipe, so to speak), you might want to adapt it.

  • KDE 3, KDE 4 and GGZ installed in /usr with KDE 3 occupying /usr/include/k*
  • KDE 4 (devel) installed into ~/sys/kde4
  • GGZ (devel) installed into ~/sys/ggz (and ~/sys/ggz/bin should be in $PATH)
  • Prefixes don't match, so configure kdegames with -DGGZ_FORCEREGISTRY=1
  • in ggz.modules, for each KDE 4 entry, add 'runkde4' before each executable
  • runkde4 does the following:

  1. !/bin/sh

export PATH=$HOME/sys/kde4/bin:$PATH export KDEDIRS=$HOME/sys/kde4 export KDEHOME=$HOME/.kde4 exec $*

Such a wrapper mechanism is needed in many places in GGZ, so a generic one might be introduced. Still help is needed to port ggz-kde-* to KDE 4!

Prueba de juegos GZZ

Conectar con el servidor principal GGZ no es necesario para testear juegos GGZ , mientras el servidor correcto del juego esté instalado ademas del cliente del juego! Simplemente usa la herramienta ggz-faketable del paquete ggz-python package. El uso de kde4launch es opcional, por supuesto.

kde4launch ggz-faketable $ggzprefix/lib/ggzd/ggzd.dots $kde4prefix/bin/ksquares

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal