Tag Info

Hot answers tagged

5

As others have said, the first step is separating logic that's shared from logic that's not. While it's great to draw that line wherever it's clear, your addendum illustrates that sometimes you don't have a clean line to split the code down. So, how do we solve cases where the client and server want to do semantically the same thing (play a sound), but take ...


2

Extract any shared code to a library which you maintain separately. Then implement your client and server as a separate applications which implement anything specific themselves and reference the library for any shared functionality.


1

Skew happens. This is a clock synchronization problem. Two nodes on a network can't know for sure what each other's clocks are. You can send the current time, but the receiver can't know for sure how old that value is. A good guess, though, is that it's stale by half the ping time. See http://en.wikipedia.org/wiki/Round-trip_delay_time. One approach then, ...


1

The cleanest way is to create a "core" project that includes shared game code. You can use either interfaces or abstract classes to prepare your game code there and use inheritance [1] to extend/implement these classes in either the server or client side. That way you do not need any if statements to distinguish between client and server code. You should ...


1

I think that no matter what strategy you plan to use, you need to consider methods like: KISS (Keep It Simple Stupid) DRY (Don't repeat your self) Read books like: Clean code Simple non repeated code tends to run clean and smooth, use alot of benchmark tests Divide the system's node value with 20 and set a max time for execution, eg. first node max ...



Only top voted, non community-wiki answers of a minimum length are eligible