solarlune / dngn Goto Github PK
View Code? Open in Web Editor NEWA Golang library for random map generation for games.
License: MIT License
A Golang library for random map generation for games.
License: MIT License
Hello! I'm building a random dungeon with GenerateRandomRooms
, but when it connects the rooms it uses a width of only one tile. With the wall tiles forming corners, this causes the hallways to be impassable. Is there a way to control the width of the connections? This could be fixed by passing a number other than one to the DrawLine call on this line.
I can do the PR for the fix, I'm just wondering how you'd like it done. If I add a parameter to GenerateRandomRooms
that would change the API, so if you want to avoid that I can add a separate function like GenerateRandomRoomsMinHallwayConnections
or something so other people won't need to update their code upon updating dngn
.
Add pathfinding to allow the user to be able to ensure connectivity between rooms. To be specific, this should probably be a standalone library that dngn makes use of to ensure connectivity, since pathfinding is pretty useful on its own.
Add a new method of Room generation making use of this. It would randomly place Rooms of varying sizes, and connect them. This is now added as of v0.2.
Add methods to customize the shape of a Room. This would include skewing a Room, shaving off a corner, and inverting a Room.
Room.Outline() should be able to outline a Room's internal values, not just the border of the Room (or at least, there should be a function that does this). Basically, it should be possible to turn:
0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0
0, 0, 1, 1, 0, 0
0, 0, 1, 1, 0, 0
0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0
into
0, 0, 0, 0, 0, 0
0, 2, 2, 2, 2, 0
0, 2, 1, 1, 2, 0
0, 2, 1, 1, 2, 0
0, 2, 2, 2, 2, 0
0, 0, 0, 0, 0, 0
This is now done through Selections; you can just select the 1's and then expand the selection outwards.
Add method to Crop out a Selection in space using X, Y, W, and H values.
Add methods to Add and Remove Selections from each other to easily select just the areas you're looking for.
Add method to overlay / copy / place Rooms into each other. This could be useful if doing random generation using pre-made Room pieces.
Add method to define entry / exit points to Rooms and have dngn randomly generate a "master" random dungeon map by randomly selecting and copying these pre-made Room pieces together.
Fix Selection.Degrade() - it should now degrade all cells, rather than just those of a specific selection, as you can select them using By().
Fix Map.GenerateBSP() - it doesn't work well with doorValues of 0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.