Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Hellomoto on Mon 08/11/2004 15:57:53

Title: Multiple walkable areas
Post by: Hellomoto on Mon 08/11/2004 15:57:53
I know that its possible to turn walkable areas on and off etc. But is it possible, to have multiple characters, each moving at the same time, in its own walkable area. Completely independently of other characters walkable areas.

I'm trying to think of a suitable analagy. But the best I can think of, is, if a game takes an over head view and you character can only walk over roads. However, you also control a plane, which can fly over anywhere that the other character can, but also the rst of the background. However, each character can in fact move at the same time. If they did not, then I could turn on and off certain areas as is appropriate, but I need to have the characters moving at the same time. So, I need for all of the walkable areas on at all times (unless theres some way around this). Also, all of the characters need to remain characters, I can't turn them into objects and control them like that, because there is a lot of character interaction etc.

Thanks in advance.
Title: Re: Multiple walkable areas
Post by: stuh505 on Mon 08/11/2004 16:04:49
I'd like to know about this also.  I have a situation where I have a dog on a leash, and I want it to try to follow the character around, but it has a limited walkable area around the pole it is tied to...whereas the character can walk anywhere.
Title: Re: Multiple walkable areas
Post by: Scummbuddy on Mon 08/11/2004 17:49:38
for that plane, you can use the move command that allows you to disregaurd walkable areas (MoveCharacterDirect, I believe) ... but i understand what you are getting at. I suppose
AssignWalkableAreaOnly(char, walkarea #); ?
Title: Re: Multiple walkable areas
Post by: Radiant on Mon 08/11/2004 18:14:35
It would be useful if there was a river, and the player character could wade through, but a fish would be restricted to the river only (e.g. AGI has a 'restrict-to-water' command)
Title: Re: Multiple walkable areas
Post by: Ashen on Mon 08/11/2004 18:57:05
Could you use regions to mark the areas (e.g. water, paths) and if (GetRegionAt (character[CHAR].x, character[CHAR].y) != x) StopMoving (CHAR); or something similar, in rep_ex to limit them to those areas?
So, using the analogy in the first post, the entire screen would be a walkable area, and the path would be marked out in Region 1. Then you'd have

if (GetRegionAt (character[EGO].x, character[EGO].y) != 1) StopMoving (EGO);
  //EGO has walked off the path, so stops moving.

The plane wouldn't need limiting, as it's free to fly around the whole screen.

I'm not sure how well this would work with path finding though - although it might work in the situation stuh505 has.
Title: Re: Multiple walkable areas
Post by: Pumaman on Mon 08/11/2004 19:57:06
What about some sort of  DisableWalkableAreaForCharacter(area, charid) style functin?
Title: Re: Multiple walkable areas
Post by: Rui 'Trovatore' Pires on Mon 08/11/2004 21:37:21
That would probably do the trick, is it feasible to implement (as well as it's counterpart, EnableWalkableAreaForCharacter(area, charid))?
Title: Re: Multiple walkable areas
Post by: Radiant on Mon 08/11/2004 21:50:57
Yes, that would be very good.
Title: Re: Multiple walkable areas
Post by: stuh505 on Mon 08/11/2004 22:44:30
Pumaman, that would be fabulous...and add a lot of capability.

It would be even more powerful if you allowed the walkable areas to not erase each other...so for example you could make a venn diagram of walkable areas, and deleting one would not leave an empty hole in the other.

Used with the disable walkable area command, this could really allow for a lot of new and cool things.
Title: Re: Multiple walkable areas
Post by: Hellomoto on Tue 09/11/2004 15:29:03
For crossing walkable stuh505, you could just use an extra walkable area at the block where they cross, then just turn off the ones around it. It would take an extra walkable area, but its more than likely that you'd have enough all the same.

Also, that function would be very useful. Especially if you could use an overloaded version, to allow multiple characters to be dissallowed at the same time. But thats not important.
Title: Re: Multiple walkable areas
Post by: stuh505 on Tue 09/11/2004 17:02:06
Good point, Hellomoto.  I still think layered walkable areas would be nice, though...even if they aren't 100% necessary.
Title: Re: Multiple walkable areas
Post by: Pumaman on Tue 09/11/2004 19:43:44
Layered walkable areas would significantly change the way the walkalbe area systme works, so I don't think it's really viable to do. The workaround is as Hellomoto suggests.

Anyway, I've added the original suggestion to the tracker (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=491).