This is the first game I have developed. Please correct me if I'm mistaken.
I want to build an online 2-player turn based card game (Shithead). I want to code it in Java as that is what I have most experience in.
From my research, I've gathered that for turn based card games a TCP connection is best (reliability over the need for constant packets). I plan to have a single Java game server that will be able to host multiple concurrent games using sockets to pair clients together in an events-based manor. I've read that it makes most sense to have the game state on the server in order to protect against cheating etc.
- Client1 (C1) sends move to server.
- Server validates move. If valid - Server sends updated game state (with certain information hidden such as opponents hand) to clients & tells C1 to wait for C2 and for C2 to make a move.
- C2 sends move to server. Repeat.
Does my plan sound sensible? I don't want to start going down this route if I've miss-understood something.
A problem I am having is knowing which java frameworks (if any? SpringBoot?) to use to achieve this. Could anyone recommend any to me?
I was planning on making the client browser-based but after some thought I think I would prefer to make a desktop client. I plan to make a Java client that uses the JavaFX GUI library that the user interacts with by clicking on cards to perform certain actions - would I be able to embed this in a webpage if I changed my mind? Would it take a lot of work?
At this point I don't want to put too much time into making a fancy GUI (by using a more sophisticated game engine) as I'd rather focus on making a mini-max AI player (and given I have time, a neural network AI to learn from playing tons of games against the mini-max AI).