Sign in to follow this  

Turn-based strategy game

This topic is 3555 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I will design and develop the following game for my second-year college students, and have them design an AI for it. The game world is a graph: solar systems connected by wormholes. The two players each control a fleet of three merchant spaceships which may travel through wormholes. The objective is to be the last man standing by having the entire opposing fleet run out of fuel. Fuel: a ship starts with 100 units of fuel. It loses 1 unit per turn, and stops working when it runs out of fuel. You cannot transfer fuel between ships. When a ship arrives in a solar system with a fuel resource, it gains 20 units of fuel and the fuel resource disappears. The fuel resources appear randomly in empty solar systems (though there is only one at most per solar system), but there are only enough to keep a single ship running forever. The location of fuel resources is public information. Control: You control your ships when they are in a solar system, and you can tell them to 1° wait there for a turn, 2° enter a wormhole at a certain speed, or 3° to lay a trap. You cannot control ships within a wormhole. Traps: When a ship lays a trap, it spends 2 units of fuel (in addition to the 1 unit lost for spending a turn there). The next opposing spaceship to enter that solar system loses 10 units of fuel. There can only be one trap per solar system. The location of traps is known only to the owner of the traps. Wormholes: each wormhole has a length (between 1 and 10 units long), and ships traverse wormholes at a speed which is specified when the ship enters the wormhole (between 1 and 5). Traversing a wormhole always costs one unit of fuel per unit of distance regardless of the speed, plus an additional unit of fuel for each level of speed above one. For instance, if a wormhole has length 6, then traversing it at speed 1 takes 6 turns and costs 6 units, traversing it at speed 2 takes 3 turns and costs 7 units, traversing it at speed 3 (or above) takes 2 turns and costs between 8 and 11 units. Piracy: when two opposing ships meet in a wormhole, they can attack each other. The slowest of the two ships loses fuel equal to the square of the difference between their speeds. So, a ship cruising at speed 1 crossed by a ship at speed 5 loses 16 units of fuel, while the faster ship loses nothing. As such, it's dangerous to go through a long wormhole at a low speed. Do you think the game would be fun for human players to play, as opposed to developing an AI for it?

Share this post


Link to post
Share on other sites
First, the idea seems cool. But I do have questions.

Is the location of your opponents ship known?
Are there any other goals besides 'don't run out of fuel'.
Why would I enter a worm hole going slow as opposed to fast (I assume it saves fuel?).
Are there different types of ships?
How long does it take to pass through a worm hole?
How many traps does a player get to lay, and how does he get more traps?

Also, the idea of fuel being won/lost in battle due to the speed of your ship seems a bit odd to me. I'd rather see a ship be able to pick up weapons (ie, a weapon that causes the enemy to lose turns, a shield that protects from attacks, a weapon that drains fuel, a weapon that limits your max speed for a certain duration, etc) and let a user 'use' a weapon if they are on the same tile as opposed to the speed rule.

But, to answer your question, I think either would be fun. Having competitions to see who's AI is the best could very well be as fun as playing it human vs. human.

Share this post


Link to post
Share on other sites
Nice design, although the 'speed' element is possibly overly useful for long wormholes (not only more cost efficient, but more chance of gaining through piracy).

What happens if one of my ships arrives in a fuel resource system in the same turn as another ship?
What if both ships try to lay traps in that turn?
What if both exit through the same wormhole with one travelling fast enough to traverse it in 1 turn, but the other in 2 turns?

Also, please write it in Java and post the interface to the AI forum ^^

EDIT: Forgot to answer your original question. I guess it would be fun for humans to play (better than a lot of simple indie strategy games), but I don't think it's worth writing a good UI for.

Share this post


Link to post
Share on other sites
Quote:
Original post by Cygnus_X
Is the location of your opponents ship known?


Yes. You know the map layout, the position of all ships, the position of all fuel resources, and the position of your own traps.

Quote:
Are there any other goals besides 'don't run out of fuel'.


Quote:
How long does it take to pass through a worm hole?


As I've said above, it takes ceil([the length of the wormhole] / [your speed]).

Quote:
Why would I enter a worm hole going slow as opposed to fast (I assume it saves fuel?).


It saves fuel: if you traverse a length 5 wormhole at speed 5, you will use up 9 fuel units and be outside in a single turn. If you traverse a length 5 wormhole at speed 1, you will use 5 fuel units and be outside in a single turn. So, you'll be spending fuel nine times as fast!

Quote:
Are there different types of ships?


I am considering it, but at least in this version there won't.

Quote:
How many traps does a player get to lay, and how does he get more traps?


The player can lay as many traps as necessary.

Quote:
Also, the idea of fuel being won/lost in battle due to the speed of your ship seems a bit odd to me. I'd rather see a ship be able to pick up weapons (ie, a weapon that causes the enemy to lose turns, a shield that protects from attacks, a weapon that drains fuel, a weapon that limits your max speed for a certain duration, etc) and let a user 'use' a weapon if they are on the same tile as opposed to the speed rule.


You can only give orders when you're in a solar system, and you can give your order to enter another wormhole as soon as you exit one, so it's perfectly possible for a player to spend all his time inside wormholes. So, the point was to allow players to hit other players while inside wormholes, even though they can't give orders when they're there. Hence the piracy rule: outside solar systems, there are no laws, so you can sabotage other players—but I still have to give an advantage to the faster-going player.

Though I do realize that a better rule here would be to use "the last player who entered the wormhole" as opposed to "the player with the highest speed", and to determine a fixed amount of lost fuel (for instance, 15 units).

Share this post


Link to post
Share on other sites
Quote:
Original post by Argus2
Nice design, although the 'speed' element is possibly overly useful for long wormholes (not only more cost efficient, but more chance of gaining through piracy).


I agree. I will change the rule to "the last player to enter the wormhole wins" instead.

Quote:
What happens if one of my ships arrives in a fuel resource system in the same turn as another ship?
What if both ships try to lay traps in that turn?
What if both exit through the same wormhole with one travelling fast enough to traverse it in 1 turn, but the other in 2 turns?


The one which receives its orders last will arrive first.

Quote:
Also, please write it in Java and post the interface to the AI forum ^^


The interface will be in Objective Caml [smile]

Share this post


Link to post
Share on other sites
Quote:
I agree. I will change the rule to "the last player to enter the wormhole wins" instead.

...

The one which receives its orders last will arrive first.

How does that work? You claim to be creating a "Turn-based strategy game" here, which means orders get bucketed into a turn. Note that if in fact the speed of submitting orders is important, then you have a real-time strategy game, and you have to be careful about CPU allocation for the AIs.

Alternatively, you may be saying that the game engine will process requests in a particular order, but in that case I want to be last in the play sequence under your new rules. You might randomise the play sequence each turn, but then the outcome of the game is based in part on that pseudo-random element which the AIs then have to account for.

Share this post


Link to post
Share on other sites
Quote:
Original post by Argus2
How does that work? You claim to be creating a "Turn-based strategy game" here, which means orders get bucketed into a turn. Note that if in fact the speed of submitting orders is important, then you have a real-time strategy game, and you have to be careful about CPU allocation for the AIs.


Whoops, I expressed myself wrong. What I mean is that if two ships have to act on the same turn, then one should look the order in which they performed their last action. So, if ship A last acted 3 turns ago and ship B last acted 1 turn ago, then ship B will get to act first. If both ship A and ship B last acted one turn ago, then they will act in the reverse order they acted on that turn.

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
Whoops, I expressed myself wrong. What I mean is that if two ships have to act on the same turn, then one should look the order in which they performed their last action. So, if ship A last acted 3 turns ago and ship B last acted 1 turn ago, then ship B will get to act first. If both ship A and ship B last acted one turn ago, then they will act in the reverse order they acted on that turn.

That seems a bit arbitrary, and would be confusing for the AI (not only do I have to guess what the enemy spaceship in my system will do, but I have to make guesses about its previous behaviour.

Also if I move at speed 5 through a length 6 wormhole, and my opponent moves at speed 1 through a length 1 wormhole one turn later - both to the same fuel-resource system - they will receive all of the fuel and I get nothing?

I would expect two ships hitting the system in the same turn to be treated equally - they both get half the fuel, they both get hit by traps they set etc.

Share this post


Link to post
Share on other sites
Quote:
Original post by Argus2
That seems a bit arbitrary, and would be confusing for the AI (not only do I have to guess what the enemy spaceship in my system will do, but I have to make guesses about its previous behaviour.


The past is deterministic and publicly known: you don't have to make any guesses about what order ships play in. You can infer the order from the observed movements of the ships, or you can ask the game for it (since it's public knowledge, and easily known to the game).

Quote:
Also if I move at speed 5 through a length 6 wormhole, and my opponent moves at speed 1 through a length 1 wormhole one turn later - both to the same fuel-resource system - they will receive all of the fuel and I get nothing?


Yes.

Quote:
I would expect two ships hitting the system in the same turn to be treated equally - they both get half the fuel, they both get hit by traps they set etc.


This actually makes AI marginally harder to develop, since you now have to consider "half-effect", "third-effect" and similar fractional situations, instead of a simple deterministic all-or-nothing situation.

Share this post


Link to post
Share on other sites

This topic is 3555 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this