Questions tagged [php]

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

Filter by
Sorted by
Tagged with
32 votes
2 answers
29k 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 ...
Gabriel's user avatar
  • 1,143
29 votes
5 answers
19k 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 ...
fabianPas's user avatar
  • 411
13 votes
3 answers
22k views

Javascript and PHP for real-time multiplayer? [closed]

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 ...
justanotherhobbyist's user avatar
12 votes
4 answers
22k 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 ...
Bitgarden's user avatar
  • 263
11 votes
3 answers
3k views

Why PHP over C# for PBBG? [closed]

I am a C# developer and wanted to start a hobby project building a persistent browser based game (PBBG). I work with C#, MSSQL and Angular and thought I would use those techniques for my hobby project ...
Kurus's user avatar
  • 111
9 votes
3 answers
2k 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 ...
user avatar
8 votes
4 answers
2k 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 ...
Extrakun's user avatar
  • 2,742
8 votes
1 answer
668 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 ...
Tesserex's user avatar
  • 2,294
7 votes
4 answers
5k 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 ...
persepolis's user avatar
7 votes
6 answers
4k 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 ...
Landstander's user avatar
6 votes
3 answers
2k 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 ...
erik's user avatar
  • 1,378
5 votes
5 answers
2k 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 ...
JimBadger's user avatar
5 votes
3 answers
443 views

Calculate resources real-time. Sockets or not?

I'm currenly developing a game in Javascript. It's a Single Page Application so every change should be pulled from the server without page refresh. I'm currently wondering how I should handle the '...
Jordy's user avatar
  • 161
5 votes
4 answers
803 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 ...
F.P's user avatar
  • 219
5 votes
2 answers
4k 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 ...
Gabriel's user avatar
  • 1,143
5 votes
1 answer
1k 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 ...
Nick Newman's user avatar
4 votes
4 answers
8k views

Is running cron jobs every minute a good practice for browser-based games?

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 ...
user31246's user avatar
4 votes
2 answers
1k 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 ...
Hannesh's user avatar
  • 981
4 votes
3 answers
2k 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, ...
Ziik's user avatar
  • 143
4 votes
2 answers
2k 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 ...
Saturn's user avatar
  • 1,771
4 votes
4 answers
3k views

In PHP, how do I implement multiplayer "rooms" for a turn-based game?

I'm working on a multiplayer checkers game. I want to let players choose another connected player and invite him to play. I have a working game engine and rendering, but I'm stuck on the multiplayer ...
New Man's user avatar
  • 41
3 votes
3 answers
2k 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 ...
facebook-100000781341887's user avatar
3 votes
2 answers
4k 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 ...
Tempus35's user avatar
3 votes
3 answers
618 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 ...
user1009013's user avatar
3 votes
3 answers
132 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 ...
Saturn's user avatar
  • 1,771
3 votes
2 answers
107 views

One big Instance or One instance for every moving entity?

I am creating a multiplayer JavaScript game with a PHP central server. Each user will be able to move around in a 3D world, with other users and NPCs. These NPCs will be controlled by the central ...
Grant Davis's user avatar
3 votes
2 answers
893 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 system,...
davidjwest's user avatar
3 votes
1 answer
198 views

Place hexagons together

Just made it with some more investigation thanks to this site: Hexagonal grid math, but the hexagons have a little bit spacing horizontally. Here is the code: ...
Enrique Benitez's user avatar
3 votes
2 answers
848 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. ...
MikeCruz13's user avatar
3 votes
1 answer
505 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 ...
Shlomo's user avatar
  • 131
3 votes
2 answers
386 views

PHP Quest System: Push or Polling?

I want to build a quest system in PHP. My idea so far was to create quests based on a class and write two functions for every quest: One is checking if its activated, the other will check the progress....
Standard's user avatar
  • 485
3 votes
1 answer
239 views

What techniques are useful for modelling Character Actions via OOP? [duplicate]

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(), ...
Kzqai's user avatar
  • 1,188
3 votes
2 answers
2k 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 ...
cgwebprojects's user avatar
3 votes
1 answer
293 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 ...
user1636490's user avatar
2 votes
2 answers
276 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 (...
Roelof Berkepeis's user avatar
2 votes
3 answers
1k 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 ...
josmith's user avatar
  • 123
2 votes
1 answer
352 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 ...
Jay Wit's user avatar
  • 163
2 votes
2 answers
3k 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 ...
CodeMoose's user avatar
  • 517
2 votes
1 answer
190 views

Feasible to do all game logic on PHP server?

For the turn-based browser Flash RPG I'm working on, I'm keeping all player stats in a MySQL database, with PHP as the go-between, for the sake of persistence and to prevent cheating by memory editing....
BladePoint's user avatar
2 votes
1 answer
270 views

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

I have a webgame written in PHP and using MariaDB for the database. I'm currently looking into ways of improving core systems. One example would be items. Currently, there is a table ...
Niet the Dark Absol's user avatar
2 votes
3 answers
273 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 $...
Paul Robinson's user avatar
2 votes
1 answer
14k 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"]; ...
Saturn's user avatar
  • 1,771
2 votes
2 answers
2k 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 ...
Kyle's user avatar
  • 41
2 votes
1 answer
2k 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 ...
Revangelis's user avatar
2 votes
1 answer
3k views

how does server communication work in a flash game with a php backend

I am trying to create a browser game using actionscript/flash. Currently, I'm trying to understand how I would go about creating a back-end which interfaced with my MySQL database. As far as I ...
Tim Rogers's user avatar
2 votes
2 answers
11k 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 ...
Alireza Seifi's user avatar
2 votes
1 answer
125 views

Best Practice for Procedural Generation and Code Updates

I am using an initial seed to generate data. The question I have though is what is the best way to mantain the information with code updates. For example if I have something similar to: ...
Robbie's user avatar
  • 121
2 votes
2 answers
2k 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 ...
user2353418's user avatar
2 votes
1 answer
1k 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 ...
user3587554's user avatar
1 vote
6 answers
564 views

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

I'm working on a browser MMORPG in PHP and MySQL and today got a bug report about int32 overflow, due to the player having too much money. When I was designing the core system, I completely forgot ...
matronator's user avatar