Questions tagged [php]
PHP is a general-purpose programming language that is especially suited for web development.
120 questions
0
votes
1
answer
516
views
Create token in Unity to send post request to Laravel controller
Some time ago I wanted to be able to create a token in Unity and send it to a Laravel Controller for saving logins and user game data to an account.
I eventually got this working so I am sharing my ...
2
votes
1
answer
177
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:
...
0
votes
1
answer
124
views
How do I change the turn from a user to the next?
I was asked by a friend to develop a small web game which should support 10 players.
Very basic game-play:
There is a piñata which has x-"healthpoints". Each player can hit the piñata when ...
0
votes
0
answers
171
views
Send post request with content type
I used a php server to communicate with my unity application . I want to send post data with content type so that my php server can use the approriate variable for the content type , for example if i ...
1
vote
1
answer
83
views
I need to improve my ring shop. help with array, loop & query PHP [closed]
I have an array setup which consists of 25 rings, names, stats, prices. Right now in its current form, I have a form setup with 25 radio buttons with a value of 1-25 on them, and I'm using If ...
1
vote
6
answers
825
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 ...
1
vote
1
answer
1k
views
How do I wrap my web browser game as a standalone for Steam?
I've got a PHP/Java based game, which runs in the browser. However, I want to submit this game to Steam.
Now Steam doesn't allow web-based games unless they come in some kind of wrapper.
How can I ...
0
votes
1
answer
311
views
Timed Events in a Unity WebGL game with a PHP / MySQL Server
I want to make an online WebGL game with Unity with button based interaction.
So far I have my login and registration system, with some tables in MySQL to deal with that kind of stuff.
Next I need ...
0
votes
2
answers
230
views
Race condition implementing World Boss System in Web Browser MMO using PHP
I am trying to create a world boss system using PHP. But I am having a problem with how to account for all the damage while updating the health of the boss in real-time.
The current damage process is ...
2
votes
1
answer
314
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 ...
0
votes
1
answer
1k
views
Retrieve multiple images from MySql database via Unity C#
We could say that we are beginners, We can consult and show our data (text) from Mysql but the images don´t show in Unity. Need some help! We hace tried almost everything! We can someone help us.
in ...
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 ...
0
votes
0
answers
61
views
How can I give to player points with ajax but secured? [duplicate]
I have a virtual world game that I developed with jQuery, AJAX and PHP. Virutal World like club penguin. Now, I want to add a game into the virtual world - like bubbles or whatever. The main problem ...
2
votes
1
answer
238
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....
0
votes
1
answer
146
views
Better way than url-encoded query stings to pass data from PHP to Flash?
For the turn-based browser Flash RPG I'm working on, I'm using url-encoded query stings to pass data from PHP to Flash. Basically, Flash posts a request to PHP, then PHP pulls some data from a MySQL ...
0
votes
1
answer
318
views
Calculate Player Level in PHP
So in my program, I currently know how much Experience a player has. I was using this formula to figure out what level the Player was:
...
1
vote
2
answers
487
views
How come serverless functions are so much more expensive than a VPS hosting my PHP API?
I'm working on an online turn-based game. I will have a server, but it will be used strictly for storing match data and relaying it to the match's participants (or spectators). For simplicity, no game ...
1
vote
1
answer
250
views
Attack Algorithm/Forula [closed]
So I'm making a simple RPG game and I'm currently stuck on creating an attacking module for it.
I need to create a simple attack algorithm but I'm really not very good at it.
Each character has 3 ...
0
votes
1
answer
131
views
Get range of hexagon based on specified center
I have this method to get the cells inside a given N range:
...
0
votes
1
answer
374
views
Finding cells within range on a hexagonal grid
I'm looking for a way to get the cells based on a N range. But no luck.
I'm converting Row Column offset to Cube Coordinate system QR -> XYZ
...
3
votes
1
answer
234
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:
...
1
vote
1
answer
2k
views
How to program an experience-based levelup system where experience carries over to the next level?
I'm new into programming, and i've tried to do a system of level up. Here it is :
...
1
vote
1
answer
364
views
How to cache tile map?
I am trying to write a strategy game with PHP, and basically I have a 1d based tile map (grass, dirt, sand, castles, etc.) stored in a database. Now where is 40k records, from x1y1 to x200y200 and I ...
3
votes
2
answers
439
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....
1
vote
1
answer
2k
views
Unity3D: Facebook login into the game + Verification on Server Side
I don't need to know the specific code required for that, but I want to understand at high level how can I implement that and what SDKs I have to use to achieve that.
Facebook PHP SDKs: Ok If I want ...
0
votes
1
answer
769
views
unable to send or update data into my mysql database using unity
I am trying to save user scores into my data base so i have deveoped backend on php and mysql datbase. All the things are complete but having issues to send or receive data through my unity WWW class.
...
-1
votes
3
answers
4k
views
How do I make a highscore database for Unity?
I have been looking around, but I haven't found the perfect answer, yet.
I want to to send scores from Unity to a database, without a username, and display the high scores in the highscore menu. How ...
5
votes
3
answers
509
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 '...
1
vote
0
answers
100
views
PHP development for online games [closed]
I am not pro on programming and games but i had developed an online browser-based game with php . Now i am creating a game like a chess that it do not needs an live-stream and FPS data exchanges.
I ...
1
vote
3
answers
177
views
Protecting/Handling game data
I have been working on a web based game, in which involves a lot of javascript/PHP. My question is what is the most secure way to handle any data being passed between the two languages?
At this ...
1
vote
1
answer
580
views
Designing PHP RPG game: Should I use multiple classes for each type of item or a single table?
I'm making a text-based role playing game written in PHP.
I have a hard time figuring out how to handle items in game - there will be a few types of objects (weapon, machine, tool, building etc) each ...
0
votes
2
answers
332
views
TCG Board Architecture
While I was, sort of, studying the various TCGs around, concepts, similarities, differences and how they could be implemented, if designed to be in a virtual environment (e.g. PC game) I obviously ...
0
votes
1
answer
3k
views
Accessing a database with a php script from Unity mobile game
So I am attempting to keep track of some user data in my game that I am creating in Unity 3d. I am using Unity's WWW class to do this. I am following this tutorial: http://wiki.unity3d.com/index.php?...
1
vote
0
answers
258
views
displaying leaderboard [closed]
Basically what i wish to ask:
*A game is developed for android platform, is on google store and its leader board (scores etc.) are on Google server.
Can we display the top scores from there on a ...
0
votes
1
answer
218
views
PHP browser game energy recover time [closed]
I would like to create something very simple. A browser game, where user can waste its energy and ability points. Unlike other games here there won't be no levels. So energy and ability points restore ...
0
votes
3
answers
1k
views
How do I keep a PHP server running forever?
I'm making a web game RTS, it's mostly create units, manage resources, attack with army, and level up factories. I have created the basics of the game using Javascript, PHP, and MySQL databases. I use ...
-4
votes
3
answers
516
views
Should I create an MMORTS game with server side coding? [closed]
I have gone through many articles on the internet and got to a final conclusion that their is almost no way to protect the game (it can be hacked or its code can be extracted from its APK) and should ...
1
vote
1
answer
145
views
Peer to Peer world download
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. It came to my attention that SQL is not going to ...
3
votes
2
answers
132
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 ...
3
votes
1
answer
267
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(), ...
-3
votes
1
answer
333
views
handling wars in multiplayer browser game [closed]
I'm building a browser game about countries, cities, the user control his city, building it upgrading it, can fight other cities in the same country, elections and war between countries, peace, trade ...
1
vote
0
answers
232
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
3
answers
448
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 ...
4
votes
4
answers
4k
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 ...
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 ...
0
votes
1
answer
1k
views
What is the correct way to authenticate a player with password from Unity to a php api server?
So, I have a game in Unity for mobiles that gives you the possibility to sign-up with username, email and password to unlock extra features.
The datas are sent, through a POST request, to a PHP+MYSQL ...
2
votes
3
answers
314
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
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"];
...
0
votes
0
answers
496
views
Securing HTTP requests to online game server
I'm pretty new at making online games. Right now I'm trying to make an iPhone game. Each player has a profile in my server.
I want to avoid username/password for authentication. Currently, as it ...
0
votes
1
answer
383
views
How to approach players beeing overlapped by high isometric tiles?
I'm making a browser game wich is based on PHP, MySQL and Javascript. It has an isometric world where the player can move and see other players/NPCs. But if a tile in the foreground is so high that it ...