How do I make a Fire Emblem style move ?

0 favourites
  • 6 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • Hello everyone!

    I just started construct 3 and I have a challenge to make a "Fire Emblem" style game. I'm a beginner in the software and I have a problem that I can't solve at all.

    I would like to have a zone around my character when the cursor is on him, indicating how far the player can go. I put sreens at the end to illustrate.

    To create this zone, I used the distance function. For small distances, it works well, but when I try it with larger distances, it averages out to a circle. This is not the result I want.

    I don't really know how to take the problem to get the expected result. I have searched a lot of things on the net but I haven't found anything that really helped me. I hope you can help me!

    Sorry if it's not very clear, I still have a lot of trouble with construct!

    Here FE movement

    Here my movement

  • Something as easy as distance won't work for this

    What about like

    Mountains or forests that slows movement, or impassable terrain

    You need to think about this more carefully, and conceptually find out how these games do it

    Not like

    A cheap imitation!

  • You want to do a distance based flood fill, or a breadth first search. A basic brute force method should be fine as far as speed goes, if your distances aren't in the hundreds and it's a single triggered calculation. Can throw an example together later if you have trouble.

  • dropbox.com/s/v56jw51ktwd70mj/bfsfloodfillexample.c3p

    Here is an example of a flood fill based method. Note that this particular implementation is exponentially inefficient as the range increases, I didn't look into optimizing or if there is a better algorithm.

    It also doesn't take into account obstacles or terrain movement cost, but that would just be one extra step. Currently each step subtracts 1 from your range. If you had terrain costs, you would subtract (1+terrain cost at the destination tile) instead. Impassable terrain could simply be represented by a really high cost tile.

    Edit: Made a couple minor tweaks by adding a couple conditions that should improve performance significantly.

    Edit 2: Reference if you're interested in further reading: redblobgames.com/pathfinding/a-star/introduction.html

  • rexrainbows SLG movement plugin was designed to do this. It has been converted to C3, along with examples. Not sure where it is hosted now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you so much for taking the time to respond! I was going to add the terrain conditions after I put the character scope!

    Thank you very much for the example and the explanation Oosyrag, I'll go through the code to understand it well and reproduce it efficiently on my project!

    I will also look for the plugins, it could be a great help!

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