The Daily Click ::. Forums ::. Misc Chat ::. Turn Based Strategy (TGF AI Examples / Suggestions / Help)
 

Post Reply  Post Oekaki 
 

Posted By Message

RopeDrink



Registered
  09/08/2005
Points
  205
14th August, 2005 at 20:32:30 -

Hi everyone.

I'll try to keep it short and sweet.
Basically I'm going to divert my efforts from MehPong (Breakout) to create a new game, which will involve turn based movement. I'm currently working on the sprites for the moment, but I know for a fact that if I take the game seriously and actually get the core of the game made, I'll have little to no idea as to how I should go about creating the enemy AI for it. I'm hoping to make the enemy into sneaky little bastards, in order to add tension to the game.

Not entirely sure wether there's some articles about it, but I'll give the Article Page a look, but I thought I'd post up here in the event that someone can throw me so alternate suggestions.

To explain the game further, it's a top down view where tbe 'Pieces' (Characters) are assigned movement points, and these points decide how many 'Squares' you can move by each turn (Think chess, and you have the idea). Same will apply to the enemy, but in order to ensure the game is worth anything, it'll greatly depend on the enemy movement selection. I have my hopes set high, like having movement decided on it's view of the Players in-game pieces, for example.

- Having them hunt down players that have low HP
- Avoiding stronger players when the enemy characters HP is low (ie Survival)
- Sneaky tactics allowing the enemy to perform surprise attacks
- Guarding critical locations or items.

And general things like that.

Any help or suggestions guys? It'd be greatly appreciated.

Also, a side note, if anyone can suggest where I can aquire some nice 'Tiled' graphics, creepy and atmospheric music (MIDI or Samples, either is good) and some fancy, space themed / metalic background images, I'll be extremely appreciative.
Thanks for any help given.

 
n/a

RopeDrink



Registered
  09/08/2005
Points
  205
14th August, 2005 at 22:22:32 -

Another few notes that I'll need help on...

If, for example, a character can move anywhere within, say, 6 x 6 squares, and there happens to be an impassable object on one of these squares in the characters path, I'd like to figure out how I can get the character to work around this problem to get to the selected square destination, and in the shortest possible time.

I'd be able to work around the problems myself through time, trial and error, but by the time I even get the sprites ready, I'm sure someone will be able to provide some answers.

Thanks again.

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
14th August, 2005 at 23:12:31 -

Sounds like a bit like Final Fantasy Tactics. I have the beginnings of such an engine lying around somewhere, but it's movement is different than the one you asked for (clicking the square next to the player to move it). The one thing that made me quit the engine though was the AI. Having any sort of AI proved more than difficult, because locating anyone on the feild was hard to do. More or less the enemies would always go after the player with the least health, even if they were surrounded by 4 others.

I don't know, possibly proirity AI would work? I could help if you need it, although everything I touch seems to become corrupted. Meh.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
14th August, 2005 at 23:18:26 -

So, what king of overarching AI are you after? Something that actively tries to compete against you like another human (hard), or enemies that just stand there and attack the player characters when they come near, or just blindly (slightly less hard)?

 
n/a

RopeDrink



Registered
  09/08/2005
Points
  205
14th August, 2005 at 23:21:59 -

I sometimes feel like myself, Peblo, but thanks for the offer.
Any form of AI would be better than none at all, so I appreciate the offer.

It is somewhat like Final Fantasy Tactics. For every turn, you select each character with avaliable points and move it from it's location to any reachable destination (via movement squares), set the direction it should face, and voila, character movement complete. The direction you face is important, however, because unless you 'sight' the enemy, you will NOT see them, and the same applies to the enemy, hence I need to figure out a fair AI, because initially the enemy won't know where player characters are unless sighted, so I'm making this thread early as to get as much feedback as possible before I get to the point of programming some AI.

On top of that, it's The Games Factory, which may (Or may not) mean it'll be harder to make any feasable AI than what can be made with other packages.

Hopefully I'll be given enough help before I get to the programming side of things.
Taking a note or two from your engine will most certainly be a good start!

Thanks for the post.

 
n/a

RopeDrink



Registered
  09/08/2005
Points
  205
14th August, 2005 at 23:27:47 -

"So, what king of overarching AI are you after?"

Preferably something that will at least present some form of challenge for the player Not super hard, but at least somewhat intelligent movement.
Also, something that could be tweaked slightly in order to make it easier (Or harder) in the interest of 'Difficulty Settings'.

I doubt all that I ask for can be done, but I can't be blamed for having a little faith

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
15th August, 2005 at 02:16:33 -

I wasn't referring to the difficulty of the game, I was asking how you want the enemies to behave; like mobs that just hang around or rush and attack you, or a moe strategically-minded AI.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
15th August, 2005 at 02:16:40 -

Uh, lagrape.

Image Edited by the Author.

 
n/a

RopeDrink



Registered
  09/08/2005
Points
  205
15th August, 2005 at 03:14:05 -

"I was asking how you want the enemies to behave"

I've already made a list above as to how I want them to behave. It's quite easy to realise, going by the list, that I'm not looking for berserk mobs of enemies, or enemies that hang around. I'm asking how I would go about creating sneaky tactical enemies that move depending on their situation/stats VS situation/stats of nearby player characters.

If you've played 'Shining Force' or other such classic games, that's the best example I can give you. The enemies in it didn't simply rush the nearest character, they chose the ones they knew could be killed in the quickest amount of time, with the least amount of damage to themselves. They also defended their own main/boss characters when they needed help, and also ganged up to face the tougher characters you had.

I don't want enemies that simply run at you and try to kill you, thats too easy, and I dont want you to have to do all the searching either, thats too boring.

It's similar to chess, only your turn doesn't end when you've moved one piece, it ends when all have been moved - When the round starts you have the option of moving all your pieces, then when that phase is over, the computer has to 'strategically' choose what would be the most effective way to deploy it's pieces. So in your own words, "Strategically minded AI", which I already listed.

It's going to be tough, hence I asked for advice, and I'm fully aware that the liklihood of me getting the AI remotely like what I have in mind is slim to none, but if anyone can help me prevent the AI being utter dribble, I'd be very appreciative.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
15th August, 2005 at 05:29:41 -

Righto, calm down. I don't think anyone's ever gotten a working AI tree in MMF that could do the sort of things you're after. However, it might be possible to simulate it.

I'd begin by having units stored in an array containing their coodinates, current HP, and current strategic value (determined by a fixed strat. value for that unit type, modified by current HP for example), as well as anything else you need.

Then, once they are capable of moving, have AI units select their target based on their strategic value, modified by distance from the unit.

I'd then have a special class of invisible unit that acts as a rallying cry, which AI units wouldn't attempt to attack but which would have a high basic strategic value. They could be placed at important areas and chokes, or created by boss units when their HP drops below some threshhold. They might also have some nature of level-specific placement at runtime which would emulate a predefined strategic behaviour.

As for the movement itself, I'm sure there are articles on tile-based movement if you need them.

 
n/a

RopeDrink



Registered
  09/08/2005
Points
  205
15th August, 2005 at 10:02:42 -

"Righto, calm down"
I'm as calm as a dead ant, just trying to get the point across
It's relatively hard to explain what I'm after without pictures to back up my posts, so I'm trying my best to type out my thoughts.

Thanks for that suggestion though, it's duly noted.
Took a brief browse through the available articles also, but wasn't too thorough so I'm sure I missed something. Will give it another look when I get the required basic materials for the game sorted out.

As I said before, I do realise that the chances of me getting the desired AI is unlikely, but I'll give it a damn good go
Thanks again.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
15th August, 2005 at 10:31:31 -

I had a thought, if the invisible markers I mentioned simply modified the strategic value of units within a radius, or with an initially high value that decreases with distance, it would cause the AI units to rush to defend a point only when it's under threat (thereby reducing the need for level scripts), and with a decreasing additive radius, more attractive the more threat they're under.
In that case, the're be no need for separate special units at all; the behaviour might simply be an attribute given to important units or locations.

A mild version of the effect applied to all player units would give clusters of units a higher strategic value. That way, an AI unit could prefer to attack a group of units rather than a lone one as they pose more of a threat. The opposite would also be possible if necessary, with units prefering to attack those least defended.

Which makes me think it would be possible to have a similar effect applied to AI units, modifying something like a 'courage rating' rather than a strategic value. It could then be made so that strong groupings of AI units would prefer to attack (high strat. value-rating) groupings of player units, while small groupings or individual AI units would prefer those with a lower strat ratings (which in a group of the same type of player units would be the one furthest from a cluster, or in a mixed group would be the one with the lowest tradoff strat. value between distance from the cluster and intrinsic strategic value [to clarify: a very weak unit near some other units might be more attractive than a stronger unit slightly further away from the cluster, though unless the cluster modifying effect was subtle the one furthest away would probably win]).

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
15th August, 2005 at 11:21:25 -

...And Radix beat me to my idea, although my idea for stratigic value was

"(((Target HP + Target MP +(Speed*2))/average current HP of everyone on feild + average current MP of everyone on feild + average speed of everyone on feild) - (Distance from target player in pixels/(square height+length/2)) + 10 for each surrounding unit)"


 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
15th August, 2005 at 11:38:38 -

What's the point of the average HP value, if I may ask? It's going to mod all units the same, so it wouldn't really serve any purpose, right?

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
15th August, 2005 at 17:20:09 -

Holy crap, we haven't had a good thread like this in a damned long time. Very nice ideas.

Ropedrink, I've got a very, very basic turn based engine, however it doesn't use square based movement. But it's in TGF (no ext) and has basic enemy movement, player unit selection, etc. It was geared for space combat; though I haven't gotten around to actually putting weapons in (if an enemy is in your attack range, and you click it, it gets destroyed). If you'd like I could send it to you to see if it gives you any ideas.

 
Craps, I'm an old man!

RopeDrink



Registered
  09/08/2005
Points
  205
16th August, 2005 at 06:56:40 -

Excellent posts, guys, thanks a million - Keep it up - We'll generate a spiffing, perfect strategic AI system yet

Thanks a million also, Unit 3, that would definately give me some idea's, although I'd rather wait until I get some sprites going and sort them out before initialising them into any form of programming. After what happened to MehPong, I've learned to do things one at a time, rather than bunched up, but you can be sure that I'll be getting in touch once I'm happy with my collection

To clarify what type of game it is, anyone who has played the Amiga version of 'Space Hulk' or 'Alien Breed' will get the gist of it, although it'll be turn based rather that the top down scrolling shoot em up (AB) or the real time 'Square based movement' style of Space Hulk.

Basically you have to cleanse the alien forces from each containment field (level) and are capable of hiring / purchasing troops (Marines) and equip them with purchasable weaponry, armour and other tools that will aid them (Each addition to their item collection adding to their effectiveness / need for the aliens to rid of them quickly)

So I'm trying to get it so that the alien horde will move their pieces on their turn, based on how they can advance on the marines with as little damage to themselves, effectively avoiding choke points and other dangerous areas that'll get them killed easily, whilst also differenciating between their most effective units depending on strength, current location, and the pieces they wish to attack.

It must also remember that until a friendly unit is effectively spotted by an enemy unit, or vice versa, then the units will remain invisible to the alternate player.

This will also require the AI to acknowledge the idea that a 'scout' unit should be used to find out where your units are, or that the first player unit the alien has spotted could be a scout unit used by the player to lure it into a trap.

It's going to be very VERY tricky indeed to get this form of AI going, but with all your help we can surely make something well worth the effort!

Thanks again to you all, this is most appreciated.

 
n/a

RopeDrink



Registered
  09/08/2005
Points
  205
16th August, 2005 at 08:55:25 -

Also, if anyone happens to have (or fancies making) any top down styled sprites of Alien Creatures, or anything along those lines, please give me a shout.

Currently making them myself, but I'm a picture editor rather than a Sprite Maker, so my efforts may look relatively odd

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
16th August, 2005 at 11:29:52 -

The average hp and mp is for the unit to compare themselfs and to find the enemy with health lower than the average. The average HP and MP is shared across all the players, but their current HP and MP are not. I don't know if that makes sence at all. Those invisible units are a good idea though.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

RopeDrink



Registered
  09/08/2005
Points
  205
16th August, 2005 at 11:47:42 -

I understand what your saying, and it's a nice idea.

As for invisible units, I'd like to think it'll add an interesting twist to the game. Afterall, if you could constantly see what the computer is at, you'll find things a lot easier. At least with this idea, you'll have to use tact and caution, and it'll be frustrating to witness your players have just strolled into a CPU set trap and having your units slaughtered

Im sure it'll add longevity to the game, seeing as each time a battle is played it will always be done differently, although Im sure there'll be people out there who wouldn't be fond of it and would go play a scrolling shoot'em up instead. Still, I like to change things around

 
n/a

RopeDrink



Registered
  09/08/2005
Points
  205
16th August, 2005 at 18:16:47 -

I'm looking for sprites along these lines.

http://www.sitesled.com/members/ropedrink/RopeDrinkPlayer01.jpg
http://www.sitesled.com/members/ropedrink/RopeDrinkAlien02.jpg
http://www.sitesled.com/members/ropedrink/RopeDrinkAlien01.jpg

If I cant find some decent sprites, Im going to have to use those, made by me, which aren't that good at all. No point criticising them, I know they're terrible, and I certainly wont use them if there's better out there.

Any suggestions!?

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
16th August, 2005 at 23:43:17 -

Yeah, those sprites are bad. However, if you can get this engine working flawlessly, I guarantee you that you'll find an interested spriter of skill.

Peblo: I see what you're getting at, but because it's based on an average you're going to have units above the average that will have a low attractivity even when they're strategically threatening. I agree that HP should be used, but only to subtract from a predefined base strategic value for each unit type.
The reason being is that a formula won't necessarily account for how units are used, only their stats. In a melee unit, for example, their movement range is more important than in a unit with a ranged attack. Or take a weak, stationary artillery-type unit with a long range. That would be used differently from normal units, and so should have it's base strat value calculated by some other criteria.
I just think it would be far easier to balance the game without applying a universal formula to strategic ratings.

 
n/a

RopeDrink



Registered
  09/08/2005
Points
  205
17th August, 2005 at 00:35:10 -

That I agree with.

There will be melee units, ranged attack units and stationary turret type long range units, which will have to be evaluated differently by the computer.

Also, when a turn ends you cannot face a different direction to the one you have selected before giving up your units turn, which means that if an enemy that your character didn't happen to notice can perform a back-attack, it'll do so, causing tremendous, and often fatal damage, regardless of the units HP / Strength, so the computer has to realise also, that backstabbing a very powerful, full HP tough unit (reducing it to sod all HP, or killing it outright) would certainly be of greater help to it than smacking a moderate to low HP regular or weak unit in the face.

Hope that made sense to you.

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
18th August, 2005 at 17:20:42 -

You could always throw in move, range, attack and defence into the formula, which solves nothing.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

RopeDrink



Registered
  09/08/2005
Points
  205
18th August, 2005 at 19:10:14 -

Was that directed at me?
I don't understand.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
20th August, 2005 at 11:51:30 -

I forgot that game today, but I'll bring it with me tomorrow and send you the link.

 
Craps, I'm an old man!

RopeDrink



Registered
  09/08/2005
Points
  205
20th August, 2005 at 16:52:47 -

Cheers Unit3 (Or do I call you shabadage?)
No rush at all, been on and off making the sprites and even THEY are giving me hassle.

Will be a long time before I even get to the engine side of things

Thanks mate.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
20th August, 2005 at 16:58:39 -

I'm universally known as Shabadage or Shab, but I change it up a bit here and there when I'm bored.

 
Craps, I'm an old man!

RopeDrink



Registered
  09/08/2005
Points
  205
20th August, 2005 at 17:19:50 -

Nice
Well then you big chameleon, I appreciate the help with the topic.

I wont be none the wiser until I get some sprites & objects together and get some testing done, but even then, I have no idea where to start. I'll cross that bridge when It comes.

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
20th August, 2005 at 23:28:31 -

" Was that directed at me?
I don't understand."

No, I'm just bored. I could translate it into spanish for you if you need it to be.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

RopeDrink



Registered
  09/08/2005
Points
  205
21st August, 2005 at 00:07:53 -

"No, I'm just bored. I could translate it into spanish for you if you need it to be."

That still doesn't answer my question, but nevermind.
If you're taking a dig at my post relating to what I'd like to add into the movement settings then, well, what can I say. Isn't it normal to want to be able to create / use a versatile movement / recognition system for the style of game I'm making?

Afterall, it's the way the computer plays that'll determine wether the entire efforts is worth the time or not. If I just throw a bunch of commands and random computer movement into the mix then I may as well pack up my stuff and leave now, because there'll be absolutely no point in playing if it's piss easy to smash the PC player into oblivion.

 
n/a

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
21st August, 2005 at 00:29:03 -

Fine, I'll explain myself then.

"((((Target HP + Target MP +(Speed*2))/average current HP of everyone on feild + average current MP of everyone on feild + average speed of everyone on feild) - (Distance from target player in pixels/(square height+length/2)) + 30 for each surrounding unit)*range of character* movement of character)+ ((Strengh of character+Defence of character)*(number of characters on field)/average strength + average defence)))"

I don't know if you have front/side/back damage or not, but you could always throw in something for that, like if the computer is able to hit someone for back damage, throw in a +50 in the equasion somewhere.

You don't have to use it, it just has everything evaluated in an equasion, which could be stored in an AV on each character. If you want cautious units, have an AV constantly be super high torwards a square. If you want something protected, put a high Straticic value on the square next to it. If you want a sneaky tactic then have stratigic points placed around the field with high stratigic value for them. And if you want them to run away, put 'run away' spots on the map when the computers health gets critical.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

RopeDrink



Registered
  09/08/2005
Points
  205
21st August, 2005 at 18:20:12 -

" I don't know if you have front/side/back damage or not, but you could always throw in something for that, like if the computer is able to hit someone for back damage, throw in a +50 in the equasion somewhere "

I mentioned that above, somewhere.
Seeing as the units are invisible whilst un-noticed, it's possible for you or the enemy to sneak up behind, or beside, a unit and deal a sneak attack for extra damage.

It'll mean that you really have to pay attention to where you move / where the PC moves their characters.

Thanks for your equation, though.

 
n/a

RopeDrink



Registered
  09/08/2005
Points
  205
21st August, 2005 at 22:13:48 -

Just finished another adition to the crap sprite collection I have.

http://www.sitesled.com/members/ropedrink/RopeDrinkAlien03.jpg

 
n/a
   

Post Reply



 



Advertisement

Worth A Click