[quote]In the minds of embittered pro games devs (taken from a GDC roundtable, and heartily agreed with by all present)
“Always - without exception - put the client and server [send and receive] code as near to each other as possible…this means in the same class, preferably in the same method, and if at all possible each taking no more than 0.5 screens to display so you can see both simultaneously whilst developing, debugging, maintaining and extending”.
[/quote]
uhmm, ok, oh god, uhmm, well, ok…hmmmm
ok, here is why I asked the question. I have created the following classes:
Sprite
ImageSprite
SpaceObject
StarShip
SpaceStation
Planet
Moon
ShipComponent
ShipWeapon
ShipEngine
ShipHold
ShipCore
ShipShield
Player
GT6 (main app with fullscreen rendering)
Sector (Collection of SpaceObjects for display if within screen space)
GameConstants
ok, now…
GT6 takes player movement and adjust the offsets for all SpaceObjects in the Sector(excpet the players StarShip) then renders them thru sector.render().
For testing purposes, GT6 creates a Player, the player creates a StarShip and GT6 calls
player.render() which paints the players StarShip in the center of the screen. It is this StarShip that can have the ShipComponents. I was going to have 2-3 StartShip creation methods, one for the player and one for the other players taht will be in the Sector collection which will only have location data, ship image data, and player name/id. (Logical?)
I think I understand your comments on having the send and receive code all in one place. (though doesn’t this require taht you send your server and client out to clients, or jar it leaving out the server folder?)
Before I even get to the communication classes, I couldn’t decide whether to have a StarShip class in the server area that was slightly different from the StarShip class in the client area. Or use one with 2-3 different creation methods depending on whether its a server object, client object or other player in this clients sector.
doh!
I guess what I am trying to get at is should I have classes for the client that only really need painting capabilities. i.e location x and y, what image, id, and handle key activity for interaction, then the server side version that will be data driven, calcs, results, etc…