Welcome to the Browser-Base Game Zone forums!
Total Members Voted: 13
He is a primitive brute barbarian...
is row level locking important for browser games
Quoteis row level locking important for browser gamesIt is useful only in situations when one user(query) is doing action on one row and another on another row only. But if you have "spend gold to buy a soldier" and "spend gold to buy building" and "steal gold from a player" then you get no advantage of row level locking (because you still need to wait for gold row being unlocked before proceeding, so no difference to table level locking in this particular case). It depends on a game, but I'm not sure if it is that powerful feature... Sure, it is nice to have, if it was for free I would not hesitate at all. Of coure it is not free Anyway, agonizing over storage type choice is not worth it. Majority of performance will come from your game design and coding style.
I've been trying to stay out of this but I can't.
Thinking about this more Chris is probably correct on game design. By his own admission he creates games that are played 10-20 minutes per day, we don't. We create games that can be soul sucking time sinks if the player wants that. We create games that do take a bit of time to play and with that we probably have a larger per user activity matrix then Chris does which would be why we see lag when using myISAM on heavily used tables like the main player table or chat table.
There are a LOT of things that go with the choice of myISAM vs INNODB. Good programming will help (don't get me wrong on that), a decent server with fast hard drives and a good size of memory, all of that goes into the picture. What I can offer is if you start to experience lag (as explained above) switch one of your heavily used tables to INNODB and see what happens. From my experience it reduced the lag almost instantly with very little configuration. As I moved more tables to INNODB I had to start learning how to configure it more and more. At the same time I had huge traffic and realized INNODB was just one part of solution. Moving to a bigger server helped, moving to a dual SCSI hard drives was another huge improvement as well.
So, am I likely to see some kind of crazy increase in hardware usage (I'll find this out for myself anyway) by switching to InnoDB? When you first switched codestryke did you do so with practically zero configuration then (only optimizing later)?
I stayed out as I've been very vocal in the past about INNODB so I didn't see a reason to rehash my views
DELETE FROM users WHERE id = %d;
I'm a big fan of validation and integrity. Foreign key constraints help to maintain database integrity. I mean, seriously, why perform 15 queries to completely remove a user from your database upon account deletion? Delete the account, delete their character, delete their inventory item references, delete their messages, etc.. With foreign keys you could write one query:Code: (sql) [Select]DELETE FROM users WHERE id = %d;And the database would make sure all the other crap gets deleted too! Pretty nifty, right?
That's one of the reasons why I do NOT use it I find it extremely wasteful to force the storage engine to make all these additional checks each time it modify the table while you could just manually write these stupid 15 queries inside DeleteUser() function that is almost never called anyway
You simply don't get any benefit for using it in a BBG...[/snip]I just mean it is useless for BBG made by a single person.
So, if your code accidentally changes user.id from 5 to 15
Binary is sure some fast-executing code... but boy oh boy does it take forever to write a program that way.
No, I can not imagine any programmer doing such huge basic mistake.
It took me 2 weeks to write playable version of Lords and I was learning PHP and MySQL in the meantime.
People, we are making here stupid simple websites, not real games! There is no 3D, no memory violation possibility, no anything.
We don't need any of these awesome features that were designed to help producing multimillion huge business software developed by hordes of programmers in years or decaders.
The quality and fun of browser games does not come from code complexity or our coding prowess.
"Simple stupid easy to make wesite" is not opposite of "quality game that make everyone wow". On the contrary, too awesome code will make a game unplayable, confusing and boring, I'm almost sure of it.
And I have a few more players
Quote from: Chris on March 09, 2011, 10:52:46 AMAnd I have a few more players Yup, but I bet you got those players after investing more time than your initially quoted 2 weeks. The more time you've put into your game, the more players you have received. That's a function of increasing the quality of your game by putting in more time on it. Your statement made it sound like, "Guys! I only put in 2 weeks and I have over 300 active users!" Which is completely false! You put in 2 weeks and got ~50 users. Which is much more believable.