Point & Click Adventure: Walk-Engine Advice ?

  • Hey All,

    So I'm trying to think what way should I use for a basic character movement for a Point & Click Adventure style game. something like the good old 90's games such as:

    "King's Quest", "Gobliiins", "Monkey Island" and many others...

    If you ever play one of those, you know that Path Finding is the BEST solution for such game-engine because you don't want to lead the player with multiple clicks to get to a specific place on the stage (mostly background art with invisible obstacles).

    My very first rough test:

    So the first thing I tried is the Pathfinding behaviour but it seems like it's "thinking" before it acts, maybe the calculation takes time or maybe I need to play with the settings to make it react right away?

    BTW - I just used a 64x64 cube as the mask / collider of the player for the test, nothing fancy.

    As I'm very new to construct I will be happy to get some advice, maybe even visual examples since I'm not an expert in the code yet.

    My Goal is Simple:

    I want the Player to go to ANYWHERE on the sage (map) as soon as I click without stop, thinking, no slowing down or accelerating, just very simple like the good old Amiga / Dos adventure games, you click... the Player goes to that point and take action if needed with the correct mouse sign (Walk, Talk, Speak, Use etc..)

    I'll probably make it very visual and simple but I still need some Construct experts to tell me if I should use the Pathfinidng behaviour and do some SPECIFIC changes so it won't run slow as soon as I click. or maybe a different way? plugin?

    Sorry for my bad English,

    Thanks ahead for your help and have a wonderful day!

  • A very simple way to do it is with the bullet behavior.

    If touch.x

    is greater than character.x--> bullet blabla

    is less than character.x--> bullet blabla

    If you want to go to the background:

    you can compare the distance form touch.x to your character.x, and set an apropiate bullet speed.

    if touch.y (between xxx and xxx)

    decrease gradually the size of the character.

    ---------------------------------------------------------------------------------

    I think this could work fine.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for your advice, I should give it a try!

    I'm still looking for a solution or answer about the path finding issue I mentioned.

    If anyone have some experience with this it will be great?

  • Pathfinding does take some time to calculate. However, as long as your map isn't changing, I believe you can do your pathfinding at the beginning of the map display, and utilities it when you need it. It shouldn't slow anything down at that point.

  • Thanks, I guess the pathfinding behaviour is not good for that goal then.

    Because as I mention I'm looking for a fast-reaction solution when you click it's just working right away exactly like most good old adventure games such as Gobliins, Simon Sorcerer, King's Quest, Larry Quest etc..

    As soon as you click on a place on the map the character will go around the obstacles, bridge, trees, rocks whatever and do it immediately.

    All I can think of right now is to do it without path finding but that will be very annoying to let the player guide the character on many clicks around the map... it won't be what I'm trying to emulate.

    Any other suggestions instead of the built-in pathfinding behaviour since it's very slow calculating and not reacting right away? please share your ideas / suggestions / examples will be great since I'm still a newbie user.

  • Any other suggestions instead of the built-in pathfinding behaviour since it's very slow calculating and not reacting right away? please share your ideas / suggestions / examples will be great since I'm still a newbie user.

    Alon, I've used pathfinding on a point-and-click type prototype before and there is no real lag for me unless I keep on regenerating my obstacles, which would not be commonly done so much in that type of game.

    I think you can use pathfinding. If you have lag issues with a certain pathfinding setup, then the best way is to show others how you've set it up by uploading the capx so we can determine if there's some thing that can be optimised/improved.

  • >

    >

    > Any other suggestions instead of the built-in pathfinding behaviour since it's very slow calculating and not reacting right away? please share your ideas / suggestions / examples will be great since I'm still a newbie user.

    >

    Alon, I've used pathfinding on a point-and-click type prototype before and there is no real lag for me unless I keep on regenerating my obstacles, which would not be commonly done so much in that type of game.

    I think you can use pathfinding. If you have lag issues with a certain pathfinding setup, then the best way is to show others how you've set it up by uploading the capx so we can determine if there's some thing that can be optimised/improved.

    Nice! First of all your demo is really cool, great job!

    Will you be kind and share the settings or maybe some events of how you make your character to go as soon as I click on the stage / map?

    In my very first attempt, I didn't touch the path-finding properties much maybe the speed acc/dec but nothing much so after checking your demo you gave me hope!

    Again, I'm new to Construct so I'm probably not understanding exactly how to set it up to react more like what you did so the player is moving without: stop for a short time, calculate... and then move...

  • Here is my first attempt for a minimalistic Point & Click movement using the pathfinding behaviour.

    Download Construct 3 (c3p) file here: https://ufile.io/k6exh

    As you can see there are no obstacles, only one sprite as the base mask for the character animation I may pin later on.

    The very first MOUSE CLICK works fast, no delaying at all.

    But from the 2nd click anywhere on the screen it takes some time, only then moves to the point.

    There is nothing much to calculate so I'm pretty sure I'm doing something wrong either on the behaviour properties or on the event sheet.

    I'll be happy if faulknermano or anybody else can have a look and tell me what I'm doing wrong?

    Thanks ahead!

  • Alex Francois who made "The Slaughter" which is a traditional PnC Adventure Game in Construct 2 has a great article on his blog about character scaling and such.

    You can find it here: http://brainchildstudios.tumblr.com/

    Quote from the blog:

    [quote:3ifvlaw2]After a lot of guess work and trial and error when trying to make a character scale realistically, I decided it was time to make a simple linear scaling algorithm that can be easily tweaked to the perspective of every scene. I’m pretty terrible at explaining, the image probably gives the clearer explanation but here’s my attempt anyway:

    Linear Scaling Algorithm:

    InitialScale+((Player.Y-a)*e)

    Find the point in the layout’s Y axis at which you want your character to be at their normal scale, let’s call this (a).

    Find the point in the layout’s Y axis which the player’s scale is at twice their normal scale, call this (b).

    Find the difference from (a) to (b) on the Y axis which we call ©, and the difference from (a) to (b) in terms of scale, which we call (d).

    Divide (d) by © which gives us (e)

    Player.Y is the constantly tracked Y position of the player in the layout.

    This works a treat and is very easy to tweak, especially if you set (a) to a variable which is changed with each scene. I hope this had made some tiny bit of sense, but if it hasn’t let me know!

    Might be worth checking out <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

  • Thanks for sharing this information joelmayer I appreciate it and I'll check out!

    Unfortunately, as you can see on my latest post I'm stuck on a very basic issue, not even on the scaling part which I'm not even sure I'll use or not.

    It's like the response is delay even that my layout is empty without any obstacles, only 1 sprite and I'm not sure what I do wrong as I explained.

    Maybe you can have a look and find out what I did wrong or how can I fix it?

  • Haha no problem i just thought i'd put it in here in case you're planning on scaling

    Unfortunately, i don't have much experience with the pathfinding behaviour myself. My Adventure Game is a sidescroller so i guess i can't be of much help :S My guess would be that there is probably a way to precalculate certain paths on layout loading so when the layout is ready, the character will move immediately since the paths have already been calculated but this is just an uneducated guess

  • Alon, sorry but I can't open up your C3 project (I'm not a subscriber and the free trial is a version lower than your c3p). I just use C2.

    I'll just quickly run through my setup, which is very basic.

    The first thing is that I use a circle sprite as a 'mover'.

    I squeeze this vertically so that it conforms to the 'perspective' of the rest of the artwork. As you can see above, the collision polygons simply follow the shape.

    The properties for the pathfinder is this:

    The Cell Size and Cell Border would highly depend on your own graphics and how 'tight' your moveable area is.

    Note that Obstacles is set to Solids.

    The next idea is that I use blocks and circles as collision and I layer them up. The best way to describe them is this picture:

    The some of the highlighted blue objects represent square sprites with collision polygons shaped likewise. If you can spot also there are these flattened pink circles (with a 'C' written on it) that are circle collisions. These Sprites have the Solids behaviour attached to them, and the Pathfinder uses these to navigate around. I use a combination of these collision Sprites to make up the moveable area. (In other progs like AGS, you define the walkable area, but in C2 I define the area that should be blocked).

    Here's another picture of the other scene in the demo. The pink circles are more visible here. I use a lot of them here.

    My event sheet for movement is super-simple. It looks like this:

    You can ignore most of it because it's mostly related to specifics of the game. As you can see it's nothing special. However, there is a 'special' workaround here that you will see in event line 35. Sometimes the player mover can get stuck because it gets too close and overlaps a collision. When it does this, Pathfinding usually fails to get a path. So what I do every time there is an attempt to walk, I check if the player mover if overlapping any of the collision Sprites (CollisionFamily). If it is overlapping, I disable Solids for the picked CollisionFamily Sprite and then regenerate the obstacle map. Then when the Pathfinding path is found, I enable the Solid again.

    Hopefully that helps. I can't share the project, unfortunately, and to be honest, it is burdened with many gameplay things anyway. The pathfinding is a very simple aspect of it.

  • WOW! faulknermano Thank you so much!

    This is very helpful, I just had a rough look at it while my basic file is open so I can reply to you and thank you but I will check it out more deeply for sure!

    Thanks to your detailed post I FOUND AND FIXED THE ISSUE!

    On my pathfinding behaviour properties I change the Rotate Speed from 135 to 2000 and now there is no delay! as soon as I click no matter where, it works like a charm!

    I'm guessing even that I'm not using Rotate object (disable) it's still calculating it slow on the background before it start moving, so the fast speed makes it work as I wanted.

    I will also try your many other advices such as the circle / ellipse collider for the player, make more sense and smoother than a cubic shape of course.

    Also, I hope to understand what you've done on the event sheet, not that I'm doing a copy past but I will try by my own first because I'm still learning.

    I may have more questions later on, but for now I'll just have a look and do some basic tests.

    Once again

    THANK YOU

    for taking the time to make this post, it will help many other users on the community for sure!

    Keep up the good job and have a wonderful day.

  • Hello!

    I've developed a little demo about point and click adventure system, take a look:

    Bye!

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