Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 May 2011
Offline Last Active Dec 12 2012 07:22 PM

Topics I've Started

Client/Server logic on same machine, singleplayer as a local multiplayer

10 December 2012 - 04:55 AM


I've been doing a fair bit of research on the best approach for putting networking play into a game im working on, and I've read that many games today are developing their singleplayer gameplay just as a local hosted network game.

Does anyone have experience in this, or have any articles on the best approach for this?

I am conflicted with the idea of how to handle game logic for this, because if your "client" is running predictive logic that the server is master over (client predicts, server validates), then are you not leading to running the same logic checks twice on the same machine?

Is there a better way to look at this? A better way to separate or even merge the logic depending on the type of game you're playing (singleplayer or multiplayer) and keep the simple design of only having to develop one core part of the game that can be shared by both the single and multiplayer aspects?

An example of this would be:
  • Client moves, sends input to server.
  • Client hits a wall, has client logic to handle collisions.
  • Server handles the input and it too detects the collision, sends result back to client.
  • Client reads server response and if needed corrects.
And with this, there are two of collision handling checks.

I've love to hear other peoples experience of this sort of idea/problem and how they've gone about it.

Many thanks.

2D Collision Detection and Response

09 May 2011 - 03:25 AM

Hey guys,

I wondered if someone would be able to help point me in the right direction for working out collisions in a simple 2D engine I'm putting together.

I have a basic 2D tile grid, and tiles can either be on or off.

What I want to do is allow the user to drag tiles around freely and have them snap back to the grid on release.

But the issue I'm having is with multiple tile collisions, I wondered if someone could provide a pseudo explanation of how I should be calculating my collisions and responses?

At the moment I have in my game loop:
  • Update positions
  • Test for collision and reposition when colliding
Am I needing to separate my detection from my response?

And should I be accumulating my repositioning vectors and then applying them at the end?

Many thanks.