Taking the First Step

Started by
11 comments, last by L. Spiro 5 years, 6 months ago
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...

Programmer and 3D Artist

Advertisement

If this is an online text game then why wouldn't you use mIRC and code it in mIRC Script?  Your goal right now is just to learn programming concepts, which you can do easily enough via mIRC Script, while mIRC handles the online communication and interaction for you.  It is easy to get people in to play your game, and that is most important.  It's how I got my start before I did any real coding, so I know from personal experience that it is easy to get going, easy to get results, easy to get people to come try it out, and easy to switch to C++ when you are ready for a real language.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement