Speeding things up

Started by Ozwalled, Wed 24/09/2003 05:34:50

Previous topic - Next topic

Ozwalled

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!

MrColossal

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
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

Gilbert

Try making the walkable areas simpler, that may work.

jetxl

You could increase the game speed.
default it's 40.

Gilbert

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.

Ozwalled

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!  :)

Timosity

#6
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.

Pumaman

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?

Ozwalled

The room's HUGE. 1926 x 926. Almost as tall as the law allows.  ;D

SMF spam blocked by CleanTalk