• Advertisement
Sign in to follow this  

The hardware and server

This topic is 869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,now that we got that out of the way here's the problem:I want to make a multiplayer game,fair enough,II did my researching (documentation),now I am about to make a educated guess using the things I think I know so don't tare me into shreds for not being right,pls. So,from what I see the player needs to request a action from the server to be able to achieve that action,right?There are a lot of tutorials out there that teach you about making a single player game but can you use that code and attach the networking component to it in order to make it functional online?Or do you have to use a code that is created for multiplayer?

Share this post


Link to post
Share on other sites
Advertisement
that strongly depends on the genre. some card game could get multiplayer at a later stage, rts should run like multiplayer internally even if it's just a singletree game ;)

Share this post


Link to post
Share on other sites
Adding multiplayer after the fact is exceedingly difficult.

It's far, far, far easier to go the other way and add a singleplayer mode to a multiplayer game. Many games intended for both are built that way outright, in fact, and the singleplayer mode just embeds the server logic into the main game loop or runs it in parallel on another thread.

The reason for this - even with a TCG - is more about keeping your design "honest." In a purely singleplayer game you can structure your code in lots of ways that isn't amenable to multiplayer. Coding for multiplayer up front explicitly ensures that everything you write is going to work for a client-server game.

Yes, you would structure a game like a TCG with a basic request-response pattern for performing actions. Anything that affects the game must be a request to the server, esp. if your game plans to be competitive or focus on collectability. The basic flow involves clicking some card/button, sending a request to the server, letting the server calculate the result, and then getting a response indicating what happens. This is complicated by the need to play animations and keep the gaming feeling smooth and responsive even though the request/response may take a significant fraction of a second (esp. in a card game where the full response may in fact require waiting on the enemy player/AI to make a choice).

Share this post


Link to post
Share on other sites

So Ipif I make something like team fortress 2 I can't use the things that I see in a single player game?
For example selecting a weapon?

 

No, that is not the case.  While I won't restate the information from the other posts above me, what it summarizes to is that you can do these types of things; i.e., weapon selecting, but you need to account for it in a networked environment.  In a single player game it is enough to say, 'we picked up a weapon, change out the current one, update what needs to be updated, etc.'  In a multiplayer game, not only do you have to do all of that, but you also need to send information to the server so that all other clients connected to the server can update their logic as well.  This way, if you are one of multiple clients connected to a server and you change out your weapon, all of the other clients can reflect your weapon change on their end.

Edited by ByteTroll

Share this post


Link to post
Share on other sites

So Ipif I make something like team fortress 2 I can't use the things that I see in a single player game?
For example selecting a weapon?

 
No, that is not the case.  While I won't restate the information from the other posts above me, what it summarizes to is that you can do these types of things; i.e., weapon selecting, but you need to account for it in a networked environment.  In a single player game it is enough to say, 'we picked up a weapon, change out the current one, update what needs to be updated, etc.'  In a multiplayer game, not only do you have to do all of that, but you also need to send information to the server so that all other clients connected to the server can update their logic as well.  This way, if you are one of multiple clients connected to a server and you change out your weapon, all of the other clients can reflect your weapon change on their end.

So cold I let's say look at a tutorial that shows me how to change the weapon in single player and then add the networking onto the single player code or do I need to write in code that applies only to multiplayer?(please have patience)

Share this post


Link to post
Share on other sites

So Ipif I make something like team fortress 2 I can't use the things that I see in a single player game?
For example selecting a weapon?

 
No, that is not the case.  While I won't restate the information from the other posts above me, what it summarizes to is that you can do these types of things; i.e., weapon selecting, but you need to account for it in a networked environment.  In a single player game it is enough to say, 'we picked up a weapon, change out the current one, update what needs to be updated, etc.'  In a multiplayer game, not only do you have to do all of that, but you also need to send information to the server so that all other clients connected to the server can update their logic as well.  This way, if you are one of multiple clients connected to a server and you change out your weapon, all of the other clients can reflect your weapon change on their end.

So cold I let's say look at a tutorial that shows me how to change the weapon in single player and then add the networking onto the single player code or do I need to write in code that applies only to multiplayer?(please have patience)


Ou,OK So I can write in the code that applies to single player but now I need to build upon it by doing the networking needed.That makes sence

Share this post


Link to post
Share on other sites

If you have not worked on any game projects I would recommend something very simple to start with.

 

Recently I created a trading card game prototype using Unity, and this prototype uses peer-to-peer networking.  A card game is fairly straight forward, be able to move cards, interact with some interface elements using the mouse, nothing too complex.  However had I not considered needing to send "events" and "messages" to a peer when thinking up my architecture, networking would have been a disaster. 

 

Even for this simple card game, more complex issues needed to be considered.  Issues like, how do I send complex objects over the wire so they can be "reassembled" and used by the peer?  Learning how to use the underlying API, be it Unity or native Windows or whatever, is maybe half the battle here (probably less than).  Creating an architecture that can use that API successfully is a challenge that really depends on "what you are doing".

 

If you have never written a game in your life, then consider taking that on first, something like Pong.  Understand what it takes to get a game going locally before you tackle networking, at least that's how I've gone about it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement