Ethan's Forum Posts

  • These are great. Really takes me back to my childhood.

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

    <img src="https://dl.dropboxusercontent.com/u/159885981/myApath/myApathTest1.png" border="0">

    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.

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

  • The bug is more serious then i thought. I did a number of tests and my code checks out ok.

    It seems to be a problem with Astar Pathfinder which i'm using thats ignoring cell costs on occasions.

    Heres an example.

    <img src="https://dl.dropboxusercontent.com/u/159885981/AWtest3/awtest3Bug2.png" border="0" />

    The path above is correct. The tank unit has a cost of 100 for moving over woods and mountains. It only has a cost on 1 for moving over grass and hills. There for it has picked the quickest route available.

    <img src="https://dl.dropboxusercontent.com/u/159885981/AWtest3/awtest3Bug1.png" border="0" />

    Yet the square below has generated a false path. I checked the cost of squares from aStar pathfinding expressions so i know they are indeed a cost of 100, yet for some reason it has chosen a route with a total cost of 104.

    I'm afraid with this bug i might not be able to continue.

  • Nice work. Really enjoyed it.

  • Oops, just noticed a bug where the arrow path sometimes ignores the terrain costs. I'll look at that.

  • Added the ability to choose a path and view the route before you ok it.

    <img src="https://dl.dropboxusercontent.com/u/159885981/AWtest3/awtest3Animation.gif" border="0">

    Test 3 here.

    It was a little bit more tricky than i first thought because i have to manually work out the angles and also insert the corner sprite images based on the angle of the current point in the path and the last point in the path.

    Next up moving the unit.

  • Wow this looks great. Any chance we can see a video?

  • Thanks for the replies guys.

    Heres a quick updated test 2.

    <img src="https://dl.dropboxusercontent.com/u/159885981/AWtest2/awtest2Animation.gif" border="0">

    Each unit now has a cost to fire.

    The yellow path area shows where the unit can move to but can't fire.

    The green path shows the area where the unit can move and still fire. So you can move further but sacrifice the ability to attack or move less and attack.

    Also Each unit now has 1 terrain type where they will get an attack and defence bonus whilst on that square. This for the moment is represented by the circle. For example soldiers can hide in woods for a defence bonus or attack in woods where theres cover. Tanks get an attack and defence bonus on hills.

  • <img src="https://dl.dropboxusercontent.com/u/159885981/awtest1Animation.gif" border="0">

    This is the very early beginnings of a TBS game like Advance Wars.

    The demo can be found here.

    Right click to reset map.

    Left double click on a unit to see its path. No actual movements yet.

    The highlighted path indicates all the possible routes the unit can move.

    This is calculated by having a certain amount of action points per turn which is reduced by the cost of each terrain type it will travel over during the journey.

    This is different for each unit, for example Tanks can't go through woods or up mountains so the cost of that tile is above the max action point (obstacle), but they are fast over grass and up hills so they only incur -1 cost when traveling over that square. Soldiers travel -1 over grass, and -2 over woods etc. You get the idea.

  • Thanks newt. I deleted and reinstalled the plugin and its working now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not generating a path, i can't get that far. Just associating it brings up the error. If i add any additional events after that i get another error saying the plugin is not connected.

    Like i said running the demos work fine, and even my old tests work, but if i try and make something new it wont work.

    newt are you just running the examples? Can you try using it from scratch on a new clean project and see if it works.

  • Looks like this plugin is not compatible with the latest stable version of construct. If you delete the behaviour in the examples and apply it again and resave then you get the errors.

    Such a shame as the inbuilt pathfinding is no good for TBS or grid based games, it seems only geared for RTS.

  • I'm also getting this. It's strange because the example files run fine and the code is the same.