Micali wrote:Why doesn't my PK run as fast as the one in the videos...
LOL, cause you really want to advertise lag in a tutorial video. Click the tree and choose chop now wait 15 seconds for server to respond and then wait 20 seconds for it to complete chopping. I am sure the video was done on a test server with no load.
All joking aside, all the lag problems are caused by server load and the fact that there are too many people on one server causes the game to have lag and server not be able to respond to requests. As a software engineer myself I understand these kinds of problems and they aren't easily solved. The simplest and most often sought after way to resolve this kind of issue is to create more servers and either have users pick a server or as they do in this game depending on your location end up on a different server. With that there has to be a way to see across servers and such which can become a challenge or even switching servers as it appears to happen in this game as you jump around. Load balancing servers and such is another solution and then you have to start looking at database farms possibly too. All these solutions I just mentioned are hardware solutions (and some session management software issues) and can get very costly when you are talking about a simple game. Scalability becomes an issue with load simple as that. This is all short term fix without something more long term being done.
The first long term solution to the hardware issue that has become quite popular is to use cloud computing where your software basically lives in a cloud of hardware. The cloud recognizes load increases and scales new hardware as it is needed based on this load. This requires some re engineering of software to utilize but has become quite popular and in the end is usually a cheaper route for a company to do then trying to maintain and control there on hardware. You can read more about this but the cost is more based on transactional or actual computing power to accomplish tasks. Companies like Amazon and Google pioneered this type of solution.
The second long term solution worth mentioning is a architectural one. This game for example relies very heavily on server interaction. The creature fights literally sends information back and forth to the server as you are fighting. Almost every single interaction with the game is calling the server. Every time you click heal or every turn in a fight or every time you click visit or mine or chop or attack or whatever is sending data back in forth from game to server. The game is mostly controlled from server instead of client which puts a tremendous load on a server for just one user. More could be done on the client but do note that this comes with potential risks. One, a more heavily client centric games means easier to hack (meaning if a player attacks something and battle takes place purely on client the player could make it that the creature does 0 damage, the same player could not do this with a server call). Second, maintenance is tougher since Droid and Iphone client code has to both be written completely independently and the code will not overlap. This makes for more work where if the client is more dummy like then the server code handles the interactions and it is more consistent as the code works the same no matter what platform you come from. The second could be helped tremendously by taking PK and migrating the client entirely to HTML5 which is the only standard supported by both and probably more in future. This would give game makers option to port to Windows mobile in future with no effort and could still be shown as an application even though it would really be running via Safari or Chrome or whatever browser supports WebKit. This option is relatively new and is still not necessarily viable as HTML5 is fairly new and still with bugs.
There's more but I'm tired of typing but I think I will throw HTML5 idea into suggestions area too.