Turn Based Strategy Game

This forum is currently in read-only mode.
From the Asset Store
A well commented RPG game template to learn from or use as a base for your own game!
  • 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)?

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

  • 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

  • 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?

  • 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?

    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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • > 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?

    >

    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.

    EDIT: first google result was a gamedev article about exactly this

    http://www.gamedev.net/community/forums ... _id=329005

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

  • rts behaviour uses A*!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)