Announcement

Collapse
No announcement yet.

Grid based movement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Grid based movement

    I'm currently working on a project where I wanna replicate the movement system used in "Friday the 13th killer puzzle". I'm not exactly sure yet on how to approach this and I only have a basic understanding of blueprints. I already gathered some ideas but I don't even know if these are possible to replicate. My first idea was to use even squares as the ground and then use the pivots of these to direct the character. The second was to spawn the character in a position where he is perfectly centered and then have his steps to be only as big as it takes to go from one center of a ground tyle to another. Hopefully, you guys understand my ideas and can give me your thoughts on this

    #2
    Oh nice.
    not familiar with the specific game but, am aware of the concept.

    My worry with the steps is if you do any diagonals. Measurement is weird.
    Having a system in place that compensates for this right away might be wise in case you come up with something later that uses it.

    My first thought is an empty trigger.
    placed in each square.
    when you mouse over it (maybe tap once on mobile to highlight tap again to confirm move)
    ​​​​​​it highlights the square as green/red

    On move it would do a move to node.

    Presumably you want the character constrain to the proper directions...if you do one square at time with a "moves left" variable it's easy.

    But when you have multiple squares you could move and want to see every option, or select the most distant and have it move correctly...

    Only rather complex solutions come to mind, like invisible blocking volumes at each corner or eaxctly the right size...forcing characters to go around them.
    Or a complex check of if you are at location x you can go to y,z,a only....

    I'll think on it. Hopefully someone comes up with something good because I am very interested.


    Hum...might be able to save some effort by doing scene components in meshes....
    okay...bear with me a second, this is rather retardedly complex but, might give you an idea.

    When you select move action have the character begin Ray tracing in the 4 directions. There is a variable for "movement" so you can have different characters bonuses whatever.
    You have modular floors built with the same invisible box in each one.
    Have then set so that when hit by a ray trace, they do the same thing, sending it in 4 directions with a movement set equal to movement -1.
    While highlighting the area (could turn on a light or effect the material of that square whatever)

    There is a Boolean that gets flipped to true for this that says you can travel there.
    When you move, obviously character movement gets -1.

    You know the character won't move more than some certain number of movements. So part of ray trace triggers is to store that components location. Array or a group of variables.
    So first, first returns location array position 0
    When second is hit position 1
    When the character moves, it follows the order 0,1,2.

    I just haven't thought of a way to prevent it from choosing horrible paths... Move just to your right and it might move forward then right then back....

    But having one scene component you can basically copy/paste
    With modular floors set up you can tile how you need the rest is only one set up of any difficulty then bunch of copy/paste.

    Comment


      #3
      First thanks for the long answer and the time you invested in it But from what I get off your answer we're both thinking of two different movement systems. As it seems your thinking of a movement system as found in games like "Civilization" or "X Com". This is not what I'm trying to approach. I want to use swipe controls and when I swipe in one of 4 directions I want my character to move in that direction without stopping until something gets in its way. If you still wanna help I suggest you watch a YouTube gameplay video so you see what I'm talking about. Thanks again

      Comment


        #4
        Originally posted by Mar7en View Post
        First thanks for the long answer and the time you invested in it But from what I get off your answer we're both thinking of two different movement systems. As it seems your thinking of a movement system as found in games like "Civilization" or "X Com". This is not what I'm trying to approach. I want to use swipe controls and when I swipe in one of 4 directions I want my character to move in that direction without stopping until something gets in its way. If you still wanna help I suggest you watch a YouTube gameplay video so you see what I'm talking about. Thanks again
        -_-

        yep...sorry.
        looked at scree shots and misunderstood them. Got excited about the problem.

        Set the collision capsule on the character to a square the size of one of your grid units.
        get the characters "stride" into a exact value of square. 1 step=1 square, 1 step = 1/2 square
        so that always ends up exactly one square movement away.

        probably use the constrain to axis to be sure you dont move at an angle
        Not familiar with touch controls enough for the "swipe" effect. And by not familiar i would probably try to just do a d-pad to avoid learning something else at this moment.... XD

        on input direction set the speed of character into that direction
        on collision set speed zero

        (disable movement node on collision. Turn back on when can move again/movement input)

        Since everything fits nicely into the grid, having your collision fit nicely into the grid like that for everything would make it a lot easier i believe

        Comment

        Working...
        X