I feel it’s about time I released another version of Train Game: so here it is, version 0.2! Like it’s predecessor this version isn’t really playable in any sense, but you can drive the train around a bit. Here’s a screenshot showing the two major new features: trees and uphill track:
Building and Playing
This version is source-only and will only work on Linux/*BSD without significant tweaking, although I do plan a Windows version at some point.
First, download and unpack TrainGame-0.2.0.tar.gz.
In the TrainGame-0.2.0 directory, run:
cmake . make
You will be notified of any missing dependencies. Note that FLTK is no longer required. Do not run
make install! It’s currently designed to run in-place.
./bin/TrainGame play demo
You can substitute “demo” for anything in the maps directory such as “figure8” or “uphill”. If you want to create or edit a map do:
./bin/TrainGame edit mymap --width 32 --height 64
The controls are quite simple:
- The up and down arrow keys control speed.
- The “b” key toggles the brake.
- The “r” key toggles reverse but only when there is no power applied.
- The left and right arrow keys change the direction of points when you are near some.
- The tab key switches between bird’s-eye, floating, and fixed camera modes. Use the mouse to move the camera in floating mode, then hit tab to lock it in fixed mode.
So, I’m thinking of where to go with Train Game now since the project seems a bit direction-less and perhaps that explains the slow progress.
My current thinking is that there will be two game modes: “challenge” and “trading”.
Challenge mode involves you completing various train based tasks. There are two sub-modes:
- Timetable – drive a passenger train along a route trying to stop at stations at the correct times and also make the passengers’ journey as comfortable as possible (i.e. no sudden starts/stops). This style of game seems very popular in Japan.
- Delivery – you are given a series of increasingly difficult delivery tasks to perform with a strict time limit. E.g. “collect 10 units of wood from X and deliver them to Y in 1 minute” or something like that.
Trading mode is a bit more open-ended and also has two sub-modes:
- Capitalism – you buy and sell goods at different stations. There’s a simple market economy which fluctuates with your actions. It’s a bit like a train-based Elite. With the money you earn you can buy new trucks, upgrade your train, etc.
- Socialism – there’s no market but you score points for heroic actions such as transporting goods over long distances at high speeds. There are also randomly generated “quotas” that work a bit like an extended challenge mode. The details still need to be worked out…
In both these sub-modes you compete against other AI controlled trains, or maybe even other human controlled trains.
I’m also considering renaming it DoofTrains to make it sound a bit less generic.
What do you think, readers?
maybe it is just me, but i really like atc(8). maybe you could have a mode like that? with trains instead of planes.
April 18, 2010 @ 10:07 pm
I got stable gentoo-amd64, xerces-c-3.0.0-r1
It doesn’t start:
$ bin/TrainGame play demo
Copyright (C) 2009-2010 Nick Gasson
This program comes with ABSOLUTELY NO WARRANTY. This is free software, and
you are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
[INFO ] Program started
[INFO ] Looking for resources in /home/yuri/work/TrainGame-0.2.0
[INFO ] Found 6 maps, 4 buildings, 2 engines, 1 waggons, 2 trees
[WARN ] XDG_CONFIG_HOME not set: using ~/.config
[INFO ] Reading config from /home/yuri/.config/TrainGame/config.xml
[INFO ] Creating parser for XML schema schemas/config.xsd
Could not open catalog:
Cannot load message domain
April 20, 2010 @ 11:32 am
I got this file here:
April 20, 2010 @ 11:34 am
I haven’t see this error message before but it’s generated the first time Xerces is used. Do you think it’s the same as the problem reported here: http://bugs.gentoo.org/259408
April 20, 2010 @ 11:33 pm
Yes, it is the same problem. I have re-emerged xerces-c without “iconv” flag and rebuild the game. It works. It is amazing! :)
So nice game :) Hope to see next release.
April 21, 2010 @ 7:00 am
> maybe it is just me, but i really like atc(8). maybe you could have a mode like that? with trains instead of planes.
Yes, that’s possible. It could use only AI trains but you control the points.
I’d like to make it as generic as possible so it’s easy to implement whatever train-based game you want.
April 21, 2010 @ 7:50 am
On OpenSuSE 11.1:
I installed a xerces RPM with yast, but it didn’t include(?) a pkg-file, so I removed the check from
and generated the Makefile with
“cmake XERCES_LIBRARIES=/usr/lib XERCES_INCLUDE_DIRS=/usr/include .”
Sadly, when compiling it throws the following error message:
[ 1%] Building CXX object CMakeFiles/TrainGame.dir/src/XMLParser.cpp.o
/home/gregor/stuff/TrainGame-0.2.0/src/XMLParser.cpp: In constructor ‘XercesXMLParser::XercesXMLParser(const std::string&)’:
/home/gregor/stuff/TrainGame-0.2.0/src/XMLParser.cpp:145: error: incomplete type ‘xercesc_2_8::Grammar’ used in nested name specifier
make: *** [CMakeFiles/TrainGame.dir/src/XMLParser.cpp.o] Fehler 1
make: *** [CMakeFiles/TrainGame.dir/all] Fehler 2
make: *** [all] Fehler 2
How can I fix that? I do not believe that my hack around the pkg causes this, but I better ask you :)
April 28, 2010 @ 3:30 pm
through some more hacking I got it working.
Firstly, I took the advice from
and added the following line to “./src/XMLParser.cpp”
Then I got linking errors with xerces, a brief look into “./CMakeFiles/TrainGame.dir/link.txt” revealed that it was NOT linking to -lxerces-c !!!
I don’t know why cmake does this (probably because I commented the pkg-check out as mentioned above….) but now it works.
Out of curiosity, how can I make a cleaner build?
April 28, 2010 @ 4:28 pm
I’m very sorry for polluting your comments but now it won’t load any maps:
./bin/TrainGame play coal_mine
[INFO ] Xerces initialised
[INFO ] Loading building from /home/gregor/stuff/TrainGame-0.2.0/buildings/platform_end/platform_end.xml
[INFO ] Creating parser for XML schema schemas/building.xsd
[INFO ] Loading model /home/gregor/stuff/TrainGame-0.2.0/buildings/platform_end
terminate called after throwing an instance of ‘std::ios_base::failure’
what(): basic_filebuf::underflow error reading the file
April 28, 2010 @ 4:33 pm
Which version of Xerces are you using? I have only tested with versions >3.0. From the above error it looks like you are using 2.8.
May 7, 2010 @ 7:48 pm
Hi Nick, your train game has the sort of “sandbox” appeal which would make it perfect for me and my four-year-old son to play together. We’d really enjoy playing with no fixed goals, just for the experience. I think lots of other young people would feel the same way!
I didn’t quite manage to build the game on Linux (got lost in dependencies) but I’d love to try again sometime or see a Windows version for us knuckleheads.
Thanks for sharing your work and we will watch with anticipation for future releases!
June 19, 2010 @ 11:23 am
Thanks for your comments. Unfortunately, building from source at the moment is a bit tortuous on Linux, and even worse on Windows. When I release a version that’s closer to being finished I intended to provide binary versions for Windows and various Linux distributions.
June 20, 2010 @ 8:33 pm
good but i wnt to download the train simulater games pls send me url or site link on my mail id
April 29, 2011 @ 5:50 pm