RandomEncounters
Overview
Tired of seeing the same old villages? Wish there was a way to add configurable encounters to the world? This is the problem Random Encounters aims to fix. From portal temples on the overworld with their Blaze leader and a horde of mad zombie pigmen gated in from the nether to common farms. Each encounter is configurable including the probability of the encounter, to the encounters eventual expansion, to the probability of each treasure item in chests or on the mobs.
Features
- Add encounters to the minecraft world
- Configure hostile mobs
- Configure encounter treasure
- Configure encounter growth
- No more are there just plain old villages
- Allows the placement of large structures without lagging the server
Dependencies
Configuration
Plugin Configuration
debug
The Debug section is designed to help developers in identifying how the plugin is operating to aid in-game verification and help troubleshoot the plugin during development.
- midas [Boolean] (default: false) King Midas was known for turning everything he touched into gold. This debug mode turns the surface area checked into gold to spot invalid encounter placement areas
- loglevel [Integer] (default: 0) This debug option tells the plugin how much information to output.
maxLockTime
[Integer] (default: 10) This is the maximum number of milliseconds any task will lock the server for processing.
structureConfig
The structureConfig option is a string of the file name containing the structure configurations in JSON format. The default value is structures.json.
{
"structures": [
{
"name": "(String) Unique structure name",
"file": "(String) Schematic file name including directories",
"minY": "(Integer) Minimum Y coordinate to place the structure",
"maxY": "(Integer) Maximum Y coordinate to place the structure",
"trump": [
"(String) MaterialName of over writable material",
],
"invalid": [
"(String) MaterialName of invalid foundation material",
]
},
],
}
mobConfig
The mobConfig option is a string of the file name containing the mob / creature configurations in JSON format. The default value is mobs.json.
For more information on the mobs.json visit:
Mob Configuration Options
treasureConfig
The treasureConfig option is a string of the file name containing the treasure / item configurations in JSON format. The default value is treasures.json.
{
"treasures":[
{
"name": "(Sring) Unique treasure name",
"material": "(String) MaterialName",
"tagName": "(String) Item Name",
"min": "(Integer) Minimum",
"max": "(Integer) Maximum",
"probability": "(Double) Probability",
"treasureGroups": [
{
"name": "(String) Treasure name for group",
"min": "(Integer) Minimum number to generate",
"max": "(Integer) Maximum number to generate",
"probability": "(Double) Probability of additional groups"
}
],
"enchantments": [
{
"enchantment": "(String) EnchantmentName",
"probability": "(Double) Probability",
"level": "(Integer) EnchantmentLevel"
},
]
},
],
}
encounterConfig
The encounterConfig option is a string of the file name containing the encounter configurations in JSON format. The default value is encounters.json. The encounter configuration file is what ties Structures, Mobs, and Treasure all together.
{
"encounters": [
{
"name": "(String) Unique Encounter Name",
"enabled": "(Boolean) should new encounters be generated",
"probability":"(Double) probability of occurrence",
"structure": "(String) Structure name from defined structures",
"mobs": [
"(String) Mob name from defined mobs",
],
"validBiomes": [
"(String) Biome name",
],
"invalidBiomes": [
"(String) Biome name",
],
"treasures": [
"(String) Treasure name from defined treasures",
],
"expansions": [
{
"encounter": "(String) defined Encounter name",
"probability": "(Double) probability of expansion",
"duration": "(Integer) Duration in minutes to check ",
"max": "(Integer) maximum number of expansions",
"distance": "(Integer) maximum distance in chunks"
},
]
},
]
}
Commands
re reload
Reloads the JSON configuration files. Keep an eye on the console for errors
re place <encounter> [<world> <x> <y> <z>]
Forces an encounter to be placed at the player's current location or the location specified. This does not perform terrain checks. The console command must specify the coordinates
re check <encounter> [<world> <x> <y> <z>]
Forces the system to check the current chunk, or the chunk containing the specified location to place an encounter. This performs terrain checks and places the encounter if a suitable location is found. The console command must specify the coordinates
re radius <encounter> <radius> [<world> <x> <z>]
Forces the system to check all chunks in a specified radius of chunks from the current player location or the location given by the specified chunk coordinates. The console command must specify the chunk coordinates
Installation
- To install the plugin, extract the contents of the zip file into your plugins directory.
- Default encounters are included in the RandomEncounters folder.
Bugs / Known Limitations
Because of the vast nature of this plugin, please use the GitHub Issue tracking system to submit bugs, issues, and feature requests.
GitHub Issue Tracking
Structure Contributors
@jacob_vejvoda
If you lower the probability for the encounter it will check less often on where to place the structures.
That change is made in the encounters.json file.
How do I make the structures spawn less often? There are so many I can always see one no mater where I go.
@kik4444
I had hoped to release v0.2 this past weekend, but the server ran away with the spoon:
I've also been adding some other features to make life easier to be more complected. Potion Effects and Equipment for Mobs, Mob Group configurations, etc...
So how long until 0.2 is out? Cause worlds can get quite boring.
I've been running some statistics on v0.2. I have the expansion configuration speed up quite a bit. Every 5 or so minutes, the server spikes for about 200+ seconds. This is problematic for obvious reasons. In a real world scenario, the expansion checks wouldn't happen every two minutes, but for large servers, this is bad news. My goal is to reduce the time required to process these checks.
Oh, sorry, I must have misunderstood. xD @Archmagelnc
@blie4
By screens, you mean screenshots? The point to remember is this plugin will load any schematic file. The ones included were just some I had previously collected for testing. You can go to Minecraft Schematics and define your structures from those schematics. This plugin merely facilitates the automated, random process of placing these structures with a defined group of mobs, treasures, and expansions. The plugin itself is not responsible for what the structures look like. That is the point. However, I will try to add some images depicting this the best way I can.
Can you post some screens? @Archmagelnc
@egadgetboy
Also, there is a fix coming in v0.2 that addresses the attachable items, like torches and ladders, falling off. As a side note, I will not take credit for any of the schematics. In hind sight, I probably should not have included them with the resources. I used them during the build process of the plugin and included them for beta testing only.
Ah yes memory. When building this I have seen where this plugin could get quite memory intensive. My tests are run with a 10Gb heap because that's what my production minecraft server uses. There is a trade off between processing power and memory that can be made to improve the overall performance. While each structure is a single instance, regardless of how many times it is placed in the world, they are all stored in memory. The larger the structure, in your case the seahorse-isle, the more memory it takes up. The problem is it is very process intensive to load these structures. Opting to load all of them at the beginning reduces the "socket timeout errors" that would otherwise occur when loading and placing a structure live. Even still, extremely large structures may still cause socket timeouts due to locking the server up when placed. I will look into how memory might be better managed in the future. Please enter a ticket in the ticketing system so this may be tracked for development.
Ok, here's an update. In the schematics folder, I added the extension .old to all of the files and then restarted the server. I then removed .old from each file, one at a time. seahorse-isle.schematic is definitely causing a huge load, so I have disabled it permanently (using the .old method). Fortunately, running all of the remaining schematics simultaneously has a total load on my server of under 700mb. One side note - one of the towers is malformed. Ladders and doors are broken and laying around. Another house (not sure which) is also malformed. Torches and flowers are broken and laying around. Please accept all of this as constructive feedback. Otherwise, I'm really enjoying the plugin! You can tell lots of work went into each schematic.
Installed latest version on 1.7.2 CraftBukkit server - now my 2.5gb of ram is completely maxed out.
Will it just be maxed out for a bit while it generates structures? Or does this plugin really cause an almost 2gb load on the server all the time?
I have uploaded what I have and re-submitted this project for approval. This is an attempt to release the plugin in Beta, meaning there may be issues, but my tests have proved successful. I will need your help to make sure this plugin is able to go into release.
All, I don't want to get anyone's hopes up. Obviously nothing has been posted on this for far too long. I have re-written this entire plugin three times now. The last rendition used WorldEdit as a dependency for structure placement and schematic reading. It works pretty well. Far better than the BlockRecorder plugin I wrote. This allows the admin to create their own structures with very specific items in chests and so forth. The down side was it limited the ability to define a random treasure. I added configuration options as to what biomes an encounter was allowed to be placed in. Mobs were still a big concern as previously I was falsifying hitting the mob to make it aggressive and then healing it. I thought about just leaving the mob portion out of the latest rendition in favor of placing spawners in the structure. This simplified configuration and put more focus on the structure itself. That also solved the problem of aggressive mobs despawning after a certain time or distance. Essentially it evolved into an automated structure placement plugin. My latest worked fine on 1.6.4, though I haven't tested it on 1.7 at all. If ever I get around to it, I'll clean it up and get it in here.
In the meantime, I am sure other plugins have sprung up doing this by now. If you have found one that works well, post it here in hopes those waiting for this can have it from a more dedicated developer. :(
I would love to help if you need some. I have experience with world generation and my generator is about to release a custom structure system, so I have experience with structures as well. Sounds like an great project. Cannot wait to see where this goes.
I find the idea fascinating. I admit I didn't read the whole post so forgive me if I missed it somewhere in your plans already, but I have a suggestion: Why not give us the option to choose what biomes certain encounters can be found? Or even control as to whether they appear above ground, underground, or suspended in the sky? Of course, I'm not a developer of any sort, so I dunno what limitations there are on your end, but as a server owner it would be invaluable to have these kinds of options.
ETA Till completion?
I want this! I want this so bad! I'm planning on using it for an Rp server, so random encounters everywhere would be the way to go for me as people can't go past the borders and everything is generated.
I hope this gets created! FerkSwe
This plugin sounds absolutely amazing, and I really hope ArchmageInc finds time
and possibly gets some helpto perfect and maintain it.Oh, and for what it's worth, I'm in favor of encounters only spawning in new chunks.
Dead? D: