Scrolling & anti-glide mode

Started by Bernie, Sun 25/01/2004 10:32:38

Previous topic - Next topic

Bernie

I'm using two characters in my game, one is following the main character. The game is set to anti-glide. This works very well so far, but when I put em in a scrolling room, the following character shakes quite a bit when the screen is scrolling.
That's what I'd like to get rid of. I've made a custom scrolling thing which worked pretty well, but when a cutscene is running, the custom scrolling doesn't work anymore. Any ideas?

Thanks~

Ishmael

I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Scorpiorus

QuoteI've made a custom scrolling thing which worked pretty well, but when a cutscene is running, the custom scrolling doesn't work anymore. Any ideas?
It's probably because you used repeatedly_execute() but the last isn't get called while the the cutscene is running.

Yeah, taking a look at the scolling script code would help us to modify it to work with the cutscene, could you also post your cutscene script?

Pumaman

If the character's walking speed is similar but not the same as the scrolling speed, you can get a 'shaking' effect.

Try making sure both characters have the same walking speed.

Bernie

Both characters have the same walking and animation speed. The game is at frame rate 40. I'm using the followcharacterex command.

It works when I do it an framerate 10 and ani speed 0 with anti-glide off because everything is updated at the same time. But at framerate 40, the follow character will or will not shake depending on when he starts to move when scrolling because the screen is updated more often than the animation speed of the char. (That's what you meant, Pumaman - right?)
If the following char would start to move at the same time the main charstarts moving, it would work.

I'm using the normal AGS scrolling right now, I ditched my own scrolling code. (It involved an invisible character which the viewport was focused on. Then I added or subtracted 1 or 2 to that character's x/y depending on the player characters position, so it would sort of follow the player. This would give smooth scrolling even with anti-glide on.)

A good solution to this would be if the mouse cursor position would be updated outside of the game frame rate, then I could use a framerate of 10 without the mouse being so slow, but I guess that is not an option.

Or...

While scrolling, the whole screen would only update when the player character's animations update. But I guess this can't be done through code and would require altering the engine itself, so... meh. :)

Pumaman

Yep that's right, the anti-glide mode is what causes the problem. It's not really a bug as such, more an unfortunate side effect of the way scrolling works. You could lock the screen in position while they move, or manually move it yourself, but I appreciate that's rather more work than it should be, just to get it to look right.


Ben

#6
What's the custom script you use to scroll the view? Maybe we could modify it so it works during blocking cutscenes..

For example, you could create a custom function to replace the default moving cammands:

Code: ags

function MoveScroll(int char, int x, int y) {
  MoveCharacter(char,x,y);
  while(character[char].walking {
     //your scrolling code
  }
}


Bernie

I don't have my old scrolling code anymore, so I'll just go and try to do a function like you suggested.

Thanks for your help, everyone! :D

SMF spam blocked by CleanTalk