By text-based strategy game+source code. Please comment.

Discuss the development of other free/open-source games, as well as other games in general.

Moderator: Forum Moderators

Post Reply
JustasJ
Posts: 4
Joined: April 2nd, 2010, 1:10 pm

By text-based strategy game+source code. Please comment.

Post by JustasJ »

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.
User avatar
dipseydoodle
Posts: 879
Joined: September 16th, 2008, 10:26 pm

Re: By text-based strategy game+source code. Please comment.

Post by dipseydoodle »

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.
JustasJ
Posts: 4
Joined: April 2nd, 2010, 1:10 pm

Re: By text-based strategy game+source code. Please comment.

Post by JustasJ »

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 ;)
User avatar
Unnheulu
Posts: 738
Joined: November 25th, 2007, 4:50 pm
Location: Cymru
Contact:

Re: By text-based strategy game+source code. Please comment.

Post by Unnheulu »

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.
User avatar
dipseydoodle
Posts: 879
Joined: September 16th, 2008, 10:26 pm

Re: By text-based strategy game+source code. Please comment.

Post by dipseydoodle »

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. :(
User avatar
Unnheulu
Posts: 738
Joined: November 25th, 2007, 4:50 pm
Location: Cymru
Contact:

Re: By text-based strategy game+source code. Please comment.

Post by Unnheulu »

Why not install the PASCAL compiler then?...
User avatar
dipseydoodle
Posts: 879
Joined: September 16th, 2008, 10:26 pm

Re: By text-based strategy game+source code. Please comment.

Post by dipseydoodle »

How do I get it? If I knew how to I would... I don't normally compile things because I have no need to.
User avatar
Unnheulu
Posts: 738
Joined: November 25th, 2007, 4:50 pm
Location: Cymru
Contact:

Re: By text-based strategy game+source code. Please comment.

Post by Unnheulu »

User avatar
dipseydoodle
Posts: 879
Joined: September 16th, 2008, 10:26 pm

Re: By text-based strategy game+source code. Please comment.

Post by dipseydoodle »

I'll check it out sometime. Untill Then I'll just stick with precompiled programs.
Blarumyrran
Art Contributor
Posts: 1700
Joined: December 7th, 2006, 8:08 pm

Re: By text-based strategy game+source code. Please comment.

Post by Blarumyrran »

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.
User avatar
Jastiv
Posts: 50
Joined: March 11th, 2005, 3:24 pm
Location: Connecticut
Contact:

Re: By text-based strategy game+source code. Please comment.

Post by Jastiv »

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.
http://wogralddev.blogspot.com/

Wograld - our graphics requirements are less demanding.
Ask_
Posts: 25
Joined: November 4th, 2005, 10:46 am
Location: Russia

Re: By text-based strategy game+source code. Please comment.

Post by Ask_ »

JustasJ wrote:This contains the actual code of the game if there are any Pascal users out there:
http://www.mediafire.com/?inzjdmkt5zd
I recommend you to familiarize yourself with the concept of two-dimensional arrays.
Using them instead of r12 .. r45 variables will cut the amount of code at least by half.
nikbard
Posts: 1
Joined: February 16th, 2013, 8:19 am

Re: By text-based strategy game+source code. Please comment.

Post by nikbard »

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...

Image
Post Reply