Finished: THEATER OF WAR ww2 strategy game.

Discussion, Reviews & High-scores

Moderator: Moderators

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Finished: THEATER OF WAR ww2 strategy game.

Postby Ghislain » Sun Oct 24, 2010 5:54 pm

Image

I'm working on a new game for the VIC-20, one that I've always wanted to make: a WW2 game with different types of units like infantry, tanks, etc.

I know a similar game was done before: Tuntematon Sotilas. Jeff D also has said that he's working on (or already made a war game).

In this game, you play the role of a German general in the Eastern front who is severely outnumbered. The computer AI won't be that good, but this will simulate the USSR armies' dearth of quality officers because Stalin had purged most of the competent ones whose allegiance to pure doctrinaire communism was considered suspect.

These are the types of units that there will be in the game:

INF (infantry/soldier) - cost 10 supply units. Movement: 2 spaces. Attack strength is normal VS INF, MOT. Strong VS ATG, AAG. Weak VS ARM.

MOT (motorized infantry/truck) - cost 20 supply points. Movement: 4 spaces. Attack strength is normal VS INF, MOT, ATG, AAG. Weak VS ARM.

ARM (armor/tank) - cost 30 supply points. Movement: 3 spaces. Attack strength is normal VS ARM, AAG. Weak vs ATG. Strong VS INF, MOT

ATG (anti-tank gun) - cost 10 supply points. Movement: 1 space. Attack strength is normal VS ATG. Weak VS INF, MOT, AAG. Strong VS ARM.

AAG (anti-air gun) - cost 10 supply points. Movement: 1 space. Cannot attack ground units. Can attack FIG or BOM units as they fly over.

FIG (figher plane) - cost 20 supply points. Can attack FIG or BOM units.

BOM (bomber plane) - cost 30 supply points. Can attack any ground unit. Normal attack strength VS INF, MOT, ATG. Weak VS ARM and AAG.

Terrain also affects movement (can stop or slow movement).

Each side has a certain number of supply points that are generated per turn (which goes into reserve). This number goes down by 1 every time a unit is destroyed. Each battle begins with an empty map, and both sides start to place units (by using up supply/reserve points). A battle is won when a ground unit occupies the flag of the enemy.

I will try to make this work for the unexpanded VIC-20. So far, I've been programming this mostly in BASIC (on the real machine), but I'll probably embed some ML routines to save memory and speed things up a bit. I'll include a loader that has instructions and a splash screen once I'm done.

Like Napoleon Simulator, the battles at first are easy, but eventually the player is faced with overwhelming waves of enemies.

Every type of unit has strengths and weaknesses. If your enemy sends a large wave of ARM units your way, a good tactic will be to place ATG (anti-tank guns) that are fairly cheap to take them down. Air superiority will also play a crucial role.
Last edited by Ghislain on Thu Nov 25, 2010 4:30 am, edited 3 times in total.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Mon Oct 25, 2010 5:48 pm

I worked some more on this today:

-moved the custom char graphics 256 bytes down. This was done with the intent of creating a single file-loading game (excluding splash screen + loader with instructions). This is done with the intent of submitting it to the minigame compo deadline before Nov. 30 (which I think I will be able to make it).

-changed Germany's color from white to black (USSR remains red)

-created some ML routines to set up, erase the bottom line of the screen (where messages and prompts will be placed), poke colors to screen. Whenever there are portions of the game that could be used to speed things up, I will try to invoke ML.

Map information will be stored on the screen and cassette buffer. If a unit is placed over a space where there is terrain (say INFantry in the forest), the game program will be able to "remember" what is underneath the unit by using the cassette buffer as reference.

The screen is 22x16=352 spaces. I'm able to store the terrain information in the cassette buffer (196 bytes from 828-1023) because there are only 3 types of terrain, so I store information for 2 spaces into 1 byte.

Air units (FIGhter and BOMber) do not appear on the map, but will be seen on the screen flying to their destination when they are invoked to perform an action.

I won't be using any BASIC variables to store ground unit information--everything will be on screen. Every turn, there will be a loop that looks for units, and when one is found, the player will prompted to perform movement/attack for the unit. The game, could in theory handle as many units as there are spaces on the screen. Air units remain at "the base" (the flag) and are invoked at the beginning of the turn.

Computer AI will basically be like this: aggressive (move units towards the German base/flag) while he has the advantage, defensive (protect the USSR base/flag).

Ground units are always deployed to a space adjacent to the base.

After working so hard on Realms III last year, I became somewhat exhausted and I didn't know if I ever wanted to make another VIC-20 game again.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Wed Oct 27, 2010 5:31 pm

I did the following today:

-replaced some BASIC code with an ML routine that copies terrain info into the cassette buffer. It took ab out 15 seconds in BASIC, now it is instantaneous.

-the player can now buy units and place them on the map. Units are deployed adjacent to the base.

I have about 2000 bytes free. I'm hoping that this will fit within the parameters of the unexpanded VIC-20
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Fri Oct 29, 2010 6:42 am

Worked mostly on unit movement yesterday. This game being mostly done in BASIC, the result was a bit slow. I'm able to move units in this manner:

-loop the entire board of the screen. German units are in BLACK
-once the loop comes across a BLACK unit, change the unit color to CYAN, player can move the unit for a certain number of spaces
-after the unit has finished it's movement, it's changed to white
-this way, the loop will not move the same unit twice.

I'll probably re-program this part of the game in ML. I figure I can do it in about 150 bytes in ML, whereas it took me about 400 bytes in BASIC.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
robinsonmason
Vic 20 Enthusiast
Posts: 193
Joined: Sun Mar 14, 2010 9:17 pm

Postby robinsonmason » Mon Nov 01, 2010 9:45 am

Here I was just commenting on Jeff's "War" (no DL available for that yet), and see this!

Looks like another quality game, Ghislain. Looking forward to it.

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Mon Nov 01, 2010 2:53 pm

robinsonmason wrote:Here I was just commenting on Jeff's "War" (no DL available for that yet), and see this!

Looks like another quality game, Ghislain. Looking forward to it.


Thanks. I'm basically working on this slowly whenever I have free time. Today I worked on the computer player's routine where it chooses to buy/deploy units.

It's not going to be a "real time" game like Jeff is working on -- it will be turn-based.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Wed Nov 03, 2010 5:02 am

I worked on an ML routine to speed up scanning the screen for unit movements and such. It does take up a bit more memory than a BASIC FOR...NEXT loop, but at least the game becomes more playable without the player growing impatient as he waits for the screen scan to stop.

I'm still doing all of the dev work on a real VIC-20--using VICMON to write the embedded ML routines.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Thu Nov 04, 2010 2:55 pm

I did a bit more work today -- mostly on the routine that scans the screen for units to move (basically to make sure the BASIC program can interact properly with this ML routine--I had to make a few corrections). I also took another cellphone pic of my TV set (as I continue to do all of the dev work on a real VIC-20):

Image

At the bottom left, the human (German) player deployed 3 units (in black: truck, tank, infantry) and moved them towards the top right where the computer (Soviet) player deployed several units (in red: truck, anti-air gun,infantry,anti-air gun, tank, tank and anti-tank gun).

The German flag is represented by an iron cross. The Soviet flag is represented by hammer and sickle.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Fri Nov 05, 2010 10:50 pm

I had a pretty big breakthrough today: computer is now able to move units. I basically re-used the player movement routine by making it usable for both the human and computer player. When the player moves, the direction is chosen by a keypress--otherwise, it's chosen by the computer AI.

Next step will be to create ground combat routines.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Sat Nov 06, 2010 10:30 am

Another breakthrough: the ground combat routines are finished.

I did make a few test runs against the computer, and I found it extremely easy. Being that the computer AI is quite dumb, I was able to easily outmaneuver the computer's armies and capture his flag.

But I haven't programmed the air combat routines yet. The computer player will have overwhelming resources and be able to build fighter planes and bombers which will be used to attack the player's ground units. Anti-air guns will be useful as a defense, but they're extremely vulnerable to other ground units.

The game's algorithm is able to handle as many units as there are empty spaces for them on the screen, so at some point as the human player progresses, he'll find himself outnumbered by 10:1, even greater. The opportunities to outmaneuver the computer's armies will be rare. The human player will have to devise a good strategy to survive the onslaught.

I think the time of the game will be 1943 or so after the debacle at Stalingrad and the final desperate push towards Moscow is the goal. Like Napoleon Simulator, you can't really win the game, you just face a stronger and stronger enemy after each flag capture and you're playing to see how far you can make it. I might also come up with a scoring system if I have enough memory left over.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
darkatx
Vic 20 Afficionado
Posts: 440
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Postby darkatx » Sat Nov 06, 2010 4:30 pm

I marvel at your efforts!
Looks very promising :shock:
Learning all the time... :)

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Sat Nov 06, 2010 7:14 pm

darkatx wrote:I marvel at your efforts!
Looks very promising :shock:


Thanks. Since my last post, I went on a 7-hour programming spree. The main game is more or less finished and fully playable. I worked on the air combat routines and they work seamlessly. I was even able to put in a scoring system. Nothing too fancy; basically the game keeps track of how many units the human and the computer have destroyed

I should be able to upload the first beta shortly. In the meantime, I'll just continue playtesting and creating the multi-loader parts (splash screen, instructions, etc).
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Sun Nov 07, 2010 2:47 pm

After playtesting for some time, I think I've come up with a balanced version that I'm satisfied with. To download it, go here:

https://sites.google.com/site/gdbsite5000/main

...and download "theater.prg" here.

Now here are the instructions. I strongly suggest reading these because it's quite a complex game.

INTRODUCTION. It is Spring 1943. After the debacle of the Wehrmacht at Stalingrad, the German High Command has decided to regroup to secure the position on the Eastern Front. Once the offensive is regained, the objective is to strike a final swift blow against the heart of the Soviet Capital. While you will be severely outnumbered, there is a dearth of quality enemy officers due to Stalin's insistence on promoting military commanders based on their allegiance to communist ideology instead of their competence. You should use the enemy's inferior strategy to your advantage. Every unit you deploy will have strengths and weaknesses. Use them wisely!

THE GAME SCREEN. The top of the screen represents the game map where units are deployed from their bases; the Iron Cross at the bottom left is where the human player places them, the Soviet flag at the upper right is where the computer player places its units. The bottom of the screen will show the following data information:

RESERVE represents resources that can be used to deploy units. You begin each level with 100 of these (+ a score bonus) while the enemy begins with 100 multiplied by the level number.

SUPPLY represents the number of reserve units you receive at the end of every turn (after resolving all movement and combat). You lose one supply point for every unit of yours that is destroyed (same thing with the enemy when he loses a unit). However, your supply rating never goes lower than 1, so you always have a chance to build units in future turns. You begin each level with 12 of these (plus 3 for each level you've completed) and the enemy gets 12 of these multiplied by the level number.

FIGHTER represents the number of fighter aircraft you have.

BOMBER represents the number of bomber aircraft you have.

THE BEGINNING OF YOUR TURN. You are prompted to deploy units. You can exit this phase of the turn by pressing the SPACE bar. You will be asked to press a corresponding key from 1-7 to build the following:

1. SOLDIER -- Cost 10 reserve points. These can move 2 spaces and even move through forested areas. They have the following attack ratings:

vs soldier: NORMAL attack
vs truck: NORMAL attack
vs tank: WEAK attack
vs anti-tank gun: STRONG attack
vs anti-aircraft gun: STRONG attack

2. TRUCK -- Cost 20 reserves. Movement: 4 spaces (cannot move through rough terrain). Think of this unit as a type of motorized solder/infantry.

vs soldier: NORMAL attack
vs truck: NORMAL attack
vs tank: WEAK attack
vs anti-tank gun: NORMAL attack
vs anti-aircraft gun: NORMAL attack

3. TANK -- Costs 30 reserve points. Movement: 3 spaces, and can also move through water areas.

vs soldier: STRONG attack
vs truck: STRONG attack
vs tank: NORMAL attack
vs anti-tank gun: WEAK attack
vs anti-aircraft gun: NORMAL attack

4. ANTI-TANK GUN -- Costs 10 reserve points. Movement: 1 space, can only move through clear areas. These are useful to deploy when you need to defend against an oncoming onslaught of enemy tanks.

vs soldier: WEAK attack
vs truck: WEAK attack
vs tank: STRONG attack
vs anti-tank gun: NORMAL attack
vs anti-aircraft gun: WEAK attack

5. ANTI-AIRCRAFT GUN -- Costs 10. Moves: 1 (only through clear). While these can theoretically attack other ground units, these are rated weakest of all in that area. These are used primarily for attacking enemy aircraft if they happen to fly overhead. These are quite useful to reduce the enemy's air superiority and be placed in front of ground units in order to defend against bombers.

vs soldier: WEAK attack
vs truck: WEAK attack
vs tank: WEAK attack
vs anti-tank gun: WEAK attack
vs anti-aircraft gun: NORMAL attack
vs fighter: NORMAL attack
vs bomber: STRONG attack

6. FIGHTER -- Costs 20. They are not deployed on the screen but are rather hidden on the respective player's side of the screen. When they attack, they fly a random path to the other side to attack other air units. They attack other fighters first, and when those are eliminated, they then attack bombers.

vs fighter: NORMAL attack
vs bomber: STRONG attack

7. BOMBER -- Costs 30. These are deployed in the same manner as fighters, however when they fly their random flight path from one side of the screen to the other, they do not attack other air units but rather enemy ground units.

vs soldier: NORMAL attack
vs truck: STRONG attack
vs tank: WEAK attack
vs anti-tank gun: NORMAL attack
vs anti-aircraft gun: WEAK attack

STRONG ATTACK denotes a 75% chance of scoring a hit.
NORMAL ATTACK denotes a 50% chance of scoring a hit.
WEAK ATTACK denotes a 25% chance of scoring a hit.

When you deploy units, they are placed right next to your flag. You are not allowed to deploy units to those spaces that are already occupied.

After you finished deploying, you can now move your units. The game will highlight the unit you're about to move in light blue. You can use the following keys to move your unit:

1. UP
2. UP-RIGHT
3. RIGHT
4. DOWN-RIGHT
5. DOWN
6. DOWN-LEFT
7. LEFT
8. UP-LEFT

You can move the unit for the unit's designated number of spaces. You cannot move in rough terrain except for soldier (which can move through forest) and tank (which can move through water). Moving through forest and water (if allowed), will cost an extra movement point. To attack an enemy unit, just place a unit right next to it, and if you still have a free movement point, just "move" towards the enemy unit and you will attempt to attack it.

Mountainous or rocky terrain is considered unpassable by ALL ground units.

You can choose not to move a unit by simply pressing the space bar. You might want to do this in order to keep units out of range from enemy units, or that you prefer to hold the position there.

After you've finished moving a unit, the game will move on to the next unit until the process of moving all units is done.

After ground movements/attacks are done, the air combat phase will commence. All of the deployed air units will fly from your side of the screen to the enemy's side. See fighter/bomber descriptions above to learn how air combat is resolved.

Once air combat is finished, it is the computer's turn to deploy and move units, following by the air combat phase which will end it's turn.

THE GOAL OF THE GAME. To defeat the enemy, you must capture it's flag, after which you will progress to the next level. But with each succeeding level, the computer opponent gets progressively stronger, while you start each level with the same strength as the first level + a score bonus for reserves, and a level bonus for your supply rating. So in order to obtain additional resources at future levels, you should attempt to destroy enemy units before progressing to the next level. You get a number of bonus reserve points at the next level that is equal to the number of units you've destroyed. Your SCORE is denoted in between levels (and at the end of the game). So, if you finish a level, and the score shown is this:

0014-0008

That means that so far, you've destroyed 14 enemy units while you've lost 8 units. But as a result of destroying 14 units, you receive 14 bonus reserve points for the next level. This might not seem like much now, but the effects of your score is cumulative so these will become helpful in the much later levels.

The game gets progressively more difficult as you complete each level. If you capture the enemy's flag at level 5, you will have accomplished what was considered nearly impossible in 1943: the capture of Moscow and the destruction of the Red Army.

SOME TIPS. If you're unable to afford to deploy air units, consider deploying some anti-aircraft guns. These will be useful to shoot down enemy aircraft if their flight paths coincide with your A-A gun's position. Every successful hit you score means you deplete the enemy's supply rating along with a small reserve bonus for the next level.

Tanks have the best defense against bombers, so you can deploy these the most safely onto the battlefield. However, they are quite weak against anti-tank guns. Once you deplete the enemy's bombers, you will want to deploy some soldiers towards the enemy's base to attack anti-tank and anti-aircraft guns.

Trucks, while being quite mobile on the ground, have the worst defense against bombers. Therefore, you shouldn't deploy these until you are relatively safe from bombing attacks. Or better yet, deploy them and hide them behind A-A guns for added protection.

If the enemy has failed to deploy much anti-aircraft artillery, it might be useful to deploy some fighter aircraft in order to score a few casualties against the enemy's air superiority.

While it seems unfair that the computer player is given more resources and supply points at later levels, it's AI is not that strong, so you will have to use your ingenuity and devise strategies to overcome the sheer numerical odds.
Last edited by Ghislain on Fri Nov 12, 2010 9:46 am, edited 22 times in total.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Sun Nov 07, 2010 4:17 pm

Here's a screenshot of the game in the emulator:

Image

I've reached level 4. I've deployed a rather long column of anti-aircraft guns so that I can shoot down the enemy's planes as they fly over. I also deployed 2 tanks and a truck who are wisely remaining behind the A-A guns.

Meanwhile, the enemy is assembling a rather large force. When I bring out my ground units, I will have to use clever tactics to overcome my numerical disadvantage.
"A slave is one who waits for someone to come and free him." -- Ezra Pound

User avatar
Ghislain
Realms of Quest
Posts: 1066
Joined: Sun Aug 08, 2004 12:54 am

Postby Ghislain » Sun Nov 07, 2010 4:37 pm

I fixed a minor bug with movement. Download theater2.p00 instead:

https://sites.google.com/site/gdbsite5000/main
"A slave is one who waits for someone to come and free him." -- Ezra Pound


Return to “Games”

Who is online

Users browsing this forum: No registered users and 1 guest