Jump to content
  • Advertisement
Sign in to follow this  
staticVoid2

Networking and UI

This topic is 2440 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

I'm implementing a basic FPS game that uses the quake-3-style server-client delta encoded model for networking and was wondering if it would be overkill to emulate a client's UI interface on the server and just accept their raw mouse-keyboard input.

I realize that a clients UI does not generally affect the state of the world as much as say pressing the player move buttons but I'm just trying to come up with a clean interface for the networking that supports some UI interaction (i.e. inventory screens etc.).

I currently have a system where the user can define "entities" on the server that have shared variables with corresponding entities on the client which works pretty well but the problem is it's a one way system, the client only sends a very limited amount of data to the server at this stage (i.e. mouse state and keyboard state) so it's difficult to tell the server for e.g. if the client has switched weapons or even for things like a basic chat system.

I was thinking I could send 'reliable' packets to the server describing these state changes on the client for the server to then verify but I don't know if this is the most optimal solution or not. Any thoughts or ideas on this?

Share this post


Link to post
Share on other sites
Advertisement

Any thoughts or ideas on this?


Have you read the links in the FAQ yet?

UI is about what you show to a player.
Networking is about serialization and deserialization.

They are basically unrelated to each other.

Share this post


Link to post
Share on other sites

[quote name='staticVoid2' timestamp='1323710394' post='4893176']
Any thoughts or ideas on this?


Have you read the links in the FAQ yet?

UI is about what you show to a player.
Networking is about serialization and deserialization.

They are basically unrelated to each other.
[/quote]


What I mean is that in order for you to do all UI stuff on the client it means you have also have to implement game logic on the client, that was the point I was trying to make.

For e.g. if the player selects a weapon from a UI inventory screen then presumably a message will be sent to the server saying "player has selected this weapon" which falls under the category of game logic, whereas if you were to just update the mouse/keyboard input to the server it could work out what you are doing and send more general data to the client telling it to update its display.

I take if from you're response that you would normally just send those game-specific messages?

Share this post


Link to post
Share on other sites

[quote name='frob' timestamp='1323713293' post='4893193']
[quote name='staticVoid2' timestamp='1323710394' post='4893176']
Any thoughts or ideas on this?


Have you read the links in the FAQ yet?

UI is about what you show to a player.
Networking is about serialization and deserialization.

They are basically unrelated to each other.
[/quote]


What I mean is that in order for you to do all UI stuff on the client it means you have also have to implement game logic on the client, that was the point I was trying to make.

For e.g. if the player selects a weapon from a UI inventory screen then presumably a message will be sent to the server saying "player has selected this weapon" which falls under the category of game logic, whereas if you were to just update the mouse/keyboard input to the server it could work out what you are doing and send more general data to the client telling it to update its display.

I take if from you're response that you would normally just send those game-specific messages?
[/quote]

Either way you're going to have to serialize data and I wouldn't want to burden the server with extra logic. If the server runs the logic it still needs to update the client, meaning you'll have to serialize the data on the server and de-serialize it on the client instead of the other way around. I wouldn't recommend it.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!