Page 2 of 2

Re: Moving Platforms

Posted: Fri Feb 05, 2016 5:11 pm
by bumbaclad
minmay wrote:Time.deltaTime() to get the time elapsed since the previous frame. Use that to scale your movement and stop at an endpoint, then you can get rid of the huge lookup tables and or blocks.
I’m having trouble understanding how this will help my script. So I use this to limit my framerate but it is still independent of the games loop. Are you saying to use this instead of using set world position on my platforms? Using this will replace my global variables that keep track of the platforms? Not seeing how this will work.
minmay wrote: Your approach for horizontal movement does not work. Consider what happens when the party does any of the following while on the platform:
- moves
- turns
- uses free-look
- makes a melee or firearm attack
- creates a projectile
- casts a burst spell
I do not have any of these issues with my script, can anyone else confirm this please.

Re: Moving Platforms

Posted: Fri Feb 05, 2016 8:16 pm
by AndakRainor
I also made some moving platforms some time ago, and used Time.deltaTime(). I did not read all your code in detail, but you must know that this is important to animate things independently of the frame rate of the game. This is the same problem and solution in every software where animations and real time tracking is involved. This function gives you the time elapsed since the last frame rendered, nothing more nothing less. So you need it to calculate all your speed and/or positions for the current frame.

Implementing moving platform requires really advanced scripting abilities I think, and I salute your efforts as it is a non trivial goal ! But Grimrock has tile based logic and the original game does not use any things like that, non integer positions can become a nightmare quickly in this environment.

A lot of things need to be dealt with, moving the party, monsters and items with some minimal realistic and game play friendly logic. For example did you test what happens when the party falls on a platform moving vertically and/or horizontally ?

From my experience, the worst thing I did not resolve is the way monsters move when moving platforms are present. If any one has an idea about that it would be fantastic; a lot of the time, flying monsters trying to reach the party end above or under the party position and finally, on the SAME tile as the party and that really is awful at least for the game play because you can't fight against a monster on your tile even if you see it very closely !

Re: Moving Platforms

Posted: Fri Feb 05, 2016 10:00 pm
by bumbaclad
I only implemented them to carry the player. Not perfect but close enough, it’s what I used and thought others would enjoy it. I use them for the player to ride them up and around the air to give a more dynamic feel.
AndakRainor wrote:A lot of things need to be dealt with, moving the party, monsters and items with some minimal realistic and game play friendly logic. For example did you test what happens when the party falls on a platform moving vertically and/or horizontally ?
Horizontal has no major issues that I’ve found. The vertical platform stops at each elevation and will fail on occasion when the party happens to fall in the middle of a vertical move.
AndakRainor wrote:From my experience, the worst thing I did not resolve is the way monsters move when moving platforms are present. If any one has an idea about that it would be fantastic; a lot of the time, flying monsters trying to reach the party end above or under the party position and finally, on the SAME tile as the party and that really is awful at least for the game play because you can't fight against a monster on your tile even if you see it very closely !
Firearms can hit the same tile the party is in but I haven’t found an easy way to make all weapons follow their example.