Race for the galaxy, a card game with AI

This commit is contained in:
espie 2009-09-08 20:45:04 +00:00
parent 05bc8e0d62
commit 5c36d18eb0
8 changed files with 163 additions and 0 deletions

28
games/rftg/Makefile Normal file
View File

@ -0,0 +1,28 @@
# $OpenBSD: Makefile,v 1.1.1.1 2009/09/08 20:45:04 espie Exp $
COMMENT = race for the galaxy card game, automated player
CATEGORIES = games
HOMEPAGE = http://keldon.net/rftg/
DISTNAME = rftg-0.5.2
EXTRACT_SUFX = .tar.bz2
MASTER_SITES = http://warpcore.org/rftg/
# Licence: GPL
# official authorization from the game publisher (Rio Grande)
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
CONFIGURE_STYLE = gnu
LIB_DEPENDS += gtk-x11-2.0,gdk_pixbuf-2.0,gdk-x11-2.0::x11/gtk+2
WANTLIB += X11 Xau Xcomposite Xcursor Xdamage Xdmcp Xext Xfixes
WANTLIB += Xi Xinerama Xrandr Xrender c expat fontconfig freetype
WANTLIB += m pixman-1 pthread-stubs xcb z
WANTLIB += atk-1.0 cairo gio-2.0 glib-2.0 glitz gmodule-2.0 gobject-2.0
WANTLIB += iconv intl pango-1.0 pangocairo-1.0 pangoft2-1.0 png
.include <bsd.port.mk>

5
games/rftg/distinfo Normal file
View File

@ -0,0 +1,5 @@
MD5 (rftg-0.5.2.tar.bz2) = 0SGu8FTymW2ke+p4mMX74g==
RMD160 (rftg-0.5.2.tar.bz2) = YcIWgUu1D+E+Nw1OWPsm3McnMdQ=
SHA1 (rftg-0.5.2.tar.bz2) = 31rLeACOBUlFrJHcaRiKWZgeVnI=
SHA256 (rftg-0.5.2.tar.bz2) = Cos1zNKhz9uD3INkypJ/2J6oAeF7ZsKmLqA0hbSIpaA=
SIZE (rftg-0.5.2.tar.bz2) = 20719738

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-Makefile_in,v 1.1.1.1 2009/09/08 20:45:04 espie Exp $
--- Makefile.in.orig Fri Sep 4 00:31:50 2009
+++ Makefile.in Tue Sep 8 21:15:21 2009
@@ -127,7 +127,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
+CPPFLAGS = @CPPFLAGS@ -DDATADIR=\"$(pkgdatadir)/\"
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
@@ -202,7 +202,7 @@ learner_SOURCES = engine.c init.c ai.c learner.c net.c
dumpnet_SOURCES = net.c engine.c dumpnet.c init.c rftg.h net.h
dumprole_SOURCES = net.c engine.c dumprole.c init.c rftg.h net.h
dist_pkgdata_DATA = cards.txt images.data
-rftg_CFLAGS = -Wall @GTK_CFLAGS@
+rftg_CFLAGS = @GTK_CFLAGS@
rftg_LDADD = @GTK_LIBS@
SUBDIRS = network
ACLOCAL_AMFLAGS = -I m4

View File

@ -0,0 +1,38 @@
$OpenBSD: patch-ai_c,v 1.1.1.1 2009/09/08 20:45:04 espie Exp $
--- ai.c.orig Tue Sep 8 21:27:26 2009
+++ ai.c Tue Sep 8 21:28:23 2009
@@ -96,7 +96,7 @@ static void ai_initialize(game *g, int who, double fac
#endif
/* Create evaluator filename */
- sprintf(fname, "network/rftg.eval.%d.%d%s.net", g->expanded,
+ sprintf(fname, DATADIR "network/rftg.eval.%d.%d%s.net", g->expanded,
g->num_players, g->advanced ? "a" : "");
/* Attempt to load network weights from disk */
@@ -122,7 +122,7 @@ static void ai_initialize(game *g, int who, double fac
#endif
/* Create predictor filename */
- sprintf(fname, "network/rftg.role.%d.%d%s.net", g->expanded,
+ sprintf(fname, DATADIR "network/rftg.role.%d.%d%s.net", g->expanded,
g->num_players, g->advanced ? "a" : "");
/* Attempt to load network weights from disk */
@@ -3758,14 +3758,14 @@ static void ai_shutdown(game *g, int who)
if (saved) return;
/* Create evaluator filename */
- sprintf(fname, "network/rftg.eval.%d.%d%s.net", g->expanded,
+ sprintf(fname, DATADIR "network/rftg.eval.%d.%d%s.net", g->expanded,
g->num_players, g->advanced ? "a" : "");
/* Save weights to disk */
save_net(&eval, fname);
/* Create predictor filename */
- sprintf(fname, "network/rftg.role.%d.%d%s.net", g->expanded,
+ sprintf(fname, DATADIR "network/rftg.role.%d.%d%s.net", g->expanded,
g->num_players, g->advanced ? "a" : "");
/* Save weights to disk */

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gui_c,v 1.1.1.1 2009/09/08 20:45:04 espie Exp $
--- gui.c.orig Tue Sep 8 21:26:55 2009
+++ gui.c Tue Sep 8 21:27:07 2009
@@ -239,7 +239,7 @@ static void load_image_bundle(void)
int count, x;
/* Create bundle file handle */
- bundle = g_file_new_for_path("images.data");
+ bundle = g_file_new_for_path(DATADIR "images.data");
/* Open file for reading */
fs = G_INPUT_STREAM(g_file_read(bundle, NULL, NULL));

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-init_c,v 1.1.1.1 2009/09/08 20:45:04 espie Exp $
--- init.c.orig Tue Sep 8 21:11:25 2009
+++ init.c Tue Sep 8 21:11:39 2009
@@ -245,7 +245,7 @@ void read_cards(void)
int i, code, phase;
/* Open card database */
- fff = fopen("cards.txt", "r");
+ fff = fopen(DATADIR "cards.txt", "r");
/* Check for failure */
if (!fff)

10
games/rftg/pkg/DESCR Normal file
View File

@ -0,0 +1,10 @@
_Race for the galaxy_ is a popular card game by Tom Lehmann,
distributed by Rio Grande Games in the US and Ystari in France.
So far, with two highly successful extensions.
This program allows you to play against an AI, with or without the
extensions. Card images courtesy of Rio Grande Games.
The rules are available from Rio Grande:
http://www.riograndegames.com/uploads/Game/Game_240_gameRules.pdf

37
games/rftg/pkg/PLIST Normal file
View File

@ -0,0 +1,37 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/09/08 20:45:04 espie Exp $
bin/do_train
@bin bin/rftg
share/rftg/
share/rftg/cards.txt
share/rftg/images.data
share/rftg/network/
share/rftg/network/rftg.eval.0.2.net
share/rftg/network/rftg.eval.0.2a.net
share/rftg/network/rftg.eval.0.3.net
share/rftg/network/rftg.eval.0.4.net
share/rftg/network/rftg.eval.1.2.net
share/rftg/network/rftg.eval.1.2a.net
share/rftg/network/rftg.eval.1.3.net
share/rftg/network/rftg.eval.1.4.net
share/rftg/network/rftg.eval.1.5.net
share/rftg/network/rftg.eval.2.2.net
share/rftg/network/rftg.eval.2.2a.net
share/rftg/network/rftg.eval.2.3.net
share/rftg/network/rftg.eval.2.4.net
share/rftg/network/rftg.eval.2.5.net
share/rftg/network/rftg.eval.2.6.net
share/rftg/network/rftg.role.0.2.net
share/rftg/network/rftg.role.0.2a.net
share/rftg/network/rftg.role.0.3.net
share/rftg/network/rftg.role.0.4.net
share/rftg/network/rftg.role.1.2.net
share/rftg/network/rftg.role.1.2a.net
share/rftg/network/rftg.role.1.3.net
share/rftg/network/rftg.role.1.4.net
share/rftg/network/rftg.role.1.5.net
share/rftg/network/rftg.role.2.2.net
share/rftg/network/rftg.role.2.2a.net
share/rftg/network/rftg.role.2.3.net
share/rftg/network/rftg.role.2.4.net
share/rftg/network/rftg.role.2.5.net
share/rftg/network/rftg.role.2.6.net