Tag Info

Hot answers tagged

4

There is one thing that bothered me about your question: "..But the only programming language I know is Java." So learn another one! Anyway, Java as a client in the browser fails on many, many fronts. For one, Java 7 (and most likely Java 8) doesn't even work in Chrome on Mac OS X because the Java people decided to stop supporting 32-bit, and Chrome ...


3

If you're smart with it, it won't be too resource intensive - but I definitely wouldn't try to run it every second (plus the shortest time interval for a cron is 1 minute). Because you mention actions occurring for a user when offline, a cron is probably your only option for that. For online actions, I recommend not having that in a cron, that way you can ...


3

I know your question is specifically asking about cron jobs, but I think a lot of web-based mmos are written using "completeTime" logic as opposed to lots of crons. When you start a long-running action, like building a granary that takes 5 hours to complete. The server will just mark the granary's completion time as start time + 5 hours and store that in ...


1

It looks like you might be better off with some formula: // keep the sign separate int sign = enemyLevel > playerLevel ? 1 : -1; // Calculate the xp as 1 xp per 20 level differences // Ensures that no negative xp is given int givenExp = math.min(0, 3 + (sign * math.floor(math.abs(enemyLevel - playerLevel)/20.f))); What this does is clamp each 20 levels ...


1

Neither JS nor PHP are very suitable for what you're trying to do. You can define transparency in PHP (http://www.php.net/manual/en/function.imagecolortransparent.php), but I'm not sure if you can actually read it out. Also understand that PHP is a server side language, so for any real-time interaction of on-screen elements it's not very suitable. You bets ...


1

The "best" is hard to say, you should test different technologies. I my case, I used C++ to create the server and js for client: The client comunicate by ajax with the server, but never close the socket. To allow that, it should expect steaming data. The server is made with C++, using a very fast http/https sub-set. When a client send a chat text, the ...


1

Let the important content take as much space as possible. Show utility buttons (like add/remove) only when needed. Replace the wall of text with images where possible. Where not, keep the text short. Take example from the design of good browser-based games. If you are having a hard type designing the page take a look at those UI libraries that can make your ...


1

I'm not all that familiar with PHP and MySQl but this is how I would go about it. First I would create a datatable for all players in a room and their status (just chillin or looking for a fight). Then link the room table to another table that contains challenge requests that links the player ids for two players in the room datatable. You could then ...


1

There are pros and cons of a long-running daemon vs cron. "Cron" will run your job every 1 minute (maximum). This carries some overhead of starting a new process, loading data files etc. However, starting a new process will avoid memory leaks (because when the old process exits, it releases any leaked resources). So there is a performance / robustness ...


1

The cron-job way is definitely the easiest one and it's good enough for normal use cases. If the changes the users makes affects the other users (for example, make a fire, which, if let unattended it would burn other player's houses in the meantime), then you can't use the first idea. Otherwise having some sort of "TODO" lists that get completed (finish the ...


1

I would recommend using some type of algorithm rather than an ACL: Algorithm for dynamically calculating a level based on experience points? http://gamedev.stackexchange.com/a/14314/20399 These aren't specific to your question, but the general principle is that there are formulas you can use to determine the requirements rather than hardcoding every ...



Only top voted, non community-wiki answers of a minimum length are eligible