Turn Based Strategy (like Advance Wars) - DevLog

Show us your completed creations made in Construct 2

Post » Tue Apr 28, 2015 8:59 am

I will follow that with interest, I would like make something with this engine one day ;)
Luca ConTato [RisingPixel]
Image
B
22
S
8
G
2
Posts: 112
Reputation: 2,899

Post » Tue Apr 28, 2015 4:14 pm

@EXPFall, @vtrix, @jobel, @icugigasoft, @tatogame, thanks guys for your kind words.

@Fireche i'm using a rexrainbow plugin for the pathfinding. I find it easier and faster than the event based ones coded before.

I'm playing about with the ai at the moment, hope to post an update before not too long.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Thu Apr 30, 2015 8:30 am

I'm not so sure that this
Image
Is the best way to make an easy level editor... How you define the (eventually) custom prop of a cell? Ex: custom sound, custom tile image, custom life value etc...

Also the image-animation-frame trick definitely isn't a best practice... why not use external files like .json? You can make it with a custom internal editor or with software like Tiled Image
Luca ConTato [RisingPixel]
Image
B
22
S
8
G
2
Posts: 112
Reputation: 2,899

Post » Fri May 01, 2015 1:05 pm

As I am also developing a tile-based wargame in Construct2, I am following this with interest.
Good progress so far, and good luck with further development.
B
4
G
1
Posts: 6
Reputation: 335

Post » Sun May 24, 2015 9:50 am

@tatogame thanks for the suggestion but i don't quite follow what you mean about it not being best practice though, the image is only used at the start of the layout to set the tile image then destroyed, all the info is passed on.


Small update.
Heres a first look at the ai.

Image

It shows the tactical phase. I loop through each ai unit (black units) able to move, check every move position, check all adjacent squares around it, create an "influence map" where the tile gets a score based on a number of factors like, the terrains attack/defence bonus, is there an enemy there? Can kill enemy? can enemy kill me? how much damage can i inflict? how much damage will i sustain? whats my hit/block ratio? Then it picks the highest scoring tile and if its above a certain threshold then it moves to attack, else the unit is ignored and is passed over to the next ai phase which will be the capture town phase.

There are still some things its doest take into account, which will be added later.

Another example.
Image

@Kyatric please can you move this topic over to the wip board, thanks.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Sun Jun 28, 2015 10:27 am

Ok i need a bit of design advice.

I'm currently working on the ai code to my game. I've split the logic up it into various stages. I've done the tactical and capturing stages and i'm currently working on the recruiting stage.

Basically you get money for capturing towns. Your commander unit is the only one which can recruit new units, and must be on a keep tile to do so. New units when bought are spawned on connecting castle tiles. It's a copy of the Battle for Wesnoth system which i prefer over other tbs games.

Right now i simply have a routine to work out which units to recruit based on the enemy units on the board.
I loop through all the enemy units, record their weakest stats in a list, loop through the ai units, for each one that can beat an enemy unit in battle i delete it from the list (as they will move and attack them in the tactical stage). What's left in the list are all the enemy units the ai needs to recruit against as it currently has no units on the board that can beat them in combat. I then prioritise their creation by finding the enemy units, that are the biggest threat, that the enemy has the most of, and recruit a unit that can beat it in combat first.

My problem is i have a number of variables the ai needs to take into account to decide - when to move to a keep, which keep to move to, and what units to recruit.


Heres how my system works. It's a work in progress so other variables can be added later to improve it, but for now i use the following-

Check to see if ai has any money, if not then skip recruiting.
Check to see if any empty keeps with empty castles are in move range, if not then skip recruiting.
For all those keeps within move range, that are empty and have empty castles, generate the following scores.
The distance of keep to Commander.
The number of empty castles keep has.
The number of enemy units in attack range of the keep and the combined damage score it could inflict on commander if it moved there.
The units the commander needs to recruit to oppose each of those enemy units, and the combined cost.

Whats the best method to use and combine the information i have to pick the best keep to move to and which units are a priority to recruit?

For example, the commander obviously wants to move to the safest keep, but that might only have 1 castle connected to it, where as it might have enough money to recruit lots of units.

I guess i'm wanting to figure out a way to somehow combine all these values into one general score or something.

Any suggestions or advice?
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Sun Jun 28, 2015 5:29 pm

Haha, this is awesome! Good job.
B
8
S
1
Posts: 26
Reputation: 498

Post » Sun Jun 28, 2015 7:51 pm

In a simple case the general score could just be the sum of the scores.
a+b+c+d

You can further tweak that to give some scores priority over others like:
4*a+3*b+2*c+d
which would give the "a" score the highest priority.

It can be more finely adjusted to adjust the priorities of the scores. You could even pick the factors at random to get a unique ai.

I suppose you could use any arbitrary formula to combine the scores into one value as well, but probably simpler is better.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Mon Jun 29, 2015 2:28 pm

Thanks R0J0, it's good to get an outside perspective on the problem.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Tue Feb 23, 2016 1:39 pm

Hi, what is the status of the game development ?
"keep calm we have giant robots!"
B
37
S
9
G
6
Posts: 138
Reputation: 5,129

PreviousNext

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 3 guests