Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use? #1

Open
selfsame opened this issue Oct 29, 2016 · 16 comments
Open

How to use? #1

selfsame opened this issue Oct 29, 2016 · 16 comments
Labels

Comments

@selfsame
Copy link
Owner

Feel free to ask general questions in this issue!

@aman-tiwari
Copy link

Is it possible to use this with 3d tilesets?

@selfsame
Copy link
Owner Author

selfsame commented Nov 4, 2017

@aman-tiwari yes you can use 3d objects as tiles, but the algorithm works on a 2D grid

@aman-tiwari
Copy link

Ah okay, I meant generating stuff over a 3D grid. Thank you!

@hmihalis1
Copy link

Could you please cover how to create the prefabs required as input for the tile painter?

@selfsame
Copy link
Owner Author

@hmihalis1 The prefabs need to be under a Resources directory so they can be instantiated during generation. (You drag an object into a directory in the hierarchy to convert it to a prefab.)

In the tile painter, you drag prefabs into the pallet property to make them available for painting (You can drag an entire folder of prefabs as well.)

The pallet options will then show up in a row below the TilePainter grid, and you can select a "color" by holding 'S' and clicking on them in the inspector.

Let me know if you have any more questions, I might do a better youtube tutorial at some point as well.

@hmihalis1
Copy link

Hi Joseph, thanks for responding. I followed the tutorial you made on procjam and have so far got the overlapping model working with a basic cube. In the youtube tutorial you also have a triangle polygon, which you use to create slightly more complicated shapes, it would be good to know how to go about producing these prefabs, as the process of producing and importing geomettry from 3d platforms into unity is always rife with errors and difficulties in my experience. I will try to get the tiling example working tomorrow, and will let you know what problems I run into. It would also be great to know how to work with 3d shapes and how to stop the algorithm and export the generated geomettry. Many thanks,
H

@selfsame
Copy link
Owner Author

@hmihalis1 oh that's more of a general unity question. I use blender for object modelling, but most programs that can export obj or fbx files should be suitable.

I don't know of any way to export object groups from Unity, perhaps there's a plugin out there.

@hmihalis1
Copy link

hmihalis1 commented Jul 27, 2018 via email

@jasonmulligan3
Copy link

Do you by chance know how to go about modifying the SimpleTiledWFC script to force it place tiles with a specific tag in a slot before running the algorithm? For example placing a "terrain" tile on all [width, 0] slots to generate levels for a 2D side scroller.

I'm really new to Unity and coding in general, and I'm using this algorithm for a school project (btw thanks so much for doing the work to get this into Unity and be so user friendly!)

@selfsame
Copy link
Owner Author

@jasonmulligan3 hey sorry for the delay.

If you just want a ground row the Overlap model has a foundation property that will do a row with a specific tile. You have to experiment with the number to find the right tile type because it corresponds to the internal chunk index, not the tile index.

The Tiled model doesn't have a foundation prop, but both algorithms should be moddable to work with 'constraints', or preset tiles that it solves around. I failed trying to implement that with the Overlap but the Tiled might be easier because your working with single tiles not chunks.

User constraints = setting some of wave coefficients to false.

Here's a few notes from the WFC creator on constraints:

11 Jun 2017
User constraints = setting some of wave coefficients to false.

Ground is a custom constraint: we set all non-ground patterns at the bottom row to false and the ground pattern at the non-bottom rows to false.

Just don't forget to propagate those changes

If you do look into it and get something working let me know!

@jasonmulligan3
Copy link

@selfsame No worries! Thanks for responding. I'm going to be playing around with it to see if I can get everything working over the next couple days

@TheodoreGalanos
Copy link

TheodoreGalanos commented May 17, 2020

Fixed! I really need to learn how to take whole tilesets and use those as object inputs for the generation.

@hmihalis1
Copy link

hmihalis1 commented May 17, 2020 via email

@fileho
Copy link

fileho commented Nov 2, 2021

Hi,

I'm trying to recreate the Flowers example from the original implementation but I'm struggling with it. I'm using Overlap model, N = 3 and it works fine with periodic input and output and it usually doesn't spawn the dirt at the ground level (as expected). In the original repo, there are always two layers of dirt at the bottom. However, when I turn off the periodic input and output trying to match it, the generation will fail almost every time. When I go over the generation, most of the time it won't generate a ground at all and then it will get stuck.

My question is whether this is intentional or if it should record the tiles on the boundries with periodic input and output set to false? Then those tiles would have the lowest entropy and would be placed first assuming we would start with the propagation from borders.

I wasn't able to make it work using foundation.

Here is a link to original repo image.

Thanks for your time.

@selfsame
Copy link
Owner Author

selfsame commented Nov 3, 2021

@fileho Yes i see what you mean, it would need a foundation to recreate those images. It does look like there is something broken with my unity adaptation, AFAIK i had modified it a bit becuase our grid is reversed on the Y axis. Opened an issue to look into repairing it: #12

@Fluidios
Copy link

Fluidios commented Oct 8, 2023

@selfsame Hi, I'm figuring out your code around OverlappingModel, it works, but there are three variables whose purpose is not completely clear to me. They are symmetry, ground and N. I have found values where everything works fine, but I would like to fully understand what is going on. For example, if I set symmetry to something other than 1, Model class crashes somewhere inside with an error when trying to divide by 0. Can you describe what these variables do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants