This content is an in-depth interview with Denis Gustafson, an engineer specializing in physics engines for games, discussing his career journey, the evolution of game physics, and the technical challenges and innovations behind his work on games like "Sprinkle," "Smash Hit," and "Teardown."
Mind Map
クリックして展開
クリックしてインタラクティブなマインドマップを確認
with voils everything is discrete if you
could do collisional detection on a
voxal grid that wouldn't need to be
convex and getting physics to work with
online multiplayer H is really hard it's
really hard to sell middleware to G
develop if you're not solving a problem
like everyone saw the success of the
graphics accelerator and AIA had this
idea like we want to do the same thing
but for physics the problem with licing
things is that you have floating Point
Precision unless you are very careful
you can end up with like not well-
defined geometry like we did an escape
room like a physical oh experience we
had this panel where you where you set
down a control panel and then we had a
hole in it and behind that hole we had a
TV a large TV so you could Peak into the
the actual uh reactor Hall financially
profitable not at all
it was terrible hello everyone and
welcome to wookash podcast this time I'm
joined by Denis Gustafson an engineer
working on a physics engines and
physics-based games from scratch an
author of the mobile games sprinkle and
Smash Hit among others as well as PC
game tur down Denis taught me a lot
during this conversation I highly
recommend to watch it tell me how did
you get get into
physics so physics I I never been that
particularly interested in physics like
academic you academic physics and I I
generally don't see a strong correlation
between that kind of physics and the
physics we do in games so it's I got I
guess when I started get interested in
in game physics was at University I had
a lot of uh student friends who was very
interested in Graphics everyone was
interested in rendering um but I I found
the the motion of objects more more
interesting this was in the 90s so there
wasn't a whole lot of simulation in
games at that time and I remember I
remember this game Carmageddon 2 that
had very accurate uh
simulation and that is I think uh
something that really sparked my
interest uh not that I really enjoyed
the game I was studying the the physics
I was very um fascinated that you could
like stack objects and they behaved like
a real world and and that was to me that
was that was very exciting okay and then
that's just when it started okay and you
were doing this during the university
and then you stayed uh in the
research um yeah it was just throughout
different courses and classes at the
University I tended to focus on physics
so if we had
like this this was media technology a
master's program so we actually had a
lot of uh classes about 3D graphics and
and we actually also had one on
simulation and whenever I got a chance I
just did something simulation even it
was if it was a rendering class I did
something simulating simulated it and
also rendered it just to squeeze it in
uh so there was a lot of a lot of that
during University and then at the the
final semester when we did this Master's
thesis uh I teamed up with with another
student and we made our own rigid body
simulator nice that's thesis how much
work was it that was six
months I'd been doing a bunch of work
before that so but it was it was a
pretty pretty good amount of time I
think full time six months um it was not
a great simulator
but um so that that also sparked
the um the beginning of uh this company
that we formed afterwards yeah
uh rigid body uh I think we should paint
the picture for everybody who is
listening there will be people that are
listening that have computer programming
experience but not necessarily physics
related uh can you do a bit of an
overview what would be the rigid body
and what would be the simulation and we
can even go further into like what is a
physics engine what is what's it
doing so nowadays it's a bit more
complex but back then in the
90s uh if a game had any type of
simulation it was only fidget body um
and rigid body physics is
basically uh what it sounds like
everything is rig so there's nothing
flexing there's no cloth um there's no
deformable there's no water or smoke or
anything whatever you simulate is is
just something that is a rigid object
colliding and resting on top of other
rigid bodies H they can also usually be
connected by
joints so you can
have um two things connected by a hinge
joint or a ball joint and things like
that and uh not long afterwards people
started using this of course to to
connect limbs uh of a character and then
you could have and that's how the the
ragd doll physics was
formed uh but yeah that that's basically
what what rigid body physics is it's
still the dominant when people talk
about physics in games it's still rigid
body physics they usually mean even
though now we have very uh advanced
simulation of cloth um fluids smoke deforma
deforma
bles um in games we'll get we'll get to
that based based on your projects so you
finished the university and you formed
meikon uh research research was was the
name and um yeah it it was it started
around this thesis that we did at
University but I I don't think
any of that code really survived that
long into that project um we rewrote all
of it the the simulator we did at
University was more academic it was more
like a
mathematical um linear
equation solver that's solved things
very accurately uh it has the advantage
of uh giving very nice results if you
feed it good input uh but it also has
the downside that if you feed it not so
nice input it tends to just explode and
everything flies all over the place
um it's
also not very fast it's the performance
is very unpredictable so if you have
like 10 bodies it works fine if you had
like a 100 or a thousand bodies uh the
scale of performance tends tends to not
scale so well when the number of
contacts so it's it's kind of like a
quadratic scale of the thing and it's
um um it's just not acceptable for games
so we had to come up with something
something else and that's when we also
discovered this these iterative methods
um for solving these
equations um so we started using that
and that's uh still what people are are
using I would say for read body physics
okay uh maybe we can also paint the
picture uh so I learned when I was doing
this physics simulations that the issue
is uh when you're doing the simulation
you can have an error in your
computations and because you're doing
this like frame by frame these errors
can compound so the stability of the
simulation is quite important right
because you need to think about it like
in a long spans of time and for there
are two two large categories right
there's a physics simulation that wants
to be like super accurate but time is not
not
constrained and there's the game game
physics where you are very constrained
about the time and you don't want to
just compute let's say couple of seconds
and you have let's say one day to do it
you need to compute it now in like a
frame because you need to render it
immediately right yeah so these are the
I think at least in my mind are two like
separate categories is this correct more
or less yeah it's I think what's
happening now and has been going on for
a while is that these these two are kind
of merging okay that the methods we're
using in games and have been using in
games um are
approaching the the more academic or
like the research oriented simulation
because they they usually give the same
result so if you just decrease the time
step you can actually get the same
result and it's it's always nice things
go fast so so sometimes you could even
get better accuracy with these in the
same amount of computation uh you can
actually get really nice results with
these simpler iterative methods if you
just uh lower the time step enough to
make it more to improve the accuracy so
they're not they're not like two
different worlds it's it's actually
closer than than you might think okay
can we spend a bit of time uh before we
go into like what mikon did and then
further uh to talk about time steps
fixed time step versus non-fixed and
then when you say iterative methods what
do you mean by that exactly so to paint
the picture sure uh so
physics um for games they usually well
always I would say solved um in time
steps uh and and say you have like a 60
HZ update of the screen you can tick the
physics also at 60 HZ or you can tick it
faster or slower it's a little different
depending on the game but you always do
it in discrete
steps um and for most simulators it's
it's pretty important to keep this time
stamp fixed so that you
always um take the same amount of time
forward every frame and the the frame
rate is not always fixed uh in the game
of course so that that can cause some
trouble because um you want to keep the
physics at a fixed rate uh but not
necessarily the rendering so that's when
you're going to have to start
interpretating the result
result
um and these are not really tied to the iterative
iterative
solver um so you take the physics at one
rate and then um
maybe we should break down the physics
uh what the physics engine does
understand that thetive solver so
usually in the physics engine you have a
couple of different phases where the
first one is to to do Collision
detection the
most complicated part in the physical s
is usually the contacts when things
Collide uh the joints uh are sort of
easier they're always the same in
between two bodies uh but for the
context we need to First
find uh what are all the overlapping or
potentially overlapping uh objects so
that is done you see usually you have
like an a bounding box around each
object and then you find overlaps
between these bounding boxes it's called
the broad face Collision detection then
you get a list of pairs and then you go
through over these pairs uh and you do a
more detailed thing where you find not
only the point where they overlap with
the closest point but actually a number of
of
points uh that in most physic engines
these form a a convex patch between
these objects so this is what you Senter the
the
solver and then the solver figures out
the next Dynamic state of the simulation
so the input to the solver is like where
are all the objects uh what are their
velocities their Mass properties and
stuff like that and then you also set
these contact patches or contact
points and then it figures
out um how things can move because if
you don't have any constraints uh bodies
just tend to move the way they they
moved but if you introduce these
contacts you can say okay it wants to
move like this but there's a contact in
between so it has to respond to that
somehow um and this may sound pretty
complicated and if you formulate this
mathematically it is pretty complicated
um because it's also it's not just a
system of linear equations because it
actually also has the property that a
contact can only push on objects it
cannot pull so it's not like a
linear thing where you just compute um
this value but you also have the
constraint that it has to be positive it
can only push things
um it's actually not that complicated
using an iterative
method um so instead of solving instead
of seeing this as this big mathematical
problem it's called a linear
complementarity problem uh instead of
doing that and solving it mathematically
what we do we just go around at every
contact push it a little bit like solve
every contact uh separately and if we do
this over and over and over again we end
up uh with a thing that converges
towards the correct state but it can
take a number of iterations to do this
and that is basically the uh the method
of of solving this
iteratively and the implementation is
also much much more much simpler than
doing the mathematically
mathematically
correct thing okay just basically just a
loop over a contact solve each contact
as if that was the only contact and then
you just move on to the next yeah so
instead of looking at all of the objects
at once and figuring out where each one
would be you think you localize this and
you look at okay here's here's one
contact Point these are the objects that
I that are touching how they should go
away and then you solve them one by one
okay yep okay okay uh regarding the time
step I think I've heard it that you can
have a stable simulation with a variable
time step is this correct but it's not
common it's not common and it's it's
even though you can get there it's very
few people are doing it um because the
reason is
that if you give it well-formed input
that can certainly work um but if if you
normally this iterative method of
solving it you go over these contacts
and and other constraints a number of
times and usually you could solve it
until every constraint is satisfied but
that's going to take a long long time so
what you do is you typically cap that at
the number of iterations in many games
it could be like four six eight
iterations and then you just say okay
enough there's going to be a small error
we'll fix it next next frame so you get
these errors that you then comp
compensate for the next frame um and this
this
error is also going to scale by the time
step so the error you got from say the
previous frames or the accumulation of
all the previous frames um you then want to
to
fix U afterwards and if you get varying time
time steps
steps
um that's going to over or under
compensate depending on whether the
current time step is longer or shorter
than the average of the of the previous
ones um so you you can get into these
shaking and self oscillation and and
things like that okay uh there are ways
to try and compensate for this but it's
never going to be perfect because if you
vary the time step a lot between every
frame uh that's really hard to work with
okay so basically by having a fixed time
stamp you also are uh locking the ER to
some sort of like order of magnitude
like a size and then you can reason
about what was the error much in a much
easier way than if you had the variable
one yeah you're not really locking the
error or clamping the error to a certain
range um it's it's more that if you had
an error from a previous frame and you
want to fix it in the next you typically
want to know
know
um in order to reason about how to fix
it in a certain amount of time or or
give you can almost see this as like a
spring say you have two objects and they
Collide and there's a contact in between
them but the solver doesn't manage to
fully resolve that they're going to
still move towards each other a little
bit ending up in in
penetration and then that you want to
fix that amount of penetration and you
can only do
that uh you can see that as kind of a
spring spring damper so you have like a
little spring trying to push it out
yeah and reasoning about how stiff that
spring should be to make it look nice
and smooth is really hard if if you
don't know the time step okay okay yeah
all right so with this as a
foundation now mikon research what was
the idea for the Institute it was
like Research Institute or was this like
a company research was just just a part
of the name it was just
a so what was the what is the company
goal uh what was the product what was the
the
vision yeah so we had like U the meon
SDK was just it was a physics engine uh
that that was the intention to just plug
it into the game engine you feed it your
objects it takes care of the the
calculations of the physics and then you
can get those back like like just like
what you have today with physx or bullet
or Havoc or or something like that um
when this came out physics was not
widely used in
games um so this was kind of a new thing
there was we had a couple of competitors
one was math
Indian okay um I don't know if anyone
remembers that um and then there was
Havoc that was pretty new at the time
um there also after a couple of years
they've been running we also there was
also a new one called novedex started
show up which later became physx
physx um
um
but physics sence was was a pretty new
thing back then so I think we were a
little bit naive to think that we could
just come right out of University and
make a product and and have people be
be excited that it's really hard to sell
middleware to game develop if you're not
solving a problem like this is something
I thought a lot about like if you if you
want to sell new technology as
middleware to a to a studio that's a
really tough sell like they're there
with their games there deadlines and
then that comes some other guy hey wait
wait maybe you want to add all these
bunch of features with all their
problems and it's it's it's A Hard Sell
and since since physics wasn't us
usually planned in games we tried to
sell them a problem rather than a
solution which which is which is hard so
it was the company didn't do that well
must say it was it was tough okay it was
a little early for physics engins I
think what uh how does this situation
change CH over time now it's like you
have a unity and unreal and unity ran
run uses now f x for the majority but
for 2D uses box 2D and now with the new
DOT stack I recently talked to Aras from
from unity and he explained that there
are actually Four engines in use like so
FS it's like how how does does market
look like now is this like everything
locked as far as you could tell like you
have two big engines they use this I I
don't follow it really closely actually
since I always Built My Own engines I
I'm I I'm not a user of uh Unity or
unreal so I I can't really say I know
it's it's pretty complicated these days
um yeah I can't really really say
anything about it because I I haven't
used that part I also know some people
writing their own physics engines for
using in okay in unreal so it's
um yeah it's a little
complicated one would have thought that
it would have stabilized by now but it's
it's almost the opposite it's it's
getting more and more
complex so for the mikon research uh you
were developing the physics engine and
trying to sell it to game studios right
yeah for how many
years we started
2001 I think
and we ran it for four years I think uh
we did get a couple
clients it was the only big one was Duke
nuk forever that we signed in was it
2004 maybe uh and that was a good one
because we could they never I mean it it
went on forever and then it was a highly
anticipated game at the time so we could
use that
as an exciting customer for a long time
um but other than that there were a few
smaller games using it um we had some
venture capital
the the company never did well
financially I would say
um and then eventually we got acquired
by by this American company AIA
AIA
in is that that was in 20 2005 yeah AIA
AIA that that was yeah no one remembers
that they did the physx hardware
accelerator some people people remember
that it was it was back in it was 20
years ago H everyone saw the success of
the graphics accelerator and AIA had
this idea like we want to do the same
thing but for physics so you buy an
extra Hardware plug it into your PC you
get awesome physics
um that didn't really work
out no one has physics accelerator
nowadays um they so they bought uh no
deex this company in
Switzerland uh that was a competitor to
us uh and
then just a year later I think they they
also bought
meon uh and we tried to to incorporate
some of our stuff into into that even
though most of it was actually noex
noex
stuff um but that's kind of when where
the meikon journey ended we got sucked
up into the AIA and trying to do
Hardware physics together with the guys
in Switzerland okay this is where where
you this is when you were flying to
Zurich yes I was I was flying back and
forth uh Sweden and and Switzerland for
a while and um it was a very rewarding
thing because there was so many smart
people there it it was it was
fantastic and [Music]
[Music]
um most of them are still on the physx
team actually 20 years later that's a
great sign that's a great sign yeah yeah
um so
um 2005 I don't know
when AIA eventually got bought out by
Nvidia I think it was maybe in
2008 or nine or something like that okay
um and then this office in you got
turned into an Nvidia office for doing
the physx SDK or continuing the work on
the physx
SDK but instead of doing it
on a a dedicated Hardware you do it as
part of the on the GPU instead yeah and
I think the whole idea with a a separate
card accelerated
card for physics it wasn't that great to
because a GP I don't think they maybe
anticipated the way gpus were going
towards more General compute yeah
because the physics accelerator was
basically also just I mean it's all just
a number gruner like different hores
operating with their local memories and
and then
gpus going also exactly that direction
it was kind
of yeah
merging um there was also a lot of
problems with AIA and physx and I this
thing I talked about about selling a
problem it was even
bigger when trying to do Hardware
physics like imagine coming to a game
Studio yeah on a timeline and asking
them to do extra content and extra
features for these very very few people
that actually buys this Hardware um and
then tell to pay them of course to do
that but it was it was yeah it was very
messy and
it's I learned a lot
about making products from that like
don't don't don't try to make a problem
something that solves the problems then
then then imagine game Studio like not
only you sell them this issue but they
also need to go to their customers
Gamers and tell them guys you should
really buy additional piece of Hardware
to our game it's like yeah and of course
no one could require that so they had to
make the game fully playable without the
physics accelerator yeah uh but there
were many other problems also with the
GM uh like the amount of speed up that
you actually got
wasn't it it didn't really
motivate extra hard and this was also
around the time where PCS started to get
extra cores up until now everything was
single core PC but around that time
these dual core machines started showing
up and
then instead of running
physics on a PPU like the physics
Processing Unit you you could just
running on on a separate core and and
that was fine so it it was a lot of bad
timing yeah I don't know uh can we talk
a little bit about how Hardware is used
in terms of CPU GPU how how much of the
physics engine work can you do
multithreaded I know that some of your
recent work was uh in this in this area
but uh so that like because uh I heard
about this PPU idea and it was uh that
it was in the
past but uh generally speaking now we
have CPUs and gpus and CPUs can do a lot
of work that is fast and but they have
couple of course and we have GPU that
are highly paralyzable for things like matrix
matrix
multiplication and how does the physics
computation fits in this in this mindset
so I think what what most people do and
what I always do also is is to run the
physics only on the
CPU um you can run there's some things
that could work well on a
GPU uh like particles for instance if
you want want to do smoke or fluid
simulation that that couldn't work but
for rigid body physics in
particular um it's not very well suited
for the GPU not not from a a technical
perspective uh or like a hardware
perspective it runs fine on a on a GPU
and that there are people who have done
that um but from from a game play and
game engine perspective having uh having
the physics run on the GPU is is not
usually not a great idea because you
want the
result of the
physics uh the game play usually depend
a lot on the output from the physics so
you do want the the result immediately
and usually when you do something on the
GPU and you can synchronize buffers and
send it but the GPU is
never in sync with the CPU or it could
be but it's usually a bad idea because
of all these
stalls um so if you want to do physics
on the GPU you kind of have to push
gameplay to the GPU also because you
know you simulate a bunch of bodies you
see these two overlap or these two are
close to each other and you want to do a
rate cast here and there and then you
want to take that result and maybe spawn
an enemy or something or in my case in
Te down two things Collide and there's a
strong enough Force I want to split up
the objects create new objects and blah
blah blah and and it's it's awfully
complicated to do all that on the
GPU so since you have to to put gameplay
code on the
CPU it's
just not really an option to do do the
physics on on the
GPU and U and there are some some parts
of the physics pipeline like we talked
about before this phase Collision
detection for checking overlapping pairs
that can be very efficiently implemented
on the GPU also the near phase which is
100% paralyzable to check these pairs
and generate lists of contact points or
patches uh also very well suited for
parallelization at a massive scale um
the solver is harder because when you um
it actually typically does not paralyze
well at all not the method actually two
ways to do it one is called ga sidel uh
which is the one I um I describ early
you just solve each contact separately
and then after solving the first one you
have adjusted the velocities of those
two bodies and then you solve uh the
second one taking into account the
result of the first one so it's kind of
a serial operation to solve them one by
one uh there is one called jacobe in
which you solve all of them independent
ently uh and then try to work at the
result afterwards which uh also works
but it converges much much slower so it
it you need a lot more iterations and
usually at least on the CPU it's it's
not worth it to do it in parallel
because you need to do so many more
iterations for it to
converge but there are ways to go around
it there are two well one one classical way
way
when talking about parallelizing the
solver and that is to break it up into
simulation Islands so we have say you
have a ragd doll over here uh with say I
don't know 12 15 joints um and then you
have a rag doll 20 M over there
simulating a bouncing off the ground
those two never touch each other or
interact with each other so you could
solve them uh on different threat
and it's going to be fine because they
they never change the same body so to
speak uh and people have been doing that
for a long time uh that's also what we
do in teardown uh the problem of course
especially in teardown I would say is
that it tends to be large piles of
rubble and these large piles are going
to end up in the same simulation Island
um so there's not a whole lot to break up
up
um and and yeah and and that's what I've
been focusing on uh very
recently um and it it's it's not an
invention of mine people have been doing
this for for a few years now where they
try to break
up have a large pile of rubble um lots of
of
contacts um there are ways to classify
classify
um or break this problem up in into
different passes so if you imagine you
have say you have 10 objects resting in a
a
pile um you can find pairs of objects
which is fine to solve in parallel yeah
but then you're going to have to do
another pass to tie together the ones
that didn't fit in the first pass so you can
can
imagine in a large pile you're going to
end up with a lot of these passes to
cover all of it and you're also going to
going to mess a little bit with the
order in which they're solved which can
also have problems
problems
um but that it's called graph coloring
this problem of trying to break up this
um yeah you can you can see it as as a
contact graph where the contact points
are kind of links between these nodes
which are the bodies and then you're
trying to to colorize the things that
can be solved in
parallel um so that that's what I've
been even doing for the for the new
project okay uh this is but this is very
specific in terms of using this as a
general parus mechanism by default in a
physics engine in game engine like Unity
it's very difficult to probably justify the
the
complexity uh to use just for any physics
physics
yeah you would need to implement the
physics engine I think for that to make
any sense you can't really modify an
existing physics engine to to use this
unless you replace the whole solver and
it's um unfortunately it's it's pretty
complicated thing it was more
complicated than I was hoping
to and get it efficient and that ties
into just multi-threading and uh how to
synchronize threads because as you can imagine
imagine
um if you break up this
pile uh into a number of of
passes um typically that number of
passes ends up
being um maybe around 10 12 uh depending
a little bit on on the configuration uh
but usually 10 to 12 15 maybe
uh and then you have to so all the
thread in the machine you tell them now
solve all the bodies in this p and then
you kind of want to synchronize and then
you say for the next pass go solve all
these bodies and then you do that like
10 times in just per iteration so if you
want to solve all the bodies eight times
you're going to have like 80 to 100
synchronization points and you want to
do that in like a millisecond and CPUs
and operative systems are are not really
designed Ed yeah to synchronize that
much across threats you cannot use
mutases and and these regular
synchronization Primitives you have to
rely on lockless programming and atomics
to do it at that granular level okay
okay all right we're going to go back to the
the
story from meon you start another
games which I would say is under selling
your games from
the that started a little bit as a joke
we didn't know what to call it and
we uh there were a lot of especially in
the mobile space there were a lot of
Studios having bombastic names and
deliver kind of mediocre experiences and
we wanted to do the opposite so we just
named it
mediocre um
I thought it was funny and and a lot of
journalists also thought it was funny
they always made like a little pun or a
joke about the name so they kind of
worked out I think yeah I would be
scared as a journalist to say like
mediocre games without any pun because
it would be like why are you why are you
so offensive you're covering a game and
they're saying mediocre like from the K
go yeah I think most people understood
or got the joke some people didn't but
uh the the
the only time we really had a problem
with that was I think at in the App
Store we didn't think about this before
releasing the game but
the at least at the time the company
name was
displayed together with the title of the
game uh next to the
rating in a way that made it look like
here is sprinkle mediocre and then you
saw like reviews and it didn't look very
yeah okay now how uh how these problems
physics problems map to the mobile world
with much more constrained
resources because me games were mobile
games right yeah it it was I started
that together with with an old friend Henrik
Henrik
Johanson um we used to make make games
as as teenagers so we we went way back
uh and we we wanted to make an actual
game together because up until this
point I had only been doing game
technology I'd not been doing any games
and he was working as an art director so
we had kind of we complimented each
other really well so he did all on the
art side I did all the
programming um and it was the the
release of the iPad that sparked this
idea um it
it
was 2010 I think it came out um I I was
up until that point I I I had not been
that excited about mobile
gam I thought it was ridiculous to do on
such a small screen and blah and all
this so um but the iPad was something
different it had like a large screen
nice form factor good touch actually
touch interface that that
worked so we wanted to do something
about it and I had been doing this uh
I'd been starting a new physics engine
uh the previous year where I tried to do to
to
combine fluid mechanics soft bodies and
rigid bodies into the same solvers to
have this kind of universal solver idea
and a much more lower level physics
enging where you could pick and choose
and build like building blocks for for a
physics engine so to speak
uh and one part of that was was trying
to solve fluid dynamics in a way that
resembles the way you do rigid body
physics very much so it's also using a
gaus sidel uh iterative solver but you
have to formulate the constraint very
differently for that to work with fluid
dynamics so I had this fluid
simulator and I I just tried to rewrite
that into 2D and see what I could do uh
on the iPad with that and it's not a
strong processor but it's it's
actually actually not that bad either uh
it's it was it was faster than I thought
it would
be H you couldn't have a large amount of
I think in sprinkle we ended up having
something like around a thousand particles
particles
maximum um okay
on the screen at the same
time it was problem the first we didn't
really have a gameplay idea we just had
like some amount of fluid and in the
beginning we also used the Tilt sensor
so you could like push fluid around a
maze by using the Tilt sensor it was at
that time where mobile games could still
be kind of gimmicky and get away with it uh
uh but
but
but the amount of fluid I think was a
little bit
problematic uh when when you when you
didn't dynamically change if you just
had that amount of fluid it didn't look
like very much so it took a couple of
iterations when we until we finally
realized that yeah we have to give each
particle lifetime so you could
continuously uh spray or pour out fluid
and then they evaporate over time that
gives the sense of having much more
fluid than you actually
have and that's when it really started
working okay yeah you said 1,000 I was
like I thought it's like order of
magnitude more because you see that's
like yeah try to do some tricks when
rendering them we render them with
little 2D
Sprites but they're actually elliptical
so we kind of Orient
them uh around the direction of of the
edge of the fluid to make it smoother
and things like that and we also adjust
the the size of the particle based on
the density and and there's a lot going
on in that in between the simulation and the
the
visualization to get the illusion of
having more particles can we do a bit of
a overview uh for the fluid simulation
in general how to think of it uh how
it's done under the hood because to me
this was like one of this magical things
like you can see the fluid and then like
how on if somebody figures out like what
is happening from frame to frame I
didn't have a con conceptual model of
what's Happening under the hood and I
guess a lot of listeners uh don't have
it as well so uh how to think of fluid
simulation how it's done under the hood
right so um fluid simulations can be
done in one of
two different way well actually now
there there are a couple more but there
are two main categories of making fluid
one is doing it particle based H which
is what we did in sprinkle uh the other
one is grid based where you
have like a a fixed
grids with with fixed size cells and
then you just compute how much fluid or
how much density there is in each grid
cell um and you've probably seen there
are a lot of online demos with these you
can drag your mouse and they're I get
these vortices and that's usually the
grid based one uh whereas if you do the
particle based one it's usually a better
fit for games H since the grid based is
very constrained you can only have fluid in
in
this box that you define and it's pretty
complicated to make the that Dynamic so
if you want to have a whole world and
you want to have fluid at at different
places you're going to have to dynamically
dynamically
um allocate and deallocate these grid
chunks and and have the fluid uh
transparently move from one chunk to the
next and stuff like that H whereas with
particles you just have particle
positions and they can be anywhere so in
in a larger
um game level for instance particles are
nicer to work with
uh the problem with particles is
that um in order to to update the motion
of the particles you need to know which
other particles
are are
close yeah so if you want to update one
particle you need to know what are the
neighbors of this particle and in a grid
that's really easy because you just look
like left right up down and then you got
it uh
with with
particles you're going to have to do
something you can't go through all the
particles for every particle that's like
an N squ problem uh so you put them in
some kind of acceleration structure you
can put them in in a hash Grid or a
dynamic bounding volume tree or
something to to accelerate that query
like where what what other particles are
close to
me um and that's usually
where the majority or close to the
majority at least of the time is spent
in these particle based
methods Because the actual calculations
are usually quite simple it's it's very
similar well at least in my case with
sprinkle it's very similar to how it's
done in rigid body because it was that's
that was the the intention of the whole
implementation uh so it's also solved
using a gaus sidel um solver but instead
of solving in contact points you
solve um
or uh for pressure or for density at each
each
particle so
it's um these if you look at these fluid equations
equations
usually hard to
read and I also don't fully understand
them uh but you can do a lot of tricks
as always with game physics you you
don't really need to understand actual
physics do something that looks nice and
that's that's true for fluids as well if
you just do something very intuitive
like if there is a lot of partic if you
have a particle here and then you have a
lot of particles on the right side uh
it's kind of obvious that the pressure
is going to push that to the left right
so you can formulate this problem and
and you can take parts of that fluid
equation like ah this this means that
the pressure gradient has to
be hard to compute that in in relation
to the neighbors uh you plug that in and
maybe you don't care about viscosity or
something it looks kind of nice anyways
so it's um yeah it's a lot of just
simplifications yeah so this particle
approach you simulate it with like uh
for uh let's say like a small dots and
these dots have a lot of properties and
then uh after you have your simulation
done and you know where are the
particles being pushed for example you
do the nice rendering and it looks like
water and I was like oh it's fine it's
water but underneath you simulate this
with pretty much with particles and for
the other category you need to have a
grid and you kind of um look where as
heat for example right as he where heat
spreads from from a point that is very
hot towards the neighbors and and
dissolves all around the grid this would
be the core ideas when you said there
are a new one
uh how the new like so there's there's
one I'm particularly fascinated by
that that kind of combines the two it's
called particle in cell methods and
there are different variants of that I a
few years ago I I implemented one called
apine particle in cell or apic and
it um you basically
take all the uh you simulate the fluid
as if it was particles so
you each particle defines an amount of
fluid or smoke depending on the
calculations are actually the same for
fluid or smoke it's it's just um using
the same
equations so you have this amount of
fluid uh and then in instead of finding the
the
Neighbors when you compute the Dynamics
for that you splat that into a
grid and then you do the Dynamics
calculations on the
grid and then you kind of sample back
the result from the grid into the
particle so you go back and forth
between the grid and the particle
representation every frame
frame
and it's sounds maybe more complicated
than it is but it has this property of
if you squeeze a lot of part the problem
with particle the classical problem with
particle based approaches is that if you
since you have these neighbors if you
squeeze a lot of fluid or smoke into
this small confined area there's going
to be like hundreds of neighbors for
every particle and it's just going to be
ah very hard to work with like very slow
because everyone is neighbor with
everyone else
um if you do it like this is that you
just Splat all of them into that grid
and then you solve the Dynamics just on
these very few grid
cells and then you can sample back the
velocity at which they move and then
just move them so it it it's
actually um more or less a constant in
time no matter the density of the
particles which is a super nice property
when you simulate going to say constant
in time I didn't get that well maybe not
not constant but if you
have well actually sort of because if
you squeeze well more like linear in in
total time but for the Dynamics solver
is actually uh pretty much
constant no matter how many
particles are in those grid cells so say
you have okay say you have a number of
grid cells and then if you have just one
particle moving about in in the that
area or 10,000 you just solve the same
numbers and then of course you're going
to have to sample back uh all those
velocities and that's going to be more
linear in time uh but for the Dynamics
update is not really dependent on the
density of particles in an area which is
nice okay okay so we started uh the
discussion about fluid simulation based
on the game sprinkle and then a game uh
that I loved actually and played like 10
years ago Smash Hit came out and it was
all about breaking stuff and by the way
the core idea I think of the game is
brilliant like even it's it's perfectly
designed for mobile you just tap you
just tap the screen and there's no limit
to how much tap you can do because now a
lot of games are like limited it's like
oh you've made like five things now you
need to wait two hours it's like you
know and then you just you just I'm the
boss and then you need to go through
like you follow a sort of a path like a
trajectory and you need to smash things
that are on the screen made out of glass
sort of and form a path for your camera
to to smoothly go in and a lot from the
physics standpoint the main core thing
is that like it's all simulated nicely
and you need to act actually properly
break the glass right you have this for
example rectangular thing and if you
press the tab on the screen there's a
ball going in and then breaks the glass
and depending on where it hits it breaks
like physically
accurately so how what was by what was
the development of the game how it was
received uh what was the reception and
then we can dive in a bit more into the
this te down like smashing things sure
so uh Smash Hit was I think our third or
fourth game at
mediocre um we already had some success with
with sprinkle
sprinkle but
but
um I think the idea for for Smash Hit
that gave us some time to actually
develop like some some leeway to to do
something uh something
spectacular uh
and I the idea for smash it it came from
from partly from meon actually because
we did a lot of when we make a physics
engineer make a lot of these physics
Demos in many cases these physics demos
I think was more fun than the actual
game just playing around with physics is
fun right H and we had one demo in
particular where you you were in this
Museum and you could just throw balls at
uh different uh things and they they
broke it was very simple breakage um but
it still worked and it was fun and and I
thought why why not just make a game
totally based around that and and
then uh Henrik did an amazing job with
these abstract visuals and we had
musician Douglas who made a soundtrack
for that that was also really
nice um but yeah that fascination of
breaking things has had been there for
long time so there was just like a
channel to get that became form it and
the reception was amazing it was U by
far our our most popular game and I
think even by today's standard 10 years
later smash it did really well in terms of
of downloads
downloads
um it was I think the first day it got
like two million down which which is
even by today's standard I think is
pretty good um we
had uh it was a free game that was also
our first game with this
this
um that was not a like an upfront
payment it was more like an a try before
you buy type
monetization we didn't really want to do
uh like
classical um this thing with consumables
in the game and stuff so we just like
one big unlock that you could pay I
think it was $2 and you got the whole
game um so it didn't monetize
spectacularly but since we had so many
downloads it's still made very well
financially uh but it was a very very
small fraction because we also were
pretty generous with with
how how you could play the game without
paying so if you didn't pay
and you you lost you had to start over
all the way from the beginning whereas
if you did pay the only thing you
actually got was the ability to start
from a
checkpoint and I even heard some people
who who prefer who thought that was
cheating so they didn't want to pay but
yeah um yeah so so the breakage in that
game was procedural um
um
that's it so when you
something uh I try to to
break the object up based on on the the
point of of impact and it's very simple
it just slices uh the object with
planes um it's all the objects in turn
or convex and if you slice a convex
object with a plane you get two convex
objects and you can just keep going and
everything will OB guaranteed to be
convex the problem with fcing
things is that you have floating Point
precision and unless you are very
careful you can end up with like a
a
non like ill defined or like not well
defined geometry
like um
vertices things that are not fully
connected or togenerate uh triangles and
and things like that so uh I had to spend a lot of time to to implement this
spend a lot of time to to implement this in a very careful way to make sure that
in a very careful way to make sure that that never
that never happened
happened um yeah breaking breaking things with
um yeah breaking breaking things with triangles is is not not very
triangles is is not not very nice that has a lot of problems what how
nice that has a lot of problems what how do you select planes to uh the planes I
do you select planes to uh the planes I think are just based on the
um I don't remember but I think they were they were based on the velocity of
were they were based on the velocity of of the
of the incoming thing that broke them so
if yeah I think the plane is aligned with the velocity of the ball when you
with the velocity of the ball when you throw it so it kind of breaks and then
throw it so it kind of breaks and then you have a number of randomized planes
you have a number of randomized planes which all align with that velocity and
which all align with that velocity and then okay but I I I honestly don't
then okay but I I I honestly don't remember it was it was too long ago it's
remember it was it was too long ago it's it's basically just a bunch of
it's basically just a bunch of randomized things okay okay but the
randomized things okay okay but the problem with with that is
problem with with that is also if you break a convex object
also if you break a convex object because we didn't talk about this but in
because we didn't talk about this but in in physics the near face Collision
in physics the near face Collision detection the one you do after the
detection the one you do after the bounding boxes the one that generates
bounding boxes the one that generates the contact that is almost always done
the contact that is almost always done on convex objects because there are
on convex objects because there are a lot of simplifications you can do to
a lot of simplifications you can do to this problem if both objects are convex
this problem if both objects are convex there are a class of algorithms you can
there are a class of algorithms you can use for detecting overlap and also for
use for detecting overlap and also for extracting the contact points that so
extracting the contact points that so much simpler when everything is
much simpler when everything is convex so and when you break things
convex so and when you break things unfortunately if you make a hole in
unfortunately if you make a hole in something which is usually what happens
something which is usually what happens when you break something yeah that's not
when you break something yeah that's not going to be convex anymore so you're
going to be convex anymore so you're going to have to
going to have to that's why I split with planes in in
that's why I split with planes in in Smash it because if you if you slice
Smash it because if you if you slice something with a plane you're guaranteed
something with a plane you're guaranteed that the two parts will always be convex
that the two parts will always be convex but the problem is that you now have two
but the problem is that you now have two objects and then if you slice so if you
objects and then if you slice so if you want to make another slice you're going
want to make another slice you're going to have to slice both of those two into
to have to slice both of those two into two new ones and you have four yeah and
two new ones and you have four yeah and then you do one more time and you have
then you do one more time and you have eight and it's just gonna they come it
eight and it's just gonna they come it just
just uh blows up in the number of of shapes
uh blows up in the number of of shapes uh after a while so if you want to
uh after a while so if you want to continuously Break Stuff using this
continuously Break Stuff using this method
method it's it's very slow and and a lot of a
it's it's very slow and and a lot of a lot of
lot of objects so yeah yeah and then you allow
objects so yeah yeah and then you allow the player to spam and just throw a lot
the player to spam and just throw a lot of balls so it can actually quickly go
of balls so it can actually quickly go up with the splitting face right like
up with the splitting face right like yeah so if you I think in Smash it there
yeah so if you I think in Smash it there is a limit if something is small if a
is a limit if something is small if a shape is is small enough it's it's not
shape is is small enough it's it's not split again okay just to prevent things
split again okay just to prevent things from being like smaller and smaller and
from being like smaller and smaller and smaller and just more and more more
smaller and just more and more more shapes so there is a limit to
shapes so there is a limit to it
it um and I I don't think that was
um and I I don't think that was particularly problematic because since
particularly problematic because since you always move forward you don't really
you always move forward you don't really have that much of a chance to go up to
have that much of a chance to go up to an object and and try to abuse it like
an object and and try to abuse it like split it over and over again
split it over and over again um but in in a different
um but in in a different game that that method would never have
game that that method would never have worked there would have needed to be
worked there would have needed to be something pretty different I
something pretty different I think
think okay okay let's turn to to see by the
okay okay let's turn to to see by the way to finish off to have a company
way to finish off to have a company called mediocre games and then to make a
called mediocre games and then to make a game called smash
game called smash it it's such a fun
it it's such a fun tonomy yeah it was I I I don't remember
tonomy yeah it was I I I don't remember how the name came about we
how the name came about we we
we always wanted the name to have this like
always wanted the name to have this like dual meaning a little
dual meaning a little bit
bit um you smash things and you hit things
um you smash things and you hit things so it's yeah you kind of get the idea
so it's yeah you kind of get the idea and it
and it was yeah the media or smash it is kind
was yeah the media or smash it is kind of a nice
of a nice combination uh then after a period of
combination uh then after a period of making uh mobile games you uh formed a
making uh mobile games you uh formed a new company tuxedo Labs Right and
new company tuxedo Labs Right and started work on te down can you tell me
started work on te down can you tell me a little bit about the transition uh why
a little bit about the transition uh why it wasn't done as mediocre games what
it wasn't done as mediocre games what happened and then we'll move to the thir
happened and then we'll move to the thir down world
down world right
right so when we started mediocre the
so when we started mediocre the intention was always to make just a few
intention was always to make just a few games and then stop we we had no
games and then stop we we had no ambition to to build a studio around it
ambition to to build a studio around it and for the most part it was only the
and for the most part it was only the two of us Henrik and I who who ran
two of us Henrik and I who who ran mediocre there was actually one more
mediocre there was actually one more person joining Emil for the last two
person joining Emil for the last two games um as a contractor and and we
games um as a contractor and and we worked with with a few other contractors
worked with with a few other contractors for level design and stuff like that but
for level design and stuff like that but it the idea was always to make a few
it the idea was always to make a few games and then do something else we had
games and then do something else we had no no we never had like a proper office
no no we never had like a proper office or employees or
or employees or anything uh and we also saw that the
anything uh and we also saw that the mobile space was
getting we didn't really like the way things were headed with free to playay
things were headed with free to playay and it's like slot machines you just
and it's like slot machines you just game design was
so it was almost the same as monetization like if you didn't sign
monetization like if you didn't sign your game for
your game for monetization you couldn't make any money
monetization you couldn't make any money and and that's just not a very
and and that's just not a very nice environment to make games in I
nice environment to make games in I think so we both wanted to get away from
think so we both wanted to get away from that uh so after our final game pin
that uh so after our final game pin out uh we uh we just
out uh we uh we just said that's it and we we decided to do
said that's it and we we decided to do something else Henrik wanted to to go
something else Henrik wanted to to go off and make more
off and make more uh like Arty games um driven by by his
uh like Arty games um driven by by his passion so he started working on on a PC
passion so he started working on on a PC game called Overlook Trail that has been
game called Overlook Trail that has been in development since then oh wow it's
in development since then oh wow it's actually coming
actually coming out very soon nice it's gonna be
out very soon nice it's gonna be released very soon um but yeah he's been
released very soon um but yeah he's been working on that for a long long time and
working on that for a long long time and I didn't really know I didn't really
I didn't really know I didn't really have a plan I just started experimenting
have a plan I just started experimenting with with technology actually I did do
with with technology actually I did do another thing in between together with
another thing in between together with AML the um a contractor mediocre we did
AML the um a contractor mediocre we did an escape room like a physical oh
an escape room like a physical oh experience H which was super
experience H which was super fun
fun um I was fascinated by Escape rooms I
um I was fascinated by Escape rooms I was also fascinated by how bad game
was also fascinated by how bad game design usually is in Escape rooms it's
design usually is in Escape rooms it's usually just a bunch of codes that you I
usually just a bunch of codes that you I don't yeah it's it's uh um overall it's
don't yeah it's it's uh um overall it's it's usually pretty terrible from a
it's usually pretty terrible from a design perspective Escape rooms I think
design perspective Escape rooms I think is it still in operation the the escape
is it still in operation the the escape room no well actually it exists it was
room no well actually it exists it was operational in in malmer in Sweden yeah
operational in in malmer in Sweden yeah for a few years H but then they changed
for a few years H but then they changed owner and now it's just um collecting
owner and now it's just um collecting dust at like a co-working space someone
dust at like a co-working space someone maybe plays it now I don't know actually
maybe plays it now I don't know actually okay but it was a we designed it more as
okay but it was a we designed it more as a video game but in physical form so we
a video game but in physical form so we built like a control room to a fictional
built like a control room to a fictional nuclear power
nuclear power plant uh that you played um uh together
plant uh that you played um uh together with a friend so it was a two-player
with a friend so it was a two-player game where you had so we were soldering
game where you had so we were soldering a lot of buttons and meters and we had
a lot of buttons and meters and we had like a a
like a a TV we had this panel where you where you
TV we had this panel where you where you sat down control panel and then we had a
sat down control panel and then we had a hole in it and behind that hole we had a
hole in it and behind that hole we had a TV a large TV so you could Peak into the
TV a large TV so you could Peak into the the actual uh reactor Hall and you could
the actual uh reactor Hall and you could do things with these buttons and it
do things with these buttons and it affected things in the reactor Hall
affected things in the reactor Hall there was a phone ringing with
there was a phone ringing with pre-recorded messages there were
pre-recorded messages there were surveillance cameras with video footage
surveillance cameras with video footage of things that then took dependent on on
of things that then took dependent on on what you did that could had different
what you did that could had different outcomes H and I thought it turned out
outcomes H and I thought it turned out really well I am so bummed that that
really well I am so bummed that that very few people played it but that's the
very few people played it but that's the problem with Escape runs it doesn't
problem with Escape runs it doesn't scale right you can't have2 million the
scale right you can't have2 million the first day so it's um but it was super
first day so it's um but it was super fun and a
fun and a good good learning experience for doing
good good learning experience for doing electronics and other fun things that
electronics and other fun things that was just a side note financially
was just a side note financially profitable not at
profitable not at all it was terrible um yeah these these
all it was terrible um yeah these these things don't scale well uh but we also
things don't scale well uh but we also didn't put that much money into it um it
didn't put that much money into it um it was mostly just our own time I think we
was mostly just our own time I think we spent four or five months
spent four or five months maybe building it and designing
maybe building it and designing it
it um so yeah but meanwhile while doing
um so yeah but meanwhile while doing that I also started tinkering with uh
that I also started tinkering with uh rate
rate tracing
tracing um and this
was just before Nvidia announced RTX with a hardware rate racing so I and
with a hardware rate racing so I and since I was still using
since I was still using openg I couldn't really even after they
openg I couldn't really even after they announced I couldn't really access it
announced I couldn't really access it because I didn't know Vulcan or the
because I didn't know Vulcan or the D so H so I was trying to
D so H so I was trying to do rate tracing and path tracing in
do rate tracing and path tracing in screen space
screen space instead um which is not a great idea but
instead um which is not a great idea but it it sort of works for for the some
it it sort of works for for the some scenes it can actually get pretty nice
scenes it can actually get pretty nice results uh and then started
results uh and then started to look for ways how this could be used
to look for ways how this could be used and um Emil also started toying with it
and um Emil also started toying with it a little bit to see what is there
a little bit to see what is there anything we can build with
anything we can build with this uh and around that time I got very
this uh and around that time I got very fascinated by this um
fascinated by this um little voxel modeling program called
little voxel modeling program called Magic a Vox
um it's a free program that artists can use to create these beautiful images
use to create these beautiful images just by placing tiny voxal and then
just by placing tiny voxal and then render them with a very good
render them with a very good uh it's it's a very good light
uh it's it's a very good light simulation like very natural light at
simulation like very natural light at traced um and around that time a lot of
traced um and around that time a lot of these
these images came out on Twitter and I I
images came out on Twitter and I I followed a lot of artists I I I thought
followed a lot of artists I I I thought they were beautiful and I wanted to to
they were beautiful and I wanted to to try and make something that looked like
try and make something that looked like that like this combination of abstract
that like this combination of abstract blocky uh geometry with this um very
blocky uh geometry with this um very natural lighting is is such a a nice
natural lighting is is such a a nice Clash I was also playing a lot with
Clash I was also playing a lot with Legos as a kid
so be one reason but I like this AES static so I and then as we talked about
static so I and then as we talked about destruction and breaking things with
destruction and breaking things with triangles after smash it I was kind of
triangles after smash it I was kind of fed up
fed up with trying to break triangles it's just
with trying to break triangles it's just not procedural breakage with triangles
not procedural breakage with triangles is just a a big mess because of all the
is just a a big mess because of all the requirements from floating Point
requirements from floating Point Precision the convexity requirement for
Precision the convexity requirement for physics and it's just terrible to work
physics and it's just terrible to work with but with voils everything is
with but with voils everything is discreet if you could do Collision
discreet if you could do Collision detection on a voxal
detection on a voxal grid that wouldn't need to be
grid that wouldn't need to be convex you could and if you could just
convex you could and if you could just render those voxal uh everything would
render those voxal uh everything would be solved you could just like remove
be solved you could just like remove voxes and add voxes arbitrarily and have
voxes and add voxes arbitrarily and have that all work and you could do amazing
that all work and you could do amazing destruction if you could just solve that
destruction if you could just solve that problem so I started to think about that
problem so I started to think about that and
and um eventually uh just gradually uh
um eventually uh just gradually uh implemented more and more ideas and and
implemented more and more ideas and and it seemed to work so that was the
it seemed to work so that was the beginning of this voxal engine that
beginning of this voxal engine that later became turone okay okay nice and
later became turone okay okay nice and then uh well where did the name toxedo
then uh well where did the name toxedo Labs came from tuxedo Labs
Labs came from tuxedo Labs was it's an old name actually it's
was it's an old name actually it's for what we actually skipped over one
for what we actually skipped over one one part in history here that I I could
one part in history here that I I could have some relevance I know you've been
have some relevance I know you've been on this podcast I've been listening you
on this podcast I've been listening you mentioned Telemetry by Rad game tools a
mentioned Telemetry by Rad game tools a couple of times yeah and I'm actually
couple of times yeah and I'm actually the original author of that software oh
the original author of that software oh really it was called yeah when I is when
really it was called yeah when I is when uh I quit from meon
uh I quit from meon I started implementing a a performance
I started implementing a a performance profiler uh for game engines because
profiler uh for game engines because that was something I I used and as we
that was something I I used and as we talked about before like trying to sell
talked about before like trying to sell a
a problem I noticed that a lot of game
problem I noticed that a lot of game studios had problems uh measuring
studios had problems uh measuring performance of their game engine they
performance of their game engine they had a lot of inhouse profilers and it
had a lot of inhouse profilers and it was hard like how should we visualize
was hard like how should we visualize this uh multicore Computing started to
this uh multicore Computing started to pop up and that made things actually
pop up and that made things actually really hard to visualize uh so I wrote
really hard to visualize uh so I wrote this profiler and I called it dress
this profiler and I called it dress code okay I thought it was funny like
code okay I thought it was funny like you dress the code with these little
you dress the code with these little like uh things and then uh you can just
like uh things and then uh you can just see beautiful graphs like this is how
see beautiful graphs like this is how the program flows like this this is are
the program flows like this this is are the the breakdown of each
the the breakdown of each frame
frame um and since the product was called
um and since the product was called dress code I wanted a company name to be
dress code I wanted a company name to be something related to that so that's when
something related to that so that's when I came up with tuxedo labs
I came up with tuxedo labs um and then just uh a few years later I
um and then just uh a few years later I I sold it to to
I sold it to to rad um and they renamed it to a
rad um and they renamed it to a Telemetry I don't think it's a lot of
Telemetry I don't think it's a lot of code still
code still survived but the basic idea and the
survived but the basic idea and the first version that they started working
first version that they started working on was was actually that that software
on was was actually that that software okay um so tuxedo Labs was just a name
okay um so tuxedo Labs was just a name I've been using uh since since then okay
I've been using uh since since then okay okay I didn't know that I should have
okay I didn't know that I should have know that it's awesome yeah yeah I I I
know that it's awesome yeah yeah I I I think I still think it's a great idea I
think I still think it's a great idea I I've been using dress code
I've been using dress code personally all my projects since then
personally all my projects since then and I there is an open source one now
and I there is an open source one now called Tracy that is also really good
called Tracy that is also really good but I find it uh a little bit over
but I find it uh a little bit over complicated I think it's it's
complicated I think it's it's complicated to work but compared to this
complicated to work but compared to this very simple everything you really want
very simple everything you really want to want to know is to get like a
to want to know is to get like a timeline and you want to be able to sort
timeline and you want to be able to sort things on these zones and see how they
things on these zones and see how they interact
interact and um and I think um dress code did
and um and I think um dress code did that really well it it was a very it did
that really well it it was a very it did only that so it was easier to make that
only that so it was easier to make that a smooth
a smooth experience um this was sampling sampling
experience um this was sampling sampling profiler no this was not ass sampling
profiler no this was not ass sampling profiler it it was um you you manually
profiler it it was um you you manually inserted these little uh tags in the
inserted these little uh tags in the functions you wanted to be included
functions you wanted to be included because you don't wanted to include
because you don't wanted to include everything okay so you said like this is
everything okay so you said like this is the start of the frame here is where the
the start of the frame here is where the where the rendering starts and this is
where the rendering starts and this is the computation this like the FR room
the computation this like the FR room calling um so that that's where you you
calling um so that that's where you you had to dress your code with these little
had to dress your code with these little little Mark
little Mark okay
okay um okay okay okay all right
um okay okay okay all right um so then you started work on thir down
um so then you started work on thir down and you also had a team there
and you also had a team there right uh yes I started well I did I
right uh yes I started well I did I guess when it started was was with this
guess when it started was was with this uh these experiments in screen space
uh these experiments in screen space path tracing then EML
path tracing then EML on and started toying a little bit with
on and started toying a little bit with that and we did some
that and we did some prototypes um I switched over to the
prototypes um I switched over to the voxels and we we made prototypes for
voxels and we we made prototypes for that it was all a very frustrating
that it was all a very frustrating experience because we didn't really get
experience because we didn't really get anywhere we we were doing this for six
anywhere we we were doing this for six months trying to come up with good
months trying to come up with good gameplay but we we never really reached
gameplay but we we never really reached a point where it
a point where it was we never really found something that
was we never really found something that that clicked I think so we
that clicked I think so we um we stopped and then I continued on my
um we stopped and then I continued on my own for another six months uh until I
own for another six months uh until I came up with this two-phase Heist
came up with this two-phase Heist structure for the
structure for the game so it was a very
game so it was a very complicated uh from a design perspective
complicated uh from a design perspective it was super complicated to work with
it was super complicated to work with and that was I
and that was I think there were several reasons for it
think there were several reasons for it one is that I'm I'm not that great of a
one is that I'm I'm not that great of a game
game designers to to make a lot of trial and
designers to to make a lot of trial and error to to get something I think I'm
error to to get something I think I'm relatively good at seeing if it works or
relatively good at seeing if it works or not but actually coming up with the idea
not but actually coming up with the idea in the first place and then implementing
in the first place and then implementing it to find out now this also big work
it to find out now this also big work and then I
have but also the the promise was that we wanted a a
the the promise was that we wanted a a fully destructible world not not just
fully destructible world not not just like a window here and there like
like a window here and there like everything should be destructible and we
everything should be destructible and we want to use it for gameplay not just a
want to use it for gameplay not just a visual if you can destroy everything
visual if you can destroy everything it's G to be gameplay it's not just a
it's G to be gameplay it's not just a visual
visual effect um and it turned out to be very
effect um and it turned out to be very very
very hard to design games around that because
hard to design games around that because there aren't really any
there aren't really any constraints um so I think that that was
constraints um so I think that that was also the reason it took so much time to
also the reason it took so much time to come up with what the game should
come up with what the game should actually be yeah maybe we should do an
actually be yeah maybe we should do an overview of tur down how it is right now
overview of tur down how it is right now so that people watching and listening uh
so that people watching and listening uh have the idea right so uh the gameplay
have the idea right so uh the gameplay that that finally ended up being tur
that that finally ended up being tur down was that
down was that you um well there are a couple of
you um well there are a couple of different Mission types but the the most
different Mission types but the the most common Mission type is that you have a
common Mission type is that you have a number of targets you want to steal at a
number of targets you want to steal at a map the maps are relatively small around
map the maps are relatively small around 3 400 meters across
3 400 meters across there are number of targets say five six
there are number of targets say five six seven
seven targets um they are connected to an
targets um they are connected to an alarm
alarm system and when you take the first one
system and when you take the first one the alarm goes off and you have to take
the alarm goes off and you have to take the remaining ones or as many as the
the remaining ones or as many as the remaining ones as you can some are
remaining ones as you can some are required some are optional and reach an
required some are optional and reach an escape vehicle within 60 seconds so it's
escape vehicle within 60 seconds so it's not a lot of time it's going to take a
not a lot of time it's going to take a lot of preparation to reach that
lot of preparation to reach that and that's where the destruction comes
and that's where the destruction comes into place you can modify the level uh
into place you can modify the level uh to your liking and you have unlimited
to your liking and you have unlimited time to do this you can use vehicles to
time to do this you can use vehicles to crash into buildings you can place stuff
crash into buildings you can place stuff you can reorganize you can stack things
you can reorganize you can stack things you can jump on uh so you kind of
you can jump on uh so you kind of speedrun this thing in 60 seconds the
speedrun this thing in 60 seconds the highest thing is basically just an
highest thing is basically just an excuse to build this speedrunning course
excuse to build this speedrunning course where you can use a lot of physics and
where you can use a lot of physics and destruction
destruction and you have a lot of cool weapons to do
and you have a lot of cool weapons to do that as well yeah you as your the
that as well yeah you as your the campaign progresses you get more and
campaign progresses you get more and more tools you can put planks and you
more tools you can put planks and you have wires to connect things you have
have wires to connect things you have different explosives and and guns just
different explosives and and guns just to to make
to to make destruction um yeah it's it's it's just
destruction um yeah it's it's it's just a Sandbox physics destruction game but
a Sandbox physics destruction game but it has this objective of trying to to
it has this objective of trying to to accomplish something
accomplish something which I think is it what what makes it
which I think is it what what makes it work a lot of people just play te on as
work a lot of people just play te on as a Sandbox game and there are dedicated
a Sandbox game and there are dedicated sandbox modes where you have unlimited
sandbox modes where you have unlimited resources of course but I think for me
resources of course but I think for me personally I wouldn't play a game like
personally I wouldn't play a game like that I want some kind of motivation to
that I want some kind of motivation to do something so I think it's important
do something so I think it's important that you you have this yeah it seems
that you you have this yeah it seems like from the physics standpoint there
like from the physics standpoint there is this uh destruction level destruction
is this uh destruction level destruction mechanics uh but majority of the work
mechanics uh but majority of the work was in the design the world's levels
was in the design the world's levels weapons it feels like it's compared to
weapons it feels like it's compared to your other games like the mobile games
your other games like the mobile games like smash it this was like 90% physics
like smash it this was like 90% physics and then like a nice rendering thing and
and then like a nice rendering thing and here as is the the rose of yeah there's
here as is the the rose of yeah there's more definitely more content in
more definitely more content in terone um and it
terone um and it was is I I never had this desire to
was is I I never had this desire to build a studio I I didn't want to employ
build a studio I I didn't want to employ build a team and that doesn't come very
build a team and that doesn't come very natural to me so I I worked with
natural to me so I I worked with contractors it's developing teron was
contractors it's developing teron was was pretty messy because there were
was pretty messy because there were people coming and going a little bit uh
people coming and going a little bit uh I used contractors for little bits and
I used contractors for little bits and pieces and and it was I I had to do a
pieces and and it was I I had to do a lot of you know management and just to
lot of you know management and just to make sure everyone's in sync and I think
make sure everyone's in sync and I think in retrospect Teran was it turned out to
in retrospect Teran was it turned out to be a little bigger than it maybe should
be a little bigger than it maybe should have
have been for for me as a coordinator at
been for for me as a coordinator at least so um yeah not not as smooth as I
least so um yeah not not as smooth as I would have
would have hoped but turn out well in the end I
hoped but turn out well in the end I think okay but it was not it was not a
think okay but it was not it was not a smooth ride definitely not so what is
smooth ride definitely not so what is the state of tur down now and what are
the state of tur down now and what are the plans for the future for the game so
the plans for the future for the game so te down came out in Early
te down came out in Early Access in 2020 that's was a long time
Access in 2020 that's was a long time ago now and then we developed it further
ago now and then we developed it further for a year and a half so in
for a year and a half so in 22 the 1.0 version was
22 the 1.0 version was released uh shortly after that I sold
released uh shortly after that I sold the company
the company um to saber interactive or embracer well
um to saber interactive or embracer well saber was owned by embracer so it was a
saber was owned by embracer so it was a Swedish this Swedish
Swedish this Swedish game group of
game group of companies because I I didn't have this I
companies because I I didn't have this I don't like running companies I don't
don't like running companies I don't want to build teams I just want to
want to build teams I just want to program uh so uh that was a way for me
program uh so uh that was a way for me to to keep teron going without having to
to to keep teron going without having to take all the responsib
take all the responsib of employment and and all of that so
of employment and and all of that so teron had this amazing response also in
teron had this amazing response also in the modding Community which I love I
the modding Community which I love I think that that's the coolest part about
think that that's the coolest part about this game that there are so many people
this game that there are so many people sitting at home uh building things for
sitting at home uh building things for this game and they were scripting things
this game and they were scripting things in Lua and then they publish it on Steam
in Lua and then they publish it on Steam Workshop and others try it and and um
Workshop and others try it and and um you know with with mediocre when a game
you know with with mediocre when a game was released we kind of just like ah now
was released we kind of just like ah now it's done let's let's do something else
it's done let's let's do something else and and then when we released the last
and and then when we released the last one like ah that was it now now we can
one like ah that was it now now we can do something else and but with teron I
do something else and but with teron I felt like almost like a responsibility
felt like almost like a responsibility towards the mod like this this has to to
towards the mod like this this has to to keep going uh so I didn't just want to
keep going uh so I didn't just want to abandon the pro even though
abandon the pro even though um yeah I I felt that it deserved to to
um yeah I I felt that it deserved to to keep going so I thought the best the
keep going so I thought the best the best Way Forward was probably just to
best Way Forward was probably just to sell the company and have someone else
sell the company and have someone else manage all that so I could focus more on
manage all that so I could focus more on the programming again okay okay are you
the programming again okay okay are you still involved in uh with tur down team
still involved in uh with tur down team not so much with te down anymore uh I
not so much with te down anymore uh I mean I still help out here and there and
mean I still help out here and there and answer questions uh but it's what I work
answer questions uh but it's what I work on is
on is is for the For an upcoming game
is for the For an upcoming game we haven't really decided what yet is in
we haven't really decided what yet is in this this regular for me way of
this this regular for me way of developing things like starting with a
developing things like starting with a technology make something fun to play
technology make something fun to play with and then figure out uh what to do
with and then figure out uh what to do with it I'm currently I'm at that stage
with it I'm currently I'm at that stage and just toying with stuff and see see
and just toying with stuff and see see what's going to come out and it is also
what's going to come out and it is also voxal
voxal based it's very similar to teron but I
based it's very similar to teron but I try to make things right this time like
try to make things right this time like knowing taking all all the lessons
knowing taking all all the lessons learned from tear down and make like a
learned from tear down and make like a more proper boxal
more proper boxal engine
engine um so yeah we'll see where where it goes
um so yeah we'll see where where it goes it's gonna take some what are the
it's gonna take some what are the lessons from
lessons from ton um there there are a lot of them
ton um there there are a lot of them actually but but it's also a lot of
actually but but it's also a lot of constraints I
constraints I think um building things in turone is is
think um building things in turone is is not as smooth as it should be I mean
not as smooth as it should be I mean voxels if you compare building something
voxels if you compare building something in a game engine is
in a game engine is generally pretty hard for a beginner
generally pretty hard for a beginner like you if you want a model say you
like you if you want a model say you want to go open unity and model your own
want to go open unity and model your own room like how would you do that you
room like how would you do that you would need like a 3D software maybe you
would need like a 3D software maybe you have blender you set up vertices you
have blender you set up vertices you make a UV mapping you have textures and
make a UV mapping you have textures and you you need to learn all these con
you you need to learn all these con Concepts whereas with boxal in theory
Concepts whereas with boxal in theory you would just place like Legos on top
you would just place like Legos on top of each other anyone could do that it's
of each other anyone could do that it's it's in in theory it's super
it's in in theory it's super simple
simple but in order to make it work teron
but in order to make it work teron introduced a lot of
introduced a lot of restrictions so just to fit in memory um
restrictions so just to fit in memory um all the voxos they're just represented
all the voxos they're just represented by one bite so we have a pallette so you
by one bite so we have a pallette so you have a very restricted limited number of
have a very restricted limited number of colors you can use for anything and you
colors you can use for anything and you need to share this between the whole
need to share this between the whole object the way we render and simulate
object the way we render and simulate objects in in teon also depends a lot on
objects in in teon also depends a lot on on how much you want to
on how much you want to minimize the number uh the amount of
minimize the number uh the amount of empty space in each in each
empty space in each in each shape so if you build a whole
shape so if you build a whole room um you would have a lot lot of
room um you would have a lot lot of empty space in the middle of the room
empty space in the middle of the room like where there's nothing so instead of
like where there's nothing so instead of doing it as one shape what Turon wants
doing it as one shape what Turon wants you to do is to break it up so you make
you to do is to break it up so you make say each wall its separate shape that is
say each wall its separate shape that is filled with boxal and then you have so
filled with boxal and then you have so four shapes for all the walls one shape
four shapes for all the walls one shape for the floor maybe two shapes for the
for the floor maybe two shapes for the for the roof or one shape depending on
for the roof or one shape depending on the how how it looks
the how how it looks um and all this it makes it kind of
um and all this it makes it kind of complicated to work with and there's
complicated to work with and there's also a restriction on the level size in
also a restriction on the level size in in Turon also from a technical
in Turon also from a technical limitation uh so you cannot make
limitation uh so you cannot make anything larger than 400 meters across
anything larger than 400 meters across with with the voxal resolution that we
with with the voxal resolution that we have um if you want
have um if you want Shadows so it's so it's it's a lot of
Shadows so it's so it's it's a lot of these also when when you model
these also when when you model something um you cannot put
something um you cannot put voxal on a negative coordinate so if you
voxal on a negative coordinate so if you start modeling a table and you say like
start modeling a table and you say like the center of the table is here and then
the center of the table is here and then you build the table around that and then
you build the table around that and then you figure out that oh I wanted a voxel
you figure out that oh I wanted a voxel actually on this end but you already
actually on this end but you already filled it up to zero so you can't go to
filled it up to zero so you can't go to minus one then you kind of have to
minus one then you kind of have to offset everything and that's going to
offset everything and that's going to shift the uh the origo of that object
shift the uh the origo of that object going to affect how it's placed in the
going to affect how it's placed in the world and it's just a lot of these that
world and it's just a lot of these that goes on and on and I want to uh I want
goes on and on and I want to uh I want to fix as much of that as possible to
to fix as much of that as possible to make it easy to build stuff with um but
make it easy to build stuff with um but also switched out the whole rendering uh
also switched out the whole rendering uh I'm building a new physics engine for
I'm building a new physics engine for this uh
this uh to to work more efficiently to use the
to to work more efficiently to use the threads better with the graph coloring
threads better with the graph coloring that we talked about uh redoing joints
that we talked about uh redoing joints completely uh yeah there's a lot of uh
completely uh yeah there's a lot of uh just doing things better on on all
just doing things better on on all fronts basically okay okay so now you're
fronts basically okay okay so now you're doing that uh multi-threaded solver with
doing that uh multi-threaded solver with the graph
the graph coloring uh we didn't talk about
coloring uh we didn't talk about deformable voxes and your idea and we
deformable voxes and your idea and we should talk about it uh and also I
should talk about it uh and also I remember your blog post about uh
remember your blog post about uh Hardware R traced uh rendering style in
Hardware R traced uh rendering style in Vulcan so maybe we should touch on all
Vulcan so maybe we should touch on all those the multi thread solver we we
those the multi thread solver we we we've done uh but let's talk about the
we've done uh but let's talk about the formal voxos yeah maybe start with with
formal voxos yeah maybe start with with the rate facing because I think it it
the rate facing because I think it it ties better together if we touch on how
ties better together if we touch on how things are rendered first so in in
things are rendered first so in in teron uh
teron uh it's it's still it was developed using
it's it's still it was developed using opengl so we didn't have access to the
opengl so we didn't have access to the hard rate
hard rate tracing there are a large number of
tracing there are a large number of tricks to make that work on
tricks to make that work on openl so what we do render each object
openl so what we do render each object as a box and we do that using back face
as a box and we do that using back face or front face calling so you actually
or front face calling so you actually render the back side of of each box um
render the back side of of each box um so at each
so at each fragment we know the ray Direction we
fragment we know the ray Direction we know the size of the Box we can compute
know the size of the Box we can compute the intersection point of the Ray and
the intersection point of the Ray and the front side of the box and then we
the front side of the box and then we can kind of Traverse through the data in
can kind of Traverse through the data in that box so that box represents a 3D
that box so that box represents a 3D grid filled with voxal one bite each
grid filled with voxal one bite each zero is no boxal and then we have a
zero is no boxal and then we have a pallette for the rest ones for the other
pallette for the rest ones for the other ones so we just Traverse through the ray
ones so we just Traverse through the ray along the ray um in this box until we
along the ray um in this box until we hit something um
hit something um but that be used for putting the primary
but that be used for putting the primary objects the primary surface of the
objects the primary surface of the screen but then when we want to do
screen but then when we want to do lighting we can't really do that because
lighting we can't really do that because then when you want to throw a secondary
then when you want to throw a secondary Ray in some
Ray in some direction you just don't know where all
direction you just don't know where all the objects are anymore because because
the objects are anymore because because you Riz the object onto the screen but
you Riz the object onto the screen but then you want to do lighting and you
then you want to do lighting and you don't you don't really have the objects
don't you don't really have the objects um which is of course very very
um which is of course very very Troublesome so what we did for Te down
Troublesome so what we did for Te down all the objects are there is actually a
all the objects are there is actually a dual representation so there is a big
dual representation so there is a big voxal grid that represents if light is
voxal grid that represents if light is blocked or not and this is for the whole
blocked or not and this is for the whole world so that's a lot the entire level
world so that's a lot the entire level is uh inside this Shadow volume as we
is uh inside this Shadow volume as we call it which is basically a big
call it which is basically a big three-dimensional bit field so there's
three-dimensional bit field so there's one bit for every vole that determines
one bit for every vole that determines whether light is blocked or
whether light is blocked or not uh so when doing secondary Rays we
not uh so when doing secondary Rays we just step in This Global axis aligned
just step in This Global axis aligned voxal grid to see how far rray is going
voxal grid to see how far rray is going that obviously has a lot of limitations
that obviously has a lot of limitations like we we cannot see the color of the
like we we cannot see the color of the surface it hits we don't know if it's
surface it hits we don't know if it's emissive we don't know anything then we
emissive we don't know anything then we have to fall back to screen space to
have to fall back to screen space to kind of fill in where it's possible we
kind of fill in where it's possible we can kind of fill in the
can kind of fill in the details um but this has um as I said
details um but this has um as I said before the limitation of level size like
before the limitation of level size like 400 meters that is because in
400 meters that is because in opengl you cannot have a 3D grid that is
opengl you cannot have a 3D grid that is larger than
larger than 496 or like sorry
496 or like sorry 248 okay across but since we have eight
248 okay across but since we have eight bits per bite
bits per bite yeah we can actually sque eight boxels
yeah we can actually sque eight boxels per bite in that so that turns out to be
per bite in that so that turns out to be 496 voxos across and then our voxes are
496 voxos across and then our voxes are 10 cmers so that translates to 400
10 cmers so that translates to 400 meters
meters approximately
approximately um but yeah there's a lot of tricks like
um but yeah there's a lot of tricks like this like this to make it work in opengl
this like this to make it work in opengl and this is also something we wanted to
and this is also something we wanted to get to get rid of so I started to to
get to get rid of so I started to to look into Vulcan
look into Vulcan to uh to see if this could be done with
to uh to see if this could be done with with Hardware rate racing
with Hardware rate racing instead
instead um and so the idea instead of R Racing
um and so the idea instead of R Racing the primary you just shoot race in the
the primary you just shoot race in the world and you still have these boxes
world and you still have these boxes with
with 3D 3D textures basically like 3D
3D 3D textures basically like 3D grids but we throw all these objects
grids but we throw all these objects into a DH you have this concept of Tas
into a DH you have this concept of Tas and Blas in in harder rate racing where
and Blas in in harder rate racing where you have a top
you have a top level U spatial
level U spatial hierarchy so you can see which objects
hierarchy so you can see which objects you actually the ray actually hit and
you actually the ray actually hit and you get like a little Shader call back
you get like a little Shader call back to make an intersection test so I still
to make an intersection test so I still Traverse the voxal space but now doing
Traverse the voxal space but now doing it
it in um in this U form of of Hardware rate
in um in this U form of of Hardware rate tracing where the hardware can actually
tracing where the hardware can actually help uh doing this top level test and
help uh doing this top level test and then you get a little call back to see
then you get a little call back to see if it actually hits um and then you can
if it actually hits um and then you can return also the color information and
return also the color information and everything so you can actually have a
everything so you can actually have a more proper path tracing
more proper path tracing simulation
simulation um and it turned out to work really
um and it turned out to work really efficiently even though Hardware rracing
efficiently even though Hardware rracing was very much designed for
was very much designed for triangles and for this new engine only
triangles and for this new engine only use uh this um bounding box test um but
use uh this um bounding box test um but I I I've been amazed how how
I I I've been amazed how how efficient that actually
efficient that actually is
is um and the way because we're getting to
um and the way because we're getting to the formes very soon but the um one of
the formes very soon but the um one of the
the limitations that we wanted to solve was
limitations that we wanted to solve was the thing with a room if you make a room
the thing with a room if you make a room with a lot of empty space the reason you
with a lot of empty space the reason you don't want to have that is of course
don't want to have that is of course that when the ray hits something and you
that when the ray hits something and you want to Traverse it's going to take many
want to Traverse it's going to take many many steps to go through all the empty
many steps to go through all the empty space in the room before it finally hits
space in the room before it finally hits something so with a new engine we're
something so with a new engine we're breaking things up into chunks so a
breaking things up into chunks so a voxal chunk is is always eight by eight
voxal chunk is is always eight by eight by eight
by eight voxels okay and then for each shape it
voxels okay and then for each shape it automatically creates and destroys these
automatically creates and destroys these voxal chunks you can have voxal in any
voxal chunks you can have voxal in any any shape or form and it's just going to
any shape or form and it's just going to create these chunks uh where they are
create these chunks uh where they are needed uh and then these chunks are also
needed uh and then these chunks are also going to go into the hardware rate
going to go into the hardware rate racing so you
racing so you do uh the callbacks that you get that
do uh the callbacks that you get that you get are per
chunk and then I started toying with the idea that
then I started toying with the idea that maybe the uh the shape of each chunk
maybe the uh the shape of each chunk doesn't have to be a perfect Cube or a
doesn't have to be a perfect Cube or a box okay maybe I can just maybe you can
box okay maybe I can just maybe you can deform the vertices of these to be like
deform the vertices of these to be like a skew box or like a a resized box you
a skew box or like a a resized box you can stretch it in different can stretch
can stretch it in different can stretch and skew you can have like a a general
and skew you can have like a a general transformation for how this is
transformation for how this is deformed uh so what you would do when
deformed uh so what you would do when the ray hits that skew box you would
the ray hits that skew box you would transform the ray into the space into
transform the ray into the space into the deformed space so you could still do
the deformed space so you could still do the stepping in a regular grid and then
the stepping in a regular grid and then you would have to transform back the
you would have to transform back the result okay so the was to be able to
result okay so the was to be able to have like stretched and deformed chunks
have like stretched and deformed chunks that make up this this
that make up this this shape
shape um but it was it was a lot of
um but it was it was a lot of complicated math unfortunately I'm not
complicated math unfortunately I'm not very good at
very good at math I I I I I never been very
math I I I I I never been very comfortable with I'm very comfortable
comfortable with I'm very comfortable implementing stuff and like thinking
implementing stuff and like thinking about numbers in in a discreete way uh
about numbers in in a discreete way uh that suits computers and programming but
that suits computers and programming but when we comes to actual
when we comes to actual [Music]
[Music] math it's continuous it it just hard for
math it's continuous it it just hard for me to think about derivatives and and
me to think about derivatives and and transforms and and things like that um
transforms and and things like that um but I eventually
but I eventually found um an approximation that works
found um an approximation that works reasonably well um it's it's not an
reasonably well um it's it's not an exact solution and I
exact solution and I think it might not even be an exact
think it might not even be an exact solution I I had a
solution I I had a conversation um with someone who's
conversation um with someone who's actually good at math
actually good at math Everly doing geometric tools U he
Everly doing geometric tools U he claimed to have found a solution in in
claimed to have found a solution in in one of his papers and I tried it but it
one of his papers and I tried it but it didn't work and then we had a long
didn't work and then we had a long conversation where we we came to the
conversation where we we came to the conclusion that that maybe it
conclusion that that maybe it doesn't there doesn't exist a solution
doesn't there doesn't exist a solution for that but but there is now at least a
for that but but there is now at least a decent approximation to this that I
decent approximation to this that I think we can use and we'll see my plan
think we can use and we'll see my plan is to try and use this for things like
is to try and use this for things like foilage for trees bushes uh also for
foilage for trees bushes uh also for characters deformable having almost like
characters deformable having almost like a a 3D voxal skinning so to speak so you
a a 3D voxal skinning so to speak so you can stretch and drag these um
can stretch and drag these um boxal um but yeah we'll see we'll see
boxal um but yeah we'll see we'll see where where it goes okay the idea that
where where it goes okay the idea that you implemented something from a paper
you implemented something from a paper and then you contacted the author and
and then you contacted the author and then you had a chat and it's like yeah
then you had a chat and it's like yeah it might not work it's a very
it might not work it's a very interesting yeah yeah I I it was um it
interesting yeah yeah I I it was um it was very helpful that they would Everly
was very helpful that they would Everly in in trying to to help me with that so
in in trying to to help me with that so I'm very thankful for that um but I
I'm very thankful for that um but I think the the general problem was was
think the the general problem was was was not constrained enough for there to
was not constrained enough for there to be an analytical solution to that but um
be an analytical solution to that but um but yeah we'll see we'll see if the
but yeah we'll see we'll see if the approximation works well or not okay uh
approximation works well or not okay uh I have a couple of open-ended questions
I have a couple of open-ended questions uh
uh M first of all you spend a lot of time
M first of all you spend a lot of time with physics how it is today and pushing
with physics how it is today and pushing the barrier
the barrier forward what do you think in the
forward what do you think in the future in video games what's possible in
future in video games what's possible in terms of like breakthroughs or
terms of like breakthroughs or Milestones that we can hit in terms of
Milestones that we can hit in terms of physics in general
I I think physics the Golden Age of physics and
physics the Golden Age of physics and video games as I see was was
video games as I see was was actually 20 years ago
actually 20 years ago [Music]
[Music] when when halflife 2 came out in I think
when when halflife 2 came out in I think it was
it was 2004 and then there were a number of
2004 and then there were a number of games after that Red Faction had really
games after that Red Faction had really cool physics games
cool physics games or this game where you could break
or this game where you could break things
things um
um then it has not really disappeared but
then it has not really disappeared but but it's
but it's it's the the interest cooled off a
it's the the interest cooled off a little bit after that and I think and
little bit after that and I think and this is just my
this is just my speculation but I think one of the
speculation but I think one of the reasons is um networking that
reasons is um networking that now that's also around the time where uh
now that's also around the time where uh online multiplayer got introduced in in
online multiplayer got introduced in in a lot of
a lot of games and getting physics to work
games and getting physics to work with online
with online multiplayer H is really
multiplayer H is really hard so in many games
hard so in many games physics has just needed to take a a step
physics has just needed to take a a step back if you look at modern multiplayer
back if you look at modern multiplayer games there's very little physics going
games there's very little physics going on that actually affects gameplay
on that actually affects gameplay um there are some exceptions of course
um there are some exceptions of course but um in general that that's a hard
but um in general that that's a hard problem to solve and I I think if that
problem to solve and I I think if that would
would be that will be an area where I
be that will be an area where I think there will be a lot of
think there will be a lot of improvements going forward trying to to
improvements going forward trying to to build massive physically simulated
build massive physically simulated worlds and have that work well with
worlds and have that work well with networking and the reason it's so hard
networking and the reason it's so hard with networking is because of latency
with networking is because of latency until you you have networks where
until you you have networks where latency is
latency is approaching uh the frame time oh yeah
approaching uh the frame time oh yeah it's gonna be very hard to make a
it's gonna be very hard to make a simulation because when you have
simulation because when you have multiplayer games there are basically
multiplayer games there are basically two ways of doing synchronization either
two ways of doing synchronization either you do a state synchronization where you
you do a state synchronization where you just send state of objects as fast as
just send state of objects as fast as you can all the time trying to keep them
you can all the time trying to keep them in sync or you synchronize inputs and
in sync or you synchronize inputs and have a deterministic
have a deterministic imulation and then you make a local
imulation and then you make a local prediction on each
prediction on each client and then you compare that local
client and then you compare that local prediction to the actual input when it
prediction to the actual input when it arrives and if there was a mismatch if
arrives and if there was a mismatch if you did a misprediction you're going to
you did a misprediction you're going to have to roll back the whole simulation
have to roll back the whole simulation to a state it was
to a state it was before and res simulate it from that
before and res simulate it from that point with the correct
point with the correct inputs and as you can imagine doing
inputs and as you can imagine doing this with a lot of physical
this with a lot of physical simulation it's not really an option
simulation it's not really an option that's not that's never going to work
that's not that's never going to work yeah so we're going to have
yeah so we're going to have to either come up with with some new
to either come up with with some new paradigm doing uh synchronization or
paradigm doing uh synchronization or we're going to rely on state
we're going to rely on state synchronization but if you have a lot of
synchronization but if you have a lot of objects State synchronization is going
objects State synchronization is going to require enormous amounts of bandwidth
to require enormous amounts of bandwidth for those to work well so I think the
for those to work well so I think the only solution that I
only solution that I see is hoping that Network latency is
see is hoping that Network latency is going to reduced to a
going to reduced to a point um where we we just don't have to
point um where we we just don't have to do prediction whether that happens or
do prediction whether that happens or not anytime soon I'm I don't know or if
not anytime soon I'm I don't know or if we can find other tricks
we can find other tricks to to do some local prediction that that
to to do some local prediction that that doesn't necessarily involve re
doesn't necessarily involve re simulating
simulating things because if you if you run a
things because if you if you run a physic simulation that takes a
physic simulation that takes a substantial part of the frame
substantial part of the frame time and then want to do multip of those
time and then want to do multip of those when there is a misprediction there
when there is a misprediction there going to be a large stutter in frame
going to be a large stutter in frame rate so I think something around that
rate so I think something around that would be uh where I think there would
would be uh where I think there would need to be some kind of Revolution for
need to be some kind of Revolution for things to
things to progress um but I'm also quite excited
progress um but I'm also quite excited about character animation and physics
about character animation and physics and where that is going especially
and where that is going especially combined with AI machine
combined with AI machine learning that is now so popular
learning that is now so popular in what
in what way sorry in what way the character
way sorry in what way the character animation like so I think I hope at
animation like so I think I hope at least um that physics will be used a lot
least um that physics will be used a lot more for character animation now that we
more for character animation now that we have good a lot of compute power good
have good a lot of compute power good algorithms to simulate joints and and
algorithms to simulate joints and and how things that we can synthesize and
how things that we can synthesize and simulate character
simulate character animation rather than just relying on
animation rather than just relying on [Music]
[Music] animation data
animation data okay and
okay and then if you go a step in that direction
then if you go a step in that direction it's it's not that far-fetched to also
it's it's not that far-fetched to also involve AI or machine
involve AI or machine learning uh to have characters
learning uh to have characters automatically um balancing or moving
automatically um balancing or moving learning like a a pattern in which they
learning like a a pattern in which they can move and then synthesize new uh
can move and then synthesize new uh motion depending on the circumstances so
motion depending on the circumstances so if if you have a character who wants to
if if you have a character who wants to to walk over a pile of rubble that they
to walk over a pile of rubble that they can actually support themselves with
can actually support themselves with their arms and have that all look very
their arms and have that all look very natural um without necessarily doing all
natural um without necessarily doing all that with handcrafted or motion captured
that with handcrafted or motion captured animations but I I I don't know it's
animations but I I I don't know it's it's some of that is already being done
it's some of that is already being done um mostly just just using AI
um mostly just just using AI uh directly working with the animation
uh directly working with the animation system but I think there was a lot of
system but I think there was a lot of benefits to it if you also involve
benefits to it if you also involve simulation in that um we'll
simulation in that um we'll see
see um
um I I'm not sure we're gonna see that much
I I'm not sure we're gonna see that much more breakage
uh maybe maybe not it's I think it depends on whether more
it's I think it depends on whether more games moved to a volumetric
games moved to a volumetric representation because the way objects
representation because the way objects are represented these days or has always
are represented these days or has always been with you're basically just
been with you're basically just representing it by the
surface um and if you just have the surface information there there isn't
surface information there there isn't really a good way to break things
really a good way to break things because you don't know what's on the
because you don't know what's on the inside
inside and how that's going to work with
and how that's going to work with texture coordinates and like it's it's
texture coordinates and like it's it's just a lot of
just a lot of it it's really hard and and it goes it
it it's really hard and and it goes it integrates so deeply into the whole game
integrates so deeply into the whole game engine if you want to break something
engine if you want to break something you can spawn new objects and uh it can
you can spawn new objects and uh it can affect game play and and also from a
affect game play and and also from a game design perspective that all these
game design perspective that all these problems we had like how do you design a
problems we had like how do you design a game where you can break walls that you
game where you can break walls that you shouldn't be able to get through and uh
shouldn't be able to get through and uh so I don't think breakage is going to be
so I don't think breakage is going to be a big part of any game at least not at
a big part of any game at least not at at that scale anytime soon and maybe we
at that scale anytime soon and maybe we don't even want that
don't even want that not um yeah so maybe maybe something
not um yeah so maybe maybe something like that and and also physics
like that and and also physics engines have for a long time been
engines have for a long time been focusing
focusing on uh performance rather than accuracy I
on uh performance rather than accuracy I would
would say I think there might be a
say I think there might be a development now that computers are so
development now that computers are so fast
fast and the physics that people normally
and the physics that people normally want are still pretty rudimentary like
want are still pretty rudimentary like you want a couple of things
you want a couple of things moving and for the most part it's more
moving and for the most part it's more important that they they don't go
important that they they don't go through walls or they they actually
through walls or they they actually stack properly rather than having the
stack properly rather than having the ability to stack 5,000 things on top of
ability to stack 5,000 things on top of each other I me that so I I think maybe
each other I me that so I I think maybe there will be some demand or movement
there will be some demand or movement towards a more accurate physic
towards a more accurate physic simulation I think that would be
simulation I think that would be welcomed by a lot of developers at
welcomed by a lot of developers at least
least um yeah what about what about fluid
um yeah what about what about fluid simulation or Club simulation in terms
simulation or Club simulation in terms of the scope of the possible simulation
of the scope of the possible simulation because like we we're doing for example
because like we we're doing for example fluid simulation with a fluid in a bowl
fluid simulation with a fluid in a bowl but what about like uh swimming in the
but what about like uh swimming in the ocean that is fully simulated you know
ocean that is fully simulated you know like and you can you sea waves and you
like and you can you sea waves and you can like splash the water with your
can like splash the water with your emotion and all all sorts of
emotion and all all sorts of that yeah I I think for
that yeah I I think for cloth we're almost already there I would
cloth we're almost already there I would say there there is a lot of games
say there there is a lot of games simulating cloth and there are good
simulating cloth and there are good techniques for
techniques for it
it um but for
um but for fluid it's just for 2D I think for 2D
fluid it's just for 2D I think for 2D game it's it's today pretty reasonable
game it's it's today pretty reasonable to simulate a large
to simulate a large number of
fluid uh but if you compare 2D fluid if you add that extra Dimension like that
you add that extra Dimension like that that that that difference is almost like
that that that difference is almost like going from zero to Infinity it's like
going from zero to Infinity it's like it's just so much more complicated to
it's just so much more complicated to make a whole a whole ocean of say
make a whole a whole ocean of say particles I don't think
particles I don't think we're at least not anytime soon if ever
we're at least not anytime soon if ever we're going to simulate that as
we're going to simulate that as physically I I don't really see that
physically I I don't really see that happening okay okay do you play any
happening okay okay do you play any games I do occasionally but but it's I I
games I do occasionally but but it's I I wouldn't Define myself as a gamer I'm
wouldn't Define myself as a gamer I'm more interested in the
more interested in the technology uh and the development of
technology uh and the development of games than actually playing them I
games than actually playing them I played a couple of games that I like
played a couple of games that I like recently but it's um it's not something
recently but it's um it's not something I
I I play maybe a couple games a year
I play maybe a couple games a year something like that what games did you
something like that what games did you play um most recently I I started
play um most recently I I started playing split fiction it was released
playing split fiction it was released just a couple of days ago um my daughter
just a couple of days ago um my daughter and I had a lot of fun playing it takes
and I had a lot of fun playing it takes two
two um and uh we have been looking forward
um and uh we have been looking forward to split fiction so uh yeah we we just
to split fiction so uh yeah we we just started we just played a couple hours I
started we just played a couple hours I really like it um I enjoyed it takes to
really like it um I enjoyed it takes to a lot I think this co-op games
a lot I think this co-op games is uh to me very
is uh to me very underappreciated it's
underappreciated it's it's I usually get pretty bored when I
it's I usually get pretty bored when I just play a g single play game by myself
just play a g single play game by myself multiplayer game online is too
multiplayer game online is too overwhelming for me I I just
overwhelming for me I I just don't have it in me really to do it but
don't have it in me really to do it but if you make it like a social activity to
if you make it like a social activity to sit down with some friend and play a
sit down with some friend and play a game uh where you actually help each
game uh where you actually help each other or like where you do collaborate
other or like where you do collaborate that's a lot of fun I think so that's
that's a lot of fun I think so that's that's my main interest I would
that's my main interest I would say um but there there are some single
say um but there there are some single player games I've uh really enjoyed also
player games I've uh really enjoyed also inside for instance was was a big
inside for instance was was a big favorite of
favorite of mine a few years
mine a few years ago and
ago and um yeah some more mainstream games I
um yeah some more mainstream games I also enjoy but but not I'm not a a big
also enjoy but but not I'm not a a big gamer I say when you play games do you
gamer I say when you play games do you always like look out for physics and
always like look out for physics and physics bags and then like wonder how
physics bags and then like wonder how it's implemented or you're just
it's implemented or you're just detaching yourself and
detaching yourself and just I do study some games just just for
just I do study some games just just for the physics sometimes and it's a lot of
the physics sometimes and it's a lot of fun but it's a different experience the
fun but it's a different experience the games I enjoy are typically not using
games I enjoy are typically not using that much
that much physics I'm more interested in story
physics I'm more interested in story driven games and more Adventure like
driven games and more Adventure like games
games um but I um have you play I don't know
um but I um have you play I don't know if good example have you played Lego
if good example have you played Lego games there are for two people I did
games there are for two people I did yeah I tried also playing that with my
yeah I tried also playing that with my daughter she
daughter she was younger when we tried it and I think
was younger when we tried it and I think she
she was maybe a bit too young to just cope
was maybe a bit too young to just cope with all the different inputs and so we
with all the different inputs and so we didn't have a good experience I do think
didn't have a good experience I do think they
they are probably pretty good if you get into
are probably pretty good if you get into them but we we never got over that
them but we we never got over that threshold yeah but yeah they're they're
threshold yeah but yeah they're they're pretty physics based yeah and
pretty physics based yeah and right kind of faked physics I think
right kind of faked physics I think mostly but in terms of like platforming
mostly but in terms of like platforming there is a bit of platforming usually
there is a bit of platforming usually done but especially if you have like
done but especially if you have like Nostalgia for like Harry Potter or like
Nostalgia for like Harry Potter or like specific thing and there's like a Lego
specific thing and there's like a Lego cas there and just like two people on
cas there and just like two people on the couch playing this is very like
the couch playing this is very like ideal experience for yeah to mix it up
ideal experience for yeah to mix it up okay all right uh thank you thank you so
okay all right uh thank you thank you so much for the discussion can you please
much for the discussion can you please tell where people can follow you and
tell where people can follow you and your work yeah I I'm
your work yeah I I'm um the easiest place would be on X uh
um the easiest place would be on X uh where I'm boxagon Labs I did start a
where I'm boxagon Labs I did start a blue sky account recently but I I didn't
blue sky account recently but I I didn't really uh try to move over to that yet
really uh try to move over to that yet that probably happen at some point so
that probably happen at some point so for now it's it's X and voxon Labs okay
for now it's it's X and voxon Labs okay okay and you have a cool blog oh thank
okay and you have a cool blog oh thank you thank you yeah it's been it's been
you thank you yeah it's been it's been going for a while now I I'm I should
going for a while now I I'm I should write more on it I do have a lot of
write more on it I do have a lot of things to write I feel but I I never
things to write I feel but I I never take the time to actually do it as I I
take the time to actually do it as I I should do that more thank you okay danis
should do that more thank you okay danis thank you so much thank you so much for
thank you so much thank you so much for joining me yeah thank you thank you it's