trading card game skill system

Started by
15 comments, last by goowik 11 years, 9 months ago
You should probably iterate through cards in play to see if any of them have this ability when more energy is added to the pool. That is if these are passive abilities. If these are activated ones where you pay with the pool, then that is more of an event and would be based on the player choosing to activate it.
Advertisement
I'm sure if you got my question :)

I don't have problems with using the skills now, but I need help saving them.
As stated I have a partial solution using xml... But I'm not sure about it's safety (where members might be able to modify em).

Regards
Let the server hold the dominate data. Should they play an ability, regardless of how you have it saved (XML could work), check on the server to see if they had that card in play and could play it. Then allow the move to be made.
k thx, so I checked around a bit on how files are manipulated on a server.
But I seem to only find chat servers in java.

Are there specific terms I should be looking for?
The thing is server side code isn't really affected by the client. The client sends requests for data (and can get/post data) to the server, but the server's code remains it's own. You program it to decide what to use and what not to use. Look up server scripting. That may help.

What I am saying is the server's code is what should be in control. If someone sent data saying they have this really powerful card, but the server knows they do not have it/do not have it in play, it can be the judge and deem that action null and void.
@Dragonsoulj: thanks, now Googeling time :)
You are welcome. After scouring the forums for the article I was thinking would help you and turning up empty, I think I will put it like this:

If someone wished to cheat and you ran most of the game code on the client side (player side), they could modify what gets sent to the server and gain an advantage. If most of the game code is run on the server (and the deciding factors about valid moves are made there), then you maintain the control. Depending on the size of your project, it may be best to only let the client choose actions (based on data you send them, ie cards in hand, cards in play, possibly a life total, etc) and then process them on the server (check for that validity, run the functions that take care of what happens, such as card A damages card B, player draws a card, and so on). If I am not mistaken, you should be able to use Java to handle both sides of the game, since Java does have server capabilities.

This link looks promising: link to get you mildly started.

Since the server would be sending out that XML file you mentioned, it could retain that data and should the client send back data that doesn't match up with that file's contents, you could do anything from send a message calling them a cheater (hilarious but not advised) to just stating an error has occurred and the client needs to reconnect.

As for your googling terms and such, "Java Server Pages" may help. I haven't done much Java programming (only had a class of it), so I'm not fully sure of decent resources to direct you to. Since you seem okay with writing the client side of things, your server code shouldn't look much different. You won't have to have any graphics or visual output since it is sending information. I'm not sure how you will handle games (holding the data while a game is in play), but using a database and having the Java code on the server access it may be the best.

I think your data flow would look something like this:
Client Java requests game data -> Server Java requests current state from DB -> DB sends data requested -> Server Java processes what's going on and sends data -> Client Java displays current state and lets player make decisions -> Server Java processes decisions -> DB is updated -> Server Java sends new current state to Client Java.......until the game ends
Amazing! Thanks for the help :)

Can't wait to start coding. I shall create another topic when everything is done (code-wise)
As graphically it might take me a loooong long time.

This topic is closed to new replies.

Advertisement