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 20, 2013Hi, thanks for the quick reply.
Makes a lot of sense.
Question/comment about the latest Dev release (0.974.1)
In src/main/java/utils/regalowl/hyperconomy/History.java
There are four places where the History sign result is "?"
in public synchronized String getPercentChange(HyperObject ho, int timevalue)
and in
public synchronized HashMap<HyperObject, String> getPercentChange(String economy, int timevalue)
Your code returns the string "?" if
a) the handles ho or sr are null
b) if the getHistoricalValue() function returns a flag -1.0 (presumably a value to indicate no history)
c) if if (historicValues.size() >= timevalue) is false (line 238)
or d) if if (allValues.containsKey(ho)) { is false, presumably if it cannot find a preset key identifying an object previously cached.
In any event .. four instances of cases where "?" is returned. Same string, different rationale.
A suggestion is to alter the return string so there are four different return strings to pin point which is the rationale for no History data to be available ?
I'm trying to debug why I get "?"
I've checked the history table, and it's populated with multiple entries.
Eg.,
mysql> select object, count(*), min(price), max(price) from hyperconomy_history where object = 'ironingot' group by object having count(*) > 1;
+-----------+----------+------------+------------+
| object | count(*) | min(price) | max(price) |
+-----------+----------+------------+------------+
| ironingot | 4 | 1129.49 | 1400 |
+-----------+----------+------------+------------+
1 row in set (0.00 sec)
My IronIngot History sign shows "(?)"
Ideas?
-
View User Profile
-
Send Message
Posted Nov 19, 2013@D496580
infosigns should already be able to do what you suggest. Try a buy sign or an sb sign. Sb will show both the buy and sell price. The only time these won't give an accurate buy/sell price is when dynamic tax is enabled. Also make sure the sign is created in the correct economy. You can check your economy with /ei
line1 = "ironingot"
line2 = blank
line3 = "buy" or "sb"
line4 = blank
All of the tax settings can be viewed with /taxsettings and changed with /settax ['purchase', 'sales', 'static', 'initial', or 'enchant'] [percent]
The process for updating a config file while the server is running would be /hc disable, edit the config file, /hc enable. /hc disable literally shuts down HyperConomy and is virtually the same as what happens when the server shuts down. The only differences are things like chest protection. On shutdown, HyperConomy saves its YML files and overwrites the files which exist on disk. It also will save and overwrite them while running every few minutes. After HyperConomy is disabled it's safe to edit the yml files.
The basic formula for pricing is: price = ((median * value) / stock) Each economy will have its own individual set of items/variables.
Items switch to dynamic pricing when the initial price is greater than the dynamic price. I guess I can update the manual to this for better clarity. Initial pricing is basically a temporary price ceiling. The point at which initial pricing is greater than the dynamic price depends on all of the price variables and the initial price setting.
The economy reacts because the prices are based on a simple hyperbolic curve price = 1/stock. The price will accelerate towards infinity as the stock approaches 0, and the price will approach 0 as the stock approaches infinity. I may add time based price increases/decreases and add other price modifiers such as item popularity/demand in the future.
As far as item data, the YML is only used to initialize the database and to provide an easy way to edit or backup data. Some other YML files are actually used, such as signs.yml, shops.yml, and displays.yml. I just haven't moved them over to the database yet, basically.
/importnewitems is for adding new items/custom items to the database and isn't needed except during upgrades/customization.
/exporttyml and /importtoyml replace all of the data in the yml, and database economy respectively. So when you do /exporttoyml it will erase everything in your objects.yml file (as of .974) and replace it with the data from your current economy. The yml file can only hold data for one economy at a time. /importfromyml will erase everything in your current economy (you can check this with /ei) and update the database with any changes you make. /importfromyml should work as long as the yml is updated first. (/hc disable first)
When you're using the plugin, technically only the actual Java objects in RAM are updated. The database will be updated a few seconds later asynchronously, however. The yml will not be changed for items. Basically the items.yml/enchants.yml/objects.yml files are not used except for certain commands and when first running HyperConomy and will always be stale unless using /exporttoyml
/ymladditem and /importnewitems are just a convenient way to add new items to the database. /importnewitems will only add items from objects.yml that aren't already in the database.
a) An instance of a purchase or sale when MySQL is enabled
The hyperobject which represents the item will update its stock to the new level and send a SQL update statement to the write queue, after a second or two the queue will be emptied and processed as a transaction. If anything goes wrong it will be rolled back and the error logged. Any statements in the transaction which didn't cause the error will be added back into the write queue. Various other things will also be updated, such as the player's inventory, the hyperplayer which represents the Player which will also send an update statement to the queue to update the player's balance.
b) An instance of /ymladditem when MySQL is enabled
An item entry will be added to objects.yml with the specified settings.
c) An instance of /hc disable when MySQL is enabled
Any remaining statements in the SQL queue are written to the database. The database is shut down and disconnected, all objects are discarded and garbage collected (eventually) except for the main plugin file and some chest protection.
d) An instance of /hc enable when MySQL is enabled
The plugin is entirely reloaded as if the server was just enabled, creating a new connection to the database etc. An object is created for each item in the database which loads all data into RAM. This allows for nearly instantaneous data access while permanent changes are made asynchronously in transactions for quick and lag free saves.
-
View User Profile
-
Send Message
Posted Nov 19, 2013@RegalOwl
Cool man. Thanks.
Good luck. I will plug along and try to figure out what I can in the mean time.
Appreciate your hard work and enthusiasm towards the plugin. It shows.
-
View User Profile
-
Send Message
Posted Nov 19, 2013@D496580
I can add some detail about this to the manual which still needs a lot of work. I will work on replying on here as soon as I get a chance. Have to head back to work for now.
-
View User Profile
-
Send Message
Posted Nov 19, 2013More specific questions on HyperConomy dynamics.
So it says in the documentation (Basics page) "This basically means that the price of items will remain the same until the stock reaches a certain level."
How do I define the "certain level"? What is the unit of that quantity? Is it a scalar value of the item-quantity? item-price? something-else?
Next the Basic's page says:
"Once that stock level is reached, the item will transition to dynamic pricing mode and the price will start to change and react to supply and demand. Dynamic pricing mode is the standard pricing mode in which the price of an item changes every time it is bought or sold."
What exactly is the formula for "react" ? If it is a continuous function, what are the parameters? Is demand a quantity based on how many items are sold/bought by players over a given time period? Can I customize that period of time?
If a sign/transaction provides the capability to sell/buy 1 at a time vs. N at a time, does that difference factor into "demand?" (eg., a player dumps a stack of gold ingot at once.. vs selling one ingot every M minutes?)
Different topic:
So if a HyperConomy installation uses MySQL then there's at least two sets of data.
One set of data is in the tables stored in the RDMS and the other is stored in the filesystem (YML).
There are commands /importfrom... and /exportto... to move between the DB and the filesystem.
I find this very delicate in practice. To work with data in the filesystem (say edit with vi), I have to first flush any new items to the DB (/importnewitems default) then quickly /exporttoyml .. do my edits there in the files.
Then it gets tricky. I cannot "/hc disable" to and /import or /export. I have to have /hc enable{d} to do any /import or /export.
So after editing my files the filesystem, I do a /importfromyml and the DB gets loaded with the new values.. or does it.. It appears (from many testing runs) that this isn't always the case.
I've had to go into MySQL, and update the tables via SQL, then re-export / re-import until the files matched the DB (all the while the /hc is still enabled)
I could easily admit that I am not using the plugin correctly, but it also appears that the process of updating the database can quickly get wedged.
Ok the other source of data - the files themselves. (Assuming again that I'm enabling MySQL)
When hc is actually use ... when players are buying/selling, which database is actually being updated in real time? the files or the MySQL tables?
If the files are being updated in real time while sales/purchases occur even if MySQL is enabled, then the database in MySQL is getting stale.
If the DB is getting updated in realtime (and not the files) during purchases/sales then the files are getting stale.
I'm a bit nervous about this. There are commands like /ymladditem that touch the files first (even if MySQL is enabled).. so Now I have two sets of data, both with new data (possibly) that have to be reconciled upon... what event? the /importfrom... ? the /exportto...?
I'm an old-school SQL programmer so I'm not afraid of relational calculus.. Maybe you can draw up some words that explain exactly what's going on during
a) An instance of a purchase or sale when MySQL is enabled
b) An instance of /ymladditem when MySQL is enabled
c) An instance of /hc disable when MySQL is enabled
d) An instance of /hc enable when MySQL is enabled
Thanks very much.. message me directly if you wish to instead..
sibomots@outlook.com
thanx (really like the plugin, lots to learn)
-
View User Profile
-
Send Message
Posted Nov 19, 2013@HammerHedd
I could make it so that enchantments are sold automatically, but that might result in people accidentally selling items or enchantments that they didn't intend to, especially with /sellall I think it has always been the way it is now, such that you have to sell the enchantment before selling the item.
-
View User Profile
-
Send Message
Posted Nov 19, 2013@D496580
OK that sounds fair. Thanks for updating the docs by the way. That _really_ helps isolate what to set for each command.
So.. here's a half question / half request .. Not sure where it falls --
It would be supremely cool to be able to show via signs what the current market price is of an item that is being bought by the server.
Eg. Here's a simple use case.
Server buys ingots from players. This is how we create the money (M1) supply (recall your Economics 101)
So the ingots are priced accordingly in the database and players sell their ingots, thus creating cash.
The cash in turn is used by players to trade among themselves for finished-goods (armor, tools, etc... The server does _not_ deal in finished goods, only raw basic commodities).
So, just like any exchange pit on Wall Street, it would be really sweet if a Sign could show the current ASK price of an item, like a "goldingot".
I could try to fake it with a "buy" transaction sign, but I don't know how to configure the sign to show the price. Maybe I'm doing it wrong.
Sort of unrelated pure question --
Tax rate. I want to set this and I'm not sure where. So, I looked in config.yml and found my answer.. Lot's of tax settings. I set them to what I wanted, then:
/hc disable /hc enable
thinking that would "reload" the config. The taxes didn't change. Did I do that wrong?
What is the right method to reload the plugin in such a way that config.yml for HyperConomy is truly reloaded?
Thanks, awesome plugin. I know there's more to this plugin I don't understand yet, but I will.
I forgot where it was, but is there a summary of the mathematics behind the formula of buying/selling prices? I have players wondering and I want to give them the straight answer from the top banana, or RegalOwl in this case.
Thanke.
-
View User Profile
-
Send Message
Posted Nov 18, 2013@RegalOwl
Should enchanted items be able to be sold? As of .974.1 a woodenhoe with unbreaking (yeah, just testing) wouldn't sell as a wooden hoe. Didn't the enchant price used to be calculated and it would sell both the item and the enchantment?
-
View User Profile
-
Send Message
Posted Nov 17, 2013@MachoMancha
Hey Erik,
I just replied to your PM. Basically it just involves editing the language file enUS.hl. I may look into pulling the currency name from Vault in the future, but I don't think that will tell the plugin whether to display it before or after the price.
-
View User Profile
-
Send Message
Posted Nov 17, 2013I sent you a PM, but I don't think you saw it.
Avatar of xMachoMancha
Reply Report Edit Delete Attach
xMachoMancha 1 day, 13 hours ago
Hey again Regal, I have a question regarding custom economy options. I have changed my currency from dollars ($) to "SC Tokens" in Essentials, which changes the currency in just about everything except Hyperconomy. What I mean by this is that when a player purchases an item, the message "You bought 1.0 diamond for $500.0 of which $0.0 was tax" appears, when in fact I would like it to say "You bought 1.0 diamond for 500.0 SCT of which 0.0 SCT was tax."
So how would I change the prefix "$" to the suffix "SCT"?
(This is only a problem with the messages, not the actual event of a purchase within a shop)
Thanks, Erik.
-
View User Profile
-
Send Message
Posted Nov 17, 2013@HammerHedd
Not yet, but that's definitely a good idea. I can add this to the todo list.
-
View User Profile
-
Send Message
Posted Nov 17, 2013@Jleeevinnn
Yep, just set use-shops to false in config.yml
-
View User Profile
-
Send Message
Posted Nov 16, 2013Is there a way to enable /buy and /sell and what not globally not requiring the player to be insdie a defined shop?
-
View User Profile
-
Send Message
Posted Nov 16, 2013@RegalOwl
Thank you much, with that and kommandsigns this is perfect :D
-
View User Profile
-
Send Message
Posted Nov 16, 2013Is there a way to add enchanted, named items to the objects database without screwing up the base objects? I see that the database stores some metadata (like 5:3 for jungle wood) but it doesn't seem to be able to deal with additional metadata like named items (chainmail renamed to mithril and enchanted with projectile protection). Perhaps I have missed something. I tried using /ymladditem, but it only recognizes the base item (chainmail_chestplate).
It would be awesome to allow custom items to float through the various economies as well, although I realize this might be a substantial database re-write.
-
View User Profile
-
Send Message
Posted Nov 15, 2013@Willnerd42
Yep, set unlimited-stock-for-static-items to true in config.yml while HyperConomy is disabled (/hc disable) and then use "/setstaticall copy".
items.yml is basically used for backups, mass edits, or setting up the first economy. After that, all data is stored in HyperConomy.db. You can export or import data to/from items.yml (it's now objects.yml if you're using .974.x) with /exporttoyml and /importfromyml
-
View User Profile
-
Send Message
Posted Nov 15, 2013Hi, is there any way to create a shop with fixed price for all items and unlimited stock of those items? I have no idea how to do this, because the items.yml does not seem to have any correlation with the ingame settings.
-
View User Profile
-
Send Message
Posted Nov 14, 2013@BobbySoSlo
You can use HyperMerchant which is linked in the add-ons section. It creates a GUI for regular shops.
-
View User Profile
-
Send Message
Posted Nov 14, 2013So I have a request, I would love it if I could make server chest shops that had unlimited inventory. I see that you already have a feature planned to make it affect global stock which I would love, and having them tax would be good too.
Basically I'd like the chest shops to act as a gui to the server inventory
Thanks, the command line will be good for now but I dont have a very 'command friendly' server.
-
View User Profile
-
Send Message
Posted Nov 14, 2013(Edit nevermind, found the answer right after posting this)
I hope this isn't a dumb question but I spent 10 mintues searching before commenting:
Is there a way to make a server chest shop?
(Also you should really put somewhere that you have to crouch to destroy chest shops)
Thanks for the great plug in, its the first I've seen one do exactly what I want without hours of work :)