Help about frames and "leaving event" timing

All about creating levels and level sets, custom elements and custom artwork.

Moderators: Flumminator, Zomis

Post Reply
User avatar
Francesco
Posts: 577
Joined: Thu Dec 29, 2005 2:22 pm
Location: Sardinia (Italy)
Contact:

Help about frames and "leaving event" timing

Post by Francesco »

I'm not sure if this help request is in the right section, but here it goes anyway.

I'm trying to realize an object that seems to move along with Rockford.

The solution I'm trying to use is as follows:
Initial state: Player inside CE1.
Event: Player leaves to the left.
Action: Using extended replace of CE1, CE1 changes to CE2 and CE3 is put on the field at its left. CE2 is the animation of CE1 moving to the left, CE3 is the animation of C1 coming from the right.

To let it work correctly, I need to know some things:
How many frames pass when the player moves from a field to another at normal speed? And at the other speeds?
The event of leaving is raised before or after that some part of the player actually leaves? I mean, when the event is raised the player is yet occupying some part of the destination field or not?

[I'm too busy to figure it out with tryouts... pleez... :cry:]

[PS: I know that Alan has already made something like this with the neck section of the snake, but I want to see *both* the player and the CE, and I'd like to see them move together.]

[PS2: I could teleport the player, replace CE1 with CE2 (that shows CE1 and Rockford moving together) and then move it with the "joypad" technique, but it needs a dedicated 3x3 area on the level, and I'd like to avoid it since the problem is mainly aesthetical]
Last edited by Francesco on Wed Jan 11, 2006 3:53 pm, edited 1 time in total.
Anyway, by the way, have fun!
Francesco
User avatar
Francesco
Posts: 577
Joined: Thu Dec 29, 2005 2:22 pm
Location: Sardinia (Italy)
Contact:

Re: Help about frames and "leaving event" timing

Post by Francesco »

Francesco wrote: [PS: I know that Alan has already made something like this with the neck section of the snake, but I want to see *both* the player and the CE, and I'd like to see them move together.]
When I was writing I was sure that the snake's head were *above* Rockford, but actually it *is* Rockford! I took a look to the game after posting, and when I saw the fluent movement of the head, I thought that there had to be the solution to my problem in Alan's CEs... unfortunately this is not the case....
Anyway, by the way, have fun!
Francesco
User avatar
Alan
Posts: 661
Joined: Fri Jun 18, 2004 7:48 pm

Post by Alan »

There is a solution!

We have lots of commands for the player (enters,exits,snaps etc)
except for one..........player moves!
I don't know why it isn't in RnD? (hint hint), it would make all these problems go away.

Anyway, using the player leaves CE is always one step behind (see how the snake animates after moving, not during?)

>>How many frames pass when the player moves from a field to another at normal speed?


Ahh-ha a very good question, this is tricky! It's 8 frames, but......... if you are swapping this CE with another (0 delay), then you have to account for that frame to....IE 7 frames + 1. In snakebite I had to seperate the animation if I wanted it smooth and to use more than one CE! (the neck uses 2 frames, whilst the body uses 6 = 8 )...... a horrible way to do it, but it worked.
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

I think I know what you're trying to do, but I'm not sure...
And I don't understand exactly why the "change when player leaves CE" doesn't work for you... check the technique I've used for continous input and roadblock movement.
I simply put a walkable (unprotected, all directions) CE under the player which changes whenever the player leaves it.. Maybe there's some animations that wouldn't work when using that, I'm not sure. Graphics isn't my best part in RND...:)

However, the frame/step amount for the other speeds doubles for slower speeds and halfs for faster speeds. For example: Normal - 8. Faster - 4. Very fast - 2. Even faster - 1. Slow - 16. Very slow - 32.
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> How many frames pass when the player moves from a field to another at
> normal speed?

As Alan and Zomis have already written, it's 8 frames indeed.

> And at the other speeds?

See Zomis' answer! :-)

> The event of leaving is raised before or after that some part of the player
> actually leaves?

The events "player enters", "player leaves", "<e> entered by player" and "<e> left by player" are triggered when the player finishes the single-tile movement that places him on the destination field (for "entering") or that he completely left (for "leaving").

> We have lots of commands for the player (enters,exits,snaps etc)
> except for one..........player moves!

It's already there ... :-o

> I don't know why it isn't in RnD? (hint hint), it would make all these
> problems go away.

Use "move of <e>" and use the "player element" as the element <e>.

Oh well, maybe I should add this explicitly as "(when) player moves"...
(I thought that "move of <e>" would be obvious, but in fact it isn't, as some things using an element <e> do not work or work differently for the player element... :-/ )
User avatar
Alan
Posts: 661
Joined: Fri Jun 18, 2004 7:48 pm

Post by Alan »

>Use "move of <e>" and use the "player element" as the element <e>.

I must of missed that one!

But...... it works exactly like enters/exits, the change only happens after the player has reached the next square! I needed the change to happen before the player starts moving... I did:-

CE1 changes to an empty space if Move of Player_1.
Is this right?
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

(Now your new posts correctly show up as "not read" -- very strange...)

> But...... it works exactly like enters/exits, the change only happens after
> the player has reached the next square!

That's right...

> I needed the change to happen before the player starts moving... I did:-
> CE1 changes to an empty space if Move of Player_1.
> Is this right?

Yep, that is correct, and should change CE1 to "empty space" *after* the player_1 finished his movement. (It works that way, right?)

But I know what you mean. In fact, the "player enters" and "player leaves" events were first implemented that way (triggering the change as soon as the player starts moving).

Unfortunately, this caused some problems. E.g., what should happen if a walkable element changes to a non-walkable when "entered by player"? (I know that this can also be caused by a walkable CE that changes to unwalkable after a given delay, while the player is just entering. So it might be that it cannot be prevented.)

So I decided that the change should be triggered when the player finished his movement...

Maybe it's worth to offer both "player starts entering" and "player finished entering" (and the same for "leaving" and "moving"), but I'm not sure...

(I had the same problem with "player pushes" -- first I triggered the change when the player started pushing. If you change the just pushed element to something non-pushable while the player is pushing it, this is the same strange situation, so I also changed this to trigger the change not before the movement is done.)
User avatar
Francesco
Posts: 577
Joined: Thu Dec 29, 2005 2:22 pm
Location: Sardinia (Italy)
Contact:

Post by Francesco »

Holger wrote:(Now your new posts correctly show up as "not read" -- very strange...)
For me your new posts are marked as already read... strange?
But I know what you mean. In fact, the "player enters" and "player leaves" events were first implemented that way (triggering the change as soon as the player starts moving).

Unfortunately, this caused some problems. E.g., what should happen if a walkable element changes to a non-walkable when "entered by player"?
Just the same thing that happens when you touch the reset terminal while standing into the tractor :wink:
Maybe it's worth to offer both "player starts entering" and "player finished entering" (and the same for "leaving" and "moving"), but I'm not sure...
Well, to be honest it has no real importance, because I needed it to make more "real" the tractor of the "Trucky Cargos" levelset.
But it would be nice if you could step into an element and then be able to push it from inside, like a bottomless box. Wouldn't it?
Anyway, by the way, have fun!
Francesco
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> For me your new posts are marked as already read... strange?

Yes... I already had this several times... :-(

> But it would be nice if you could step into an element and then be able to
> push it from inside, like a bottomless box. Wouldn't it?

Indeed... This would be a cool thing! And it shouldn't be too hard -- that walkable element just mustn't be walkable into the direction that it should be pushed to.

But adding a push method where the player and the pushed element are on the same tile would be some sort of new concept, so it would probably a bit tricky to add it (or at least needs some work).

But that idea is indeed not bad! :-)
User avatar
Francesco
Posts: 577
Joined: Thu Dec 29, 2005 2:22 pm
Location: Sardinia (Italy)
Contact:

Post by Francesco »

10x 10x 10x!

...still not enough...

(10x)*[8^8]!

:D

[RE-EDIT]
Well, it would be better if this CE could be pushed to any side while standing in it, not just in one direction.
But I think that you will give us full control over the four sides ;-)
Maybe a pushable/walkable CE, so you can push it from both faces of the side.

I know that maybe I am putting some confusion into this forum, but when you'll have the time to implement the above CE, think about a single side CE (it's a new kind of CE indeed - it's a sheet) this could let us make floors and walls 0x1!
[/EDIT]
Anyway, by the way, have fun!
Francesco
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> Well, it would be better if this CE could be pushed to any side while
> standing in it, not just in one direction.
[...]
> Maybe a pushable/walkable CE, so you can push it from both faces of the side.

Hmmm... But how do you then tell if the player should leave the CE or push it? I mean, it could then either be pushed from inside, or it can be left.

The only option I can see is a CE that you define to be walkable from only some, but not all directions, and have it pushable from those non-walkable directions. (Just like you already can do, but with pushing from inside instead of from outside.)
User avatar
Francesco
Posts: 577
Joined: Thu Dec 29, 2005 2:22 pm
Location: Sardinia (Italy)
Contact:

Post by Francesco »

As usual, a walkable CE can change to another walkable CE when the player enters it, so it could change even into a CE that is walkable, pushable and completely closed. When you bring this CE to a "CE opener", it switches back to the open one and so on.

It could be implemented in this way:
"Walkable" and "Pushable" as separate thickable properties, "Allow passage from/to:" as another property to thick and "Up,Down,L,R,UD,LR and so on" in a dropdown for choosing the various sides combinations, although 4 checkboxes would be better - notice that I speak just of the interface, I don't know how hard to realize it would be into the events' routines.
Anyway, by the way, have fun!
Francesco
User avatar
Francesco
Posts: 577
Joined: Thu Dec 29, 2005 2:22 pm
Location: Sardinia (Italy)
Contact:

Post by Francesco »

I'm sorry but I didn't know that those two properties were yet selectable together.... I took a further read to your post and then I'm gone to see on the editor... eh, still I have a lot to learn, even about simple CE's properties... :wink:
Anyway, by the way, have fun!
Francesco
Post Reply