Hot answers tagged

8

One way to do this is not to change the actual values in the database in realtime. When the player logs on, you see how long it's been, and how much stuff he should have if he were earning during the time he was logged off, then update the value accordingly. One benefit of this is that if a player never logs on again, you're not spending server time and ...


5

For peer-to-peer communication between web browsers, WebRTC is likely the best option available. But keep in mind that it is not universally supported yet. Also keep in mind that while you might save traffic on the server this way, the perceived performance for your clients might be far worse, because consumer-grade internet connections will likely have far ...


5

A rule of thumb is that you use different classes when objects require different code and instances of the same class when the objects only require different values. So when ShortBow, HuntingBow, CompositeBow, ElvenBow etc. all behave identical except for having different stats, then they would all be instances of the same class. When bows have different ...


4

Card and Slot concepts should not be mixed. They're not the same. My behind is not fused with the chair on which I'm sitting. This allows me to play musical chairs. Let's organize your data: // A card; belongs to a player, has abilities (among which we find 'CanJump') Card Owner : Player // Blue or red CanJump : bool // Tells if the card can jump two ...


3

Foreword: I'n not an expert about MMOanything or games in general, but I have a decent grasp on security and I wrote more than a single client/server app. Also being an avid gamer kind of helps. Your conclusion about the inability to protect your game is essentially correct, at least if you expect it to be 100% cheat free: whatever logic you delegate to the ...


2

While I don't have much experience creating games with php/js I'd say that there are a few things you should consider. First thing that popped out to me is that you wanted to save positions in an SQL database - this seems like a terrible idea. It would be incredibly slow, consider how many times a second a game loop would run, times the number of entities ...


2

Web php games usally uses 2 different ways to do this: 1- Daemon. You set up a "run forever" script that sleeps for 1 second and updates all data that needs update. 2- Time elapsed. you have to store the last conection somewhere and, in the next connection do CURRENTTIMESTAMP - LASTTIMESTAMP to get the seconds elapsed since last update, so you just have to ...


1

I'm not 100% sure I caught your main idea between card relationships here, but to me it looks like some sort of network-like structure might work here. Your cards would have neighbours specified with some relation. It seems like you are trying to force a generic array here, but I think this is where using some traditional OOP simplifies the thinking process ...


1

I think you are facing the wrong direction, if you want to build a RTS you have to build a serverside application that handle the game's processes and a clientside app to be shown to the users. If you have a good PHP level maybe you should read about sockets and websockets, that would make it really easy, i've been building a MORTS based on websockets ...


1

Any moderately popular multiplayer game will be targeted by hobbyist cheat developers who just want to exploit it for fun. But when you also add an incentive to cheat in form of price money, you are practically paying people to hack your game. It is a literal job offer to professional cheat developers. When you want to prevent cheating, you need to ...


1

my first instinct when seeing this is that you are using all of the wrong technology. that is the big optimisation win to be had. i am a bit old school so maybe these days you can get away with it, but networking games were never historically made in these ways. even TCP is considered too much overhead (it introduces a lot of lag for dropped packets, a lot ...


1

Great Question! In general, you should start with your high level objects and then think about what they do. So, I'm not sure about your specific use case, but I'll assume it is the following: A player will use a skill to attack a different player. This will only work if that skill can be used on that player, which is dependent on a set of conditions. ...


1

I would say both code database. Perhaps also a software component, in the server-side, to leverage access to databases and have a kind of poor cache (the actual intention is not to do cache, but maintain objects as being alive). With code you will define basic algorithms and, perhaps, rebalance the enemies in the future. Perhaps the code could involve a ...



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