Jump to content

  • Log In with Google      Sign In   
  • Create Account


Networking A Game


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 !Null   Members   -  Reputation: 380

Like
0Likes
Like

Posted 27 November 2012 - 11:46 AM

Okay so I'm taking this courses while I'm abroad and our final big project is to build a game (which is fine) and network it.

The latter is my concern. We had a lecture / lab on building a echo server in C which i got most of I guess. But now I'm not sure how I'm suppose to mold this to help me network my game.

The game is developed using a scripting language developed by the college (which has heavy hints of C++).

I'm not looking for you guys to 'do my homework for me' I'd just appreciate some step in the right direction.

If you need to know anything just let me know.

Edited by !Null, 27 November 2012 - 12:00 PM.

/********************************************************************************\
/**********************He Who Dares, Wins**********************************\
/********************************************************************************\

Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 11696

Like
1Likes
Like

Posted 27 November 2012 - 11:52 AM

What genre is your game? Networking a chess game is very different than networking a FPS.

#3 !Null   Members   -  Reputation: 380

Like
0Likes
Like

Posted 27 November 2012 - 11:54 AM

It's an FPS
/********************************************************************************\
/**********************He Who Dares, Wins**********************************\
/********************************************************************************\

#4 J. Evola's Apprentice   Members   -  Reputation: 307

Like
2Likes
Like

Posted 27 November 2012 - 01:20 PM

Take a look at: http://gafferongames.com/networking-for-game-programmers/

#5 BeerNutts   Crossbones+   -  Reputation: 2509

Like
0Likes
Like

Posted 27 November 2012 - 02:12 PM

It's an FPS


Wait a second. From a one lecture that teaches you an Echo Server, you're supposed to know how to program an FPS networked game? I think something is missing here. Is it just a 2 player game or a true multiplayer (ie, 2 - 16)?

FWIW, creating a truly robust FPS Networked game is PRETTY FRIGGING HARD. Now, you can create a protocol that runs good over LAN, but would do poorly over the internet that's not too difficult (not too difficult for someone who understand networking protocols at least).

BTW, there's a networking forum here that has loads of information that you may want to look over all the posts there.
My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#6 !Null   Members   -  Reputation: 380

Like
0Likes
Like

Posted 27 November 2012 - 02:18 PM


It's an FPS


Wait a second. From a one lecture that teaches you an Echo Server, you're supposed to know how to program an FPS networked game? I think something is missing here. Is it just a 2 player game or a true multiplayer (ie, 2 - 16)?

FWIW, creating a truly robust FPS Networked game is PRETTY FRIGGING HARD. Now, you can create a protocol that runs good over LAN, but would do poorly over the internet that's not too difficult (not too difficult for someone who understand networking protocols at least).

BTW, there's a networking forum here that has loads of information that you may want to look over all the posts there.


yep you got it right.

We haven't been given the exact spec yet but i get the impression that a 1v1 would be enough but even if you got a 1v1 going it would be just as 'easy' to get more players going.

If i could get it working over LAN that would at least be a step. I do know a little about networking but if I'mhonest I don't really like doing it from a programmatic stand point.

I've been looking through some of the functions and stumbled through some networking functions

NetAcceptTCP();
NetClose();
NetConnectTCP();
NetCreateChannel();
NetCreateChannelTCP();
NetDataReady();
NetGetIP();
NetReceiveFrom();
NetReceiveFromTCP();
NetSendTo();
NetSendToTCP();
NetSetMulticastIP();
NetVarReceiveFrom();
NetVarReceiveFromTCP();
NetVarSendTo();
NetVarSendToTCP();


Also thanks I might move the post over. And i'll have a look a look through there too.
/********************************************************************************\
/**********************He Who Dares, Wins**********************************\
/********************************************************************************\

#7 BeerNutts   Crossbones+   -  Reputation: 2509

Like
0Likes
Like

Posted 27 November 2012 - 03:31 PM

We haven't been given the exact spec yet but i get the impression that a 1v1 would be enough but even if you got a 1v1 going it would be just as 'easy' to get more players going.


That's not really true at all. If you know you're making a 2 player game (1v1), then you wouldn't (or at least I wouldn't) waste time on making it client server, you should just make it peer-to-peer.

If it were me, and for a school project (with a strict deadline), I'd design the 1v1 FPS game like this:
Every update sent will include the players position and velocity. If nothing substantial happens (player is just moving), then you send an update every x milliseconds (say 100 mS) to the remote player.
The Clients sends immediate updates for actions (Bullet Fired, item picked-up, bullet hit).
So, when one client gets an update from the other player, he ensures the player is where he's supposed to be, and gives him his current velocity. If a special action occurs, like bullet fired, he puts the bullet into his local world and starts to move it.

All bullet hits happen locally (so, if the local player see it hit himself, it happens, but if the local player see the bullet hit the remote player, it may not, if that remote player has actually moved on his local machine).

Anyway, that's the general idea I'd start with since it's fairly simple and shouldn't be too difficult to implement in a short amount of time. Of course, there are tons of other ways you could do this, and mine may not even be the bets for this situation, but just one I thought of.

Good luck.
My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#8 Goran Milovanovic   Members   -  Reputation: 1107

Like
1Likes
Like

Posted 28 November 2012 - 12:41 PM

That's not really true at all. If you know you're making a 2 player game (1v1), then you wouldn't (or at least I wouldn't) waste time on making it client server, you should just make it peer-to-peer.


You say that as if making it "peer-to-peer" would be easier than establishing a client-server model. In my experience, it's the other way around; If you run the game on the server, and treat clients as dumb input/output terminals, you greatly simplify the architecture of the network system, and there's a whole class of problems that you don't have to worry about (like cheating, or overly ridiculous sync issues).

@!Null

I have a video tutorial that demonstrates how one could design and implement a relatively simple networking system:



I'm doing this within the blender game engine, using python, but the concepts are the same no matter what languages/platforms you use.

Hope that helps

+---------------------------------------------------------------------+

| Need a programmer?        ->   http://www.nilunder.com/protoblend   |

| Want to become one?       ->   http://www.nilunder.com/tutoring     |
| Game Dev video tutorials  ->   http://www.youtube.com/goranmilovano |
+---------------------------------------------------------------------+

#9 BeerNutts   Crossbones+   -  Reputation: 2509

Like
0Likes
Like

Posted 28 November 2012 - 12:55 PM

You say that as if making it "peer-to-peer" would be easier than establishing a client-server model. In my experience, it's the other way around; If you run the game on the server, and treat clients as dumb input/output terminals, you greatly simplify the architecture of the network system, and there's a whole class of problems that you don't have to worry about (like cheating, or overly ridiculous sync issues).


In my experience (having done both), I think it is easier to do p2p for 1v1 games, but that may not be the case with everyone. Hopefully, by the time the OP has to start developing it, he'll have a grasp on doing either method and can choose which he wants. BTW, I don't think he's going to be concerned with cheating for a class project.

I'll have to check out your video, it looks interesting, thanks!
My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#10 !Null   Members   -  Reputation: 380

Like
0Likes
Like

Posted 29 November 2012 - 11:54 AM

Thanks guys for all the support. I'll continue to try to make this work and when I'm done i'll post the result (after its submitted otherwise It wont get marked at all)

Goran Milovanovic
Thanks I'll have a look at it :)
/********************************************************************************\
/**********************He Who Dares, Wins**********************************\
/********************************************************************************\

#11 BCullis   Crossbones+   -  Reputation: 1813

Like
0Likes
Like

Posted 29 November 2012 - 12:15 PM

I've been looking through some of the functions and stumbled through some networking functions

(list of functions)


I think there's a big assumption being overlooked here: they're using an academic-proprietary scripting language. That may well remove a lot of the complexity of the task depending on how the script-hooked methods are designed.
Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS