Jump to content

How do YOU design netcode & client server structures?

Guest

Tl;dr

How do you design how your netcode will work and what will be processed where? 

 

What methods do you use? 

 

Long:

I'm designing a software video game that will use a client server model. I know where I want stuff but since I'm using sockets, I'm basically writing all the protocols and whatnot myself for the sake of learning what it's like. I also want a good way to lay it out so it doesn't become too difficult to read when I need to reference it later. 

 

(Also I'm not sure of what alternative to use and believe I need more direct access for some of the program's features)

 

I wrote out and made diagrams of what the program will look like and how it should appear to the end user with one note. 

 

"When you go into this menu, these buttons show and this is what happens when you press this button."

 

I learned about activity diagrams in some of my software design classes, but I'm not sure how to design a network like I'm doing. I'm hoping to learn more about doing that by.... Doing it. 

 

If you guys use a program, what do you use? I heard about visio or something from Microsoft. It looks like an industry standard, but it's also pretty general in use so may not be as good for the task at hand as a dedicated software. 

 

For the time being I have some free uml programs i found on source forge. 

Link to comment
Share on other sites

Link to post
Share on other sites

Soft dev is not my area of expertise but i would query the following:

What is the nature of the the network connection?

Do you wish to make queries to a database? Like a quiz or a match making system? 
If so SQL manager i think is the most widely used software and there lots of resources out there about how to make queries to an SQL ect

I use Visio for making  network diagrames, work flows and step by step guides and ive been involved in work where its been used for project management. Sadly its not included in most standard O365 subscription making it abit of a premium. 

I found this list of alternative but cant say i used them (and sounds like you might alreadyxD ) : https://www.maketecheasier.com/5-best-free-alternatives-to-microsoft-visio/

 

Link to comment
Share on other sites

Link to post
Share on other sites

I'd say it depends on how thoroughly you want to flesh out your ideas before you go into actually implementing them. At work, most of our specs are Markdown documents with some Balsamiq, Draw.io and Websequencdiagrams thrown in if visualization is needed.

 

Start with a coarse idea: What is the game about, what are the players objectives. Then work on fleshing things out in more detail. Ideally this will help you figure out possible issues and inconsistencies before you waste time going into too much detail. Once you have a good idea of the parts you need and which way they're going to interact you can then think about how to implement it and which technologies to use.

 

4 hours ago, fpo said:

How do you design how your netcode will work and what will be processed where?

As a general rule of thumb, any type of logic and validation is server side. Anything that is graphical in nature is on the client side. Some validation is duplicated on the client side for convenience (i.e. the client can immediately tell you that a value is invalid, before having to communicate with the server).

 

So e.g. for a game, the client is responsible for rendering how a projectile travels, showing the projectile hitting the enemy and so on. But ultimately it is the server that determines whether this was actually a hit and how much damage it did.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

A good starting point

 

Networking in C++ Part #1: MMO Client/Server, ASIO & Framework Basics

 

 

Networking in C++ Part #2: MMO Client/Server, ASIO, Sockets & Connections

 

Networking in C++ Part #3: MMO Client/Server Framework, Tweaks & Client Validation

 

Link to comment
Share on other sites

Link to post
Share on other sites

RobinD

Spoiler
21 hours ago, RobinD said:

What is the nature of the the network connection?
If so SQL manager i think is the most widely used software and there lots of resources out there about how to make queries to an SQL ect
I use Visio for making  network diagrames, work flows and step by step guides and ive been involved in work where its been used for project management.

Thanks! So visio is really the general way to go unless I'm doing database stuff in your experience.

If you're interested, I've been using Violet UML & NClass. Surface level easy to use programs.

 

EigenVektor

Spoiler
17 hours ago, Eigenvektor said:

I'd say it depends on how thoroughly you want to flesh out your ideas before you go into actually implementing them.

I'm mostly doing it for motivation. I have no funding atm & no associates so it's difficult to stay determined. I've found planning stuff really helps me stay focused.

17 hours ago, Eigenvektor said:

Start with a coarse idea: What is the game about,

~snip~

I have the entire game fleshed out & have done network programming for games before.

I do appreciate your explanation of how a networked program works though. I'm really having trouble in planning network protocols and whatnot.

I suppose going back to basics like that may be a good strategy.

 

Zhnu

Spoiler
5 hours ago, zhnu said:

You can use DIA for diagrams but yeah visio is preferred.

Netcode depends on the type of game and on the engine you're going to run it on. For example fighting games use a very different logic that from FPS, there're already some solutions out there I would not try to reinvent the wheel.

My game is more like a program than a game. I already decided on using basic sockets as the network api.

5 hours ago, zhnu said:

That you may want to google "user stories".

That's a cool concept. Unfortunately all of that stuff is fleshed out.
I will use that in the future though. Thanks!

 

Mariushm

Spoiler
4 hours ago, mariushm said:

A good starting point

I have programmed network stuff before. I've seen a few of his videos & like his explanations of stuff.

 

I'm working on a different project so was looking for strategies to plan my network protocols & stuff. I guess some of that stuff would help, but I'm not going to use ASIO as I'm using C# and sockets since that's something I know & works very similarly to ASIO.

 

I've seen most of the first video & recall ASIO as it's used in Audio DAW software as well.

 

Thanks for the information though!

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

31 minutes ago, zhnu said:

Basic sockets it's a way of communicating not the topology. That's why I mentioned the type of game because there are some good middlewares out there that do a lot of the heavy lifting for you.

One of the reasons I'm using sockets is because I will want to make a web browser version & interface with future stuff allowing a generic web browser to interact with the servers later.

 

sticking with one technology that is basically universal.

 

edit:
No matter the technology i use... I still need to plan it.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×