Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Ozwalled on Wed 24/09/2003 05:34:50

Title: Speeding things up
Post by: Ozwalled on Wed 24/09/2003 05:34:50
I'm not sure if this fits in this section or not, but here goes...

I'm using a really large room. So far, all I've really done is assigned the walkable area... But  things are going VERY slow when I click for the character to walk anywhere that's not a perfect, straight line (i.e., if an obstacle is in the character path).

I figure this is likely due to pathfinding calculatons being slow due to the room being so darned big.

What I want to know is whether or not there any reletively easy way to speed things up here SAVE for just diving the large room into bite-sized rooms (I'd much rather have it as one very large room, if at all possible).

Thanks!
Title: Re:Speeding things up
Post by: MrColossal on Wed 24/09/2003 07:05:43
have you tried maybe breaking the walkable area up and turning parts of it on and off?

like when he gets close to one turn the new one on and then turn the old one off?

mayhaps?

eric
Title: Re:Speeding things up
Post by: Gilbert on Wed 24/09/2003 07:26:37
Try making the walkable areas simpler, that may work.
Title: Re:Speeding things up
Post by: jetxl on Wed 24/09/2003 11:23:32
You could increase the game speed.
default it's 40.
Title: Re:Speeding things up
Post by: Gilbert on Wed 24/09/2003 11:34:44
Hmmm if he's refering to the pause before a character gets moving (path-finder in action), I think increasing game speed won't help.
Title: Re:Speeding things up
Post by: Ozwalled on Thu 25/09/2003 01:32:01
Yeah, I'm talking about that pause before the character moves, after you click on an area (sorry I wasn't more specific).

Anyway, though I have no idea how to do so, I'll give the "turning part of the walkable areas on and off" idea (if anyone could offer any quick pointers on how to do that, it'd be swell, especially if it's something that's not readily obvious in how to do it...).

Thanks for the input, though!  :)
Title: Re:Speeding things up
Post by: Timosity on Thu 25/09/2003 04:52:09
You will need to use these.

RemoveWalkableArea(4); // the number of the walkable area

RestoreWalkableArea(4); // the number of the walkable area

To trigger them probably use regions (copy your walkable areas into your regions) workout where they change,

maybe have a small walkable area in between larger ones that remains on for both the larger ones.

You will have your regions within the smaller walkable areas (make 2 regions [side by side, between the 2 larger walkable areas] eg. 1 and 2 (when room loads, DisableRegion(1);  )

when player steps onto region 2, DisableRegion(2), EnableRegion(1). (vice-versa for walking the other way)

Also at this stage you will need to RemoveWalkableArea(?); // the large one you came from and
RestoreWalkableArea(?); // the large one you are about to enter [note: on room load, Remove the walkable areas that you wont need]

(this should all happen while you are standing on the small walkable area that remains on, [also where your 2 regions will be])

Note: remember to do the opposite on the way back

I hope that's not too confusing but I'm sure it will work,

Just play around with the idea, you learn a lot more by just experimenting.
Title: Re:Speeding things up
Post by: Pumaman on Sat 27/09/2003 13:11:20
Yeah, this can be a problem with large walkable areas. The best bet is probably to split them up as Timosity explains. Out of interest, how large is your room exactly?
Title: Re:Speeding things up
Post by: Ozwalled on Mon 29/09/2003 07:55:40
The room's HUGE. 1926 x 926. Almost as tall as the law allows.  ;D