Gighalen Posted May 30, 2008 Share Posted May 30, 2008 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. Quote Link to comment Share on other sites More sharing options...
Hooker Posted May 31, 2008 Share Posted May 31, 2008 Can we see your table structures? I think i understand what you want but without seeing how its all set out its difficult to say what your best bet is. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.