Android Question Wanting advice: Making multiplayer card game

Scotter

Active Member
Licensed User
I'm wanting to make a multiplayer card game and looking for advice or ideas before I spend eons making the same mistakes other people already made :)

I've already prototyped a database in MS Access. I will export to something like mySQL or SQL Server, depending on various factors. I have a server I can use to facilitate data use/sharing/etc.
I haven't played with B4A in a couple years and even then I was not a pro.
I feel like I'm starting from scratch almost.
I'd like to use the latest improvements in this 8.50 version, rather than stuff I've built using older versions of B4A.
Are there any templates for this kind of thing?
I have 90 card images but they are so plain that the more efficient way to display will be text on a colored background.
But I'm getting ahead of myself, ha!
The biggest challenge will be how and what kind of database to set up for this. I'm guessing I can probably store what is needed for game play local on the device but it will check the server database for updates and especially use it to save game data as games are being played, as well as for finding / matching players, and maybe some kind of record after the game has finished. Oh and "friending" so that people can find each other and play again in the future. If it helps any, I'll post a screenshot of the database table/field relationships view here.

p2e-db.jpg


Thank you for any help or guidance you can give!
 
Last edited:

Scotter

Active Member
Licensed User
By "prototyped in MS Access" I just mean I used Access to create it. My plan is to import into SQL Server or mySQL once I get more advice here.

I want people to connect over the Internet, not local network.
 
Upvote 0

Scotter

Active Member
Licensed User
Thank you! Can you elucidate a bit on this and/or point me at a tutorial or thread that helps me understand/learn:
(1) What is a "B4J server"?
(2) How do I "create" a B4J server? Do you mean rent one? Suggestions where?
(3) Is that a database type or a server that I can run a database server (which one do you recommend? MySQL? SQLlite? SQL Server) on?
THANKS!
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

Scotter

Active Member
Licensed User
It is really frustrating when users who are asking for help DO NOT anything about it by themselves. WHY NOT using the forumsearches FIRST to try if you can find something about?
It is not hard to find Examples and Tutorials using the forumsearch; if you use it...
When you assume I'm not also doing my own research at the same time that I'm asking for help, do you get really frustrated and want to lash out?
Do you choose take my requests for help as demands?
Happy Thanksgiving!
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
The biggest challenge will be how and what kind of database to set up for this
I don't think so. I think that the biggest challenge is how to make sure that the game is synchronized on the various devices.

Also, I think that you shouldn't save everything on a DB server, because it is not indispensable and it takes time (hw hd). Just store data in classes and/or data structures (mainly Maps) and few data on DB (accounts, friends, ...).

https://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/#content
 
Upvote 0

Scotter

Active Member
Licensed User
You can create a B4J server with WebSockets for the communication.
Hoping you don't get too annoyed by my newb/high level questions!
I *am* researching on my own, too.
I want to clarify my "I have a server" statement.
I don't have (or want to have) a server in my house. Did that kinda thing back in the 90's and early 2000's.
I have a managed Windows Server situation at A2 Hosting where I use a PLESK control panel. It supports Classic ASP, .Net, CGI, and PHP.
I don't have access to the server that would allow me to do a whole lot.
From experience with them, I know I can do this: upload and set up a SQL Server database for web access via some .Net code or Classic ASP (VBscript) code.
I am conversant with JavaScript, VB and VBscript, SQL, HTML, and CSS.
No Java experience or knowledge. So when I hear "use B4J for..." I wonder what alternatives exist.
Please note: I'm here to use B4A because I come from the old VB world.
Thanks for any direction any of you can give! Or even B4A project templates that do something similar to what I want and/or at least get me started in the right direction.
Watching B4A tutorials as we speak.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Is there a particular reason you want to manage the multiplayer aspect yourself? You might find it easier (& faster) to implement a multiplayer game using Google Play Games Services. @Informatix has wrapped the GPGS library & it works pretty well. I haven't used it for turn-based multiplayer, but I do have real-time implemented in a couple of my games (Five Dice & Dice Match) & it seems to work fine.

One thing though - it can be a reasonable amount of work to implement the in-game logic for a multiplayer game & I've found that while a lot of people like to play my games on a local network, comparatively few people play them over the internet. It could be just my games, but I think that there are certain types of games that naturally lend themselves to wide-area multiplayer & then others that don't. Something to consider before you invest large amounts of time & effort on multiplayer development.

- Colin.
 
Upvote 0

Scotter

Active Member
Licensed User
Is there a particular reason you want to manage the multiplayer aspect yourself? You might find it easier (& faster) to implement a multiplayer game using Google Play Games Services. @Informatix has wrapped the GPGS library & it works pretty well. I haven't used it for turn-based multiplayer, but I do have real-time implemented in a couple of my games (Five Dice & Dice Match) & it seems to work fine.
One thing though - it can be a reasonable amount of work to implement the in-game logic for a multiplayer game & I've found that while a lot of people like to play my games on a local network, comparatively few people play them over the internet. It could be just my games, but I think that there are certain types of games that naturally lend themselves to wide-area multiplayer & then others that don't. Something to consider before you invest large amounts of time & effort on multiplayer development.
- Colin.
Thanks for the ideas! FYI: THe game I'm making is turn based. Think Cards Against Humanity type game.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
The use of Google Play Game Services has just a few "problems":

1) @Informatix is fed up with the constant Google's changes, so he does not ensure the update of his library (and I agree);
2) you will depend on the Google's "whims" and maybe you will be unable to do some things or have to pay for the service.

Also, you have to study both Google Play Game Services and the @Informatix' library. Studying "b4j web servers" you will learn something useful for other applications.


P.S. we can not know how long @Informatix will live :p
 
Upvote 0

Scotter

Active Member
Licensed User
The use of Google Play Game Services has just a few "problems":
1) @Informatix is fed up with the constant Google's changes, so he does not ensure the update of his library (and I agree);
2) you will depend on the Google's "whims" and maybe you will be unable to do some things or have to pay for the service.
Also, you have to study both Google Play Game Services and the @Informatix' library. Studying "b4j web servers" you will learn something useful for other applications.
P.S. we can not know how long @Informatix will live :p

Luca - Thanks! Sounds like you are proposing the lower priced (I am poor), more sustainable, and potentially more simple (I'm retarded) route.
And you are the 3rd person recommending using a B4J Web Server. Thanks!
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Luca - Thanks! Sounds like you are proposing the lower priced (I am poor), more sustainable, and potentially more simple (I'm retarded) route.
And you are the 3rd person recommending using a B4J Web Server. Thanks!
There is currently no cost for using GPGS & no intention (that I know of) to introduce charges for it. Informatix's library has been stable since he switched to using Maven repositories. The last needed update to it (afaik) was in 2016.

I seriously doubt that writing your own server to handle multiplayer will be more simple that using GPGS. All the stuff like sending & receiving invites, tracking player & game states, & synching game data are taken care of for you. If you write your own server, you'll have to implement all of that. It might seem simple on the surface, but I think you'll find it to be a pretty major undertaking.

But if you do decide to go down that route, good luck! :)

- Colin.
 
Upvote 0

Scotter

Active Member
Licensed User
Regarding using B4J and setting up a database server on a VPS, I see how that can be done and realize I did something similar a few years ago.
Problem: I don't have a VPS right now and can't afford one right now at $90/mo.
The kind of hosting I have gives me a bit less control.
See this screencap of my management console there:
screencap-plesk.png


I CAN upload various kinds of databases and point to them via various kind of web tech, including .Net, Classic ASP, and PHP. I don't know any other backend languages, though. Ideas? Know of a VPS cheaper than $90/mo? Or a way I can do the B4J thing via the hosting I have? Thanks!
 
Upvote 0

Scotter

Active Member
Licensed User
Wowee thank you!!! I didn't even bother looking *before* because the ones in the past I've had were so expensive and the host I'm with now charges minimum $90/mo!
 
Last edited:
Upvote 0
Top