Network play to me is really hard to program. I'll explain my design for now, and if anyone would like to comment, please do. I need help on this... even if just the implementation.

If I ever want to make money out of this... I'll need to have a really spiffy server going, and basically create a "single user" server (run one game on it) and a multi user server, that can organise a whole tournament, with timeouts, player assignments, breaks, reports on the "meta game" etc. I can envision truly huge amounts of work and beautiful things there... And then sell this... dunno if I'll sell the application itself... that just sucks, but maybe ask a fee per player per tournament... something like $0.01 per player per tournament, payable everytime it gets to $100.

A nyway... Back to the network program... Server driven it will have to be... You'll not be able to do anything (including moving a card) before "asking" the server first.

So you click to draw a card... the client (DA) "asks" the server can you draw a card. The server will then answer "Yes: Card ='Wrath of God'" or "No" or "No more cards, you lose". (Though the server won't do anything once you've lost... for a tournament both players will need to "sign" the result slip.)

The same for moving the card... and here's why... what if your opponent moved the card too? The server will then decide (first come first serve) to move the card. Admittedly though you'll only be able to move the card while you're the owner, but still, you'll be asking first, and then receiving the movement back, and only then will your card move.

For this to work, you'll need a "local" card which is basically a new card created as you start to move your current card, and then as you lift your mouse, it requests the server to move the card... if the opponent hasn't moved it, the card then jumps (on both players' screens) to the new place. Hopefully connection speed won't be an issue.

So what's next... well, I guess to create a test application of where you move click and move and object, (locally) which will then ask permission to move another object. 3 Objects total... (actually 5) 1+1 local, 1 server, 1+1 opponent. So 1 is a representation of the server position, and the other one is your "request" object. Maybe I can create a small two player game doing this excersize.

1 comments:

I don't know how slow this would be...

But if people can play quake or counterstrike, then it can't be that slow.

But I think we actually need a drawing board... or just a drawing :)

July 3, 2008 at 10:31 PM  

Newer Post Older Post Home

Blogger Template by Blogcrowds.