GlowstoneMC / Glowstone-Legacy

An open-source server for the Bukkit Minecraft modding interface
Other
363 stars 122 forks source link

World generation #76

Open SpaceManiac opened 10 years ago

SpaceManiac commented 10 years ago

World generation is fairly bleh right now and does not feature biomes. It also does not use the updated generation API. The optimal solution to rectify this would be:

Alternate options that were considered:

The generator should reasonably approximate the vanilla generator in terms of biome diversity and characteristics, and should not have obvious flaws.

zyuiop commented 10 years ago

Can we use the NMS code and adapt it to GlowStone to implement this feature ?

TomCaserta commented 10 years ago

100% no. NMS is copyrighted code and would cause major legal issues if any of the code was copied from decompiled source code.

Nothing stopping people from viewing the code to get an idea of the implementation (ie to find out what each meta data bit does etc) however any sort of copying is out of the question.

EpicSharkNoob commented 9 years ago

Can anyone tell me a world generation plugin that spawns only in-game biomes, and not some weird thing like "city" biome or "rainbow mountains" biome? That would be AWESOME

jimmikaelkael commented 9 years ago

This is way far to be a complete world gen, but I can help if needed. I already have implemented huge mushrooms in PR #374. After I will have completed this PR I think I can try to reproduce the different possible vanilla trees.

EpicSharkNoob commented 9 years ago

Hi,

Thank you SO MUCH for the answers. It really bugs me to spawn a jungle world with ugly mountain-colored trees and grass. :)

Also, in response to Michael J, I would LOVE some help!! That would be awesome. Now I can get my Multiplayer Deathmatch server up!

Thank you both 1,000,000,000 times,

EpicSharkNoob

On Thu, Oct 9, 2014 at 3:19 AM, mastercoms notifications@github.com wrote:

@EpicSharkNoob https://github.com/EpicSharkNoob http://dev.bukkit.org/bukkit-plugins/terrain-control/

— Reply to this email directly or view it on GitHub https://github.com/GlowstoneMC/Glowstone/issues/76#issuecomment-58489597 .

MeanMaggie commented 9 years ago

Terrain Control plugin works well. I use it on my Craftbukkit server and is compatible with Spigot, Cauldron and Forge. Here is the link: https://github.com/MCTCP/TerrainControl/wiki/Installation-instructions

mastercoms commented 9 years ago

@MeanMaggie Except that uses nms, which is not in Glowstone

MeanMaggie commented 9 years ago

Just an idea - if we are starting from scratch, build in the ability to loop. In essence making the world a sphere. You walk so far North, you eventually come back to your starting point

turt2bot commented 9 years ago

@MeanMaggie that is way out of scope and not relevant to this PR. It would also be likely impossible with the current game structure.

EDIT: This is the last time I use my bot to comment on things. Whups. ~turt2live

dequis commented 9 years ago

and not relevant to this PR

Also not a PR

turt2live commented 9 years ago

Whups. Thanks @dequis

mastercoms commented 9 years ago

@MeanMaggie That would be more suited for a mod or plugin. We are trying to stay like vanilla unless it is uneccessary or it performs better to do it another way.

tyzoid commented 9 years ago

Why not leave default functionality to be flatland/basic terrain and make a separate plugin to do wgen?

PaulBGD commented 9 years ago

@tyzoid why not include a basic feature?

turt2live commented 9 years ago

It's been pretty much decided that Glowstone needs a world generator. Plugins can modify the generator further if they please, but Glowstone needs a more realistic generator to survive as an out-of-the-box software application.

tyzoid commented 9 years ago

Why not bundle the world generator in as an example plugin? I think that leaving it out of the server software would lead to reduced bloat of core code. On Oct 27, 2014 6:48 PM, "Travis Ralston" notifications@github.com wrote:

It's been pretty much decided that Glowstone needs a world generator. Plugins can modify the generator further if they please, but Glowstone needs a more realistic generator to survive as an out-of-the-box software application.

— Reply to this email directly or view it on GitHub https://github.com/GlowstoneMC/Glowstone/issues/76#issuecomment-60683524 .

tyzoid commented 9 years ago

Pardon me, I was thinking of the word example but many to say default. On Oct 27, 2014 7:34 PM, "Tyler Dence" eggnog5.1@gmail.com wrote:

Why not bundle the world generator in as an example plugin? I think that leaving it out of the server software would lead to reduced bloat of core code. On Oct 27, 2014 6:48 PM, "Travis Ralston" notifications@github.com wrote:

It's been pretty much decided that Glowstone needs a world generator. Plugins can modify the generator further if they please, but Glowstone needs a more realistic generator to survive as an out-of-the-box software application.

— Reply to this email directly or view it on GitHub https://github.com/GlowstoneMC/Glowstone/issues/76#issuecomment-60683524 .

turt2live commented 9 years ago

How is providing a standard gameplay feature bloat?

Ribesg commented 9 years ago

Hey. Wanted to give some pointers to available Vanilla world generators.

The first one is VanillaGenerator by @coelho. It requires VanillaNMS and that you own the Vanilla Server jar you want to use (Official links here, unofficial repositories available here and here). Supports MC 1.7 and 1.8, as well as MC Alpha 1.1.2.1 (0.2.1) and 1.2.6 (0.2.8). I don't know if @coelho plans to update it and/or add other versions to it. Note that it doesn't support Chests generation yet, but it's an easy fix now that I've implemented it, see next paragraph.

The second one is Pure by me. It's based on the work by @coelho. It just requires you to drop the jar into /plugins and setup the world(s) generator in bukkit.yml or glowstone.yml, or whatever multi-world plugin you're using. It will download the Vanilla jar files itself from the official location if available or from my own server. It doesn't require any dependencies. I fixed Chest generation and would be happy that @coelho use the code for VanillaGenerator :). It supports MC 1.6, 1.7 and 1.8, as well as MC Alpha 1.2.6 (0.2.8). I'm currently trying to implement MC Beta 1.7. You can find all the planned versions in the README.

I would like to know if there are other plugins like these, if you find one, please share :)

gdude2002 commented 9 years ago

Well, this certainly is a pleasant surprise. I'd like to know of any others as well, this is great news!

Ribesg commented 9 years ago

The remaining problem is the handling of structures that have to be saved for reasons, like Villages. No idea if it's the World Generator's problem to save them in a Villages.dat file.

I don't have the knowledge about Villages and other structures to know why exactly you need to save them, and I don't know if not having that is a huge issue or not. See https://github.com/Ribesg/Pure/issues/1.

I think that it depends on CraftBukkit. If CraftBukkit saves them itself, Glowstone should do it. If not, the plugin should do it.

mastercoms commented 9 years ago

Do plugins have to specifically use VanillaNMS or can all plugins that use NMS use it?

Ribesg commented 9 years ago

@mastercoms I don't understand your question. VanillaNMS and "plugins that use NMS" are unrelated.

mastercoms commented 9 years ago

I was asking if VanillaNMS added the net.minecraft.server package to the server so that all plugins could use it.

Ribesg commented 9 years ago

Well.

First, it doesn't add a net.minecraft.server package but something more like r1_8.net.minecraft.server. It's required: imagine if you want an Alpha map and an 1.8 map. You need to load both jars, and classes will overlap if you don't relocate.

Next, this has absolutly nothing to do with CraftBukkit's NMS. CraftBukkit's NMS is a heavily modified version of Vanilla NMS, which those plugins (Pure and VanillaNMS) provide. If you want to use one of them as a NMS provider (I recommend VanillaNMS for this, Pure is really a World Generator), you can, but note that you will need to use fully obfuscated code.

Finally, note that this NMS "instance" isn't connected nor related to Glowstone's server. Pure and VanillaGenerator use the World generation code of NMS as a module. You could use NMS parts as modules with this, but really nothing comparable to what you usually do with CraftBukkit. For example, you just can't get a NMS entity and expect it to be related to an in-game entity. It's not. Glowstone's entities aren't NMS entities. CraftBukkit entities were NMS entities.

mastercoms commented 9 years ago

So it provides Mojang's nms. And nms isn't implemented in Glowstone so the server couldn't understand if plugins used it. VanillaGenerator just uses it to get a value, in this case the map.

Did I understand correctly?

Ribesg commented 9 years ago

To make it clear, in CraftBukkit the classes in NMS are what is actually used to run the server. In Glowstone, there's no NMS, and there never will. Both plugins cited "just" use NMS to "get a value", yes, even if it's much more complex than that. But you can think about it as calling a method in NMS to generate chunks if you want. All the context of a real running server is missing and has to be stubbed.

mastercoms commented 9 years ago

Yes, I understand that CraftBukkit wraps nms. And Glowstone is a project to "rewrite nms" in a clean room fashion.

Thanks for helping me understand VanillaNMS!

mastercoms commented 8 years ago

Glowstone++ has advanced world generation.