Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [GM6] Looking for some help/tutorials for online coding  (Read 1194 times)

0 Members and 1 Guest are viewing this topic.
[GM6] Looking for some help/tutorials for online...
« on: July 07, 2009, 10:53:37 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1082
I've recently decided that I really have got to finally learn how to setup online engines(in GameMaker) since I've been putting it off for years.

What made me really want to do it is the fact that I want to take my project One Occurrence online and have a two player co-op type game where you have to survive the zombie waves like in the solo Survival mode already featured in the game.

I've looked at a couple online engines and examples, but what I've gathered from it seems not to work right when put into practice. For example:
Player 1 sees player 2's bullets facing the correct direction, but with a speed of 0 and not moving.
Player 2 sees player 1's bullets facing the wrong direction, but with correct speed and moving. It's weird...
I blame it mostly on the poor documentation in the examples I looked at. lol

But yeah, if anyone knows any good online tutorials or examples I can look at, or are willing to help me out first hand, that'd be great. =)
I'll start from scratch and re-code the whole game engine if I have to just to get online working in my game.
Logged

Mamoruanime

@Mamoruanime
Re: [GM6] Looking for some help/tutorials for on...
« Reply #1 on: July 07, 2009, 11:07:42 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I'm not too positive on GM online, but I'm sure it's like any other online out there-

I can guess with the bullets not moving it's an issue with your position prediction and sync routines :s You need to make the game attempt to 'assume' where the bullet is going to go, and have the projectile update it's position for the other player. That's how I would imagine it should work anyway :s I could be horribly wrong.
Logged
Re: [GM6] Looking for some help/tutorials for on...
« Reply #2 on: July 07, 2009, 11:29:23 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1082
Wouldn't it just be easier to just have player 1's bullet create a bullet on player 2's screen that simply sends the information once of x,y,speed, and direction. That way once it gets started on a path it doesn't need to be updated constantly wasting sent data usage. Or is that basically what you're saying? lol
Logged

Mamoruanime

@Mamoruanime
Re: [GM6] Looking for some help/tutorials for on...
« Reply #3 on: July 07, 2009, 11:32:55 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
Yeah it's sorta the same, except by leaving it up to just the client machine to determine where the bullet ends up would cause some potentially major syncing issues I think.

The reason for this is that the bullet still needs to check enemy position on both machines, as well as player position and such. If the bullet's not updating its current position according to it's originating machine, it will never appear to properly collide with an enemy on the other players machine.

I could be horribly wrong (again), but I assume it's good to have the object update it's position online and compare it with the other one, and sync up. One of the hardest thing with online games is syncing :(

Of course, Infini will prolly pop in and say "stfu mammy ur dumb", and give you better advice than I can XD but I'd just remind him that he was wrong wrong wrong on ib4f's bandwidth/storage consumption ;p
« Last Edit: July 07, 2009, 11:36:12 am by Mamoruanime »
Logged
Re: [GM6] Looking for some help/tutorials for on...
« Reply #4 on: July 07, 2009, 12:17:47 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Well, I have no experience programming online for GM, but what read about it, it seems to be a B***TCH. And your better of making your game in XNA or C++. But how I would do it is, that each side has the same game logic and then only send key events to update the user input and let the game logic deal with it. But like Mammy said, you get trouble having both games run in sync. I would have the client side check and if needed update the position, speed and direction of dynamic objects. You can do this after a number of gamecycles have passed.
Logged
Re: [GM6] Looking for some help/tutorials for on...
« Reply #5 on: July 07, 2009, 02:42:19 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
I would advise you to consider creating and updating bullets on an entirely client-sided basis, the quantity of bullets usually on-screen make it infeasible to have them all in-sync, I don't actually know of any professional game that does this. Its usually a better idea for the shooting client to simply send a packet PLAYER_BEGIN_FIRE with their position, direction and any other relevant information then a PLAYER_FINISH_FIRE when they finish, its them up to each client to deal with spawning the actual bullets within their game.
Logged
Re: [GM6] Looking for some help/tutorials for on...
« Reply #6 on: July 07, 2009, 11:39:46 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1082
Yea Infini, that makes sense. haha Never thought of that, which is weird cuz it's clearly the way almost every current-gen online game does it.
Ok, so these ideas are all great, but I still need to take these theories and ideas and make them real. Thus, I need some GM6 example or engine to play with... Which was my main problem, cuz I fail at knowing anything about online coding yet. :/
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.019 seconds with 52 queries.

anything