Sandscape - WTactics browser game

Browser based open source cross platform solution for easily playing customizable card games online vs other players. Lead dev: knitter
Knitter
developer
Posts: 87
Joined: Mon Jan 17, 2011 11:26
Location: Leiria, Portugal
Contact:

Re: Sandscape - WTactics browser game

Post by Knitter » Wed Oct 19, 2011 11:50

xarn wrote: - In case http requests are used, rather than encoding the information in the URLs, I prefer to use just a single (or a few) URL(s) and put the information about the action into its POST data
You can clone the repository and see what is being done, requests send their info using POST whenever AJAX is used and GET when the request is being made with a link anchor. There, as far as the game controller class is concern, the game uses only POST.
xarn wrote:Is this clearer?
Yes, thank you :D

I'll see what I can do about listing tasks, the docs are not update :(
Rejoice! For very bad things are about to happen.
Knitter
developer
Posts: 87
Joined: Mon Jan 17, 2011 11:26
Location: Leiria, Portugal
Contact:

Re: Sandscape - WTactics browser game

Post by Knitter » Wed Oct 19, 2011 14:40

I just remembered that an easy way to get started with code is work on some more trivial tasks, things that could be added:

- Token management, tokens are small imagens that can be added to a card and that mark the card as having a special state, token management needs to allow admins to add new tokens (name, small description, image upload). There is already an image manipulation extension in place but it's not being used;
- Proper game detection and creation/joining/watching in lobby section, the lobby has only a few placeholder informations, there are no actions to create games from the lobby, join existing games as either a player or a spectator;
- In the game board: chat messages and full card view, the full card view is intended to show the card's larger image, its rules and its state (tokens, marker, etc) when a card is selected;

These small taks would allow you to get to know the code and the framework, the very small database and a bit of jQuery in the last one.

As for coding standards, I follow Java Code Conventions published by Sun Microsystems, meaning the use of camelCase, opening curly braces inline with the function name or code block. These conventions extend to any SQL that is created, at least the camelCase ones.

The wiki has a list of technologies being used, you can use any editor you like as long as it properly supports UTF8 and UNIX line endings... any questions, just ask in this topic or create a new one.

I'm currently bringing the prototype server code to the current version.
Rejoice! For very bad things are about to happen.
User avatar
xarn
Posts: 101
Joined: Thu Oct 13, 2011 11:50

Re: Sandscape - WTactics browser game

Post by xarn » Fri Oct 21, 2011 10:02

I'll probably have a little time this WE ...see you soon
User avatar
xarn
Posts: 101
Joined: Thu Oct 13, 2011 11:50

Re: Sandscape - WTactics browser game

Post by xarn » Sat Oct 22, 2011 15:21

Yohoho! It's me again! ;)

Basically, I've not the slightest idea how this is meant to work, especially about the networking.

So, let's say player A moves a card. How exactly will player B be notified of this?
I understand that you can call an URL when player A makes an action to notify the server ...but how will the server notify player B? Do you plan to make some continuous polling of the server to check if there were changes?
Knitter
developer
Posts: 87
Joined: Mon Jan 17, 2011 11:26
Location: Leiria, Portugal
Contact:

Re: Sandscape - WTactics browser game

Post by Knitter » Sat Oct 22, 2011 16:36

xarn wrote: Basically, I've not the slightest idea how this is meant to work, especially about the networking.
It works the same way as any other website (web application) does and the way browsers work, using a stateless protocol. Servers and clients are only connected for the time it takes to transfer information and then they forget about one another.
xarn wrote: So, let's say player A moves a card. How exactly will player B be notified of this?
I understand that you can call an URL when player A makes an action to notify the server ...but how will the server notify player B?
A web server never, ever, notifies a client. It is the client that, from time to time, asks for more data and it's always the client that starts the connection, the server doesn't even know that clients exist.

So in the scenario you mentioned would go, roughly like the following:
1) player A moves the card and when finished tells the server where the new card position is;
2) the server updates its game state to place the card in another position;
3) when player B requests updates, the server sends all the updates that were made after the last update call;
4) player B's browser updates its interface to reflect any received change;
xarn wrote: Do you plan to make some continuous polling of the server to check if there were changes?
That's the all ideia behind AJAX :), not the continuous part, but being able to request information to the server without reloading the all page. The clients will just have a function executed every few seconds that will ask the server for game state updates.

Again, this is the basis for HTTP communication and the way browsers and web servers work.
Rejoice! For very bad things are about to happen.
User avatar
xarn
Posts: 101
Joined: Thu Oct 13, 2011 11:50

Re: Sandscape - WTactics browser game

Post by xarn » Sat Oct 22, 2011 17:47

Yeah, I took a look at the websockets, which would enable exactly that since it's for 2 way communication.
However, I got more annoyed than anything else. The websocket handshake seems to be revised several times per year, resulting in a lot of temporary or broken implementations on the net. ...what a shame. I hoped it would be a little more mature but it's really bleeding-edge. :cry: :evil:
Post Reply