Comments (5)
Indeed, that does solve it!
Thank you very much for helping and for all your work on the generator!
from edgar-dotnet.
Unfortunately, there are situations where not all preconditions are checked and the algorithm ends up throwing a generic exception only after something goes wrong (there's an issue created to improve this).
From what I can see from your code, I'd say that there is a problem with your definition of the corridor room. You create a 1x1 square and then use the new OverlapMode(1, 1)
door mode. By using that door mode, you tell the algorithm that you want all doors to be at least one "tile" from corners of the room shape. And as you use 1x1 square, there are no door positions that match your requirements. I'd suggest you to try using var corridor = new RoomDescription(GridPolygon.GetSquare(1), new OverlapMode(1, 0));
(note the 0 instead of 1). It will allow 4 door positions for that corridor room and should solve the issue.
This is absolutely something that should be handled by an exception with some useful message.
from edgar-dotnet.
Thank you for the quick response! Alas, the problem persists: I've tried setting the Overlapmode to (1,0), and to remove the corridors and change the generator to a LayoutGeneratorFactory.GetDefaultChainBasedGenerator<int>()
, and even just copypasting the example shown here but it keeps throwing a NullReferenceException on the same line.
from edgar-dotnet.
I think that I've found the problem. When implementing the library, it took some time to solve all the big bugs in the core of the algorithm. And as the algorithm is stochastic, it sometimes happened that a bug showed up only when you were quite unlucky. To fix such bugs, you have to fix the seed of the random numbers generator so that you always get the same result and can debug the issue. So to prevent me from accidentally not setting the correct seed for the generator, I removed the default instance of the random generator. And that's exactly the problem you're encountering - a missing instance of the Random class.
I uploaded a newer version of the binaries that should have this issued fixed. But before downloading the newer version, please try a quick manual fix to make sure that it was the only problem. Before running the layout generator, please inject the random numbers generator like this:
layoutGenerator.InjectRandomGenerator(new Random());
from edgar-dotnet.
I'm glad that it worked! If you have any problems in the future, feel free to open another issue.
I'd also love to get any feedback on the library - either on the features of the algorithm or how usable it's for a programmer. So if you find anything that you feel is not very intuitive or if you miss a feature, just please let me know. There are quite a few places that I already know are not perfect, but it'd be great to hear from other people, too.
from edgar-dotnet.
Related Issues (20)
- Performance: simulated annealing parameters
- Chain decomposition: faces connected by chains
- Improve exception messages
- Allow doors with zero length HOT 1
- Update config format to reflect new transformations
- Refactor configuration spaces generator
- .NET Standard
- Add possibility to choose that no two neighbouring rooms should be same
- Two-stage generation
- Output 'points' or json structure to determine position of the rooms on output images? HOT 2
- A doorway to the outside? HOT 2
- Room shape smoothing
- Algorithm simplification
- Suggestion: Sub-shapes within Rooms HOT 1
- Performance optimization - evolving generator configurations
- Roadmap
- Notes on performance
- Get json HOT 2
- Memory leak
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edgar-dotnet.