GCCG

From Arcmage Wiki
Jump to: navigation, search
gccg is an open source card game engine that is very modular and extensible. We are currently in the process of setting it up so that it can be used for playtesting. The module's source code is available at GitHub.

IsharaComix handles most of the gccg-WTactics work. If you need help setting it up or have some amazing ideas that you totally believe need to be put into the module, he's the man to ask - just hunt him down in the IRC channel or scribble on his Talk Page.


Client

Installing

The following is a summary of the instructions found on the gccg docs, tailored for WTactics.

Prerequisites

In order to install and run gCCG and its modules, the following libraries are required. Keep in mind that some Linux distributions (such as Ubuntu) require *-dev packages in order to install the headers for these libraries, which are necessary for the make step to function propery.

  • sdl_net
  • sdl_mixer
  • sdl_image
  • sdl_ttf
  • libjpeg62

Linux & Mac

mkdir gccg
cd gccg
wget http://gccg.sourceforge.net/modules/gccg-core-1.0.4.tgz
tar xzvf gccg-core-1.0.4.tgz
./gccg_package source add http://wtactics.org/files/gccg/modules/
./gccg_package install client fonts source wt
make all

To run WTactics, simply run ./wt. To stay updated, run ./gccg_package update.

Windows

  • Download and extract The Windows Installer to your hard drive.
  • Download the WTactics Installer and save it inside of the gccg folder.
  • Run Install_WTactics.bat.
  • Run wt.bat to play.
  • Run Update Everything.bat to keep up-to-date.

Flags

--full Fullscreen mode. Note: It's still running at the default resolution (1024x768) as that can't be changed at the moment.
--design <width>x<height> Changes the canvas size. Areas outside default geometry area will be dark & other users won't be able to see objects it contains. Default value is set to 1024x768.
--nosounds Runs client without sound.
--user <user name> Loggs you in as <user name>.
--server <server name> Connects to <server name>, which is usually an IP an not a "name".
--port <port number> Tries to connect to port <port name> of <servername>


FAQ

How do I set my avatar?

Use /set avatar image where image is the name of one of the images in gccg-core/graphics/avatar/. For example, to set your avatar to viking.png, use /set avatar viking. In order for someone to see your avatar, both players must have the avatar on their machines, so you can't use a user-defined avatar.

How do I create a Deck?

  • Type /newdeck name-of-deck to create a new deck.
  • Right-click to bring up the Menu
  • Select "View Collection"
  • To add a card from the collection to your deck, middle-click it. To remove it, left-click it.
  • To add another copy of a card that is already in your deck, middle-click its name in your deck description. To remove it, left-click it.
  • To zoom in on a card, hover over it and hold shift. To see a textual description of the card, right-click it and select "show card text w/ errata".
  • To change the deck you are editing, right-click and choose "select deck". Your deck will be saved automatically after each change you make to it.

Why are these cards shaded out?

In gCCG there is no restriction on what cards you can put in your deck - in other words, you don't have to "own" cards to play with them. Cards that you play with that you don't own are called proxies. Playing with only cards that you do own will allow you to win "promotional" cards. Card ownership only exists to give folks who want the added challenge of trying to collect all the cards something to do on top of playing the game itself. The collecting in the WTactics gCCG module is totally optional and doesn't give you "better" cards or somehow helps you win against a player that isn't collecting. The promotional cards do not have better stats or abilities on them, instead they differ in appearance or other ways which don't affect the gameplay.

I see $. Does this cost?

No. The dollars on your account are virtual ones. They are not and will never be connected to real money, credit cards or anything else. In gCCG you can win more "dollars" by playing, and you can then wager them on one of your games or buy new cards with them to improve your collection.

How do I start a game?

Find an open table and left click on it. Some tables require a minimum bet to play at, while others are free. Some have restrictions on the decks you are allowed to play with, while others don't. Left clicking the table will put you in the table. To actually join the game, middle-click the table. Once both you and your opponent do that, the game will start.

How do you win?

When you decide that you have won, right-click and choose "declare win". If your opponent agrees that you are the winner, then he will choose "accept declaration", and the game will end. If you decide that things are hopeless, you can "declare loss" in the same way, or "declare undecided" to end the game without a winner being declared. An undecided game will be auto-saved on the server and can be continued at a later time if you would both want to do so.

How do I do...

If you're trying to do something, the first thing to try is to right-click and bring up the menu. Most actions that are needed can be accessed through this menu, and by clicking on the deck or a card, you can bring up actions that make sense for those objects. Try exploring all of the possibilities, as there are a lot of features available.

Some commands can only be accessed using the console. Press F1 to bring up a list of commands, and use /help command to get instructions on how to use it.

It's hard to play when you have to type everything.

Try finding a VoIP program that you and your opponent can use, such as Mumble. It's much easier to discuss what's going on in the game with your opponent when you can do so out loud.

You didn't answer my question here!

Try visiting the gccg FAQ.

If that doesn't help drop by #WTactics on Freenode IRC and see if anyone there can help you, or try our forum.


Server

As a player you will not need to install or setup any server whatsoever to be able to play WTactics. We will do that for you, and you will be able to use our servers for free. By doing so you will also have an easier time of meeting other players in them. Please only follow the steps i this section if you for some reason want to setup a server of your own.

Installing

The following assumes you're doing it on Linux, download the 1.0.4 version and are on i386: By changing the version numbers you can fetch newer versions if they are released.

mkdir gccg
cd gccg
wget http://gccg.sourceforge.net/modules/gccg-core-1.0.4.tgz
tar xzvf gccg-core-1.0.4.tgz
./gccg_package source add http://wtactics.org/files/gccg/modules/
./gccg_package install client server fonts linux-i386 wt

Before running, copy conf/wt-sample.conf and change the line that says server-ip to whatever the publicly visible IP address of your machine is. If it is behind a router and you want it to be world-visible, then you need to find out the IP address that has been assigned to you router (can be found by visiting 'whatismyip.com'). If you want to play on a LAN, you need to find out your machine's local IP address, which can be found using ifconfig. If you only want to play locally on your machine to test something, then set this value to 127.0.0.1. Ports for metaservers are usually 28500 and 28600 for game servers.

Starting Servers

After setting it up, run ./ServerLaunch path-to-new-conf-file, which will launch the factory server, meta server, and a number of tables, as specified by the conf file. These will be detached from the terminal, so you can run this in ssh and then log off without killing the server.


Important Accounts

After setting it up, immediately log onto the server's administrative accounts, so that nobody can take it over:

./wt --server your-server-ip-address --user root
./wt --server your-server-ip-address --user God
./wt --server your-server-ip-address --user Guard
./wt --server your-server-ip-address --user Judge
./wt --server your-server-ip-address --user Salesman

Stopping

To stop the server, run ./ServerKill wt, which will kill all of the processes started by ServerLaunch.



For more information on managing the server, read the manual.

Changing Resolution

For user to have a chance to use a higher resolution than the 1024x768 that gCCG comes with as default the server must be properly setup. If it isn't then it doesn't matter what resolutiont he player uses, if it's full screen, windowed or design.

To change the server-side values edit /scripts/*-server.include and edit the lines "screen.width = BIGNUM" and "screen.height = NOTQUITESOBIGNUM".

Keep in mind that a user won't be able to play without serious issues if he/she is on hardware that use lower resolution than what is set in the above, but that he/she will be able to play on "higher" one by using --design.

Handling updates

(15:50:10) snowdrop: so say we update the content of the game...

(15:50:18) snowdrop: and players only need to ./gccg_package update.

(15:50:35) snowdrop: what happens if they DONT use that command, eneter server, nd try to play with one that has the latest stuff?

(15:50:59) Anonycat: they will see face down cards in place of any card data they don't have

(15:51:19) snowdrop: but if card data is the same and only images changed and/or card text?

(15:51:43) Anonycat: then they'll still see the old image and/or text associated with the card

(15:51:45) snowdrop: meaning, the cards were revised, but no new cards added. (15:51:53) snowdrop: aha (15:52:03) snowdrop: so there are no md5-checks or something like that? (15:52:44) snowdrop: actualy, is there any way at all the player could be warned about him having an old version of the stuff? (15:53:05) snowdrop: preferably i wouldnt even want hi to be able to connect before updating, if needed.

(15:55:21) Anonycat: if there's an update that breaks backward compatibility, what you can do is overload the RegisterPlayer function from server.functions (15:55:41) Anonycat: copy it into wt-server.include (that version takes precedence), and add a version check (15:56:34) Anonycat: for some reason there's a version check on the client side in client.triggers, that sees if you're running old versions of the binary (15:58:35) snowdrop: k (15:58:40) Anonycat: you can run a similar version check when a player tries to connect (client version number is sent as ARG[1]), and reject the connection if it's too old 15:59:44) Anonycat: actually no, meta-server.functions already handles such a thing (16:00:00) Anonycat: you just have to set REQUIRE_VERSION (16:01:17) Anonycat: but note that that's going by binary package version; the client doesn't send the version number of its game data package at all

Module Management

This section is of interest for anyone that wants to port his/her game to gCCG so that gCCG can be used to play the game. The info here is typically not relevant for an individual that just plans on playing a game that is already around.

Developing and updating game modules is easy. Firstly, a remote module directory needs to be set up, containing a listing file called available.xml. WTactics has its module directory at http://wtactics.org/files/gccg/modules/ and has its listing file at http://wtactics.org/files/gccg/modules/available.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE modules SYSTEM "modules.dtd">
<modules>
  <source url="http://gccg.sourceforge.net/modules/"/>
  <module name="wt" version="0.0.1">
  </module>
</modules>

This file contains two types of entries, sources and modules. A source is the location of a module directory. This allows directories to point to other directories. It's usually a good idea to point back to the official gccg directory.

Then, there is a list of modules, each with a name and a version number. Each module entry corresponds to a file in the directory of the format gccg-NAME-VERSION.tgz, so in this case, we have a file gccg-wt-0.0.1.tgz.

When ./gccg_package install wt is called, it fetches the highest version of wt that it can find. <code./gccg_package update</code> looks at all of the modules that have been installed and then fetches the highest version, replacing the older version.

When a module is installed, the archive containing the files is retrieved and copied into the gccg core directory, overwriting files that are already there. To turn a folder into a package, one simply has to run tar cvzf ../gccg-GAME-VERSION.tgz . --exclude '.*' inside of the directory that needs to be archived. This will ensure the proper file format and directory structure, and in the event that the folder is under version control, this will prevent the '.svn' or '.git' directories from being included in the package.

Suggested Features

The following outlines features and specs needed for the WTactics module.

  • Rotate the representation of a card so that it is placed 180 degrees, regardless of what position it was before that.
  • Make it possible to put a surrounding border around a card to signal that it is in a specific state. Different colours should be available for this, like for example red, green, orange, blue, white and purple. The border remains there until specifically removed by a player. (Maybe name="table card size" value="30" in wt.xml has to be used to determine the size of framing)
  • Two point vaiables per player: Influence (I) and Victory Points (V)
  • Possibility to let each card have two images associated with it: One that is custom made for the table and only visible whenever the card is shown on table (simpliied version, more iconic, properly scaled and no text etc)and one version that's the real one, shown in hand, when zooming in upon on the table version, and everywhere else except on the table.