Archived Generic Pluggable World using AnotherWorld

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
Cervator edit: Moved to Suggestions and archived as the thread is mostly obsolete with our facet system able to cover it pretty well

Name:
Generic Pluggable World Module
Summary: Extending the work of MarcinSc with WoodAndStone and the AnotherWorld library module
Scope: Mod
Current Goal: Get a module repository created and usable
Phase: Design / Implementation
Curator: Josharias, msteiger
Related:
Vision:
Provide a world that is extensible using the AnotherWorld library module. Extracting the implementation out to a separate module will allow less clutter in the world generator selection screen for various game types.
There has been much discussion about game types and game mechanics. This thread is to pull a few of those ideas into one spot that can result in an actual implementation.
Current Needs:
  • A module name
  • A world theme to provide direction when defining landscape features (ie. a whole world made of water, a flat world with rolling hills, a mountainous spiky cliffhanger of death, etc)
All you idea people, unite! Spew your awesome ideas here!
 
Last edited by a moderator:

msteiger

Active Member
Contributor
World
Architecture
Logistics
I would like to be involved in this development, if possible. There's also a whole bunch of (useful) code in Cities, that could be moved to a common, general world-gen module. Is AnotherWorld supposed to be be?
These are world-gen issues which are currently on my todo list:
  • Fix the integration with PlaTec - that requires a heightmap -> texture -> heightmap converter and proper finite world support
  • Add customizable configuration dialogs to the "Create World" UI dialog - this is halfway done already
  • See if / how the world gen people can work together, avoid duplicate code, create cool stuff. - a rather generic task, I guess :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Badgering of Marcin Sciesinski shall continue till he posts in this thread to help support this worthy effort :D

There are a lot of old world gen threads floating around, it might be good to do a summary post here with links for extra details. A lot related to the different phases of world gen (starting even with the shape of the world) and making the overall structure pluggable by modules injecting their stuff during different phases
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
I'm not sure, what exactly do you need. AnotherWorld provides some world generation basics.

It supports setting some basic world details:
- sea level and maximum height of the generated terrain,
- humidity, temperature maps spread in the world.

Whoever uses this world generator has to provide:
- LandscapeProvider - code that decides what's the ground Y-level for a block column at (X,Z) coordinate,
- at least one ChunkGenerator that will set the basic blocks based on the Y-level defined by LandscapeProvider and BiomeProvider.

Whoever uses this world generator can provide:
- Any number of additional ChunkDecorators that will modify the generated blocks (in one chunk only) based on GenerationParameters available,
- Any number of additional FeatureGenerators that will modify the generated blocks (in one chunk and neighbours) based on GenerationParameters available.

AnotherWorld also provides some basic generator implementations one could use:
- PerlinLandscapeGenerator - a LandscapeGenerator that returns world height based on Perlin noise, where user can define a sea frequency, how the distribution of height above sea level is, how diverse the terrain shape is (can steep mountains be right next to flat terrain), and the distribution of flat areas to mountains,
- way to define new biomes using @RegisterPlugin that are matched with the conditions in the specified spot based on: temperature, humidity, terrain shape (flat, hilly) and Y-level, these biomes define their desired conditions using a weight system and system matches the best match for each block,
- simple LayeringDecorator that allows to quickly define what is the layers spread of each block in a given (X,Z) coordinate based on biome, also these definitions can be picked up using @RegisterPlugin,
- simple OreDecorator that allows to replace blocks in the world based on definition of ores, that can be picked up using @RegisterPlugin, OreDefinitions should return a list of structures for each chunk, where structure replaces the block for that chunk, couple of useful structures have been added to the module - clusters, pockets and veins,
- simple BeachDecorator - a decorator that replaces blocks if the ground level is within specified range of sea level,
- simple CaveDecorator - decorator that uses vein structures to carve caves and tunnels in the generated terrain.

I think a simple explanation on the @RegisterPlugin is useful here. Immortius has introduced a mechanism that allows mods to load classes of specified interface that have @RegisterPlugin annotation. The interface however has to extend WorldGeneratorPlugin, a marker interface.

If possible, I would like to avoid adding more complicated and less-generic Decorators/Generators to the mod, but there should be nothing stopping anyone from defining them in a separate module, like I did in GrowingFlora module. The only new Decorators/Generators I can see being added to AnotherWorld, is if someone came up with how to generate inland lakes and rivers, as these are generic-enough to be readily reused on any world that someone might generate.
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
Well, I would say there are currently 3 interested parties.

msteiger: would likely want to put your cities into the generic world.
Cervator: would likely want to add in miniions.
Josharias: would want to add in ore generation and other diggables

Lets start there. Why dont we start with the foundation that MarcinSc has started and start adding in stuff as we need to accomodate (whether it is by adding to AnotherWorld, or to the generic world).

Next up, some sort of name for the module itself. Please dont make me decide one. :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Oh my interest is more at a design level, I doubt I'll have time to apply it anywhere. I just want to push us towards having a great framework :)

My understanding is that AnotherWorld is already a generic and pluggable world module - so what if anything are we really aiming to put in another yet-to-be-named module? Any generic and "global" world gen features probably would fit well into AnotherWorld and anything more specific probably would go in a game mode/type specific module (or a support module for such a batch of modules)

Or are we talking higher level like offering better config options in the UI, like msteiger is working on in Cities? A "world theme" / "civilization theme" could also be an interesting addition, though again that might be defined more in a gameplay specific module

Or is this more about a generic approach to game mode/types where the "normal" world (existing Perlin/flat/heightmap) would also be defined in some fashion using AnotherWorld as a central organizer?
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Let me repeat something I have stated on the chat. I do not think there is a reason or need to have "generic world". Either a world is for a specific game configuration (a.k.a. modpack), and then it is specifically defined and configured to suit the desired gameplay experience, or it's a world used for debugging mods that have nothing to do with world generation and you just want a bit of workable space to place blocks, spawn entities, etc.

In the first case, the "content mod" (for example WoodAndStone) extends and configures the PluggableWorldGenerator in a very detailed way, to suit exactly the needs of this gameplay experience.
In the second case, probably a "flat world" is best suited for testing, as the world gen is quick and you don't have to swim to land to build stuff. If you think flat world is not enough, you can create a new mod "TestingWorld" or something similar and create the "generic world" there.

I'm not sure, but it seems you have a view that Minecraft has, where there is the "generic world" (vanilla) that provides a gameplay, I'm not sure if that's what we want to achieve, as Terasology without any mods will never be anything more than just block-building demo.

As for anything in between, for example "Cities", I think it should stay where it is (in its own module), it should just contain class(es) that implement ChunkDecorator/FeatureGenerator that are responsible for generating the extra stuff. If someone will then create a "mod pack", they are free to pick and choose the mods and world generation they want and all should (theoretically) work without any problem.
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
This is more about creating a baseline landscape for other content mods to build on top of that is more interesting than "flat world". It is for those that have less of a creative vision of a specific world like in WoodAndStone.

I figure that if we can get a few heads together, we can find a landscape that can accommodate the needs for a handful of modules, all the while being compatible with any world generated with "AnotherWorld". And if we are lucky maybe it will result in some fun flavor.
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
Well, or you could collaborate with your "Through the Ages" world and allow others to use your work there by extracting it to its own module. ;)
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
This thread requires nothing more from you Marcin. As far as it has seemed, you are wanting "Though the Ages" to remain specific to your "Wood and Stone" module. Which is fine and good.

So, let us have a conversation about how us non "content mods" can have some fun creating some unique content?
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
I want full freedom to modify the world. if you are ok with unstable world, then I can extract it, as is in WoodAndStone, "was" package (without ores).
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Not sure if I'm missing something, but with world gen already at the specific classes level (the assortment of different classes in AnotherWorld) ... aren't we just wanting another world (or worlds) that use similar classes just with tweaked config? Or is just the class structure in place and you need to extend raw classes and do all your own world gen details ? Or is the config pretty much embedded within the classes, thus the trouble with AnotherWorld being specific to WaS and not super suitable to support several different worlds at the same time?

Just trying to understand better here :)

I figure a generator that makes trees actually implements a technique in which to create trees, and it is the exact config (parameters fed in) that gives you exact trees. Can reuse said trees in multiple worlds, "forking" the config details (which belong in a gameplay module or traditional "mod") if one person likes them bushier and another branchier
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
AnotherWorld is not specific to WaS, and can support different worlds at the same time, with different configuration (classes).

The tree definitions (how it grows, branchier/bushier) can be found in PlantPack module that depends on GrowingFlora module, which in turn depends on AnotherWorld, so can be used by any mod. If you wish to have different tree definitions, you can create your own mod with different trees, or embed the tree definitions in the "content mod" and not depend on PlantPack. You can also depend on PlantPack but decide not to use some of the trees there, and use some additional of your own, as the tree spawning pattern (which biome, how often, etc) is defined separately from how the trees grow, branches, blocks used, etc. This definition of spawning is pretty simple, as you can see in this example class: https://github.com/Terasology/WoodAndStone/blob/master/src/main/java/org/terasology/was/generator/forest/BirchForestSpawnDefinition.java which defines how Birch spawns in Forest biome.

I have created this separation of "how the trees grow" from "where the trees grow" to be able to reuse the "how the tree grows" which basically defines the genome of the tree, from where they spawn, as for some horror-themed world you might want to have your forests more densely packed with trees, etc.

As I said, I could extract the basic world generation of WaS out to a separate mod, including tree spawning patterns if you (plural) think it might be usable, however this world will be the one required by WaS only, and for example it will not contain any ores, as these become "required" only after including "Bronze Age" (working title) mod. Also, I might be heavily modifying this world generation which might break any of the worlds you already have created using it. To give you an example, I have been tweaking some settings at least once per day for the past week or so.

Just let me know, if you want the world gen module and I will create it.

And once again - creating your own world gen is not very difficult. At worst - you just copy paste a couple of classes.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Bump. Almost done moving/archiving threads from the Incubator. What do we do with this thread? Obsolete by now in favor of assorted other modules? More things to extract or architect?
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
The facet system has solved most of these problems. This can be discarded in favor of fresh perspective.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Thanks @Josharias :)

I'll prefix this Archived and move it to Suggestions (there it can still be found easily if needed, unlike in the Archived forum)
 
Top