Skip to main content
16 votes

Why PHP over C# for PBBG?

PHP has the advantage that it is very widely supported by cheap webhosters. You can rent some shared-hosting LAMP (Linux, Apache, MySQL, PHP) webspace for peanuts. And that webspace can also host your ...
Philipp's user avatar
  • 119k
6 votes
Accepted

Designing PHP RPG game: Should I use multiple classes for each type of item or a single table?

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 ...
Philipp's user avatar
  • 119k
5 votes

Why PHP over C# for PBBG?

The other answers are correct, but there's a historical factor that hasn't been mentioned. When I started to search for do and donts and tips I realized that a lot of projects use PHP and I have ...
IKM's user avatar
  • 151
5 votes

Unity3D: Facebook login into the game + Verification on Server Side

Token and App side So to do this you will need to get the the relevant Access Token from facebook: User Access Token if you want to post things on their behalf and access information about them. App ...
user3797758's user avatar
  • 3,641
5 votes

Calculate resources real-time. Sockets or not?

Introduction There are pros and cons to each method of synchronization you gave that depend on a couple of factors. First, is your game singleplayer or multiplayer, second, how real-time is your game?...
RJ-Adam's user avatar
  • 163
4 votes
Accepted

How to deal with players having too much money (or any large numbers)?

I read somewhere that you shouldn't compare floats Beware programming by hearsay. This is a good way to make mistakes for reasons you don't understand. Instead, ask for clarification. The full ...
DMGregory's user avatar
  • 134k
3 votes
Accepted

TCG Board Architecture

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: ...
Vaillancourt's user avatar
  • 16.3k
3 votes

How to program an experience-based levelup system where experience carries over to the next level?

Solution A: Don't store the level or the experience points from the last levelup. Only store the total number of experience points the player collected from the start of the game. When you want to ...
Philipp's user avatar
  • 119k
3 votes
Accepted

Feasible to do all game logic on PHP server?

It depends on your skill at programming, but it should be feasible. Remember, Facebook was built in PHP and it serves a pretty big crowd. A better question might be if PHP is the best choice for what ...
Erik's user avatar
  • 1,556
2 votes
Accepted

Get range of hexagon based on specified center

Found a better way to do by moving a cursor N times. ...
Enrique Benitez's user avatar
2 votes
Accepted

How can I avoid writing a class for each of my 800 different items?

Having a class for items is a good idea, but it is rarely useful to have a class for each item. When entities in a game differ by their values and not their behavior, then it is usually better to ...
Philipp's user avatar
  • 119k
2 votes

Place hexagons together

Just fixed by doing the X coordinate with $x = $hexagon->ver + $i * $hexagon->size * 1.5; Looks beautiful now.
Enrique Benitez's user avatar
1 vote

How do I wrap my web browser game as a standalone for Steam?

Since you mention PHP as well as Java, which are both server-side languages, I assume you are running a web server that your game connects to for content, game state management, and so forth. So ...
Tim Holt's user avatar
  • 10.3k
1 vote

Race condition implementing World Boss System in Web Browser MMO using PHP

You could either use "SET boss_hp = boss_hp - 10" directly in a MySQL query if your damage calculation is simple enough to be expressed by a simple subtraction. Or look into some of the locking ...
Jannek's user avatar
  • 66
1 vote

Best Practice for Procedural Generation and Code Updates

The problem is if I do updates to the 'weather' variable, it will break all the code after. The less you do, the better. If you are only picking a weather at random, you probably don't need to ...
Theraot's user avatar
  • 26.7k
1 vote

How to deal with players having too much money (or any large numbers)?

Instead of int32, use uint32, it doesn't hold negative numbers thus max value will be 4,294,967,295. (Not for PHP. Currently PHP supports int32 or int64 depending on the type of machine its running on)...
Nick's user avatar
  • 561
1 vote

How to deal with players having too much money (or any large numbers)?

You can straight up cap your players money. However, if this is a game where high numbers are going to be common, you are better of using a big integer solution, such as Philipp suggests. ...
Theraot's user avatar
  • 26.7k
1 vote

How to deal with players having too much money (or any large numbers)?

The GMP (GNU Multiple Precision) library for PHP offers you the class GMP which can represent integers of arbitrary length and perform arithmetic with them. MySQL offers you the BIGINT type which ...
Philipp's user avatar
  • 119k
1 vote

Retrieve multiple images from MySql database via Unity C#

To start with, you should move the line imagen.sprite = Sprite.Create (img, new Rect(0,0,690,345),new Vector2(0.5f, 0.5f)); from ...
KevLoughrey's user avatar
1 vote

Why PHP over C# for PBBG?

Browser based games rose at a time when C# wasn't very popular, but PHP was. So many projects are done in that languages, many tutorials were written for that language and many experts in such games ...
Frank Hopkins's user avatar
1 vote
Accepted

Better way than url-encoded query stings to pass data from PHP to Flash?

What you have here is basically a RESTful webservice API. The client communicates with the backend using HTTP requests with the request parameters in the query string. The backend then answers the ...
Philipp's user avatar
  • 119k
1 vote
Accepted

Finding cells within range on a hexagonal grid

I think you have the "offset-q" coordinate system mixed up with the cubical coordinate system. In general, it's easier to translate from the cubical coordinates to screen coordinates because it's a ...
Jimmy's user avatar
  • 9,019
1 vote

How to cache tile map?

PHP, without the use of dedicated extensions, is bad for this task. The main problem is that in PHP the execution of requests is compartmentalized. It serves each request in an isolated thread, and ...
Theraot's user avatar
  • 26.7k
1 vote

PHP Quest System: Push or Polling?

There's two basic approaches to this. First, call a script at a regular frequency to perform the work. You can setup a Cron job that will call a given URL every so often, or at specific times ...
CLo's user avatar
  • 1,330
1 vote

Passive skills and items

how can I implement a function for every item, that gives the bonuses or other options when the appropriate roll is made First, there are two approaches to managing passive bonuses and such: ...
badunius's user avatar
  • 166

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