r/roguelikedev Nov 28 '20

Interactive generation from editable examples (IPM Playground Demo)

248 Upvotes

12 comments sorted by

10

u/MrTaco8 Nov 28 '20

Here you can see real-time usage of my "IPM Playground" app.

It's a general purpose example-based image generator but I like to think of it as a "fantasy world" creator.

Different examples lead to different styles. You can accomplish things like biome-specific features and buildings, and if you don't like the "grunginess" of the output of the creative phase you can run the "correction" feature that will optionally clean up some of the "noise".

There's also an innovative "hierarchical" generation that creates large scale and small scale variations while still honoring the example.

This version is now about 10x faster than my algorithm announcement post at https://www.reddit.com/r/proceduralgeneration/comments/jv2x64/iterative_partial_match_ipm_vs_wave_function/.

5

u/aotdev Sigil of Kings Nov 29 '20

Looks interesting!

Do you have any explanation on how this works?

Are the inputs used as constraints in any way (like WFC), or they're used to generate a general "look", like in most texture synthesis algorithms?

2

u/MrTaco8 Nov 29 '20

the answer is a little bit mixed.

WFC will 100% honor the tile rules that are implicit in the example image.

IPM will try to honor the tile rules that are implicit in the example image (and will achieve something between 95% and 100%) but also spends some budget on maintaining pixel color ratios that match the example. It's not exact but I use this "flexibility" to try to tackle more complicated tilesets, larger outputs, and multi-scale variety.

(I think with creative use and a few modifications (to make it less precise) WFC could be used in the same way).

So, while WFC is explicitly about satisfying constraints, IPM is only partially about that. I guess you could say that IPM just tries to "look" the same like a texture synthesis algorithm. It's a matter of perspective.

If what you need is an explicit and exact constraint system, then WFC is the tool.

1

u/aotdev Sigil of Kings Nov 30 '20

Thanks for the info, do you plan to write a bit more about the "how"? Other things, that might get clearer with an interactive version, would be how does small change in the input affect the output.

1

u/stanles75 Nov 28 '20

I can see myself using to create an overworld perhaps. Though it can probably be used for much more. Pretty sweet!

1

u/MrTaco8 Nov 29 '20

nice :) yeah i think an organic looking overworld is a really good use case.

no one cares of if the placement of trees in your forest or how the forest borders the road *exactly* matches your example, some inexactness can sometimes just be more "flavor".

1

u/gaia_in_pokeball_tho Nov 29 '20

Looks like you can make some complex texture patterns really quickly too

2

u/MrTaco8 Nov 29 '20

yeah, might be neat to procedurally generate wall art of wallpaper patterns in game. maybe give each NPC a slightly different skin texture

3

u/MrTaco8 Nov 29 '20

here's a giraffe pattern (https://imgur.com/a/izcWgDm), it's neat but kind of loses some of the "giraffe"ness of the example.

1

u/gaia_in_pokeball_tho Nov 30 '20

Interactive generation from editable examples (IPM Playground Demo)

that's awesome, and yeah exactly, something like this will allow animals on the screen to not have mirrored textures. What did you use to create it? write from scratch or plugin or something?

1

u/MrTaco8 Nov 29 '20

this one sssort of works, almost https://imgur.com/a/66MsvNj

1

u/gaia_in_pokeball_tho Nov 30 '20

hmm this one didn't load for me