Improved Procedural Generation#49
Open
TheBardWhoCodes wants to merge 8 commits intoGodotCommunityGamesOrg:mainfrom
Open
Improved Procedural Generation#49TheBardWhoCodes wants to merge 8 commits intoGodotCommunityGamesOrg:mainfrom
TheBardWhoCodes wants to merge 8 commits intoGodotCommunityGamesOrg:mainfrom
Conversation
ChaoticTechSupport
requested changes
Jul 12, 2025
Collaborator
ChaoticTechSupport
left a comment
There was a problem hiding this comment.
looks good, I like the idea of threading, but it might be better to use an async function instead, but I'll leave that up to your discretion.
- missing some documentation
- for functions and script variables that will not be used outside the script please add a _ at the start of the name.
| @@ -0,0 +1,23 @@ | |||
| extends Resource | |||
| class_name ProceduralGenerator | |||
| class_name ProceduralGenerator | ||
|
|
||
| var floor_positions: Array[Vector2i] = [] | ||
| var wall_positions: Array[Vector2i] = [] |
| push_error("ProceduralGenerator is abstract and cannot be instantiated directly.") | ||
| assert(false) | ||
|
|
||
| func generate(rng: RandomNumberGenerator) -> void: |
| func generate(rng: RandomNumberGenerator) -> void: | ||
| assert(false, "generate() must be implemented by a subclass.") | ||
|
|
||
| func clear() -> void: |
| procedural_generator.generate(rng) | ||
| apply_terrain_changes() | ||
|
|
||
| func clear_the_previous_room() -> void: |
| @@ -0,0 +1,268 @@ | |||
| extends ProceduralGenerator | |||
| class_name WalkerGenerator | |||
| extends ProceduralGenerator | ||
| class_name WalkerGenerator | ||
|
|
||
| @export var number_of_walkers: int = 1 |
| var room_height: int | ||
| var rng: RandomNumberGenerator | ||
|
|
||
| func generate(_rng: RandomNumberGenerator) -> void: |
| func is_in_bounds(pos: Vector2i) -> bool: | ||
| return pos.x >= 0 and pos.x < room_width and pos.y >= 0 and pos.y < room_height | ||
|
|
||
| func walker_thread_func(args): |
Collaborator
|
is this still being worked on? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant updates to the procedural generation system, refactors tile sets for terrain and objects, and enhances pathfinding functionality. The most important changes include the addition of a new abstract
ProceduralGeneratorclass, the replacement of terrain tile sets with space station-specific ones, and the integration of pathfinding initialization into themap_generatorscript.Procedural Generation Enhancements:
scripts/procedural_generator.gd: Added an abstractProceduralGeneratorclass with properties for floor, wall, entrance, exit, and player positions, along with methods for generation and clearing. This class provides a foundation for procedural generation logic.Tile Set Updates:
resources/space_station_objects.tres: Introduced a new tile set for space station objects, including player and door scenes, with a tile size of 64x64.resources/test1_terrain_procgen_tileset.tresandresources/test2_terrain_procgen_tileset.tres: Removed outdated terrain tile sets used for procedural generation. [1] [2]Scene Updates:
scenes/room_generator.tscn: Refactored the room generator scene to use the new space station terrain and object tile sets, replacing the old procedural terrain tile set. Updated node properties for floor and object tilesets.scenes/player/world.tscn: Integrated a procedural generator resource into theRoomGeneratornode, defining parameters for walker-based room generation.Pathfinding Integration:
scripts/map_generator.gd: Added aninit_pathfindingmethod to initialize the pathfinder (AStarGrid2D) and map references, enhancing the readiness of pathfinding functionality in the game.