Adventure Game Studio

AGS Development => Editor Development => Topic started by: Walmaker on Mon 03/06/2024 12:53:07

Title: Vector-based walkboxes
Post by: Walmaker on Mon 03/06/2024 12:53:07
I have a suggestion for the editor. How about a mode to use either the default draw-in walkable areas or the vector-based walk boxes like in the original LucasArts games. The reason I'm asking is because when a character's walk movement is linked with it's animation, their movement is really jagged and unnatural, I mean, it's good for a straight line but when the drawn-in walkable area is at and angle then it will make it look clunky.

I'm actually trying to mimic the style of the classic LucasArts games as close as I can and a mode like this would help.
Title: Re: Vector-based walkboxes
Post by: Crimson Wizard on Mon 03/06/2024 13:02:01
Could you post some videos for comparison, or maybe some documentation about how it worked in LA games, to let us know clearly which effect you like to achieve?

If by "jagged movement" you mean that the characters are making sharp turns, then I suppose that is not because walkable areas are painted masks, but because of how pathfinder works: it creates straight lines between points, instead of curved paths, for example. For this reason I doubt that having vector based areas alone will improve walking in any way. It would require changing pathfinder instead.

Indeed calculating curved paths may be easier with vector-based areas, but then our current pathfinder generates a navigation grid from the painted mask, which brings things somewhat closer to vector-based, internally.

Not that there's anything wrong with having vector-based areas in AGS, but these are two separate problems, in my opinion.

Title: Re: Vector-based walkboxes
Post by: Walmaker on Mon 03/06/2024 14:14:27
I've used a room editor for the scumm games and I found out that there are resizable walkboxes with four corners that can be changed. AGS, however, has a mask for walkable areas where you draw in the walkable areas. To be honest, I like the walkboxes better because with the four corners of each box being connected, it gives the engine a good idea of how a walkable area should be like at an angle, making the character's movement much smoother (even if it's movement is linked with the animation). Whereas the draw-in walkable areas in are too pixely to understand what part of the WA is a straight line or what part is at an angle, making the movement of the characters clunky when their movement is linked with their animation.
Title: Re: Vector-based walkboxes
Post by: eri0o on Mon 03/06/2024 15:05:21
The way you define the walkable area, the way the pathfinder works, the way the character walks are three things that are completely disconnected. Can you give some explanation on the difference of the movement or footage or something that clearly shows what you are mentioning?

I think I remember a fan Indiana game that used 3D shapes to define the space and had the characters walking in this 3D space, this space was invisible in-game and you had just the pixel art bg - like original ff7, but pixel and point and click. But this would be completely different than using vector to define walkable areas as it's instead a completely different space.
Title: Re: Vector-based walkboxes
Post by: Crimson Wizard on Mon 03/06/2024 15:29:19
Quote from: Walmaker on Mon 03/06/2024 14:14:27I like the walkboxes better because with the four corners of each box being connected, it gives the engine a good idea of how a walkable area should be like at an angle, making the character's movement much smoother (even if it's movement is linked with the animation). Whereas the draw-in walkable areas in are too pixely to understand what part of the WA is a straight line or what part is at an angle, making the movement of the characters clunky when their movement is linked with their animation.

Do you mean that making diagonal areas is complicated, because character may walk in "ladder" steps instead of one straight diagonal line? I was not at first sure what kind of "boxes" are you referring to, and I never used scumm engine.


EDIT:
Whatever decision is made in regards to this, I must be honest, I doubt that such feature will be in AGS in the nearby future. We have very little people working on the program at the moment, and a list of priority tasks;  while implementing new pathfinding mode will require to make changes in number of parts in the editor and engine. Unless somebody volunteers to put a good time and effort into this, this is going to remain in "plans" for a while.
Meaning, if you are making your game in AGS right now, then you should not rely on this.
Title: Re: Vector-based walkboxes
Post by: Snarky on Mon 03/06/2024 15:37:26
Though by exposing the pathfinding API as you've just been working on, @Crimson Wizard, it becomes possible to implement vector-based walkable areas (and editing) within AGS. (That is to say, it will still be a pixel mask in the end, but it can be dynamically generated from a set of polygons.)
Title: Re: Vector-based walkboxes
Post by: Crimson Wizard on Mon 03/06/2024 15:42:15
Quote from: Snarky on Mon 03/06/2024 15:37:26Though by exposing the pathfinding API as you've just been working on, @Crimson Wizard, it becomes possible to implement vector-based walkable areas (and editing) within AGS.

But how? This is simply an "route search" interface in script, but it has exact same pathfinding implementation underneath, that is - based on painted masks.

We need a pathfinder that works with a list of geometric shapes instead.

Maybe an existing JPS implementation can be reworked into one, if it's possible to convert a geometric map into the same navigation grid. But I am not sure, personally, I've only ever had an experience with node-based pathfinders which worked with pre-built node maps. I would have to research this topic before I could have any educated opinion on this.
Title: Re: Vector-based walkboxes
Post by: Snarky on Mon 03/06/2024 18:57:54
Quote from: Crimson Wizard on Mon 03/06/2024 15:42:15We need a pathfinder that works with a list of geometric shapes instead.

Do we, though? Why?
Title: Re: Vector-based walkboxes
Post by: Crimson Wizard on Mon 03/06/2024 19:17:29
Quote from: Snarky on Mon 03/06/2024 18:57:54
Quote from: Crimson Wizard on Mon 03/06/2024 15:42:15We need a pathfinder that works with a list of geometric shapes instead.

Do we, though? Why?


How do you implement vector-based walkable areas without that?
Title: Re: Vector-based walkboxes
Post by: Snarky on Mon 03/06/2024 20:47:23
Well, in the simplest case, simply by defining the walkable areas in terms of connected polygons. They will then be rasterized as a step in the pathfinding (drawing onto a Dynamic sprite and using MaskPathfinder), but who cares?

Alternatively, users can write a pathfinding algorithm for polygon-based regions, and use the new WalkPath() method to apply it. This would enable e.g. overlapping walkable areas.

It comes down to a question of what problem we are actually trying to solve. (It's not clear what @Walmaker's problem really is, nor whether it actually has anything to do with "vector based walkboxes.")
Title: Re: Vector-based walkboxes
Post by: Crimson Wizard on Mon 03/06/2024 20:52:21
Quote from: Snarky on Mon 03/06/2024 20:47:23Alternatively, users can write a pathfinding algorithm for polygon-based regions, and use the new WalkPath() method to apply it. This would enable e.g. overlapping walkable areas.

Oh, you meant, write a pathfinder in script and and pass array of points to a character.
Yes, that might work...
I did not add WalkPath to the actual code yet, it's in plans, but I'll amend this PR soon.