Jump to content

doTurn()


Gighalen

Recommended Posts

Hey guys.

 

I'm currently working on an MMORPG that pretty much revolves around 'turns'. It's a space-oriented game. Each 'turn' players will recieve money, food, resources, and different types of ore based on how much of their 'population' they had assigned to perform those tasks on that turn. I already have 'planets', with population assigned to them, and I have a research system setup to where it will research technology based on how many turns they type in.

 

I am trying to get it to when they do a task, such as researching, it will calculate how much food, money, resources, and ore they should get based on:

1. How many turns they selected.

2. The TOTAL number of populants they have assigned to 'commerce', 'mining', 'agriscience' and 'industry'

3. They get a bonus for each based on how much they have in their infrastructure (commerce, mining, agriscience, and industry).

4. Certain planets produce different ores, so that needs to be taken into account too.

 

Now, I could write a 600-line function that could do this, but that would be extremely inefficient and stressful on the DB, so I was wondering if any of you gurus out there had a better way to calculate this given I have a variable for:

 

-Player's current 'Commerce' level //(1-100), Used For bonus

-Player's current 'mining' level //(1-100), Used For bonus

-Player's current 'agriscience' level //(1-100), Used For bonus

-Player's current 'industry' level //(1-100), Used For bonus

 

-Total population assigned to 'commerce'

-Total population assigned to 'mining'

-Total population assigned to 'agriscience'

-Total population assigned to 'industry'

 

Also, I need some form of SELECT DISTINCT function to select all the planets that produce different types of ores, and have a function that will calculate how much ore will be added the their inventory based on players assigned to mining for that planet and mining bonus.

 

I'm not asking for a complete script, but if you could tell me a few functions that I could use to calculate a few things that would guide me in the right direction, I would greatly appreciate it.

 

 

 

 

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.