PHP is a general-purpose programming language that is especially suited for web development.

learn more… | top users | synonyms

26
votes
5answers
13k views

How to create a hexagon world map in PHP from a database for a browser based strategy game

I'm trying to create a hexagon world map for my PHP browser based strategy game. I've created a table in my database with the following data per row: id, type, x, y and occupied. Where type is the ...
23
votes
2answers
15k views

Understanding Perlin Noise

I'm toying with Perlin Noise after some work with Diamond Square. I followed the implementation by Hugo Elias that basically, makes a series of functions with x,y as input to throw each coordinate ...
11
votes
3answers
5k views

Javascript and PHP for real-time multiplayer?

I'm wondering if combining Javascript clientside with PHP/mysql serverside is a good idea for HTML5 real-time multiplayer (small scale) browser games? My technical knowledge is very limited, and even ...
10
votes
4answers
9k views

How relevant is PHP today for browser games?

I was the lead developer of 2 moderately successful browser games quite a few years back, and plan on working on a new game soon. At the time, I wrote them in pure PHP (no template engine or anything ...
8
votes
3answers
984 views

Calculating Experience Points earned after a battle

I'm developing a simple text battle game and having some issues calculating how much XP should be earned after a battle, theres a few factors that i want to consider: 1) Players should of course earn ...
8
votes
1answer
570 views

Separating logic and data in browser game

I've been thinking this over for days and I'm still not sure what to do. I'm trying to refactor a combat system in PHP (...sorry.) Here's what exists so far: There are two (so far) types of entities ...
7
votes
4answers
1k views

Securing HTTP data from a JavaScript game to server

Suppose I am doing a JavaScript game, and I wish the game to update the server if the user has successfully completes the game and his outcome. How should I ensure that the request came from the ...
6
votes
4answers
2k views

Text-based game using JavaScript and/or PHP

I'd like to make a simple text-based game using either JavaScript or PHP. Ideally I'd like to be able to render ASCII text in a kind of blackscreen "console" style (think console roguelikes such as ...
6
votes
6answers
3k views

How to implement a component based system for items in a web game

Reading several other questions and answers on using a component based system to define items I want to use one for the items and spells in a web game written in PHP. I'm just stuck on the ...
5
votes
3answers
1k views

Securing JavaScript / PHP game data

Followup to securing-http-data-from-a-javascript-game-to-server. I'm working on something similar, in that I have a PHP backend and a JavaScript frontend, which plays around with the HTML5 canvas ...
5
votes
5answers
878 views

PHP Browser Game Question - Pretty General Language Suitability and Approach Question

I'm developing a browser game, using PHP, but I'm unsure if the way I'm going about doing it is to be encouraged anymore. It's basically one of those MMOs where you level up various buildings and ...
5
votes
4answers
733 views

Browser-board-game and server push

I want to start developing a browser game. Not for success, just for the sake of doing it and learning something from it. Now, a point where I have serious problems figuring out how to deal with it ...
5
votes
2answers
2k views

Control diamond square algorithm to generate islands/pangea

I generated a height map with the diamond square algorithm. The thing is i do not manage to create islands, this is, restrict the height other than water level range to a certain value in the center ...
4
votes
2answers
503 views

What platform should I use for a master server?

We are making a small FPS, and want people to be able to play it online and fetch a list of all servers from a master server. We only have experience in C#, and we have already written a master server ...
3
votes
3answers
1k views

Facebook Game database design

I'm currently develop a facebook mafia like PHP game(of course, a light weight version), here is a simplify database(MySQL) of the game id-a <int3> <for index> uid ...
3
votes
3answers
2k views

Will running cron jobs every minute a good practice?

I'm trying to create a browser-based game (made in PHP, MySQL, Js, HTML, and CSS) that is heavily dependent on user's actions being carried out after a certain amount of time passed whether online or ...
3
votes
2answers
2k views

Advice on a PHP RPG System

I am looking to make a php/mysql/javascript based rpg on a site. I am trying to figure out the best method when it comes to items, quests, etc. For instance should I make classes for each item type ...
3
votes
3answers
323 views

How can I randomly generate arbitrary “rules” for a creative card game

My friends and I in school play this interesting card game, which we call 'the game without rules' (ironically, of course). The game is like this: in the beginning of a school year, we start with one ...
3
votes
3answers
80 views

Validating victory report to PHP leaderboards

I have decided to begin working on some sort of leaderboard server for my PC game. For starters, I decided to write some PHP scripts to handle it. The script doesn't actually receive a score - it ...
3
votes
2answers
671 views

Drag and Drop Team Selection

I have a Fantasy F1 Website, currently users select their teams using dropdown menus. It works OK but isn't as user friendly as I would like. I would like to implement a drag and drop type of ...
3
votes
2answers
467 views

PHP Browser Game Private Messages?

First off, I'm asking this question here because gaming and messaging are intimately connected. Why win if you can't gloat? Nevertheless, I won't be offended if this needs to be moved to overflow. ...
3
votes
1answer
280 views

Game based on Ajax polling for 12 players

I am planning on writing a small browser game. The webserver is a shared server, with no root / install possible. I want to use AJAX for client/server communication. There will be 12 players. So ...
3
votes
1answer
81 views

What techniques are useful for modelling Character Actions via OOP?

I'm trying to rewrite a legacy php Browser-Based-Game so that it uses object oriented programming. I find it relatively easy to model concrete nouns, like: new Npc(), new Character(), new Account(), ...
3
votes
1answer
184 views

How to do monster AI movement and attacks server side?

I have my web based rpg game already created. Inventory management, equipment system, character stats, skill tree, and etc. It's almost complete. For the game world, I am creating a top-down rpg ...
3
votes
2answers
1k views

PHP battle script [closed]

I have custom built as a little personal project a website coded in php that is a MMORPG. It is at the minute just a personal private project but I am stuck as what to do when it comes to users ...
3
votes
1answer
223 views

PHP city-sim castle layout

I am currently contemplating the layout system for my php based game but i've run into a couple of worries. So my idea is a 9X9 grid where the center 3X3 are inner castle. The inner castle will be 6X6 ...
2
votes
2answers
194 views

Web application interacts bi-directional with server program?

I want to write a web application to play chess against the engine Crafty. I'm not new to PHP and javascript, but must learn how to interact with a server process : how can a web application and/or ...
2
votes
3answers
169 views

Formula for Planetary Alignment

I am attempting to create a game where there is a universe of two 16-bit addresses ranging from (-32768, -32768) to (32767, 32767), or in hexadecimal, each value can run from $8000 to $FFFF then 0 to ...
2
votes
2answers
390 views

Balancing Attack to Defense in a text based RPG [duplicate]

I understand that there is no correct or incorrect way of doing this, and its all down to a matter of trial and error in terms of perfecting the system. What I am after is some advice or even get ...
2
votes
1answer
3k views

Sending POST data with WWW in Unity C#

I would like to use Unity's WWW class to send a an HTTP request with POST data. So in my server, my PHP script can do something like $number = $_POST["NUMBER"]; According to ...
2
votes
2answers
729 views

how to implement pvp(text based rpg in php/mySQL)

I'm creating a text based rpg in php/mySQL and I've come up to a dead end in regards implementing the pvp aspect of the game. First off is this even possible in php/mysql? If so, how would I go about ...
2
votes
2answers
750 views

Passive skills and items

I'm making a small text browser RPG game using PHP, MySQL and Java Script (and jQuery). All the items are saved in the MySQL database. Every now and then a character have to make a skill roll (Talk, ...
2
votes
1answer
382 views

How to display a hierarchical skill tree in php [closed]

If I have skill data set up in a tree format (where earlier skills are prerequisites for later ones), how would I display it as a tree, using php? The parent would be on top and have 3 children. Each ...
1
vote
2answers
656 views

PHP and Javascript/HTML5 Collaboration [closed]

I've recently been working on a fairly complicated game. I've stored information with local storage, but that allows the player to edit it, and does not transfer from computer to computer. The two ...
1
vote
1answer
263 views

How can I keep track of a battle log on a web game?

Recently I started working on a Web turn-based PvP RPG game. Now I'm working on the battle system but I encountered some issues: How can I keep track of everything that happens in the battle? It ...
1
vote
3answers
533 views

Calculation of a fight with many entities

User A can have many entities A Entity is a object that has properties such as health, attack, defence, agility, stamina, etcetera. When User A want to attack User B with x entities I am looking ...
1
vote
2answers
1k views

How do I generate a 2d grid-based map without screwing it up?

I'm relatively new to the mechanics of game development - catching up fast, but there are still some things that escape me. For example: generating a fully-accessible map on a 2d grid. See the ...
1
vote
2answers
313 views

What's the best way to keep battle log in a browser based game written in PHP?

I've searched for it, but I couldn't find any question about this. I'm working on a game where PvP fights are possible. The game is written in PHP/MySQL. What I want to implement is to save all the ...
1
vote
1answer
288 views

How to decide who wins a race?

I'im thinking of building a text-based browser game. A racing game.like F1 or rally. users can set-up a car. thinks like tyres, fuel, driver,brakes. every attribute gets a value. the part where i ...
1
vote
2answers
5k views

Multiplayer card game using PHP/Ajax and mysql

I am designing a map game, using PHP and MYSQL. I don't know how to make the players who sign-in to the website to see other players who are also connected to the site and be able to chat with one ...
1
vote
2answers
259 views

Increasing resources overtime for a browser-based game [duplicate]

I've been interested in developing a browser game ala OGame or Ikariam etc. Basically, a menu is displayed with your resources and, overtime, they increase depending on how advanced are you in the ...
1
vote
2answers
196 views

How to figure out a users earnt exp based upon calculating the difference by user and player by x?

How would I figure out a users earnt EXP based upon calculating the difference by user and player by x using this format? If the user is 60 levels less than me, I would get 0 exp (as that's just ...
1
vote
1answer
229 views

What tech will enable a script to run after a certain amount of time elapsed following a user's action?

I'm trying to experiment in creating an MMO browser-based game using PHP, MySQL, Javascript, HTML5, and CSS. There is this certain functionality that I want in my game that I'm having trouble with. ...
1
vote
1answer
483 views

How to handle a player's level and its consequent privileges?

I'm building a game similar to Mafia Wars where a player can do tasks for his gang and gain experience and thus advancing his level. The game is built using PHP and a Mysql database. In the game I ...
1
vote
1answer
761 views

php multiplayer game - server&client model

I'm working on a simple round&web-based multiplayer game. The idea of the game is very simple: The players get an array of audio files which they listen to and write the transcripts for in 5 ...
1
vote
1answer
560 views

Architectural advice - websockets javascript/php integration

Myself and a friend have started making a game, he's likely to be using impact.js for the user interaction etc, but we need multiplayer functionality so some form of websockets for TCP connections ...
1
vote
1answer
673 views

hexagon tiles to square tiled map

in a previous question asked here:how-to-create-a-hexagon-world-map @Tim Holt has provided code that does the job that i'm wanted to do, the only difference I would like is to have it as squares ...
1
vote
0answers
45 views

Security-minded design patterns / paradigm for client/server application

I am working on a client/server application and am starting to take it from proof-of-concept to actual implementation. The client is an Android application and the server is in PHP. In similar ...
1
vote
0answers
86 views

Browser-Based Game Design: Keeping track of NPC stats (Attack, Defense, Health, etc)

Hope this is a proper question to ask here. If not, I'd appreciate somebody pointing me to other game developer communities. Since I am creating my game by myself it'd be nice to communicate with ...
1
vote
0answers
69 views

Basic mmo client/server relationship. Is my approach correct? [closed]

Lately a friend and I have been thinking about making an mmo after we finish highschool and while I have more than some programming experience I have never before made anything like an mmo so two days ...