Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: BlackBaron on Wed 16/04/2003 20:01:33

Title: Suggestion: Character speed.
Post by: BlackBaron on Wed 16/04/2003 20:01:33
It would really nice to have independent 'x' and 'y' speeds on characters.
It would also be nice to be able to change the speed of acharacter with its scale.
Title: Re:Suggestion: Character speed.
Post by: Jimi on Wed 16/04/2003 20:46:20
There isn't a "speed" on the scaling, is there? Don't you just have to have more walkable areas that change the % at a steady rate?
Title: Re:Suggestion: Character speed.
Post by: Privateer Puddin' on Wed 16/04/2003 20:48:42
This has been mentioned a lot, well the second one that is :)
Title: Re:Suggestion: Character speed.
Post by: Pumaman on Wed 16/04/2003 21:26:30
Yep this has been requested many times, it's on the tracker here:

http://www.agsforums.com/tracker.php?action=detail&id=14

It has not yet been implemented for technical reasons.
Title: Re:Suggestion: Character speed.
Post by: BlackBaron on Thu 17/04/2003 04:33:56
Quote from: Jimi on Wed 16/04/2003 20:46:20
There isn't a "speed" on the scaling, is there? Don't you just have to have more walkable areas that change the % at a steady rate?

I didn't mean a speed on scaling, I meant that it should be alowed to let the character moving speed depends on it scale, i.e. if you draw it small it walks slower (lust like distant objects in real life, imagine a plane, the farther you see it the slower it seems to be going, doesn't it?).
Title: Re:Suggestion: Character speed.
Post by: BlackBaron on Thu 17/04/2003 04:36:14
Anyway, thanks a lot (I didn't know about that tracker stuff).

I'll guess I'll just have to be patient.
Title: Re:Suggestion: Character speed.
Post by: Pumaman on Thu 17/04/2003 19:14:22
Quote from: BlackBaron on Thu 17/04/2003 04:33:56
I didn't mean a speed on scaling, I meant that it should be alowed to let the character moving speed depends on it scale, i.e. if you draw it small it walks slower (lust like distant objects in real life, imagine a plane, the farther you see it the slower it seems to be going, doesn't it?).

For reference, what you describe there is speed on scaling. :)
Title: Re:Suggestion: Character speed.
Post by: Hollister Man on Fri 18/04/2003 20:08:44
It is a bit larger, and more difficult for the coder, but Permanent Daylight used an interesting approach.  They used different walkable areas to simulate scaling.  When the character walked away from the screen, he became smaller.  This way they could make sure he looked nice at any level, nnot just multiples of 25%

You could use this approach, setting a function so that if the character is on the more distant walkable area, his walking speed slows.

Just my five cents, (Inflation is a pain)

Al
Title: Re:Suggestion: Character speed.
Post by: scotch on Fri 18/04/2003 20:11:38
Could you write that function for me?? :)

I didn't get what you meant at all.. you can't change the character's speed while it's moving btw.
Title: Re:Suggestion: Character speed.
Post by: TerranRich on Fri 18/04/2003 22:59:01
At the very least, Chris, could you implement a GetCharacterScale(int charid); function until you find a way to implement full scale/speed synchronization. Is that possible? This way we could do it ourselves until then using script by checking the scale size and setting the speed accordingly.

//EDIT//
Whoops, forgot that speed can't be changed while walking. Is there a way around that? Is that where the problem in the implementation lies? :)
Title: Re:Suggestion: Character speed.
Post by: Pumaman on Sat 19/04/2003 16:35:19
Yep, that's the whole problem here. When the character wants to walk from A to B, his entire path is pre-calculated, but the technical issues of handling changing speeds in that calculation are the reason I havent' done it yet.

It's possible, it just needs a fair bit of work.
Title: Re:Suggestion: Character speed.
Post by: Hollister Man on Sat 19/04/2003 16:50:50
Would it be possible for someone to rewrite the walking function for themselves, possibly using an unused cursor mode?  I would try something like this, although it might not work.

Animate the character, maybe using While, to animate until he arrives in his final location, lets say BX, BY.  Detect when he changes walking areas, stop him for an istant, just long enough to change speed, and start him toward BX, BY again.  I have not tried it, so I cannot be sure it would look good.  I'm going to try it now.

Title: Re:Suggestion: Character speed.
Post by: scotch on Sat 19/04/2003 17:07:42
Well I can't think of a way of doing the pathfinding in the script, probably just best to wait until this is added to ags, I don't think it's possble in script.
Title: Re:Suggestion: Character speed.
Post by: Hollister Man on Sat 19/04/2003 17:27:01
Well, I was just going to tell it to check if he changes areas, and stop if he did, still using the normal pathfinding.  Unfortunately I suck at coding enough that it froze solid.  I must have got a loop in there somewhere.
Title: Re:Suggestion: Character speed.
Post by: Pumaman on Sat 19/04/2003 18:09:37
What you suggest is possible, but would be rather slow because it would have to keep re-calculating the path every time he changed areas. This is something I'm thinking about how to fix though.
Title: Re:Suggestion: Character speed.
Post by: Scorpiorus on Sat 19/04/2003 21:02:05
QuoteAnimate the character, maybe using While, to animate until he arrives in his final location, lets say BX, BY. Detect when he changes walking areas, stop him for an istant, just long enough to change speed, and start him toward BX, BY again. I have not tried it, so I cannot be sure it would look good. I'm going to try it now.
I had tried that method earlier but it doesn't look good (at least for me). :-\

Another way is to write you own MoveCharacterDirect() function using character[].x character[].y variables. Since it is 'direct' it wouldn't use the pathfinder at all. Well, checking for walkable area under the character may help a bit. Although it would be like AGS MoveCharacterStraight() function. Not sure it is enough unless you use keyboard to control that char.

-Cheers