3 hours ago, JaLue2002 said:I did think of another question regarding my game. Due to the nature of it, their is going to be alot of conditional things (production cost being effected by specific choices and so on). Plus I want the box office to be recalculated automatically every week. Is this able to be done through SQL or do I need to add algorithms in addition?
In your case you need to prepare a table with any attributes such as production costs, ect... When the player makes a choice to buy wood for example, you would verify with the database that the player has enough gold, and if so remove the gold amount from the player in the database, and update the wood count. Then relay it back to the user. Keep everything server side, don't feed in attributes to the client and allow updates to the database based on local information otherwise people can modify those values.
I would keep it simple to start.
Player logs into the game client, the database pulls the player info and feeds it to back to the client and you display it on the screen (You'll have to figure out login and account security though, and making sure the proper user is getting the correct information). The player has 50 gold and wants to buy 1 wood for 25 gold on the market screen. Once the player clicks the quantity amount and buy button you make a call to pull how much gold the player has, and if it's possible to buy the wood then you minus the gold cost from the player's amount, then add 1 wood to their inventory in the database, otherwise you fail the purchase and relay the message back. Once it's all complete, update the client with the new information.
All checks need to be done SERVER SIDE, not CLIENT SIDE. Keep this in mind...