Database: MySQL+PHP vs Array+AJAX vs Firebase plugin

  • I am developing a strategy war board game. Each player choses his soldiers from a database. I am aware that an online DB is needed for the game to keep track scoring. That's another issue.

    The point is the soldiers DB has 500 entries, each soldier having 50 stats aprox. And those values are never changing. So I was wondering whether an offline DB for that would be better. I mean an array, XML or a project file via AJAX.

    On the other hand, Perhaps the fact that once a player chooses a team, he is allowed to save that team for future battles, means that teams must be saved on the same DB than soldiers, in order to be accessed. So, it should be an online DB. Am I wrong?

    I am no programmer, so my undestanding comes from reading the tutorials and the posts from the forum.

    Maybe I can create an offline DB for the soldiers and an online DB for the players' teams, which calls the soldiers DB.

    Anyway, I've been reading some people cpncerns about SQL not being as safe as JSON. The same for XML. And also people telling arrays with so many fiels slow down performance. Can someone lighten me?

  • Let me understand it better...

    Is it an online game/multiplayer or is it a single player game or even local multiplayer?

    If it is an offline game just use all of it locally.. the only reason to use a online db is if you plan to add new soldiers or change their stats frequently. If you do it localy you will have to update the app everytime you change soldier/stats.

  • It is an online game. Troop stats never change, actually. They are in the game or destroyed - no health bar/stat.

    Yet the different troops in a player's team and their number may change. Let me take an example-

    I play against you. At the beginning, we have to choose our teams, so we pick troops (or we could pick a team that we had previously saved). We have a maximum number of "slots" to fill with our choice of troops (ler's say 15). Each one decides which ones to include. Including any troop in a team doesn't remove it from the available choices for the opponent - no substract.

    I might choose to fight with 3 templars, 2 pirates, 4 SS soldiers, 2 navy seals, 3 napoleonic cavaliers and a roman gladiator.

    Yo might choose 10 hashashins and 5 navy seals.

    [I know.. that's why the DB has so many entries]

  • If its an online game, keep it all on the server side..

    Otherwise if I "hack" the app I can change troop stats.

    So when it starts it sends a request to get this stats from the server and also you can compare after if the stats still "correct" between client/server.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So, given that, which option would fit better? There is some hype with Firebase around here. Based on what I have managed to understand reading the forum, it uses JSON trees and the manner it handles the DB for the purpose keeps it safe on the server side. So that's fine for me.

    I was interested in SQL because the gameplay should involve also a skills tree DB and a battle DB. Each troop is allowed to a certain actions from the battle DB, depending on the skills tree. So a related DB would have been nice. Otherwise, with JSON, I would be forced to include all in one DB with Troop, Battle, Skills as parents. Three times the same data and lots of true/false.

    But people complaint about SQL having the lack of security that you are talking about. Does it mean I should go all straight away with Firebase? Chadori's incoming new version of Rex's plugin is not back on the streets again. Hope will be soon.

  • To be honest, I don't know which's the best option.

    I also have 2 projects that would need remote database and I'm struggling about the server side security.

    Would be awesome to have a native mysql client plugin.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)