Jump to content

Building a game in PHP/Mysql. [My input and hopefully yours!]


thewhat

Recommended Posts

Hi all. As the title says, I'm building a game in PHP/Mysql. Now this is my first time but I've got everything mapped out pretty well. Most of the nation building aspects will be done through mysql with the users being able to extract specific info from a DB and placed on their nation and whatnot. I have a few questions though - for those more experienced with these languages.

 

Creating a war system. ??? How would this work? Essentially, what I'd need would be for one user to be able to "destroy" another users info. Soldiers, tanks, etc. But it's clear to me that I have NO idea on how to go about this. So, my question to all of you is this: What options would you suggest to me to create such a system.

 

Sadly, I know this will be all to simple in the end. A Db with some kind of manipulative function and I'm done, probably. But considering I'm kind of stuck atm, I'll ask around. :)

 

 

Link to comment
Share on other sites

You're going to have to come up with some form of algorithm based on what units each person has. This could be very simple - say a person has 5 soliders with a power of 1 each and 2 tanks with a firepower of 2 each. Total firepower = 5*1 +2*2 = 9. Other user has 4 soldiers and 3 tanks. Total firepower = 4*1 + 3*2 = 10. User two destroys user 1.

 

However, its unlikely your game would be very good with such a simplistic battle. You'd want to take into account factors such as which units are better against what, who is defending, speed of units etc. You'd also probably want to consider the idea that you dont destory all of either team at first, but rather destroy some of their units.

 

In short, its as complex as you want it to be.

Link to comment
Share on other sites

Hi again. Anyone familiar with cron jobs? I've had an idea floating around recently that would require cron. Essentially, the player/user would click something that would give them something from a database, HOWEVER, it would take x amount of hours.

 

I know it seems like I'm asking alot of questions but I think if more people join in on this convo it could be a useful thread for the future.  ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.