Designing a Turn Based Strategy Game

1 favourites
  • 3 posts
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • Good day to all who is reading this.

    I am designing a Turn Based Strategy (TBS) game called "LifeTime of Human War" you can play this game on Construct 2 -> Arcade -> Strategy Games, there you can see what the game is about and how it is played.

    The game is operational but in the designing of this game I am facing two major problems with Player and AI maintenance. To see the issue in the image files below.

    The Player Control and Fight Army

    The AI Control and Fight Army

    As you can see in order for the game to work, it is required to program each individual sprite (in this case Army), their conditions and actions according to what triggers those events to occur. This required an immense amount of copy and paste the same code and rewriting them according to each of the sprites needed conditions.

    And as seen in the game and the code images provided above, it is an ineffective and inefficient way of designing this game, as this raises maintenance issues.

    I have tried using families but AI would fight it own self. Tried creating invisible objects that would attach itself to each AI every other turn and another for the Player, but that raised issues in destroying that invisible object to pinned to sprite and issues with game resource management.

    So, basically I am stuck with this issue of maintaining my code in being efficient. Any help or suggestions would be greatly appreciated, an example of your solutions would also be of great use in designing this game.

    Thank-you for reading this and really would appreciate your help.

  • The answer is to use families but I can't really work out what your game is doing. I don't know what 'cell' does. Also, why are the player and AI objects the same? What distinguishes them from being player and AI? There was nothing too obvious there. You can make use of variables, it could be left click on army(family) set that to player, then another object in the army family has variable set to AI then you can control the picking, so far I didn't see anything like that. Also I had a look at your game and it's on a board, is line of sight really the best thing to use? You can use pick nearest army or something similar.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The thought of using famlilies I have tried issues that I came accross were that AI would not be able to identify its Own vs Opponent Armies and would combat it own self. Cell is just an invisible gameobject that exsities behind each building (Roads, Farms, Mines, and Castles). To which Player and Bots set their armies to.

    Player and AI objects are the same because they are Armies that the Player decideds to select. Since I do not know what the player selects out of the possible combination I had to create those possibilies.

    What distinguishes them from being Player and AI is on start of game a global variable exists called "PlayterSelect" when player choses an Nation and enters the game, the AI for that nation is disabled and Player controler is enabled. So basically since there are 11 Nations I had to create 11 Player Control and AI systems, all which are consited of copied and pasted code with different conditions for each other Nation and different actions.

    Unfortnately, the line of sight (LOS) was the easiet way creating the AI system in the first place. As for use pick nearest army or something similar I do not clearly understand what you mean by that, because there is nothing like that I mangaed to find on the internet.

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