But imagine your scenerio. 1000 concurrent users. All Fighting each other or NPC's. For every single swing of the sword, shot of the gun, kick in the face, you are processing hit points, mana, energy, skills in defense, archery, swords, hand to hand combat, armor point reductions, spell casting...and you want to make a call to a database to update all this instantly? No way is that going to work.
Originally posted by Lordly Caliber:
You only update the database when the player dies, logs out, or is idle for 30 minutes, etc. Everything is stored in memory and is not saved to the database until death/logout/etc. Do you have to do processing whenever someone gets hit? Of course. But this MUST be done server side. If you have HP changed on the client, then cheaters can take advantage of this. (if it's just a hobby RPG it won't matter). HP on the client is just for display purposes. The "real" HP is on the server sitting inside the Players object. If the user tries to hack their HP they are only hacking some ficticious display. The server knows the truth.
If it's a serious MMORPG, then the client should only be for display and making requests to the server. I know a few commercial RPGs that are suffering from cheating becuase they put too much client side. Tibia comes to mind. They had to give up and incorporate into the game things that used to be considered cheating (auto aim magic, etc.)
[ January 20, 2007: Message edited by: Lordly Caliber ]
So I left, I came home, and I ate some pie. And then I read this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized bookhttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton