Turn Based Strategy (like Advance Wars) - DevLog

Show us your completed creations made in Construct 2

Post » Thu Aug 22, 2013 2:20 am

There an abandonded .cap you could base this code from construct classic to construct 2... unfortunately his server seems dead :/

http://www.scirra.com/forum/unfinished-project-advance-wars-style_topic42223.html
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,371

Post » Thu Aug 22, 2013 6:54 pm

[QUOTE=Ethan] Thanks Manley.

Unfortunately i have no way around the bug. It's a 3rd party object and i don't think 00Rez updates.

The only other option is to recode the game with the official inbuilt pathfinding behaviour. I've had a play around with it today and have it working on a grid but i can't understand how it handles costing. For it to have any effect i have to set it to a value of around 100 or else it just seems to ignore it completely, which presents a problem at the moment.[/QUOTE]

Well, isn't that the fun part of engine building? No, not really. It is always a bummer if you have to recode and rework vast chunks of your game. But on the plus side, by using the built-in pathfinding, you'll have better support and I would assume it works well. I haven't tried it out yet. So, anyway, hang in there and keep working. Don't look at the hours and hours of work - just take baby steps to stay sane.Manley232013-08-22 18:54:39
B
33
S
7
G
8
Posts: 312
Reputation: 8,528

Post » Thu Aug 22, 2013 7:29 pm

Okay so i had no luck with the inbuilt pathfinding. The cost seems to based on distance so if you're only moving a few squares it will always cut through a high costing square, even if the surrounding squares have a lower cost. The distance may be longer going around the but the total combined cost of the journey would be less.

Therefore i wen ahead and coded my own A*pathfinding engine in construct.



The only problem is that its quite slow at the moment. I hope some one can have a look at the source and suggest how i could speed it up.

Heres the Demo. It will start working as soon as it loads. Give it a few seconds to find the path.

And here is the Source.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Fri Jan 30, 2015 8:16 pm

Hi @Ethan. Just curious if you ever made any more progress on this. I came here after googling "turn based strategy" + "Construct 2" on Google. Would you be willing to share any of your previous work?
B
2
Posts: 1
Reputation: 152

Post » Sat Jan 31, 2015 1:55 pm

@lylepratt I found a solution to the problems i was having but moved on to other projects. Construct has also moved on a lot since this thread so the methods i was using is outdated but theres no reason a turn based strategy couldn't be made in Construct more easily now (if you're familiar with the software).

Rexrainbow has also made a lot of cool plugins that might help with boards, pathfinding and movements etc. http://c2rexplugins.weebly.com

@sethmaster has experience working on some really cool looking turn based games. Maybe he can help?
https://www.scirra.com/forum/rpg-made-in-construct-2_t121088?start=10
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Thu Mar 19, 2015 5:31 pm

Rebooting this project and perhaps combining it with my other one.

Any way had a quick play about with procedural map generation and how i might go about it. It's my first attempt and lots needs adding and the values need tweeking but i'm already getting interesting island shapes.

Image

Heres basically how i did it. First i populate an array with random values between a set range. Next i loop round the values and average them out based on the values surrounding them, this generated a height map. I normalise it which smooths it off into bands or contours. Each height then represents a different land type like water, sand, hills, mountains etc.

Still to be added, lakes, rivers, towns, perhaps different biomes like deserts or iceland.

Also at the moment its really inefficiently coded and the generation time could be speeded up a lot.

You can try the test here https://dl.dropboxusercontent.com/u/159885981/islandgenV1/index.html. Refresh browser to generate new map.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Sat Mar 21, 2015 9:24 am

I've been thinking about how battles will be handled. Doing some research into how many tbs game handles things they tend to use complicated formulas that require tables or calculators, i wanted things to be much simpler so players can see at a glance which units are good or bad against other unit types. So i harked back to my board game days and thought i'd try a simple dice roll system and made a quick mockup.

Image
Attack successful.

Image
Defence successful.

Each unit has 1 of 3 types of attack, ranged (like guns), melee (hand to hand) or arcane (magic). How strong that attack is shown by its Strength value.

Each unit then has a defence against each attack type shown by their Toughness value. This creates a rock, paper, scissors approach to combat.

Both these values are then modified by being added to or subtracted from depending on 2 factors, what terrain the unit is on and if that unit has been set to guard.

This finally produces an Attack value vs a Defend value, each represents a roll of the die with a 50/50 chance of a hit/miss or block/miss. Hit and Blocks cancel each other out and any hits left over is the damage inflicted. The percentages shown represent the probability of the attacker or defender winning the battle.

What do you think about this?

Also do you think in a battle the defender should counter attack like in advance wars or should it just be attack and defend like in most boardgames?

You can try the mockup here. https://dl.dropboxusercontent.com/u/159885981/tbs/tbsBattleMockup/index.html
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Sun Mar 22, 2015 10:15 am

I made myself a mini map editor of sorts as a quick way to develop and test the game.

Say my level map is 64 tiles x 48 tiles, i create a sprite 64x48 making each tile 1pixel in size. I then use different colours to represent the different terrain types like water land etc.

Image

Then i do an x y loop and get the rpg colour at each pixel position and depending on the value create a different tile when the layout starts.

So this...

Image

becomes this…

Image

This also allows me to have each level as a frame in an animation, and each animation as a different campaign.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Wed Mar 25, 2015 9:22 am

Movements are now in which includes move costs over different terrain types for different units. It also shows how far the unit can move and still have enough action points to attack or the player can sacrifice this ability and move further using all the units action points.

Image

I've added a basic menu system for now which will be greatly improved later. It includes a help system which tells you why an option is not available. The help info changes depending on the situation.

Image

Recruiting new units is in as well. It works like Battle for wesnoth where the commander must be on a keep and units can only spawn on connecting zones. Zones are connected dynamically using a flood fill so it can be altered easy in the level editor with no extra work.

Image

Also made a start on capturing towns, which provide a source of money each turn so you can buy new units.

Image

Lots more to add.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Wed Mar 25, 2015 10:15 am

Will be keeping an eye on this. Looks promising so far. Can't wait to see what this will progress into. I'm quite curious about the procedural generation of maps..
Follow my progress on Twitter
or in this thread Archer Devlog
B
38
S
15
G
17
Posts: 949
Reputation: 12,320

PreviousNext

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 9 guests