Samurai Legend Posted December 18, 2015 Share Posted December 18, 2015 Hello, I just wanted to know how I could make my game economy good when I release it. Any suggestions or ideas? I want my game to be hard but fun at the same to time. However, the economy I need to balance it out. How much each player has, how much this cost etc. I just need to know how to balance out the economy so the game doesn't get ruined. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted December 18, 2015 Share Posted December 18, 2015 I was working on a feature that generically determined the game inflation. I was doing it by: Giving the game X amount of money and crystals ie 1 million game money and like 100k crystals. And every time a player would do a crime or course then the money would be taken from the games bank account(s) and given to the player. Also when a player would buy something in game from like a city shop the money would go back into the bank account. Then I would just query up and sum all the players money and compare it to the bank account and adjust prices on in game items based on that. So if the players had less money than the game, economy is good and items are cheaper but if the players have more money than the game then items were more expensive. This is just to kind of simulate real world 1 Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted December 22, 2015 Author Share Posted December 22, 2015 (edited) [uSER=68711]KyleMassacre[/uSER] - I love your idea! But how would you do something to decide on the crimes payouts, item price etc. When the game bank accounts will always change? I did something like this: I added a new field to the crimes table which is called crimePERC which is a percentage which will take out of the games bank money. So crime 1 will take 1% of the games bank money. Only the do crime page I replaced the money part with: $muny = $set['money_bank'] / $r['crimeMONEYPERC'] / 100; And added: $db->query( "UPDATE `settings` SET `conf_value` = `conf_value` - $muny WHERE `conf_id` = 23"); To update the games bank money. Is this alright or am I doing something wrong? Also what happens if the games bank money goes into minus? Edited December 22, 2015 by Samurai Legend Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted December 22, 2015 Share Posted December 22, 2015 I would crete a function that handles that kind of stuff. Everything you make will have a base price based on what you would ideally want it to be. And if it goes into negative then you need to figure out a way to get people to start buying Quote Link to comment Share on other sites More sharing options...
Dave Posted December 22, 2015 Share Posted December 22, 2015 I was working on a feature that generically determined the game inflation. I was doing it by: Giving the game X amount of money and crystals ie 1 million game money and like 100k crystals. And every time a player would do a crime or course then the money would be taken from the games bank account(s) and given to the player. Also when a player would buy something in game from like a city shop the money would go back into the bank account. Then I would just query up and sum all the players money and compare it to the bank account and adjust prices on in game items based on that. So if the players had less money than the game, economy is good and items are cheaper but if the players have more money than the game then items were more expensive. This is just to kind of simulate real world That's an incredibly interesting way of thinking about game inflation, I've seen numerous games that end up having trillions of $'s flying around and become very unrealistic. Would really love to see this as a plugin! Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted December 22, 2015 Share Posted December 22, 2015 That's an incredibly interesting way of thinking about game inflation, I've seen numerous games that end up having trillions of $'s flying around and become very unrealistic. Would really love to see this as a plugin! I started on it a while ago and put it in a private bitbucket repo but just never got around to completing it 1 Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted December 23, 2015 Share Posted December 23, 2015 I started this a while ago and never really tested it all that much but I figure we as a community can make it better and possibly work. In all honesty I have not idea what I need to fix nor do I really have time but maybe we all can. I'll admit it's not very good and can be better so don't hate but appreciate since something like this can ultimately improve your players game experience. https://bitbucket.org/KyleMassacreMC/mccodes-economy-manager Quote Link to comment Share on other sites More sharing options...
Coly010 Posted December 23, 2015 Share Posted December 23, 2015 (edited) My idea of how to control economy would be to give everything a base value then add or subtract to this base value depending on how the game economy is. I'll take a look at your code now [uSER=68711]KyleMassacre[/uSER] EDIT Seems your code uses base prices lol Edited December 23, 2015 by Coly010 Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted December 23, 2015 Share Posted December 23, 2015 Yes [uSER=65530]Coly010[/uSER]! Basically you have to give everything an ideal price for a perfect world. I believe Alain created an article on how he manages items and stuff using Excel which is pretty handy. Then to calculate the inflated prices you just pass the item value in the constructor and access the class properties and methods based on the items base price. I even tried to go further and calculate inflation for money to crystals and crystals to money for the standard MCC crystal temple. If people want to fork it and make improvements by all means do so 1 Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted December 24, 2015 Author Share Posted December 24, 2015 (edited) [uSER=68711]KyleMassacre[/uSER] - Thank you for the share! Will try to get this running on my gameI seriously love your idea. One more question. I still don't understand how I should make the module update the crimes payout etc Edited December 24, 2015 by Samurai Legend Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted December 24, 2015 Share Posted December 24, 2015 Pass the amount of money that the crime would pay through the constructor Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted December 24, 2015 Author Share Posted December 24, 2015 [uSER=68711]KyleMassacre[/uSER] CREATE TABLE IF NOT EXISTS `economy_settings` ( `type` VARCHAR (20) NOT NULL, `total_ingame_start` decimal(38,0) NOT NULL, `total_ingame` decimal(38,0) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Primary Key: id doesn't exist Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted December 24, 2015 Share Posted December 24, 2015 I'm mobile right now at the store but just add the id in there as auto_increment Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted December 25, 2015 Author Share Posted December 25, 2015 (edited) [uSER=68711]KyleMassacre[/uSER] - I get an error A critical error has occurred, and page execution has stopped. Below are the details: PHP Recoverable Error: Object of class MoneyManager could not be converted to string (4096) Action taken: Line executed: /home/******/public_html/******/test.php:8 <?php require_once('globals.php'); require_once('class/class_economy_system.php'); $mm = new MoneyManager(1000); $cm = new CoinManager(10); echo $mm; ?> Don't know how to fix it or am I doing something wrong? Edited December 25, 2015 by Samurai Legend Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted December 25, 2015 Share Posted December 25, 2015 It's because $mm is an object that can't be converted into a string. The class comes loaded with methods and properties that you can use. Just read the readme file Quote Link to comment Share on other sites More sharing options...
Coly010 Posted December 25, 2015 Share Posted December 25, 2015 [uSER=70283]Samurai Legend[/uSER] I think it's time you learnt OOP. An object, which the MoneyManager is, is a collection of methods (functions) and variables which are grouped together to perform similar tasks relating to the same concept. You are trying to print this object on screen. Essentially you are trying to print the PHP code, all the methods (functions) and variables. This isn't what you want. Within the MoneyManager file there are methods that will allow you to print the inflated price to the screen. EDIT: omit the ?> from the end of your file, it isn't needed 1 Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted December 29, 2015 Author Share Posted December 29, 2015 (edited) [uSER=65530]Coly010[/uSER] - Yes deffo lol and thank you very much [uSER=68711]KyleMassacre[/uSER] - Haha, was being stupid and thank you very much for this modification! I now know how to work it out hahahah Edited December 29, 2015 by Samurai Legend 1 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.