ORGANIC TOWNS FROM SQUARE TILES - a talk by OSKAR STÅLBERG at INDIECADE EUROPE 2019 — Transcript
Full transcript
- 4:25let's start okay it is me again so our
- 4:33next speaker is Oscar who will show you
- 4:36how the wavefunction collapses I told
- 4:39him I'm gonna make a joke so I had to
- 4:40please welcome Oscar oh now it's working
- 4:51yeah hello everyone yeah I'm Oscar
- 4:53Stalberg I'll be talking to you about my
- 4:57new project that looks like this that I
- 4:59am currently working on the talk will be
- 5:02quite technical probably more technical
- 5:03than a lot of talk so far but I'll start
- 5:06by just introducing myself
- 5:07my name is Oscar Stalberg I've worked in
- 5:12video games for like 7 years now I think
- 5:15I started out at Ubisoft massive so my
- 5:17first part is I worked on was the
- 5:19division where I made this cool
- 5:21holographic map and sort of maps and
- 5:23urban environments has been a big part
- 5:25of my work ever since in the middle here
- 5:29you see two like web demos I did a long
- 5:31time ago those are accessible like
- 5:33online you can play them in browser and
- 5:35build your own little house or build
- 5:36your own mobile planet so I'm very
- 5:39interested in procedural stuff in
- 5:41general and that's the talk is gonna be
- 5:42a lot about procedural stuff and the
- 5:45last gift you see er here is from the
- 5:48game bad north which is what I like the
- 5:50past two years I was working on the game
- 5:52bad north so it's a small procedurally
- 5:57generated micro strategy game where you
- 6:00defend Islands against Vikings that also
- 6:04started as a procedural project like all
- 6:07my projects do and then I was kind of at
- 6:09a good place in my career where I
- 6:10figured well might as well put a game on
- 6:13top of this and like do my first indie
- 6:15project yeah but that's all out now it
- 6:17actually shipped on mobile two days ago
- 6:19so now we've shipped on all the
- 6:21platforms that we were gonna ship on
- 6:24yeah and if you want to see cool gifts
- 6:27like this you could follow me on Twitter
- 6:28that's my Twitter handle right there but
- 6:31today I'm going to talk about my new
- 6:33project it doesn't have a name yet the
- 6:36working title is placed
- 6:39because you're building nice little
- 6:40places kind of but this is what it looks
- 6:43like
- 6:43and it's kind of the it's kind of a
- 6:46combination of a lot of themes I have
- 6:49been working on lately so it uses a lot
- 6:53of the same core ideas from bad north
- 6:56but it also combines it with some with
- 6:58things from brick block that thing where
- 7:00you build a house and a bunch of other
- 7:03stuff and then it introduces the new way
- 7:05of doing a like a non-square grid you
- 7:07can see so we can create kind of more
- 7:08organic looking tiles which is something
- 7:11I've been wanting to trying out try out
- 7:12for a very long time yeah so i'ma talk
- 7:17about just like the different techniques
- 7:19that go into making this thing so so
- 7:24first of all what is it its a mix
- 7:27between the algorithms marching cubes
- 7:29which is quite a simple algorithm but
- 7:31like that's a good first procedural
- 7:34algorithm to implement and the algorithm
- 7:36wavefunction collapse which is a bit
- 7:37weirdly named algorithm but it's an
- 7:39algorithm for like placing tiles or
- 7:41inside a space as its a mix between
- 7:44those and then it's also running on an
- 7:48irregular quadrilateral grid so
- 7:51quadrilateral means that all the like
- 7:54you see how the little black grid here
- 7:56it's all made of squares or not squares
- 7:59it's made of quads right so they all
- 8:01have four corners but it's irregular
- 8:04right here you have three quads meeting
- 8:08at a corner and you can build there if
- 8:10you want to or here you have five of
- 8:12them being a corner and you can probably
- 8:14yeah here's there's six of them meeting
- 8:16at all that's too far away I can build
- 8:18like that there we go so I'm gonna start
- 8:21to talk just about how I am approaching
- 8:24the generation of a grid like this it
- 8:28took me some time to like I knew I'd
- 8:30been wanting to work on a grid similar
- 8:32to that for some time but it took me a
- 8:34while to figure out the best approach
- 8:35for it so imma just show you a get like
- 8:38some of you might have seen this gif on
- 8:40Twitter before so that was the only
- 8:42slide now it's just gonna be in unity
- 8:44and a couple of pictures
- 8:47so here you can see how the grid is made
- 8:51so I start by creating a bunch of
- 8:53triangles within a hexagon and then I
- 8:56randomly join some of the triangles into
- 8:59quads so that's the only random element
- 9:02in creating the grid because after that
- 9:05like the grid like if you and I just see
- 9:07that with the position of that
- 9:08particular grid patch then you know it's
- 9:10deterministic yeah so then it randomly
- 9:14joined some of the triangles into quads
- 9:15and then it subdivides all the quads and
- 9:19all the triangles because obviously you
- 9:21can subdivide subdivide a quad into four
- 9:25new quads but you can also subdivide a
- 9:26triangle into three quads so it's like
- 9:30if you run the smoothing algorithm
- 9:31function in any 3d software that's
- 9:34basically what it does and then I run a
- 9:36relax algorithm on that to make it all
- 9:39kind of smooth and nice and not like
- 9:40jagged and sharp yeah so I do that and
- 9:45the point of that kind of is the point
- 9:48of using a quadrilateral grid like that
- 9:50well the point of using it rather than a
- 9:53just a square grid is of course because
- 9:55like town escapes look more fun when
- 9:57they have fun and interesting organic
- 9:59shapes I mean Pirates of all towns kind
- 10:01of look like this a lot but it's also
- 10:04because if we have if it's all made of
- 10:05quads then you can use square tiles and
- 10:08place them there so that means it's
- 10:10quite easy to input like that's a good
- 10:12functional you can like you can
- 10:13tessellate square so you can place them
- 10:15next to each other they have edges that
- 10:17bump up against each other so it's like
- 10:19that's how we normally use tiles and
- 10:20games so it's just a more fun way of
- 10:22using pretty regular game tiles actually
- 10:26the first actually did some work for
- 10:29those who game released of like a few
- 10:32months ago called night call that takes
- 10:34place in Paris you're a taxi driver
- 10:36driving around and they just needed a
- 10:37view of Paris like you're driving around
- 10:39on the actual map of Paris and they just
- 10:41needed a view of Paris
- 10:43this sort of swish by in the rear view
- 10:44mirror as you're driving around so bait
- 10:46so they contacted me to help them out
- 10:48with that and that was my first attempt
- 10:50to try out making a quadrilateral grid
- 10:52so this is what I did for that one so
- 10:54you can see how like the grid it or the
- 10:56here it's actually generating it within
- 11:00city blocks that are like the actual
- 11:02blocks from actual data of Paris but
- 11:07that was pretty complicated to write
- 11:09because when you and you can see how it
- 11:11gets kind of wonky around a lot of
- 11:13especially like sharper places but for
- 11:15my new project and I wanted to figure
- 11:17out is and there's a lot of like I have
- 11:18to do a lot of intersection tests
- 11:20because you're kind of tiling it up
- 11:21you're like you have is an irregular
- 11:23polygon an arbitrary regular polygon and
- 11:25then you're tiling it up with quads
- 11:27along the edges and then you sort of
- 11:28keep filling it in until you filled it
- 11:29in all the way but if you make a mistake
- 11:31and the quads start sort of overlap each
- 11:34other then it will all turn inside out
- 11:36and then it will start building towards
- 11:38infinity and you obviously don't want
- 11:39that so that was quite tricky and you
- 11:42have to do a lot of just line line
- 11:43intersections and quad quad
- 11:44intersections check like can I play
- 11:46something here so in this new project
- 11:48I'm making I want it to be very
- 11:50performant and be able to run like in
- 11:51the browser or in mobile and stuff like
- 11:53that so then I wanted a solution that
- 11:55didn't contain where I didn't have to do
- 11:57any intersection tests and stuff like
- 11:59that so I'm very happy that I bet I
- 12:02figured out this model yeah and we can
- 12:06actually see let me show you it
- 12:08generating on the fly so now the game is
- 12:09running so we'll turn off the game and
- 12:11then we will turn that like I can tell
- 12:15the game how fast its update loop is
- 12:17supposed to run so now it's quite slow
- 12:19it's just going to be able to do eight
- 12:20steps each frame normally I run like a
- 12:26couple of like eight milliseconds each
- 12:27frame so we'll see the yeah here you can
- 12:30see how like it's building everything
- 12:33and the sort of tiles are slowly falling
- 12:37into place there's still some
- 12:38awkwardness but that will sort of soon
- 12:46and all these like red things are
- 12:49marking out like where it's supposed to
- 12:51generate new because now it's just
- 12:52generated a little grid patch in the
- 12:53middle here it's actually up to speed
- 13:01here a little bit yep so now you can see
- 13:03it like now it's generating these little
- 13:06grid patches and like a challenge here
- 13:08was also you can't like a relaxation
- 13:12algorithm you can only run a relaxation
- 13:13algorithm on a finite set of points but
- 13:16I wanted this to be a erratically
- 13:17infinite grid where you could just keep
- 13:19building forever I mean obviously you
- 13:21will run out of memory but you can like
- 13:22build a bit here and then remove those
- 13:24things build them here remove those
- 13:25things built-in mirrors you can kind of
- 13:26walk by building in different directions
- 13:28like if I place if a place a tile like
- 13:32here it will start to build like build
- 13:35grid in this direction too so what I
- 13:37have to do is I have to generate a bunch
- 13:39of these little patches so here you can
- 13:42see the clear like the the patches made
- 13:44of triangles that are subdivided that
- 13:46turn into quads but I have to generate
- 13:48clusters of those patches that I then
- 13:50can sew in clusters of three as you can
- 13:53see here with this thing that kind of
- 13:54bends into place I relax them together
- 13:57and then with the final result I can
- 13:59interpolate between a bunch of different
- 14:01of those relaxed clusters and then you
- 14:03get like a seamless tiling thing made
- 14:06out of quads so you can see how like
- 14:08here's obviously the borders between the
- 14:10different patches and you can see how it
- 14:11all lines up perfectly in the end yeah
- 14:17so now it's generated like everything it
- 14:19has to generate for my current size of
- 14:21the world but if I keep building this
- 14:22way yeah you see how now like it wants
- 14:24to generate more in this direction and a
- 14:26bit more in this because there's like oh
- 14:27yeah
- 14:29so and a very interesting thing in
- 14:31generating the quad grid this way in
- 14:34starting with generating triangles is I
- 14:37got an interesting opportunity use
- 14:38something I've been wanting to use for a
- 14:40long time which is there is a way of
- 14:43thinking about hexagons like has any of
- 14:46you ever built a hexagon based games
- 14:48yeah few knots yeah okay a few people
- 14:51there is a very interesting way of
- 14:53thinking about hexagons where instead of
- 14:56where you can think about them as as
- 14:58cubes in a sort of diagonal plane
- 15:01stacked like this because as you can see
- 15:04here these are cubes but they're also
- 15:05hexagons and then you can use integers
- 15:08instead of floats for their positions
- 15:12you don't get precision errors and you
- 15:13can do like a lot of the math becomes
- 15:14much more straightforward than if you're
- 15:16using positions and angles and stuff
- 15:18like that then you get a lot of floats
- 15:20and then if you build a very large grid
- 15:21you start getting flowing points issues
- 15:23and stuff like that so it's a very nice
- 15:25way to approach hexagons yeah and it
- 15:31also makes sure that the grid kind of
- 15:33has this nice irregular shape right so
- 15:36none of these not like there isn't an
- 15:38underlying square grid that creates this
- 15:40this quadrant but but it's all made of
- 15:42hexagons yeah another fun thing with the
- 15:46hexagons is oh yeah and if you want to
- 15:49look further into there's an amazing
- 15:50article that I've used a bunch of times
- 15:52written by like the addresses here by
- 15:54Amit Patel he does a bunch of I mean I'm
- 15:56sure you've come across some of his work
- 15:57before he does a lot of really
- 15:59interesting really well explained sort
- 16:03of articles and blog posts about some
- 16:04fundamental like path finding algorithms
- 16:07ways to structure your grids graphs
- 16:11stuff like that and like procedural
- 16:13generation stuff in general so I got a
- 16:15lot of my hexagon math from him yeah and
- 16:23an interesting way to illustrate this as
- 16:25well is that since all the verts here
- 16:28have an origin position on this like as
- 16:32integers I can actually use I'll show
- 16:36you the bounding box I'm using to decide
- 16:37like how what's the center of this world
- 16:39is and how far out I'm going to generate
- 16:40so this looks like that and it looks
- 16:42like a kind of a hexagon but if we build
- 16:45it a lot in one direction you can see
- 16:47that it acts it is actually a box but
- 16:50that's projected down into the flat
- 16:51plane into the hexagon space so it
- 16:54becomes a bounding box but in in hexagon
- 16:58space which means that you get less of
- 17:00the obvious bounding box center that you
- 17:03would get if it was just a grid aligned
- 17:07bounding box the normal way you would do
- 17:09it so that's a nice little illustration
- 17:12of what's
- 17:14yeah so that's kind of it about know
- 17:17there's a few more things about the grid
- 17:20so yeah obviously when I run the relax
- 17:22algorithm to make the grid look as as
- 17:25sort of nice and relaxed and smooth as
- 17:27possible I found an interesting way of
- 17:28doing that and that could be a general
- 17:30way if you have like an irregular quad
- 17:31and you want to turn that quad into more
- 17:33of a square but you don't want to align
- 17:35it to the the axis of the of the world
- 17:40you're working and this is very
- 17:41convenient and fast an easy way to do
- 17:42that where so you start by like
- 17:44calculating the center and you get the
- 17:46vectors like from each corner to the
- 17:49center right and then if you just rotate
- 17:52them all like rotate one of them nothing
- 17:55and 190 degrees one one eighty degrees
- 17:57and one 270 degrees and the way you can
- 17:59rotate a 2d vector is if you just flip
- 18:01the you flip the coordinates and it
- 18:05invert one of them that's a 90 degree
- 18:07rotation of a 2d vector so that's a
- 18:08super cheap way of doing it so you
- 18:10rotate them and then you average them
- 18:11and then you rotate them back out and
- 18:13then you just move towards that right so
- 18:15then you get a perfect square in the end
- 18:16of course in my relaxation I can't make
- 18:19a perfect square out of them because
- 18:20like I could make a perfect square out
- 18:22of one grid but since they're all
- 18:23budding up or one quad but since they're
- 18:25all budding up against each other this
- 18:27I'm sort of accumulating these little
- 18:29forces like they sees a little red green
- 18:31blue yellow force on these corners I'm
- 18:34accumulating them from all the like for
- 18:36each verse for all the adjacent quads
- 18:38and then I sum them up and then I do
- 18:39that over multiple iterations and that's
- 18:42kind of the slowest parts of the with
- 18:45one of slowest algorithms that I have
- 18:47running the relaxation because you have
- 18:50to do it quite a lot of times like when
- 18:51you saw the grid relax in the beginning
- 18:54you can see how like it actually takes a
- 18:56while to relax all of them and it keeps
- 18:57like it's still having effective and 256
- 19:00steps out which is how fast I'm running
- 19:02it yeah yeah so that's the the grid I'm
- 19:07working on another interesting thing I
- 19:09do with the grid is I I want to create
- 19:12like sort of different areas that are
- 19:14dif work aortic and some feel more
- 19:18orderly so you can see how some of these
- 19:22some of these
- 19:25hexxus are like this here you can
- 19:28clearly see the remnants of a triangle
- 19:30right and here's clearly the remnant of
- 19:32a triangle
- 19:33whereas this piece here is just made out
- 19:38of six very big triangles so this piece
- 19:41becomes much less chaotic than this one
- 19:43here that's made out of more anyway and
- 19:46this one here is made of a ton of small
- 19:48little triangles like you can see how
- 19:49the triangles is kind of made up of
- 19:50learn or Mike here's the mid-level
- 19:54here's the very very big triangles and
- 20:01yeah this is the more chaotic one so
- 20:04these end up like if you build around
- 20:05those areas you get a much more chaotic
- 20:08looking town with like weird Wonka
- 20:10shaped houses like you see like that's a
- 20:12weird
- 20:14that's a weird house shape obviously
- 20:16whereas if you build in the more axis
- 20:21aligned areas you can build nice big
- 20:23square ish function so that's kind of an
- 20:25option I want to I want to give the user
- 20:26in the end to kind of choose what kind
- 20:28of style they want to build their
- 20:29environment in but I don't want them to
- 20:31be able to build a completely square
- 20:33thing too big like they're always
- 20:34supposed to butt up against the sort of
- 20:36organic nature of a city and that's kind
- 20:41of one of the fundamental sort of
- 20:43aesthetical things of this project is I
- 20:46really like the in urban environments I
- 20:48really like the combination of the
- 20:51artificial and the plant and the
- 20:53symmetrical which is like whenever you
- 20:55build a house usually well not anymore
- 20:56but it used to be did you build it kind
- 20:58of symmetrical with a clear sort of idea
- 21:00and repetition and patterns but then you
- 21:02know it always butts up against another
- 21:04house was sort of a weird angles and you
- 21:05have to make it a bit of a weird angle
- 21:06and then after a while when you're
- 21:08renovated you've changed like half of
- 21:10the house likely or so in the end you
- 21:11have this sort of organic asymmetry
- 21:13growing so new symmetrical things keep
- 21:15popping up but then they kind of become
- 21:17more organic and symmetrical less the
- 21:18environment grows around them and that's
- 21:20kind of a thing that I wanna an
- 21:22aesthetic that I want to that I want to
- 21:24work with in this game I'm hoping to add
- 21:26later like right now I just have these
- 21:27little grassy patches but I'm hoping to
- 21:29add later stuff like plants that
- 21:32actually grow slowly over time like
- 21:34vines growing on the walls would
- 21:35obviously be ideal but even just a
- 21:38little tree
- 21:38or whatever and stuff like that it kind
- 21:40of grows slowly over time so house
- 21:43obviously this is a very tile based
- 21:45thing so if you just look at the how it
- 21:49all comes together and turn off the grid
- 21:51of this grid - so these are here you can
- 21:54see how it's all divided into little
- 21:56tiles and these I for this project I
- 22:00have to build a lot of tiles to make the
- 22:02make the whole thing work so this is
- 22:05actually what it looks like in Maya when
- 22:06I'm building them so that's quite a few
- 22:08tiles I'm up to about 200 tiles already
- 22:11but I reckon I'll have to build like 3
- 22:12or 400 to satisfy all the possibilities
- 22:15of what you whatever you can build and
- 22:17so these tiles look very similar to
- 22:20something that you would use for a
- 22:21normal marching squares algorithm and
- 22:23one core one core idea is that the tiles
- 22:27sit on kind of the corners right so if
- 22:31we select a small little house piece
- 22:33here so this is just a single block of
- 22:35house right but it's made up out of like
- 22:38four corners on top and then four
- 22:41corners on the bottom like this so each
- 22:44of these little modules have like this
- 22:49one obviously only has one corner that
- 22:50sort of inside the house block whereas
- 22:53it has like the rest of the corners are
- 22:54outside the house book so we can look at
- 22:57what that looks like so here is all
- 23:01these tiles imported into Maya but they
- 23:05don't have a texture here this this mesh
- 23:07here is actually just for debug purposes
- 23:08for me to be able to see what I'm
- 23:09working on
- 23:10and here incidentally is actually the
- 23:12different tiles I'm building being
- 23:14recombined into bigger tiles because I
- 23:16don't wanna have to build all of these
- 23:18weird combinations myself so whenever
- 23:21you have tiles that could fit it like
- 23:22you could have a corner like this
- 23:23against the corner like that and they're
- 23:25not intersecting I might as well just
- 23:26generate that out of the meshes I
- 23:28already have instead of building it
- 23:30manually because there's a lot of
- 23:31combinations to build obviously this
- 23:33like goes into forever here and here
- 23:37also you can see how let's pick the
- 23:40thing we were looking at before here's
- 23:42that little thing so if we select this
- 23:44one here I should be able to click on it
- 23:45and yeah oh it's a bit slow when I try
- 23:50and display all those so you can see how
- 23:52this how it
- 23:52little square on the or a little cube on
- 23:55the corner here that's because that's
- 23:56the only cube that's inside whereas if I
- 23:59click this piece of wall here it has
- 24:01four cubes because it has four corners
- 24:03that are inside and it has four cubes
- 24:05that are outside so that means of course
- 24:08that you can like taking those corners
- 24:12in sequence you can combine them into
- 24:13right if it was just inside and outside
- 24:15it's not that simple but if it was just
- 24:17insides and outsides you could you could
- 24:19put it into just a binary number right
- 24:21so this one here could be this one here
- 24:25could be one zero zero zero zero zero
- 24:28zero zero so that's like the byte that's
- 24:30one or if the corner was placed here
- 24:32instead of here then it's going to be 0
- 24:341 0 0 0 0 0 which is 2 so that's a great
- 24:37way you can just index them like that
- 24:38and then when you ask for them again and
- 24:40the algorithm is very easy to just ask
- 24:42access the right the right one straight
- 24:43away now in my case there is one pretty
- 24:47significant piece of complexity above
- 24:51that which is that I want to be able to
- 24:53use multiple colors so if I build let's
- 24:57run the game again if I build with more
- 25:02than one life I build with like color
- 25:04colors of blocks of different colors
- 25:06next to each other I want to like make a
- 25:08little comment in the mesh of what
- 25:09happens when those two blocks meet right
- 25:11so here you can see I'll let's make it
- 25:13run faster there we go
- 25:16so here you can see how this green meets
- 25:17the yellow so then there's like a little
- 25:19trimming like this and it has like a
- 25:21slightly taller window and when these
- 25:23ones meet each other like that there's a
- 25:25little bit of a drainpipe yeah basically
- 25:28I want to be able to and here these meet
- 25:29and they have like slightly different
- 25:30heights so I want to be able to comment
- 25:32what happens when different colors meet
- 25:34but that also means that I have to like
- 25:36it's not enough to have a court like a
- 25:39house corner like this I need to have a
- 25:41corner where like the top or house side
- 25:44like that I need to have one where the
- 25:45top part is one material color and the
- 25:48bottom one is another material they
- 25:51don't this doesn't all only work for a
- 25:53green and white though like whichever
- 25:55color you choose you can pick this one
- 25:56and they recolor them offers so I have
- 25:59to do that one but then I also have to
- 26:01do like ok what happens if we split the
- 26:02colors this way around and what happens
- 26:04if we split the colors
- 26:06like here's one that splits the name for
- 26:07different ways so then I have to like
- 26:10assign different colors and build all
- 26:11these kinds of different combinations so
- 26:12that's a lot of work and that's why I
- 26:14think I'll need another if I didn't have
- 26:16the different colors I think I only
- 26:17would theoretically need 667 pieces to
- 26:20make this whole thing work but with the
- 26:21different colors the permutation count
- 26:23kind of explodes so now I think it will
- 26:25be like in the three four hundreds or
- 26:27something like that yeah so the marching
- 26:32squares part the marching cubes part of
- 26:35the algorithm that's the simple part
- 26:36that's the part that can figure out that
- 26:39you know but this is a corner and can
- 26:43place the corner on the corner of a
- 26:44house but that's not all it takes
- 26:46because obviously I have a bunch of
- 26:47different types of corners right so I
- 26:49have this top corner here it's like a
- 26:51simple type I have now became a
- 26:53different type but then of course I have
- 26:54like this little corner here where it's
- 26:56like a terrace or this little thing here
- 26:59where it's like a bigger roof or than
- 27:02those all kinds of things like that so
- 27:03that's where the wavefunction collapse
- 27:05algorithm comes into place so let's see
- 27:07if we can actually see this unfold in
- 27:09real time so if I turn on the gizmos I
- 27:11select the that's the graph I need to
- 27:16select and then turn on off the graph
- 27:17gives me turn on the cube there we go
- 27:20so nope that's the wrong one yeah okay I
- 27:22think this should work yes
- 27:24so here it became very very slow and now
- 27:26it's the drawing of everything that's
- 27:27very small so what you see here the
- 27:29white wireframes you see is the entire
- 27:33possibility space right so for each of
- 27:35these little slots it there is there a
- 27:42bunch of different modules that are
- 27:43possible but it's usually not that many
- 27:45like on a corner slots maybe there's
- 27:47like I don't know 20 different ones
- 27:49because it's like a few different styles
- 27:51but then they can be rotated and mirror
- 27:53different ways so it starts with all of
- 27:56those being so let's just maybe look at
- 28:03its bit slow if you have everything
- 28:04selected so let's maybe look at them
- 28:07here I think it's still yeah so here if
- 28:09you look at this corner you can see kind
- 28:11of the shadows of let's turn on the word
- 28:12from the shadows of the different
- 28:15possibilities you see like it could have
- 28:16a chimney here it still thinks it could
- 28:19have a like a pointy side and achieve me
- 28:22here it actually can't in the end
- 28:23because that would there would have to
- 28:25be a similar chimney on this side and
- 28:27there's not but it doesn't know that yet
- 28:29because the algorithm hasn't gotten that
- 28:30far yet right so right now this thing's
- 28:33that there are eleven possibilities for
- 28:36this cube and those are the ones we see
- 28:38here and this one things that are that
- 28:40there are ten possibilities for this one
- 28:42this only thinks there are eight like
- 28:45you can see the shadow of the the kind
- 28:48of trimming we were looking at before
- 28:49here but as to then ask the wavefunction
- 28:52collapse algorithm runs fewer and fewer
- 28:55things are possible and in the end it
- 28:56all collapses so if you're just running
- 28:59again we can if we select everything we
- 29:01see all the gizmos for it yeah and the
- 29:07so obviously the wavefunction collapse
- 29:09is an algorithm that can be quite slow
- 29:11I've managed to build my thing in a way
- 29:12so that I can run it like if we run it
- 29:16very slow and I can keep clicking and
- 29:19even though it hasn't finished figuring
- 29:21out what things are supposed to look
- 29:22like I can still keep building and then
- 29:25it will just like if we just make it
- 29:26faster again okay now I selected it so
- 29:29now it's very slow then it will kind of
- 29:32resolve it all anyway after the fact so
- 29:37there's like two kinds of propagation
- 29:39happening first there's a propagation
- 29:40where like if you build something it
- 29:43needs to propagate out and tell all its
- 29:44neighbors like hey something changed so
- 29:46everything is possible again and that
- 29:49one tells its neighbor hey I changed and
- 29:50that means I could have a different side
- 29:52towards you so that means everything's
- 29:53possible for you again and that kind of
- 29:55propagates out obviously if you have
- 29:56disconnected houses like this it won't
- 29:59propagate to them so if I select all of
- 30:02these and build here it might even be so
- 30:06fast that yeah cuz if I build here you
- 30:08see how this entire chunk it becomes
- 30:10like everything becomes possible again
- 30:11and then the possibility space collapses
- 30:13and yeah where I said but if I build
- 30:15over here these aren't connected to this
- 30:17but if I connect them like this then
- 30:19yeah that all happens so that I have
- 30:23done a longer totten like hour-long talk
- 30:25on just the topic of wavefunction
- 30:27collapse for anyone who wants to dive
- 30:28deeper into that so that's the name
- 30:30again of the algorithm that kind of
- 30:31figures out which pieces fit next to
- 30:33each other and select
- 30:33them but the core idea is like you make
- 30:36you build a large possibility space
- 30:38where everything is possible in my case
- 30:40here not everything is possible because
- 30:42just the right like corner pieces or
- 30:44side pieces that satisfy the constraints
- 30:45around they are possible and then you
- 30:49start removing you start as soon as you
- 30:51place this one piece that big means that
- 30:52a bunch of the pieces next to them are
- 30:53not possible anymore so then you start
- 30:55removing those and then that means that
- 30:56a bunch of other ones are not possible
- 30:58anymore and that propagates and the
- 30:59whole thing collapses and in the end no
- 31:01it's just one possibility and that's
- 31:03what you end up showing the player yeah
- 31:07that went by way quicker than I thought
- 31:10because I have a bunch of other things
- 31:11but maybe we'll cut for questions to
- 31:14wrap it up maybe yeah ok but all I'll
- 31:17have this project running on my computer
- 31:20I will be sitting around somewhere so if
- 31:21anyone want has further questions or
- 31:23want to take a look at anything or stuff
- 31:25like that
- 31:25then you are most welcome to approach me
- 31:27thank you
- 31:29[Applause]
- 31:53you
About this transcript
This page contains the full transcript of ORGANIC TOWNS FROM SQUARE TILES - a talk by OSKAR STÅLBERG at INDIECADE EUROPE 2019 by IndieCade Europe, generated from the public captions YouTube serves with the video. The transcript has 5,264 words across 705 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.