Turn Based Strategy Game

New releases and general discussions.

Post » Thu Jul 08, 2010 8:02 pm

Is it possible to make turn based 2D game using Construct? A game similar to Advance Wars, Civilization 1 and so on?
With grids I can create the player movement, but how about the enemy? Is it possible to script the enemy AI to wait for it's turn and most importantly to be able to find it's way on the grid to attack the player (pathfinding with other words)?
B
1
G
2
Posts: 5
Reputation: 635

Post » Fri Jul 09, 2010 9:37 am

You could do this without scripting you know,
Maybe something like,
After you move your units,
set Player turn to 0,
when Player turn is 0,
Enemy's start moving to there newer positions.

Not very specific but its just an example.
B
2
S
2
G
3
Posts: 140
Reputation: 1,530

Post » Sat Jul 10, 2010 4:49 pm

xxKitheifxx's solution will work perfectly for turns from the sounds of what you described.
As for pathfinding/grid movement, the RTS behaviour already does both :)
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sun Jul 11, 2010 12:26 pm

Yup, but the problem with the enemy's pathfinding is still on.
Is there a script or something which calculates the path that the AI have to move to go near your troops?
B
1
G
2
Posts: 5
Reputation: 635

Post » Sun Jul 11, 2010 1:46 pm

[quote="Wanderer":1cyaj1tu]Yup, but the problem with the enemy's pathfinding is still on.
Is there a script or something which calculates the path that the AI have to move to go near your troops?[/quote:1cyaj1tu]

Im afraid something like that would be way to general, the only way to go about it is to program your own enemy ai. If they just blindly attack theyll be retarded, and you need to make sure the AI plays like a human player with similar disadvantages (LOS etc), you'll also want to make sure they build counter units to yours if they catch a glimpse of what you have, and their force is deemed weaker by some arbitrary formula you'll have to make up.

Since any good AI should be limited to the abilities of a human player, unless your game absolutely dictates otherwise you can see why making them just SEND attack forces to you if they have no sight of your units would be a little unfair. the AI should scout to find you, just like any human would.

All this is pretty general, its up to you to figure out a way to get it into your game with your programming, theres no easy way, but making use of RTS pathfinding should make it much easier to give the AI routes. for example to scout you dont need to make some movement script, just make the AI send the scout unit to some random point it can't see, where it thinks there are no units etc, make a soldier unit walk up to range from some enemy to engage it.

Good luck!, im sure there are some good resources on RTS AI programming around the web you could use to help you, google is your friend. Gamedev.com would be a good place to look aswell.
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Sun Jul 11, 2010 1:56 pm

[quote="QuaziGNRLnose":3ob58mvi][quote="Wanderer":3ob58mvi]Yup, but the problem with the enemy's pathfinding is still on.
Is there a script or something which calculates the path that the AI have to move to go near your troops?[/quote:3ob58mvi]

Im afraid something like that would be way to general, the only way to go about it is to program your own enemy ai. If they just blindly attack theyll be retarded, and you need to make sure the AI plays like a human player with similar disadvantages (LOS etc), you'll also want to make sure they build counter units to yours if they catch a glimpse of what you have, and their force is deemed weaker by some arbitrary formula you'll have to make up.

Since any good AI should be limited to the abilities of a human player, unless your game absolutely dictates otherwise you can see why making them just SEND attack forces to you if they have no sight of your units would be a little unfair. the AI should scout to find you, just like any human would.

All this is pretty general, its up to you to figure out a way to get it into your game with your programming, theres no easy way, but making use of RTS pathfinding should make it much easier to give the AI routes. for example to scout you dont need to make some movement script, just make the AI send the scout unit to some random point it can't see, where it thinks there are no units etc, make a soldier unit walk up to range from some enemy to engage it.

Good luck!, im sure there are some good resources on RTS AI programming around the web you could use to help you, google is your friend. Gamedev.com would be a good place to look aswell.[/quote:3ob58mvi]

EDIT: first google result was a gamedev article about exactly this :P
http://www.gamedev.net/community/forums ... _id=329005
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Sun Jul 11, 2010 11:05 pm

Thanks for the informative post :)
A few days ago I found an article for the A* pathfinding algorithm (they are talking about it in the forum thread you gave), so I guess I have to start coding it and start making the game step by step. First - game with zombies (with the pathfinding algorithm and LOS), then human soldiers (with taking cover, retreat and so on), etc. It's gonna be a tough job and I don't have that much time but I'll see what I can do. There are so much things that have to be taken in consideration if I want to do an AI smarter than a mindless zombies.
B
1
G
2
Posts: 5
Reputation: 635

Post » Mon Jul 12, 2010 12:39 am

rts behaviour uses A*!
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests