HyperConomy
Getting Started|Commands|Permissions|FAQ|How To|Troubleshooting
______________________________________________________________________________
Introduction
HyperConomy is the all in one economy and shop plugin. It can be a simple chest or sign shop plugin, a Vault compatible economy plugin, a region based shop plugin with many configurable options, or even a complex system of economically competing towns and kingdoms. Any vanilla Minecraft item can be traded in HyperConomy and virtually any custom item can be added as well. Prices can be configured to change dynamically or they can be set as desired. To quickly edit prices and settings you can double click on HyperConomy.jar to access the GUI editor. HyperConomy has many features including things such as item price linking and item displays. Read below or check out the wiki for more information.
New Chest Shops:
______________________________________________________________________________
Features
- Supports all standard Minecraft items. (fireworks, lore, books, maps, damaged items, etc.)
- Supports the addition of unlimited custom items.
- Integrated economy plugin.
- Player to player, player to shop, and shop to player trading.
- Dynamic pricing system based on a hyperbolic curve.
- Item price linking (price of recipe item is based on price of component items)
- Player owned shops and chest shops.
- Item frame shops.
- Showcase style item displays.
- Localization.
- GUI Editor for easy manipulation of price settings.
- Price floor, price ceiling, static pricing, initial pricing, sales tax, purchase tax, unlimited stock option and much more.
- Dynamic tax rates. (Rich players can be taxed more than poor ones.)
- Supports MySQL and SQLite.
- Allows the creation of an unlimited number of economies, which allows for economically competing towns, kingdoms, factions, or other groups.
- Supports command-free economies using transaction signs and chest shops.
- Price information, history, and more can be displayed on automatically updating information signs.
- Price update notifications for any or all items.
- Experience and enchantment trading.
- When a player enters and leaves a shop, HyperConomy displays a customizable message.
- Nearly everything can be changed while the server is running.
- Unwanted features can be disabled.
______________________________________________________________________________
Requirements
- None. If you'd like to integrate with an existing economy plugin using Vault, you will need the following: Vault and an economy plugin such as BOSEconomy, iConomy, or Essentials Economy
______________________________________________________________________________
Versions and Development Builds
- Recommended builds are marked with [RB] and are generally thought to be stable and bug free.
- Builds marked as [Beta] are as bug free as possible, but often have large code changes which may result in the appearance of new bugs.
- Builds marked as [Dev] are development builds that I've decided to upload to BukkitDev. I may upload dev builds on occasion to provide easy access because Bukkit staff does not allow linking to development builds.
- Development builds may contain bugs as I work on releasing a new [Beta] build. They may also contain fixes for bugs found in [Beta] builds. Use these builds if you're looking for a bug fix, or would like to try out a new feature I've just added. Also, feel free to search for bugs in the development builds. Any help with testing is greatly appreciated!
- Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
- The latest development builds can be found here.
______________________________________________________________________________
Add-ons
- HyperMerchant
HyperMerchant is a graphical user interface for your players to use to interact with HyperConomy shops.
It is also includes the ability to easily create Citizens npc shopkeepers for your HyperConomy shops. - HyperConomy Web
HyperConomy Web creates a web page for HyperConomy, displaying information about all shops, items, and price history. The web page appearance can be customized to fit your server.
______________________________________________________________________________
New Features, Bugs, Problems, etc.
- If you have a question, or find a bug, first check the FAQ. I will try to include as many helpful questions and answers as possible.
- If the FAQ doesn't help, don't hesitate to post your question or make a ticket.
- If you do find a bug, please include which version of HyperConomy you're using, the full error message or stack trace (if there is one), the version and type of Minecraft server you're running, and an explanation of how to reproduce the bug or what causes the bug.
______________________________________________________________________________
Donate
- If you'd like to send me a donation for the time and effort spent making this plugin, you can do so here: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AMK9AR4CVKEJJ
- To those who have donated: thank you very much for the support. If you'd like to be listed as a donor here just send me a message.
______________________________________________________________________________
Donors
- pr4xt3roy -> CapricaTown
- Baamoink -> Mantle-Craft
- Thanks as well to all of the other donors that haven't requested a listing here.
______________________________________________________________________________
Basic Tutorial
New tutorial videos to come...
-
View User Profile
-
Send Message
Posted Nov 23, 2013PLEASE find a way to integrate this plugin with FrameStore.
I love the dynamic economy of HyperConomy, and the visually appealing design of FrameStore, but alas they don't work together.
-
View User Profile
-
Send Message
Posted Nov 22, 2013@RegalOwl
About the futures data.
What I envisoned was this:
When the server goes down for regular backups, I query the DB and figure out the number of ores mined in the last 24hrs. And, using some heuristic determine how many items to offset the median by. So I understand the data flow/timing problem you mention (thanks for reminding me). But in the short term, I may be able to work around it until something allows for dynamic real-time updates (think: WalMart feeds Proctor and Gamble databases -- which is how most big-box retailers work these days.. When a customer buys X units of Y, the database at the manufacturer is updated not just the retailer).
So, for example if I see a spike in Iron Ore mining, I may adjust the median for say, Iron Ingots, or Iron Pick Axe etc..
I need to collect data over time to model it -- throw it in to a JMP model or something to look for any correlation between ore mined and iron-based items sold/purchased.
As far as the code environment, I just need to get the right MCP environment setup. I've dabbled with mods (FML) but plugins may be just as simple to setup in the IDE. I run a MCPC+ server so I need to make sure that I have the right MCP version so I can test my mods to your plugin before submitting the diffs for your review and approval.
One of the things I will probably try to do first is make the formula configurable in yml.
I prefer data driven operations, so the formula to compute prices should (IMHO) be something I can actually configure in files rather than in the code. I may want to put a dampening function on the price so that I can smooth out the prices.. Eg., if I drop 64 items at once to sell, I should be able to get the same price for all 64 (I think you do this actually already because you can set N (Line 4) of a sign).
I also want to re-work some of the offsets.. LIke instead of just tax to offset prices, I want to setup a discount/markup % as well. So for a server shop, I don't really want to use taxes, but I do want to markup any purchases so that it always costs more to BUY the raw material than it does to sell it. the use of "tax" to do this seems contrived. Not a complaint, just an idea.
I also think about accounting for demand when stock is 0. I get some players who ask "why are there no X in the server shop?" and on my server (which is 99% player run economy based) the answer is invariably "because no player has sold any to the server."
I need to know this data to make sure we're balanced. We run a MagicFarm server (blatent plug: FooFarm.net) and so the idea of resources sold/purchased is at the heart of the design of player-run-economies.
I remember fondly the mud we used to play 20 years ago where we had player run breweries.
There was a clan that made barrels, a clan that grew hops, and a clan that brewed beer. It all worked beautifully. Beer was required to heal.
Minecraft has taken this idea up an order of magnitude, and it's great. Your plugin provides a real interesting way to implement these player run economies. You got a good thing here.
-
View User Profile
-
Send Message
Posted Nov 22, 2013@shadvalentine
For a transaction sign it would be like this:
line1 = Dirt
line2 =
line3 = [sell:buy]
line 4 = 1
If you only want to be able to sell to the sign make it [sell] on line 3, and [buy] for only allowing purchases. You can change the quantity to whatever you'd like on line 4. If you turn on scrolling transaction signs in config.yml players will be able to use their mouse scroll wheel to change the quantity when looking at the sign.
There are both informational signs like the one you made, and transaction signs for trading.
-
View User Profile
-
Send Message
Posted Nov 22, 2013@RegalOwl
using latest dev build and it seems to be working now .. I can actually use your econ commands /hcbalance and it will update correctly when I change servers with miconomy running .. so now I just need to figure out how do use your plugin ;-)
question about signs .. I have made a sign with
line1 Dirt
line2
line3 Sell
line4
and it looks like it sets correctly however when I click the sign nothing happens .. this is how you make "admin" shops that players can buy from right?
-
View User Profile
-
Send Message
Posted Nov 22, 2013ok .. I renamed MiConomy to aMiConomy in both the the plugin.yml and the jar name and it now hooks the external plugin .. however now I get an error from hyperconomy ..
2013-11-22 09:33:33 [SEVERE] org.apache.commons.lang.UnhandledException Plugin HyperConomy v0.974.1 generated an exception while executing task 22
at org.bukkit.craftbukkit.v1_6_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.milkbowl.vault.economy.plugins.Economy_MiConomy.hasAccount(Economy_MiConomy.java:111)
at net.milkbowl.vault.economy.plugins.Economy_MiConomy.hasAccount(Economy_MiConomy.java:103)
at regalowl.hyperconomy.HyperPlayer.createExternalAccount(HyperPlayer.java:75)
at regalowl.hyperconomy.HyperPlayer.<init>(HyperPlayer.java:70)
at regalowl.hyperconomy.EconomyManager$3.run(EconomyManager.java:339)
at org.bukkit.craftbukkit.v1_6_R3.scheduler.CraftTask.run(CraftTask.java:53)
at org.bukkit.craftbukkit.v1_6_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
... 3 more
-
View User Profile
-
Send Message
Posted Nov 22, 2013@shadvalentine
Try the latest dev build #290. I will be releasing a new version soon. The problem is most likely that HyperConomy is loading before Vault and thus can't detect it. Due to the way the new Vault link works a softdepend was needed.
And yes, that's correct. You would need to use the API to change the balance of an account for the internal economy since the live data is stored in RAM.
-
View User Profile
-
Send Message
Posted Nov 22, 2013I think I may have found the problem .. looks like hyperconomy is loading before mieconomy hooks into vault .. if I leave hyperconomy unloaded at server start then use plugman to load it hyperconomy uses the external economy plugin
-
View User Profile
-
Send Message
Posted Nov 22, 2013looked in the console ...
2013-11-22 09:00:03 [INFO] [PlugMan] Loading PlugMan v1.8.4
2013-11-22 09:00:03 [INFO] [MiConomy] Loading MiConomy v1.2
2013-11-22 09:00:03 [INFO] [HyperConomy] Loading HyperConomy v0.974.1
2013-11-22 09:00:04 [INFO] [Vault] Loading Vault v1.2.27-b349
2013-11-22 09:00:04 [INFO] [Transporter] Loading Transporter v8.14
2013-11-22 09:00:04 [INFO] [HyperConomy] Enabling HyperConomy v0.974.1
2013-11-22 09:00:05 [INFO] [HyperConomy]Using internal economy plugin.
2013-11-22 09:00:05 [INFO] [Vault] Enabling Vault v1.2.27-b349
2013-11-22 09:00:05 [INFO] [Vault][Economy] MiConomy found: Waiting
2013-11-22 09:00:05 [INFO] [Vault][Permission] SuperPermissions loaded as backup permission system.
2013-11-22 09:00:05 [INFO] [Vault] Enabled Version 1.2.27-b349
-
View User Profile
-
Send Message
Posted Nov 21, 2013I am trying to use this economy with your plugin: http://dev.bukkit.org/bukkit-plugins/miconomy/
and I can not figure out how to make it link .. I have vault and have these options set:
use-external-economy-plugin: true
hook-internal-economy-into-vault: false
but it still uses your built in economy .. reason I need this economy is because I am setting up a bungee cord server and miconomy will let me have the same balance on multiple servers through MySQL .. where yours does not update from the MySQL unless I reload the server.
-
View User Profile
-
Send Message
Posted Nov 21, 2013@Zach443
Use the following to make the values 1/4 of their current value.
/scalebypercent startprice 25
/scalebypercent value 25
For 1/2 it would be:
/scalebypercent startprice 50
/scalebypercent value 50
You can repeat it as many times as you'd like. Eventually though some items might get to less than .01 value.
-
View User Profile
-
Send Message
Posted Nov 21, 2013@D496580
The other thing I wanted to say but ran out of time for was thanks for pointing out the division by 0. That could cause problems for free items. Never noticed that or tested whether or not free items work. They seem to.
Your idea about using statistics on the number of mined blocks to affect the median is definitely an interesting idea. I could potentially add something like that. Rather than log each block it could just keep the total collected for each. When combined with composite items it could adjust most of the medians indirectly. The hard part would be figuring out some sort of formula which translates the number collected into a reasonable median.
The only problem you may run into if using a cron job is that changing the database won't update the objects in RAM, so the changes could potentially be overwritten and wouldn't take until the next server restart. The API has a setmedian method which could be used through another plugin for this.
If you do get Eclipse setup any help would be appreciated. :)
-
View User Profile
-
Send Message
Posted Nov 21, 2013@RegalOwl
Nah, you're cool. You got more time to code these things than I do.
I gotta get my Eclipse setup to make modifications to plugins. One of these days.
-
View User Profile
-
Send Message
Posted Nov 21, 2013I just got this on my server and all the prices for things are extremely high (80 dollars for 1 carrots... lol). How do I fix this?
-
View User Profile
-
Send Message
Posted Nov 21, 2013thank you for this awesome plugin!
-
View User Profile
-
Send Message
Posted Nov 21, 2013@D496580
There is a third possibility that I hadn't thought of in my last message, which is that the sign itself is dead/broken. By dead I mean the sign is no longer registered as an info sign and is just a regular Minecraft sign. This can be tested by creating a new identical sign next to it to see if it behaves differently. If you have any data in your history table the 1h sign should be working since this history updates in 1 hour increments. I've had problems with signs breaking in this manner in the past so it wouldn't be too surprising if there is some new bug which causes it. I can look into it if that's the case.
I see your point about ? being ambiguous. In general, however, the intention of the ? mark was simply to show that the percent change in value is unknown, not to specify why it is unknown. I guess I just felt like it would be more confusing to players to say something like "no data" and/or "error". The percent change is either green for an increase, red for a decrease, or blue for unknown (?). So it's basically now the equivalent of yes, no, or unknown which seemed nice in its simplicity. I can think about changing this however. There may be a better way.
The 3600000 can be changed to a constant as well for clarity. It's simply the number of milliseconds in 1 hour. I agree about avoiding magic numbers for clarity. That's sometime I had no idea about when I started working on this plugin. Definitely good to improve the code now though. I'm sure there are still many more poorly written sections from the early days. Thanks for the nit-picking. :)
Have to go...will edit to finish the message later.
-
View User Profile
-
Send Message
Posted Nov 21, 2013@RegalOwl
I had it set to 1hr, then 5hr, then 24hr.
Meanwhile I checked the database and there were multiple entries of prices per object (as I demonstrated with the SQL query).
It was unclear at first until your post-reply that the data in a History sign is delayed.
So, let's say for example that the history table has many records per object. Then creating a History sign, the data in the sign is still "(?)".
Why wouldn't a non "(?)" result be the initial string if there was data to compute upon making the sign? That is what was confusing. I thought I had valid data to compute a History but.. as you hinted, the result in the History sign is delayed (still trying to see where that time out is counted).
I also see that there are some magic numbers in that class..
For example, in History.java
if (timeCounter >= 3600000) {
// if (timeCounter >= 120000) {
3600000 looks suspiciously like a 24hr clock time out.. But it's still a magic number in the code. (just what SW engineers call the insertion of hard coded numbers in code -- magic numbers). Over time, magic numbers in code tend to bite you in your 6. A simple const enumeration in the class would be great.
About this "(?)" thing:
Just a programming idiom -- the return value of "(?)" for distinctly different rationales is confusing.
Eg:
public synchronized String getPercentChange(HyperObject ho, int timevalue) {
if (ho == null || sr == null) {
return "?";
}
CommonFunctions cf = hc.getCommonFunctions();
double percentChange = 0.0;
double historicvalue = getHistoricValue(ho.getName(), ho.getEconomy(), timevalue);
if (historicvalue == -1.0) {
return "?";
}
It's confusing because the User (who is staring at the sign) doesn't know really what the problem is.
If the handle is bad, we return the same string as if the handle was good and the data was not available. Completely different situations. Return values from functions should have distinct values for different reasons.
It's sort of like CheckBankAccount() returns -1 if the account is unavailable because the database handle is null or -1 if the account has been closed.
I can't return 0 for a closed-account because 0 could be the balance of an open account.
I can return -2 for a closed account. And then I've just made two distinct return values for two distinct causes. Good. But I could go further -- Or in fact I could return -X for a closed account if the account still had funds X in it. But then I cannot return -1 for a bad handle. So more feature I add, the more I box myself in a corner.
Instead, the return value can be a structure (class object) so that the meta data in the struct has members:
code
balance
where code is an enumerated type: E_NOHANDLE, E_CLOSEDACCT, S_OK,
and balance is just a float.
Then I can tell easily if the query was successful or failure by testing Result.code != S_OK
else treat Result.balance as legitimate.
It would be better, IMHO that the return value be relevant to the meaning.
No data in _history table => "N/A"
No handle => "Error"
etc..
One more super small nit to pick (sorry, the embedded software engineer in me can't resist )
percentChange = ((currentvalue - historicvalue) / historicvalue) * 100;
percentChange is a double.
So if it was me, the operand 100 should be 100.0 in the code. Makes it more readable.
I know Java doesn't care and does "the right thing", but human reading the code may be confused if the operands are integers or not. And, unless I missed something you divide by historicValue without checking it's non-zero. I forgot if you put in a try block, nope seems not. Just an fault/bug waiting to happen.
Up to you; it's your code.
Don't read me wrong -- I really love this plugin and use it heavily in my server. I've got a lot of reading to do in pricing and market dynamics to pick the right median.
I am tempted to link the results of the CoreProtect plugin (which uses MySQL so I can query it easily in the shell) with yours (hc_objects table) so .. heh (evil grin) I can actually determine how many blocks of a certain ORE are being mined as insider information on setting the median dynamically via cron on an hourly basis.
Keep up the great work. It's awesome.
-
View User Profile
-
Send Message
Posted Nov 21, 2013@RegalOwl
I'll make a ticket and give more details.
Short answer tho:
It doesn't happen every time. I'm using MySQL and I don't have an errors.log.
This also happens on build #288.
-
View User Profile
-
Send Message
Posted Nov 20, 2013@HammerHedd
Not yet, but that sounds like a large issue. Do you have any errors in errors.log? And are you using MySQL or SQLite? Mass errors are the only certain thing that might slow it down. If it's not that it has to be a bug of some sort. Let me know if you find a way to repeat it consistently. I'll see if I can reproduce it, but so far no luck.
-
View User Profile
-
Send Message
Posted Nov 20, 2013In build #284 I periodically have long delays (up to 20 minutes) right after
[HyperConomy] Internal economy unhooked from Vault.
It seems like this task is the cause of the delay:
[Databukkit[HyperConomy]] Finishing the current SQL write task... Please wait.
I have 5 different economies currently. Even if I start up and then shut down right away, this still happens.
But only sometimes.
Any idea what might be causing this?
-
View User Profile
-
Send Message
Posted Nov 20, 2013@D496580
There are really only two cases for the "?". I've added an error log entry for one of the two cases so that there is only one possible meaning in the latest dev build. (If you look at the error log, of course.) One of the getPercentChange functions is used by the web page, and the other is used for info signs. In each function there are basically two options, either the HyperObject is null or doesn't exist, or there is no data available for the specified time value. I tested it and no errors have appeared yet. Let me know if you see any. It seems to be functioning as expected for my test server.
The ? should mean, unless you get an error, that there is no data available for the specified time on the info sign. So if you set the time value to 1d for instance, your server will need to run for 24 hours or so until that history sign will populate. A 1h info sign will populate in 1h. What did you have your sign set to?