• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Manually trigger timeline events?

L

LordWilliam1234

Guest
I'm currently working on a prototype for a fighting game that I wish to make, and I want to be able to implement rollback style netcode, part of which involves rolling back to a previous game state and then re-running frames with new input. This would involve going through potentially multiple frame actions in one single frame; doing event_perform for the instances I'm rolling back would work well for this, but I don't see a way to do that with timeline events. Timelines are extremely good for building character actions as they allow me to easily edit things on a frame-by-frame basis, and what I used in a previous project. But I didn't see anything in the documentation that lets you perform a timeline event manually, which I'll need for my new project (or I'll have to construct my own timelines using scripts with switch statements...which can get messy depending on the move).

So in short; is it possible to manually trigger an event in a timeline?
 
L

LordWilliam1234

Guest
Not exactly, but you can move the timeline index to one frame before the desired event happens with timeline_position.
I thought about that, but it doesn't actually trigger the events in the timeline until just before the begin step event. Need to be able to activate the events manually in order to simulate multiple frames passing at once (for the aforementioned rollbacks).
 
R

renex

Guest
You can write game state to buffers every frame and use that as your rollback method.

Fighting games don't have as much relevant data going on during the fight as say anything that isn't a board game.

I also see you are looking at GGPO. You probably want to use something simpler.
 
L

LordWilliam1234

Guest
You can write game state to buffers every frame and use that as your rollback method.
Well that solves another question I had planned on asking later on.

I also see you are looking at GGPO. You probably want to use something simpler.
Either way I believe the handling of it involves replaying events with new input in order to get the correct current state, hence what I mentioned in the OP. Unless you had something else in mind?
 
R

renex

Guest
Unless you had something else in mind?
I generally think the rewinding and catching up method to be incredibly complex so I tend to experiment with input buffer timing instead, where you trade the lag from the remote player with the local player. Really easy to set up and depending on the situation it can have acceptable latency even for long distance play (I made a simple direct connection test once with a friend and we were only 300ms apart, even though we are on different americas).
 
L

LordWilliam1234

Guest
I generally think the rewinding and catching up method to be incredibly complex so I tend to experiment with input buffer timing instead, where you trade the lag from the remote player with the local player. Really easy to set up and depending on the situation it can have acceptable latency even for long distance play (I made a simple direct connection test once with a friend and we were only 300ms apart, even though we are on different americas).
Complexity I'm not worried about, I'm just looking for the best method for FG netcode, and rollback is it. Guarantees that your inputs register when you press them and keeps the online vs offline experience equal. And you can combine input delay with rollback so players can adjust their experience how they want (higher input delay for a smoother experience depending on their connection).

I don't have all of the implementation figured out, but rollback is what I want to go with. At the very least even if I can't get it working right at first I can have a base to implement it in later.
 

doq3q

Member
Hello guys,

sorry for bringing this old post up.

I'm currently collecting as many info as possible about implementing either a custom rollback netcode or GGPO in GMS, but i struggle to find usefull informations.

@LordWilliam1234 did you (or anyone else) manage to achieve this ? and if yes could you share some of the problem you had to face

(not talking about the timeline events issue here, sorry)

thank you :)
 
Top