Comments (3)
Thanks for explaining it's working now.
from godot-constraint-solving.
Hi. That's an expected behavior. In most cases an empty space is not useful, so, if it wasn't ignored in sample map, it would be more difficult to create a valid sample for rules that don't use empty tiles. With empty space ignored it is easy to just throw some new tiles somewhere in free space of the map and add some adjacent tiles like this:
without spending time to fit them into existing part of the map. If empty space wasn't ignored, a sample for a map that doesn't use empty tiles would have always been kept a rectangle without any gaps, because otherwise those gaps would be recognized as empty tiles.
It may be possible to add use of empty cells as an option. But I'm not yet sure how to make it work without interfering with functionality of negative samples, preconditions and communication between threads in multithreaded mode.
The cleanest solution I currently see is to create a tile type that is visible in editor but isn't visible in the game. And use this tile to represent an empty space in samples.
I have just researched how to make it work with grid maps. And the only way I found is a bit complicated and not very efficient (as the "empty" mesh is rendered in game):
- add a global boolean shader uniform
IS_EDITOR
, defaults to true - in some game script it should be set to
false
:RenderingServer.global_shader_parameter_set("IS_EDITOR", false)
- create new material for "empty" mesh. It should use shader like
shader_type spatial; global uniform bool IS_EDITOR; void fragment() { if (!IS_EDITOR) { discard; // Do not render in actual game } ALBEDO = vec3(1.0,0.0,0.0); // Mesh will appear red in the editor }
- add a mesh with this new material to mesh library (use surface material override, not material override if you're using a mesh imported with different material)
Now this mesh can be used in samples where an empty space is supposed to be. And in the game the space will look empty.
This could be easier if meshlib/gridmap did respect visibility layers set in meshlib source scene, but they don't.
from godot-constraint-solving.
from godot-constraint-solving.
Related Issues (14)
- How to use your addon to generate dungeons. HOT 3
- [Docs] Add metadata to GridMap HOT 2
- [Docs] Samples and Negative Samples HOT 3
- Does this respect the various properties of the tile? HOT 10
- Rerun on different Rect. HOT 1
- Big key dungeons HOT 1
- [Docs] Custom Preconditions2D HOT 2
- [Discussion] Possibility with Path Constraints HOT 1
- [Suggestion] Multi-Layered TileMap Support HOT 5
- Cannot seem to find WFC2DGenerator node HOT 2
- [Discussion] Tile probability HOT 6
- [Docs] How to make a good sample? HOT 5
- [Discussion] Why gdscript and not something else? HOT 1
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 godot-constraint-solving.