saffeine
Member
i'm in the process of making a game with animations and frame data, but i plan on sending that over a network at some point down the line for a co-op mode ( only 2-4 players, nothing huge ).
it's not a fighting game per-se, it's a hack n slash, but obviously there's an overlap as far as hitboxes / hurtboxes / typical fighter data goes.
i've played around with networking before, but that was on smaller projects that didn't depend too much on whether or not the clients were delayed ( to an extent ), so i'm familiar enough with that i think.
i understand that networking runs best on a fixed timestep / operating on delta timing rather than relying solely on gamemaker's game speed and system performance to stay on beat.
currently i'm building it around a single function call that iterates through all appropriate systems and updates them as necessary, but what would be the best way to separate that from the fps / gamemaker's game speed?
i know i can use delta_time, divide it by 1,000,000 to get a factor to multiply other values by, such as movement speed, but what about all of the steps in between?
as far as i can figure, the best way to do it would probably be to track the game step and increment that by ( 1 * dt ), then run the game loop x amount of times, but i'd hate to commit to that just to find out it doesn't work later.
does anybody else have any experience with this, or can anyone confirm / deny that i have the right idea? are there any downsides to this approach i should be aware of? any major concerns that might pop up later?
update + alternative question: i'm realising that looping the game x amount of times according to delta is probably unnecessary, but i still don't really know how i would go about calculating hitboxes and such if i don't. normally i would probably consider just checking active hitboxes per frame and comparing them to a unit's bbox, but if there's a lag spike at any point while using delta time, how can i make sure a hitbox comes out at the same position consistently, at the correct time, between the last and current frame?
all feedback and suggestions are greatly appreciated, in the meantime, i'll be looking up more resources to try and learn from.
it's not a fighting game per-se, it's a hack n slash, but obviously there's an overlap as far as hitboxes / hurtboxes / typical fighter data goes.
i've played around with networking before, but that was on smaller projects that didn't depend too much on whether or not the clients were delayed ( to an extent ), so i'm familiar enough with that i think.
i understand that networking runs best on a fixed timestep / operating on delta timing rather than relying solely on gamemaker's game speed and system performance to stay on beat.
currently i'm building it around a single function call that iterates through all appropriate systems and updates them as necessary, but what would be the best way to separate that from the fps / gamemaker's game speed?
i know i can use delta_time, divide it by 1,000,000 to get a factor to multiply other values by, such as movement speed, but what about all of the steps in between?
as far as i can figure, the best way to do it would probably be to track the game step and increment that by ( 1 * dt ), then run the game loop x amount of times, but i'd hate to commit to that just to find out it doesn't work later.
does anybody else have any experience with this, or can anyone confirm / deny that i have the right idea? are there any downsides to this approach i should be aware of? any major concerns that might pop up later?
update + alternative question: i'm realising that looping the game x amount of times according to delta is probably unnecessary, but i still don't really know how i would go about calculating hitboxes and such if i don't. normally i would probably consider just checking active hitboxes per frame and comparing them to a unit's bbox, but if there's a lag spike at any point while using delta time, how can i make sure a hitbox comes out at the same position consistently, at the correct time, between the last and current frame?
all feedback and suggestions are greatly appreciated, in the meantime, i'll be looking up more resources to try and learn from.
Last edited: