Giter Club home page Giter Club logo

gaea's Introduction

Gaea

๐ŸŒ Gaea

Join the Gamedev Graveyard discord server to get notified about Gaea and hang out with other devs.

Gaea is an add-on for Godot 4.2*, designed to empower your project with advanced procedural generation capabilities.

*For 4.0-4.1, use v0.6.2 or lower.

NOTE: Gaea is currently in early development, and may not yet be optimized for larger, more complex projects. Stay tuned for ongoing improvements and enhancements!

What's in a Name?

Gaea, in Greek mythology, is the personification of Earth - a nod towards the terrain and world generation capabilities this addon brings to your game development toolkit. Plus, we think it sounds pretty cool.

๐Ÿ’ซ Key Features

Generators

Our collection of generators, including Cellular, Heightmap, and Walker, allow for dynamic and unique world creation. Whether you're looking to create intricate cave systems or sprawling landscapes, Gaea's got you covered.

generators showcase

Modifiers

Further fine-tune your procedurally generated worlds with our set of modifiers. Add layers of complexity and fine-tune the details to create environments that truly come alive.

Renderers

GaeaRenderers are nodes that take the generator's data to render the generation. They can be used for drawing in a TileMap, a GridMap, a mesh, a texture, or whatever you can code.

Chunk loading

Gaea comes with a ChunkLoader node that can generate an area around an actor, allowing both for infinite worlds and to optimize big worlds.

Videos

A great tutorial for beginners:

How to Create Procedural Generation in Godot 4 10+2 AWESOME ADDONS for GODOT 4 by MrElipteach

๐Ÿ”ง Installation Steps

  1. Download the project files.
  2. Move the gaea folder into your /addons folder within your Godot project.
  3. Enable the addon through the project settings, and let your world-building journey begin!

gaea's People

Contributors

ariber-yadier avatar benjatk avatar bitbrain avatar david4chirino avatar mebaddev avatar nathanhoad avatar nedmas avatar nubels avatar ramenthenoodles avatar reuse898 avatar sgervais333 avatar titusio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gaea's Issues

Chunk system?

I am wondering how much out of scope would be a chunk system - generating an infinite world with this addon (depending on the generator used).

Saving/loading chunks to disk may be out of scope but I could totally see a system where depending on the player position, a level gets re-generated dynamically.

If anyone actually reads this, I need some feedback on the TileInfo idea.

It's way more flexible than having predetermined variables in the generator, but at the same time I think it's a bit confusing? What do yall think?
(TileInfo is a resource you use to tell the generator which tile to place, it contains the TileMap layer, the atlas_coord and source_id if it's a single cell, or the terrain set and terrain if it's a terrain)

Error when running walker demo

I was testing the demo scenes and everything worked worked fine except the walker generation
I got this error
Screenshot from 2023-08-03 20-52-16
I did not modify anything for this to happen.

My current version of Godot is 4.0.3 and I am using commit e345b77 which is the latest at the current time.

RandomTileInfo

Add a TileInfo resource that holds different TileInfos with different weights, and randomly chooses one of them, getting replaced with it.

Height-based texturer

(Name needs work)
Basically, what this modifier does is change a tile based on it's height. An example would be: the first tile is a grass tile, the next 3 ones are dirt, then they're stone until the last one, which is bedrock. However, I'm not sure how to implement this since the height can variate between columns. So even though you could set it to look for a certain height, this would just create a straight line. Any help would be appreciated.

Maze generator

Another generator that could be nice, a maze with a start and an end.

Can not get ChunkLoader3D to work

I am using v0.8.0 of Gaea, and I would like to have chunks generated on ready, but I cannot get the chunk loader to load in the chunks that the ChunkLoader3D creates. I attached a generator and an actor to it. It seems to generate chunks, as it takes a while to load, but it does not show any. I can provide images if needed. Is there a specific way I need to set this up?

Remove areas that aren't connected (Modifier)

Using a pathfinding algorithm, we could start an "agent" in a certain starting position and then remove the tiles the agent can't reach. This should help with, for example, the smoothing modifier which can sometimes cause little islands.

Add wiki

Add documentation for nodes and modifiers. Both in Godot and Github.

Optimize _draw_tiles function

HeightmapGenerator2D takes a very long time to generate. Tested with a 1750x900 world, it takes about 25 seconds with no modifiers, and the carver modifier only seems to add only about 2 seconds.

Make a logo

Something to do with Gaea, greek mythology, and procgen ofc.

Remove all warnings

The documentation for submitting assets to the Asset Library mentions removing every warning from the addon. This would mean adding _ to unused variables and stuff like that.

Chunk loader loads it wrongly

in the demo of heightmap when the player moves some distance the chunks are loaded a bit off and it increases more when u move more

Multi-threading/queueing chunk generation

With #29 merged, the new chunk system is now available and working great. However, it could still use some optimizations. We could use threads, though I have no idea how to work with them. Do you think it needs more optimization?

TileInfoGroup

Could hold TileInfos, maybe each with an offset, that all get placed when this is set.

extra collisions beside collidable tiles

I am encountering a bug where if you have a tile map with collisions, when I generate a map using that tile map there are extra collisions beside collidable tiles. This happens to every 2d generator and I have tried to fix it with no success. Is this a bug or is there something I am doing wrong?

Failure after adding Gaea

Once I enable plugin in project settings I got these errors:

Godot Engine v4.1.2.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started ---
--- GDScript language server started ---
res://addons/gaea/generators/generator.gd:35 - Parse Error: Could not parse global class "GaeaGrid" from "res://addons/gaea/grid.gd".
res://addons/gaea/generators/generator.gd:54 - Parse Error: Could not parse global class "GaeaGrid" from "res://addons/gaea/grid.gd".
res://addons/gaea/generators/generator.gd:64 - Parse Error: Could not parse global class "GaeaGrid" from "res://addons/gaea/grid.gd".
res://addons/gaea/generators/generator.gd:35 - Parse Error: Function "get_grid" cannot be used as getter because of its signature.
res://addons/gaea/modifiers/2D/modifier_2d.gd:0 - Parse Error: Could not resolve class "Modifier".
res://addons/gaea/modifiers/modifier.gd:30 - Parse Error: Could not parse global class "GaeaGrid" from "res://addons/gaea/grid.gd".
res://addons/gaea/modifiers/modifier.gd:36 - Parse Error: Could not parse global class "GaeaGrid" from "res://addons/gaea/grid.gd".
modules/gdscript/gdscript_compiler.cpp:2594 - Condition "!base->is_valid() && !base->reloading" is true. Returning: ERR_BUG

[NoiseGenerator] Render different tiles to different Tilemaps

Thank you for the excellent repository.

I am looking to take different Tiles from the NoiseGenerator (e.g. Deep water, shallow water, sand, grass, deep grass) and render each particular Tile layer to different TileMaps in the TilemapGaeaRenderer.

Why do this?

Shader Materials are applied to the entire tilemap. If I have a shader material for my water tiles, but I don't want it applied to any other tilemap layers (e.g. sand, grass, etc), how can I support this in Gaea? You could imagine that every biome might have shaders applied at the tilemap layer and want layer-wise tilemap rendering.

It would seem that it's compatible with the way the Tiles from NoiseGenerator are being generated, the code is just missing a specific tilemap to render into. Alternatively, another hack would be to have a shared Tilemap resource, then 2 TilemapGaeaRenderers, and select which Tiles are included/excluded from the rendering for the target Tilemap. Then I could render some layers to one tilemap and other layers to another.

Any thoughts on how I could:

  1. hack this quickly
  2. More permanent and principled solution?

Thanks again, really great work!

Add custom way of adding modifiers

While the Array works, I think it'd be nice to have a custom UI in the inspector. Something similar to Blender's UI for adding modifiers.

Add demo images to readme

I am looking at this on my phone and I cant see a demomstration of, how the terrain looks. Can you please add some. Kindly. Thank you.

Make grid a resource

I think the grid could be changed to a GaeaGrid resource, instead of just a dictionary. This resource would still have a dictionary, but it would allow for easier adding of features and saving.

The pros:

  • Could add get_value and set_value methods which would allow for doing stuff like #25, #48 or #51.
  • As a resource, it can be easily saved and loaded.
  • Grid logic would be separated from generation, which is kinda what we've been doing with stuff like separating generation from rendering, and all that.
  • Could have helper functions such as getting the neighbors of a tile (which already exist in the Generator class, but is a bit of a mess).

The cons:

  • Lot of refactoring
  • Resources can sometimes be a bit wonky
  • Can't think of anything more tbh

Biome Modifier for Overworld map generation.

A native modifier to Gaea that overwrites the assigned tile based upon defined XY region within the MapRenderer. This would allow for a defining of polar and desert biomes within the generator.

If it considers the existing value, it should feather that overwritten tile in. Eg. If pos within Region and Value within Range, then overwrite tile.

Add missing icons

  • GaeaGenerator
  • ChunkAwareGenerator
  • NoiseGenerator
  • TileInfo
  • ChunkLoader

Can't generate tilemaps with heightmaps

everything works but heightmaps.

I'm getting the error:
res://addons/gaea/generators/2D/heightmap_generator/heightmap_generator_2d.gd:25 - Invalid set index 'seed' (on base: 'Nil') with value of type 'int'.

I made a recreation of my issue, with a HeightmapGenerator2D and a WalkerGenerator. They both have the same tilemap settings and TilemapGaeaRenderer.

Am I doing something wrong? There's no documentation for heightmaps so I used the same setup used in the getting started tutorial.

project showcasing my issue:
gewrwertgtwegr.zip

Separating Generation and Rendering

I think generation and rendering should be different scripts.
The Generator classes should only be responsible for generating a certain area (like implemented in #29). The actual tile placing could handle another script.

This approach will have some advantages in my opinion:

  • Regenerating data each time would be unnecessary because the user could implement saving logic and the WIP chunk system could take advantage of unloading.
  • The plugin will be more universal. When users could handle drawing by themself, more custom solutions will be possible because they won't be bound to TileMaps.

Feedback is appreciated!

ChunkLoader don't load Chunk correctly when Actor is in a negative position

When the actor is in a negative postition, it does not work.

The solution is to change the code in 'chunk_loader_2d' and 'chunk_loader_3d' to put a cast float() in one of the variable:

func _get_actors_position() -> Vector2i:
	# getting actors positions
	var actor_position := Vector2i.ZERO
	if actor != null: actor_position = actor.global_position.floor()

	var tile_position: Vector2i = actor_position / generator.tile_size

	var chunk_position := Vector2i(
		floori(float(tile_position.x) / generator.chunk_size.x),
		floori(float(tile_position.y) / generator.chunk_size.y)
	)

	return chunk_position
func _get_actors_position() -> Vector3i:
	# getting actors positions
	var actor_position := Vector3i.ZERO
	if actor != null: actor_position = actor.global_position.round()

	var tile_position: Vector3i = actor_position / generator.tile_size

	var chunk_position := Vector3i(
		roundi(float(tile_position.x) / generator.chunk_size.x),
		roundi(float(tile_position.y) / generator.chunk_size.y),
		roundi(float(tile_position.z) / generator.chunk_size.z)
	)

	return chunk_position

Should we rework the block data storing

When I was looking at the code I notices you are storing the values using a dictionary where the key is the position. This method is great except, when looking at the other Issues like Issue #6 where you want to place different blocks based on height in the colum. And Issue #7 and #16 where you discuss about using chunks to optimize drawing and generating infinite terrain.

I dont think the way tiles are stored should change, because for most generations the current system is perfect. but when I look at the code I see alot of instances where the grid is directly acceses, which should rather be though a set_block and get_block variable, that way you could exchange the ways blocks are stored to suite the generation type.

I suggest using an oct tree but its 2d so its actually a quad tree, to store data. Then you could use a simple algorithm to get the top most block of each colum. A octree is great for storing limited sized worlds, but not great for infinite sized worlds. But that is where the dictionary method comes in, at a certain point when one octree has too mutch depth, then you can split the oct trees up into dictionaries of oct trees whith a maximum of 4 octrees in memory to make it look seemless. And then loading and unloading as needed.

Filters for modifiers

Some modifiers which affect tiles could use for some filters such as "exclude certain tiles" or "only modify certain tiles". Maybe by having an Array of TileInfos.
Now, if we wanted to check if the TileInfos match, the user would have to reference the same resource. Either that, or we could add a matches_tile_info in the TileInfo class which checks if all properties are the same. Is that worth it or just having the user reference the resource is enough?

Publish Gaea to Godot Asset Library

I'd love to see the plugin added to the Godot Asset Library. Currently, it seems unavailable there the last time I tried searching for it. Having it in the Asset Library would make installation more convenient for Godot users.

C# support

Will there be C# support in the future?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.