Results 1 to 7 of 7

Thread: Chessgame?!

  1. #1

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Posts
    61

    Chessgame?!

    ChessGame.Questions.Part1.ShowDialog


    hello,

    I'm writing a client/server chess game application ( of course 2clients play against eachother), i'm finished with the parts that have to do with chess, its working fine , but i had some big architectural questions, i'm new to programming so i have no idea what to do.

    The clients connect to the server using TCPCLIENT, so here are my first set of questions

    Proccessing:
    Should i put the main proccessing on the
    client side app, and just use the server to transform
    data and keep state? how do they usualy do it? like
    for example in yahoo!games
    DataTransoformation:
    1)If the proccesing is done on the client, the data
    transformed each time is just going to be 2numbers
    (initial and final position of the move )

    2) if the proccessing is done on the server(as it is
    now) :
    the server before each move, gets all the boxes
    that can be moved in the next turn , and where they
    can be moved, how do you guys suggest for
    transfering the data to the client? ( this info is
    stored in a dataset on the server, for each game)

    *** I'm trying to make the game work like Yahoo!Chess Game, its a multitable game, and clients can play or watch others playing, know i'm still working on vb applications, and dont know anything about web development, but later i want to put the game up on the internet, so while answering my questions, please have that in mind, thanks allot


    ChessGame.Questions.Part1.Close

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    The server should only take the data from a client and pass it around to the other clients. The client should be the only thing processing that data. The only real processing the server needs to do is to determine who should be getting the data.

    Like client1 makes a move. Your client app sends a chunk of data that may be something like

    "BlackPawn1:A5"

    Server gets that, determines who the other player is, then sends that exact same data to the c lient. then the client can parse that out and know to redraw the chess board by placing BlackPawn1 into square A5.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Depends on how efficient your code is, internet connection speed, and clients computer speed. Ther is no simple answer to that question. You can process and redraw the chess board in the blink of an eye. But you still are constrained to the possiblty of slwoer internet connections making one client wait for the other.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Posts
    61
    okay, so now that the server is gonna pass around the data, what do you think is gonna be the fastest way to save and retrive the state of the clients on the serever? database, xml ?

    the for thing that is going to be saved for each connection is ,
    *ID
    *Connection Object(each user has his object, to send and receive
    * Table ID (integer)
    * Stat in table (3choices, White, Black,View)

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    just use collections. You can keep track of what socket each player is on, his username, ip address, a unique number that signifies what chess game he is in, or anything else you may need. When the server recieves data from soemone in chessgaem '3' for example, you can loop the collection looking for connected player that are also in chessgame '3', then send the data to only them. This is what I did in a chat application I wrote in VB6. I used collections to keep track of who joined what chat room, so that when someone was in chat room 'A', their chat text wouldnt go to other users in different chat rooms. Only to those in room 'A'.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Posts
    61
    what kind of collection should i use? i just know about the hash table which only has 2 columns, pleaze tell me the collection that suites this program , so i can go read about it
    thanks,

  7. #7
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    hash table. You make a class that holds the different properties you need to store. The use the class as the object for the hash table.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width