By text-based strategy game+source code. Please comment.
Moderator: Forum Moderators
By text-based strategy game+source code. Please comment.
So I have made a small text-based game in like 3-4 days. The AI of the enemy is still quite weak and the game is very easy to outsmart, but I don't know how to make the enemies more clever. Plus I would like to write a manual so I want to include the answers to questions any of my players may have, so feel free to ask. The game requires Pascal to be played in Linux.
.exe version for Windows - no additional programs required: http://www.mediafire.com/?azzimwq0zkj
.pas version for Linux, Pascal required. This contains the actual code of the game if there are any Pascal users out there:
http://www.mediafire.com/?inzjdmkt5zd
Quick tutorial for the game:
When you start a new game, write your name, press enter, then the desired name of your country and then press enter.
Later you set your difficulty. 0 difficulty is the easiest "playable" difficulty while the difficulty "9" would make it impossible to get the more refined resources: power and steel. Greater difficulty just means more Mayhem for now.
You are asked to note the resourcefulness of the area too. 10 <Enter> 10 <Enter> resourcefullness is ok. It means that each oil well and ore mine will produce 10 oil and 10 ore respectively. Larger numbers make game faster and smaller numbers make game slower.
With each turn you will get resources depending on the building. All buildings except Power Plant require 1 point of energy to maintain while Power plants need oil and Steel Mills need ore to produce power and steel.
At the beginning of each turn, you will see what other players are doing. Sometimes they will be building buildings and sometimes they will be hiring troops. You should notice that as the countries are hiring troops, the diplomatic relations with them worsen. A relation of zero means war. The country which exceeds the other in their military power at least in three types of forces(troops,tanks,planes,ships) gets all of the opposing countries' resources. No way to beat the game yet though.
.exe version for Windows - no additional programs required: http://www.mediafire.com/?azzimwq0zkj
.pas version for Linux, Pascal required. This contains the actual code of the game if there are any Pascal users out there:
http://www.mediafire.com/?inzjdmkt5zd
Quick tutorial for the game:
When you start a new game, write your name, press enter, then the desired name of your country and then press enter.
Later you set your difficulty. 0 difficulty is the easiest "playable" difficulty while the difficulty "9" would make it impossible to get the more refined resources: power and steel. Greater difficulty just means more Mayhem for now.
You are asked to note the resourcefulness of the area too. 10 <Enter> 10 <Enter> resourcefullness is ok. It means that each oil well and ore mine will produce 10 oil and 10 ore respectively. Larger numbers make game faster and smaller numbers make game slower.
With each turn you will get resources depending on the building. All buildings except Power Plant require 1 point of energy to maintain while Power plants need oil and Steel Mills need ore to produce power and steel.
At the beginning of each turn, you will see what other players are doing. Sometimes they will be building buildings and sometimes they will be hiring troops. You should notice that as the countries are hiring troops, the diplomatic relations with them worsen. A relation of zero means war. The country which exceeds the other in their military power at least in three types of forces(troops,tanks,planes,ships) gets all of the opposing countries' resources. No way to beat the game yet though.
- dipseydoodle
- Posts: 879
- Joined: September 16th, 2008, 10:26 pm
Re: By text-based strategy game+source code. Please comment.
Cool(I run a Mac so I can't try it other-wise I would.) Maybe I'll be able to use the code as an inspiration.
Re: By text-based strategy game+source code. Please comment.
There is no Pascal for Mac? There ought to be. Having a Pascal compiler enables you to fix all those petty mistakes I have made there. If you want to
Re: By text-based strategy game+source code. Please comment.
dipseydoodle wrote:Cool(I run a Mac so I can't try it other-wise I would.) Maybe I'll be able to use the code as an inspiration.
Free Pascal (aka FPK Pascal) is a 32 and 64 bit professional Pascal compiler. It is available for different processors: Intel x86, Amd64/x86_64, PowerPC, PowerPC64, Sparc, ARM. The discontinued 1.0 version also supports the Motorola 680x0. The following operating systems are supported: Linux, FreeBSD, Haiku, Mac OS X/Darwin, DOS, Win32, Win64, WinCE, OS/2, Netware (libc and classic) and MorphOS.
- dipseydoodle
- Posts: 879
- Joined: September 16th, 2008, 10:26 pm
Re: By text-based strategy game+source code. Please comment.
I don't have a pascle compiler for all I know. When I wan't to compile something I have to manually compile it in Terminal or xTerminal. Any program that I whant to automatically compile I have to run in Fink, wich only compiles Fink/X11 compatable programs.
Re: By text-based strategy game+source code. Please comment.
Why not install the PASCAL compiler then?...
- dipseydoodle
- Posts: 879
- Joined: September 16th, 2008, 10:26 pm
Re: By text-based strategy game+source code. Please comment.
How do I get it? If I knew how to I would... I don't normally compile things because I have no need to.
- dipseydoodle
- Posts: 879
- Joined: September 16th, 2008, 10:26 pm
Re: By text-based strategy game+source code. Please comment.
I'll check it out sometime. Untill Then I'll just stick with precompiled programs.
-
- Art Contributor
- Posts: 1700
- Joined: December 7th, 2006, 8:08 pm
Re: By text-based strategy game+source code. Please comment.
The link for the exe doesn't work anymore.
Last edited by Blarumyrran on February 16th, 2013, 8:45 am, edited 1 time in total.
Re: By text-based strategy game+source code. Please comment.
It compiles and runs, and it saves, but for some reason when I try to load the save it crashes.
Other than that though it is pretty good for a small text based game.
Other than that though it is pretty good for a small text based game.
Re: By text-based strategy game+source code. Please comment.
I recommend you to familiarize yourself with the concept of two-dimensional arrays.JustasJ wrote:This contains the actual code of the game if there are any Pascal users out there:
http://www.mediafire.com/?inzjdmkt5zd
Using them instead of r12 .. r45 variables will cut the amount of code at least by half.
Re: By text-based strategy game+source code. Please comment.
Hey, another cool game that is text-based and uses simple tables and tds to draw out a grid map is called
The Grid: http://codeelf.com/games/grid/
It feels a lot like Risk if you stuck it into a web browser, had a bunch of strangers from around the world all playing, and instead of countries fighting eachother, the map is split up into a large grid with many squares - each player ruling one or many of these squares...
The Grid: http://codeelf.com/games/grid/
It feels a lot like Risk if you stuck it into a web browser, had a bunch of strangers from around the world all playing, and instead of countries fighting eachother, the map is split up into a large grid with many squares - each player ruling one or many of these squares...