egordorichev / LastTry

:deciduous_tree: LastTry is open-source game written in Java, using LibGDX library and inspired by Terraria :deciduous_tree:
MIT License
118 stars 17 forks source link

Refactoring + World Gen + Lighting #76

Closed Col-E closed 7 years ago

Col-E commented 7 years ago

Whats new:

Whats changed:

egordorichev commented 7 years ago

Hey, @Col-E! Big thank you, that you are here, while i'm offline. As @Nufllee sad, I will be back on night from 4 to 5 june. Right now, i'm trying to join gittr from my book reader ;)

I really like the -wd feature. Also, can you add generation of surface biomes to the algorithm?

Big thanks, Egor.

egordorichev commented 7 years ago

Code climat is broken right now, you should check out code beat! I'm amazed, with new inventory system and lighting! I can't merge pull right now, but you should be able to do it your self.

Col-E commented 7 years ago

No problem!

can you add generation of surface biomes to the algorithm

Currently I have a rough biome GeneratorTask layed out but it doesn't focus on the surface. Its based on raw noise so biomes can be put anywhere. I'm not exactly sure how I would force it to populate the surface like terraria. I'd have to look at their code more.

I can't merge pull right now, but you should be able to do it your self.

I'm gonna hold off until I can fix / add a few more things before I merge. Hope you're enjoying your vacation.

Actually going to merge now so people pulling from dev will get the changes.

egordorichev commented 7 years ago

Also, why did you add temperature/humidy to biomes? We handle them by calculsting on-screen blocks. Also, you've made a todo, for storing them in json. That can be easily done, by changingv hardcoded values in Envirnoment class.

Here is how you can store them:

{ 
  "Corruption" : {
    "background" : "…",
    "required" : {
       { "id" : 24, "count" : 200 }
    }
}

This will make more sense...

Col-E commented 7 years ago

The biome temp/humid is used for initial world generation. You need to have an algorithm for placing the biomes initially. The temps and humidity are not used anywhere outside of generation. Here's the initial generation example. When you walk between the blocks the on-screen block logic is used instead.

https://www.gamedev.net/topic/682351-biome-based-map-generation/

The humidity/temperature model ensures biomes like tundras and jungles wont be placed next to each other.

egordorichev commented 7 years ago

Hm... How terraria generator works, is that it places snow biome and dungeon on one side of spawn, and jungle + desert on othr side of spawn. This could be also useful.

Col-E commented 7 years ago

Whoops. I guess we can have both. When the player creates a world just have the option for "Classic terraria biome placement" and "Natural biome placement". Never hurts to provide extra.