Problem with Point & Click

dapiondapion Member, PRO Posts: 353

Hi everyone,
I have a problem in a project, maybe one of you can help me.
My Scene consists of an area where the player can move freely.
The whole happened over poit & click.
I have divided the pitch (green) into individual small areas 50x50 pixels.
Once I click on a field with a mouse or finger, the player moves to the saved position.
Now to my problem.
There are also obstacles where the player can´t get through (purple)
I have yet not found a way for my player to say that he must bypass the obstacle.
Here's a little video ...

Anyone help?

http://www.dapion.de/Digger_1.mp4

Comments

  • dapiondapion Member, PRO Posts: 353

    This must be new:-)
    Thanks for this @Lost_Oasis_Games, great!
    Will test it right now...

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @dapion said:
    This must be new:-)
    Thanks for this @Lost_Oasis_Games, great!
    Will test it right now...

    Actually that behavior has been in there for like a year..lol I was just talking to @Hopscotch about how nobody has been teaching about this behavior or using it. He is going to do some samples and I am going to do some videos. This will be in the near future.

  • owen_dennisowen_dennis Just a guy, you know. Member, PRO Posts: 236
    edited April 2016

    @Lost_Oasis_Games said:

    @dapion said:
    This must be new:-)
    Thanks for this @Lost_Oasis_Games, great!
    Will test it right now...

    Actually that behavior has been in there for like a year..lol I was just talking to @Hopscotch about how nobody has been teaching about this behavior or using it. He is going to do some samples and I am going to do some videos. This will be in the near future.

    I think a lot of people would really appreciate that. I have trouble seeing how it would work in a non-perfect grid format. So if there are objects with a weird shape for the character to go around. Like what does pathfinding code look like in a kings quest style adventure game? Or does it only work in a grid? The code makes it look like it's not actually colliding with objects, it's just going from point to point, but some points are harder to pass through I guess? Can you make it slow down when it starts to go over a point like that like it's in mud or something?

    Just some real world examples. It's a little complex.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited April 2016

    @owen_dennis said:

    @Lost_Oasis_Games said:

    @dapion said:
    This must be new:-)
    Thanks for this @Lost_Oasis_Games, great!
    Will test it right now...

    Actually that behavior has been in there for like a year..lol I was just talking to @Hopscotch about how nobody has been teaching about this behavior or using it. He is going to do some samples and I am going to do some videos. This will be in the near future.

    I think a lot of people would really appreciate that. I have trouble seeing how it would work in a non-perfect grid format. So if there are objects with a weird shape for the character to go around. Like what does pathfinding code look like in a kings quest style adventure game? Or does it only work in a grid? The code makes it look like it's not actually colliding with objects, it's just going from point to point, but some points are harder to pass through I guess? Can you make it slow down when it starts to go over a point like that like it's in mud or something?

    Just some real world examples. It's a little complex.

    Yes it still would be some complex logic. What pathfinding does is figure out an index of data for you to define yourself and then build logic for that data. I've never dug into it but I have read the overall specifics. I know that movable actors, inside the physics engine, will traverse colliable objects on their own. In my game puck it, the AI paddle will slide around the round bumpers to reach the puck. Without proper testing, I'm not sure about other more complex shapes. I surmise that if the shape has rounded edges and doesn't have spots larger than your actor, which could trap it, you could get some decent results. Once again in my puck it AI paddle, I build a condition that would recognize when the paddle had the puck trapped against the wall and would back off and then re-strike the puck. My early assessment is it would be possible to build a basic AI system with auto physics movement using the pathfind behavior as a basis. What the behavior is not though is an AI unto itself. You would need to build out that AI logic.

    One other note: you can do different layouts other than a grid pattern but still a pattern. So in essence you could do a slowing when you overlap and collide with a specific type of actor that would be defined by the value in the path table. You could modify the actor's tag based on the table value. Then set code that adjusts the velocity based on an overlap and collide of an actor with a specific tag. The only drawback is custom collisions are not recognized by the overlap and collide condition, this is still defined by the overall rigidbody of an actor. The custom collision shape is only recognized by the collide behavior.

Sign In or Register to comment.