Coding Adventure: Solar System

  Рет қаралды 831,831

Sebastian Lague

Sebastian Lague

Күн бұрын

Experimenting with gravity and attempting to make a miniature, explorable solar system.
Watch the next solar system video here: • Coding Adventure: Proc...
Project Files:
The Unity project is available on github here: github.com/SebLague/Solar-Sys...
If you'd like to support my work and get early access to new projects, you can do so here on Patreon: / sebastianlague
Learning Resources:
en.wikipedia.org/wiki/Three-b...
arxiv.org/pdf/math/0011268.pdf
fabiensanglard.net/floating_po...
Inspiration:
• The Making of Outer Wi...
joshworth.com/dev/pixelspace/...
Music:
"Somewhere in Outer Space", "Space Adventure 1982", "Under a Distant Star" and "Brief Respite" by Antti Luode.
"Atlantean Twighlight" and "Tango de Manzana" by Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0 License
creativecommons.org/licenses/b...
Sections:
0:00 Intro
0:27 Gravity
4:28 Solar System
7:56 Spaceship

Пікірлер: 2 300
@saifors
@saifors 4 жыл бұрын
"Simulating erosion of a mountain": Wow that's neat "Simulating an ecosystem": Oh, that's pretty cool. "Simulating a Solar System": Wait, where is this going?
@MrRonny6
@MrRonny6 4 жыл бұрын
Upwards. Really, really quickly
@ross9263
@ross9263 4 жыл бұрын
"Becoming god by accidentally discovering the events that led to the big bang"
@APaleDot
@APaleDot 4 жыл бұрын
No Man's Sky
@landon5030
@landon5030 4 жыл бұрын
Spore 2
@TheR971
@TheR971 4 жыл бұрын
No Man's Sky lol
@TonsOfHunStudios
@TonsOfHunStudios 4 жыл бұрын
Judging by what Sebastian thinks is ugly, it would be an honor if he called my art ugly :D Awesome work!
@MorgurEdits
@MorgurEdits 4 жыл бұрын
Everything is relative ;P
@TonsOfHunStudios
@TonsOfHunStudios 4 жыл бұрын
@@MorgurEdits ;P
@jambie
@jambie 4 жыл бұрын
@Almost blank I think he meant when Sebastian called the spaceship ugly not the planets
@TonsOfHunStudios
@TonsOfHunStudios 4 жыл бұрын
@@jambie You are right, thanks :)
@thedude4039
@thedude4039 4 жыл бұрын
Tons Of Hun Studios He’s being humble.
@ManuelDornbusch
@ManuelDornbusch 4 жыл бұрын
"“If you wish to make an apple pie from scratch, you must first invent the universe.”" - Carl Sagan
@okboing
@okboing 4 жыл бұрын
One of my favorite quotes from carl
@moonman5819
@moonman5819 4 жыл бұрын
I vaguely remember some Netflix show with Carl Sagan. Does anyone remember the name of it? It had him standing on the giant universal calendar
@TheInterestingInformer
@TheInterestingInformer 4 жыл бұрын
Marinebiohazard cosmos
@moonman5819
@moonman5819 4 жыл бұрын
The Interesting Informer, Thank you!!
@ilya8914
@ilya8914 4 жыл бұрын
Was that a productive KZbin reply section? A rare sight indeed.
@jhinius7689
@jhinius7689 4 жыл бұрын
8:02 "I opened up blender and made a rather ugly space exploration vehicle" My attempt: *potato*
@okboing
@okboing 4 жыл бұрын
As opposed to his nofeatures cylinder sub when it was first made
@alfiepearce23
@alfiepearce23 3 жыл бұрын
Mine is just a holo cylinder
@dragontv9783
@dragontv9783 3 жыл бұрын
better than a Kale leaf
@anshats8947
@anshats8947 3 жыл бұрын
HEY GUYS THEY SAID POTATO LAUGH LAUGH NOW
@clankcc7410
@clankcc7410 3 жыл бұрын
anshats your about page is soooo funny 😐
@maxmuster2637
@maxmuster2637 4 жыл бұрын
Give this guy 20 more years and you will find "coding adventures: the matrix" in your feed
@Kokurorokuko
@Kokurorokuko 4 жыл бұрын
Yo just make 2d array
@Zeus-fe3we
@Zeus-fe3we 4 жыл бұрын
@@Kokurorokuko well he's not talking bout that Matrix
@anirudhsharma2003
@anirudhsharma2003 4 жыл бұрын
If he wills, 1 is enough...
@gileee
@gileee 4 жыл бұрын
@@Kokurorokuko And iterate over it and voila, we have agent Smith
@disrespecc9678
@disrespecc9678 4 жыл бұрын
He should heart this comment, it’s absolutely amazing..and original. I love this
@christ7007
@christ7007 4 жыл бұрын
2030 Coding Adventure: Entire Alternate Universe.
@serena_m_
@serena_m_ 4 жыл бұрын
Coding Adventure's Sky
@zanderoneil3405
@zanderoneil3405 4 жыл бұрын
2022: Galaxies 2027: Galaxy Clusters
@Brenden-H
@Brenden-H 4 жыл бұрын
but its procedural generated and has portals that lead to other universes
@MrBlack0950
@MrBlack0950 4 жыл бұрын
I mean, if you got infinite time, its possible
@Brenden-H
@Brenden-H 4 жыл бұрын
its a joke... he previously did coding adventures where he made portals and a procedural generated world.
@spencerrawls970
@spencerrawls970 4 жыл бұрын
"The engines don't move the ship at all. The ship stays where it is and the engines move the universe around it."
@halleyc6603
@halleyc6603 4 жыл бұрын
Futurama 100.
@okboing
@okboing 4 жыл бұрын
There are thrusters on everything in the universe except the vehicle.
@louisgreenland4446
@louisgreenland4446 3 жыл бұрын
That's actually how floating point origins work
@okboing
@okboing 3 жыл бұрын
@@louisgreenland4446 exactly!
@halleyc6603
@halleyc6603 3 жыл бұрын
@@okboing yep!!
@typryor2227
@typryor2227 3 жыл бұрын
“Does your ship meet all the safety requirements?” “It has a fire extinguisher.”
@Orion-sd1zz
@Orion-sd1zz 3 жыл бұрын
PASS, ITS FULLY SPACEFLIGHT CAPABLE
@ZachTheHuman
@ZachTheHuman 3 жыл бұрын
I wonder if Wall-E just flew around semi-randomly for ever in space with a fire extinguisher, how long would it take for the fire-extinguisher stuff to create a planet (assuming the fire extinguisher has an infinite supply of stuff)? What would that planet be like? Could it stand up to an orbit around the sun?
@valentinmitterbauer4196
@valentinmitterbauer4196 2 жыл бұрын
@@ZachTheHuman I know i come late to the party, but here are my thoughts anyway: Judging by his own size, Wall-E's extinguisher contains around 3 litres of compressed foam, which normally takes 10 sec. to empty, so 0.3l/sec. As soon as the foam will flock together it will release almost all of the air inside, leaving the water and tensides which will then regain the same volume as the compressed form. Assuming that the extinguisher magically regenerates the foam it looses, it would take 2,319,356,774,070,000 (2 sextillion) years to create a ball of water the size of the moon, but it wouldn't have as much gravity as the moon. Of course this assumes that no water evaporates from this body of water, which is unrealistic. It's water without foam, as the gas will have separated rather quickly, floating away, as this planet wouldn't have enough gravity to hold an atmosphere. It would literally be a ball of water, or rather ice, if it orbits further away from its sun. But it would have no problem with orbiting.
@ZachTheHuman
@ZachTheHuman 2 жыл бұрын
@@valentinmitterbauer4196 Huh. Thanks, that was super cool, I wasn’t expecting anyone to really answer my question! Huge respect to you man. 🙌
@Danidev
@Danidev 4 жыл бұрын
This is really fascinating, the universe is really lit tbh
@niklas7133
@niklas7133 4 жыл бұрын
Is it just me or does the Universe look THICC
@pixspaces4777
@pixspaces4777 4 жыл бұрын
Dani the universe needs a 'milky wayy' care to join! Lol
@yvesbreidel5438
@yvesbreidel5438 4 жыл бұрын
Try build an entire solar system..or you can't? jk... Unless?
@SebastianLague
@SebastianLague 4 жыл бұрын
Thanks!
@Danidev
@Danidev 4 жыл бұрын
@@SebastianLague keep up the great videos man, always love to see them!
@iamarugin
@iamarugin 4 жыл бұрын
Coding Adventure: Outer Wilds.
@nepunepu5894
@nepunepu5894 4 жыл бұрын
Coding adventure : examining no man's sky by making one
@sirgrem2988
@sirgrem2988 4 жыл бұрын
Coding Adventure: Kerbal Space Program
@swagguy47
@swagguy47 4 жыл бұрын
Exactly what I was thinking.
@muuubiee
@muuubiee 4 жыл бұрын
None of those games use nbody physcis though.
@phantomderp834
@phantomderp834 4 жыл бұрын
Coding adventure: Piracy
@peterk1821
@peterk1821 4 жыл бұрын
"One day they'll figure out that the sun is actually the center and its gonna make so much more sense" -- I spent way too long thinking about this
@okboing
@okboing 4 жыл бұрын
Society in the1400s
@zapdragon5942
@zapdragon5942 4 жыл бұрын
Yeah, but then the Church set fire to the guy who said that, so
@weckar
@weckar 4 жыл бұрын
@@zapdragon5942 I mean, the dude actually worked for the church.
@OrdinaryLatvian
@OrdinaryLatvian 3 жыл бұрын
@@zapdragon5942 No they didn't. I despise the catholic church but there's no need to lie about their actions. They were bad enough already.
@hedgehog3180
@hedgehog3180 3 жыл бұрын
It's funny because it's actually those same apparent retrograde movements that clued us into the fact that the planets orbit the sun.
@Jabrils
@Jabrils 3 жыл бұрын
Man I am so impatient for part 2 I came back to watch this again xD
@SebastianLague
@SebastianLague 3 жыл бұрын
Haha thanks for this reminder to stop lazing about and get back to work!
@elnico5623
@elnico5623 3 жыл бұрын
@@SebastianLague if you dont do it tomorrow i'll make my own solar system.. with black jack.. and hookers... you know what? Forget the solar system
@_creare_2742
@_creare_2742 3 жыл бұрын
Same lol. I am making a space game and I don't know how to do LOD and stuff so I keep every week or so check back to see if anyone has a decent tutorial on how lod works.
@benjaminlong729
@benjaminlong729 3 жыл бұрын
@@elnico5623 Bender?
@SemiMono
@SemiMono 3 жыл бұрын
Ben Jammin and Benjamin Long, do you guys know each other or something?
@grunch346
@grunch346 4 жыл бұрын
Watching those planets twirl around each other was mesmerizing
@TheBelrick
@TheBelrick 4 жыл бұрын
This video highlights how easy it is for NASA to see a deep space body and calculate with 100% accuracy whether it would hit the earth or not...
@you_just
@you_just 4 жыл бұрын
Play Outer Wilds. If you like that sort of thing, you’ll love that game.
@drainbamage2542
@drainbamage2542 4 жыл бұрын
In some future episode: So apparently the creatures are worshiping me as if I am god... Interesting
@drone_better7757
@drone_better7757 4 жыл бұрын
'Unfortunately, I had to put this thing on hold while I focus on more interesting projects. Bye, bye, little creatures.'
@Music7Ada
@Music7Ada 4 жыл бұрын
“Unfortunately that won’t make their lives easier”
@DrYoutubMAN
@DrYoutubMAN 4 жыл бұрын
So the Big Bang was the start of the simulation
@okboing
@okboing 4 жыл бұрын
@@DrYoutubMAN THEORY ALERT THEORY ALERT SEBASTIAN IS THE CREATOR OF THIS UNIVERSE AND ALSO PRETENDS TO BE A HUMAN TO SEEM LIKE NORMAL BUT REALLY SEBASTIAN IS GOD WOULD YOU CARE TO JOIN MY RELIGION
@argore9709
@argore9709 4 жыл бұрын
Coding Adventure: Solar System Clouds Hydraulic erosion Simulating an Ecosystem Procedural Moons Atmosphere Dude we don't need to replace the universe yet
@andrienw8847
@andrienw8847 4 жыл бұрын
honestly with the amount of shit that has happened we might need to
@jtn191
@jtn191 4 жыл бұрын
Have you seen ours lately?!
@abigsillay5226
@abigsillay5226 4 жыл бұрын
Yet...
@Jutlantic
@Jutlantic 3 жыл бұрын
YET
@asher-360
@asher-360 3 жыл бұрын
look around you, yes we do
@ryanclapperton9449
@ryanclapperton9449 3 жыл бұрын
Am I the only person who was startled when he hit the green planet and didn’t go through into a water world with tornados? Damn I love that game.
@SaadTheGlad
@SaadTheGlad Жыл бұрын
damn too me a sec too long
@sepiar7682
@sepiar7682 Жыл бұрын
@Blayne Bradley In the game this video was based on - Outer Wilds - there's a big green planet that has tons of tornadoes and is a water world. I would highly recommend the game, it's my favorite of all time! If you want more information, make sure you find a *spoiler free* review or something because the game's progression is soley based upon what you know, so spoilers literately skip chunks of the game for you.
@greencircle2063
@greencircle2063 10 ай бұрын
real
@project_fakehim5378
@project_fakehim5378 4 жыл бұрын
This was comfortable to watch. It's currently 2 am, the background was dark, brightness toned down and the planets were easily visible. Idk why I wrote this. This was just satisfying
@zyaicob
@zyaicob 4 жыл бұрын
No i totally get you. This is really... nice
@benjaminanderson1014
@benjaminanderson1014 4 жыл бұрын
I was going to make a joke about him basically recreating outer wilds, then he said that's exactly what he was doing and I was like oh ok this makes a lot more sense now.
@milkywegian
@milkywegian 4 жыл бұрын
Benjamin Anderson so, from now on every space game with orbital mechanics is outer wilds?
@erictheepic5019
@erictheepic5019 4 жыл бұрын
@@milkywegian Well, the two binary planets closest to the star are also found in Outer Wilds, the second planet being a nice green one with a tiny moon is also true in Outer Wilds, a large planet with high gravity is also found in Outer Wilds (but that's pretty generic), and the ship design could fit right in with the rest of the ships found in Outer Wilds.That's everything I saw that screamed 'Outer Wilds' to me (before he revealed that it was based on Outer Wilds, of course).
@commenturthegreat2915
@commenturthegreat2915 4 жыл бұрын
​@@milkywegian Can you really not see the similarities? Did you play outer wilds?
@wkrisz
@wkrisz 4 жыл бұрын
At first I was like "Oh it's like KSP" but it is true that Outer Wilds is more similar.
@captainjirk9564
@captainjirk9564 4 жыл бұрын
Outer wilds doesn't really have orbital mechanics beyond the planets
@bo2_435
@bo2_435 4 жыл бұрын
3:09 what happens with headphone wires when you put them in your pocket.
@okboing
@okboing 4 жыл бұрын
This is an underrated comment here have a like It's all I can do
@valovanonym
@valovanonym 4 жыл бұрын
Best comment ever
@Vindkast
@Vindkast 3 жыл бұрын
Lmao
@sebastianjost
@sebastianjost 3 жыл бұрын
Headphone wires have three heavy ends, so this could actually be an interesting approach for studying the tangling of headphone cables.
@stuprice9379
@stuprice9379 4 жыл бұрын
@Sebastian At 5:00 when the Sun starts to wobble, this is essentially how exoplanets (planets around stars other than the Sun) are detected! en.wikipedia.org/wiki/Methods_of_detecting_exoplanets#Radial_Velocity
@delofon
@delofon 4 жыл бұрын
That is one of the methods. There are a lot more exoplanets found with transit method. en.wikipedia.org/wiki/Methods_of_detecting_exoplanets#Transit_photometry *yes it's the same wikipedia article don't blame me lol*
@covirtcat786
@covirtcat786 4 жыл бұрын
The music accompaniement for the sphere “dances” was a really good idea
@awiewahh
@awiewahh 4 жыл бұрын
3:10 my earbuds the second I put them in my pocket.
@alexhobbs3814
@alexhobbs3814 4 жыл бұрын
HAHAHAHA i'm dying xD
@kesleta7697
@kesleta7697 4 жыл бұрын
You have three ears?
@questwalkerko
@questwalkerko 4 жыл бұрын
@@kesleta7697 you have 2? how else will your eyes hear the music?
@HiggyZiggy
@HiggyZiggy 4 жыл бұрын
I love how he goes off topic every now and then and teaches you something super cool you never would of thought you were about to learn, then continues back to something super cool you clicked on to learn.
@NoorquackerInd
@NoorquackerInd 4 жыл бұрын
Physics person: _tries to understand gravity_ Differential equations: *henlo*
@sebastianjost
@sebastianjost 3 жыл бұрын
That's why similations are used. It's not that hard to simulate a basic solar system but explicitly calculating the paths of all the planets is pretty much impossible due to the differential equations involved. Simulations are a powerful tool
@Verrisin
@Verrisin 3 жыл бұрын
programmer: _timeStep_
@Jabrils
@Jabrils 4 жыл бұрын
Everytime I watch a Sebastian video, I feel like such a dunce. But I am so hyped to see you try this. I remember watching the Outter Wild's documentary, & when Alex mentioned his solution for fixing floating point precision was to move everything to the player, I almost fainted from how genius that was!
@you_just
@you_just 4 жыл бұрын
“Because of this, among other grievances, I’ve decided to make my own solar system.” Straight out of a Terry Pratchett novel
@puffyfox7038
@puffyfox7038 3 жыл бұрын
it really is lol
@MegaTuroc
@MegaTuroc 4 жыл бұрын
OMFG I've taken astronomy classes before I went into programming (No luck on either so far), and at 7:10 when you showed the solar system paths from a planet center. my mind immediately rose to Geocentrism, It's so amazing on how a change of perspective can show this. Early astronomers were baffled by the loops, until Heliocentrism came around.
@arijanj
@arijanj 4 жыл бұрын
This is actually so cool. Outer Wilds is one of my favorite games so this was very interesting to watch.
@itsjustlogic7232
@itsjustlogic7232 4 жыл бұрын
I agree
@benjoe1993
@benjoe1993 4 жыл бұрын
It's interesting how you encountered the physics precision problem just like the Outer Wilds people did :D They fixed it by disabling any velocity changes to the player and just add all the forces in the opposite direction to everything else in the entire world! (Edit: Corrected game name thanks to Gulli)
@Gulli03
@Gulli03 4 жыл бұрын
It's "Outer Wilds" not "Outer Worlds"
@benjoe1993
@benjoe1993 4 жыл бұрын
​@@Gulli03 Ohh shoot! Thanks a lot. Corrected! I just watched a couple episodes of the Outer Worlds ./noclip documentation and that was stuck in my mind. :D
@squeakybunny2776
@squeakybunny2776 4 жыл бұрын
So pretty much the same Sebastian did but in a continuous way instead of a discrete one
@DaedalusCommunity
@DaedalusCommunity 4 жыл бұрын
They did the same treshold based recentering in Kerbal Space Program. That's because of floating point precision :) I had a different problem that I solved in the same way that you described, I was making a VR space thing, and when moving too fast the trigger collisions don't work very well. So I made the spaceship stay in the origin and applied the forces to everything else. It's causing a bit of problems with multiplayer, but I think I'll get to solve them soon!
@MartinJab
@MartinJab 4 жыл бұрын
We use floating points, which means that the "point" "floats", so you can either have 9999,9 or 99,999 or 9,9999... as the number gets bigger, its precision gets smaller - if you get into bigger numbers (aka far from origin), everything "shakes" because you need bigger precission than you currently have. So, everyone encounters that problem.
@SamHogan
@SamHogan 4 жыл бұрын
This is amazing. I'd really love to see him combine a lot of his projects (procedural planets, ecosystems, etc) into a universe sandbox type game
@grouchy8886
@grouchy8886 3 жыл бұрын
wait its you, i was watching ur vids in 2017
@spocite
@spocite 2 жыл бұрын
hi sam
@_Silenceman
@_Silenceman 2 жыл бұрын
hi sam
@jacode422
@jacode422 2 жыл бұрын
hi sam
@niksaanic5575
@niksaanic5575 3 жыл бұрын
Why is nobody talking about just how beautiful the planetary dance starting at 2:16 is? And how they go wild at 2:45? It's such a mesmerising scene
@pigeon_bot
@pigeon_bot 4 жыл бұрын
Maybe when you add things to the planets, you could try scaling the player down by a large margin to make the planets a lot larger. (not actual planet size, but something that could be habitable by some species at least) Just to see what it would end up like. Maybe to make a second little experiment game where you can calmly fly across space, like some of those truck driver games you can find online. Paying minimal attention to keep the ship runnng, something that you could busy yourself with in the background while chatting with some friends. Something with more of a focus on the journey than the destination.
@Greenpixel16
@Greenpixel16 2 жыл бұрын
I like this idea so much that I'm trying to make it myself. I already have the gravity done
@creatroyer2701
@creatroyer2701 4 жыл бұрын
Next video: Coding Adventure: Meaning of life
@Minihood31770
@Minihood31770 4 жыл бұрын
That's too easy. Print 42.
@radekwysocki7875
@radekwysocki7875 4 жыл бұрын
OMG i read that wrong... Mining... XD Make a 3d space exploration with procedurally generated minecraft like worlds XD Every player gets a planet they can modify and when they land on another planet they can ask for permission to edit the world otherwise they could only interact with it
@nanonorthlabs3375
@nanonorthlabs3375 4 жыл бұрын
Cringy comment.
@MadSki11s
@MadSki11s 4 жыл бұрын
Simulating Meaning of Life, rather.
@swagguy47
@swagguy47 4 жыл бұрын
Here's an explanation of how they did the stars in Outer Wilds: The "stars" are actually just a particle system that follows the camera, the star particles are in a sphere shape around the camera. They set the particle system's layer to be in the back, behind all objects and UI in the world. Since they didnt move or rotate from your perspective it gives off the effect of stars really far away. A very interesting and effective way around the problem. You should apply it to your project!
@lifelover69
@lifelover69 4 жыл бұрын
@Gek Badass cubemap is limited by being a texture, particle system is more flexible
@TWGuardian
@TWGuardian 4 жыл бұрын
@Gek Badass Not necessarily. If you want crisp stars, you would need a very high resolution cubemap, which will take up a lot more memory. Using particles to creates stars makes them detailed regardless of texture resolution and CPU/GPU power, with low memory consumption as well. Instancing and batching can be used to increase performance drastically, surpassing using a cubemap to achieve equal detail.
@disrespecc9678
@disrespecc9678 4 жыл бұрын
As a person learning ROBLOX dev this isn’t possible I think
@downey2294
@downey2294 3 жыл бұрын
@@disrespecc9678 why would this not be possible?
@garrettrichards9028
@garrettrichards9028 3 жыл бұрын
(Spoilers) Hmmm I wonder how they achieved the supernova then for each individual star, when you look at a star in the game you actually can see a bunch exploding, it's mentioned in one of the NPC's dialogue at the twin planets
@Killbayne
@Killbayne 4 жыл бұрын
2:55 me trying to dock inn KSP
@okboing
@okboing 4 жыл бұрын
How to tie a knot
@BlazertronGames
@BlazertronGames 3 жыл бұрын
Oh my god! Thanks so much for mentioning outer wilds. I bought it a few days ago on sale, and just finished it. It's genuinely one of the best games I've played! It scares me to think of a timeline where I didn't watch this video and check out the game. Anyone reading this, do yourself a favour and buy it, I've played a lot of games, and this one shocked me with how enjoyable it is!!!
@Gromek999
@Gromek999 4 жыл бұрын
Not a lot of channels are able to make coding sound so interesting, but damn you do it well! can't wait for more content, it's awesome to watch and really also good at teaching.
@wrillwastaken
@wrillwastaken 3 жыл бұрын
W-what are you doing here gromek?
@codefiela8215
@codefiela8215 2 жыл бұрын
did not expect you to be here
@Evoleo
@Evoleo 4 жыл бұрын
I love how he plays that tango music when 3 planets are rythmically spinning around each other
@okboing
@okboing 4 жыл бұрын
Relationships when everyone dates everyone That's what I thought
@Woodledude
@Woodledude 3 жыл бұрын
OUTER WIIILDS outer wilds is an amazing game and I am SO glad to see you playing around with some of the more basic concepts from it :3
@PeregrineChurch
@PeregrineChurch 4 жыл бұрын
Coding Adventures has become one of those rare series on KZbin where I instantly like the video before even watching it.
@SystemfehlerK
@SystemfehlerK 4 жыл бұрын
1:16 You accidentally re-invented a simpler cousin to "leapfrog integration" by first updating the velocities and then updating the positions with those velocities in the Newtonian equations. It's called "symplectic Euler". "Leapfrog integration" is as stable as that, but more accurate (though you only see that after a very long simulation time, for a solar system possibly thousands of years). So don't worry, you probably did it right.
@SebastianLague
@SebastianLague 4 жыл бұрын
Thanks for the info!
@elliotstronge4839
@elliotstronge4839 4 жыл бұрын
@@SebastianLague This is an amazing resource I've found for integration, especially to do with games. gafferongames.com/post/integration_basics/
@adrienreynaud9668
@adrienreynaud9668 4 жыл бұрын
@Yannick Kuhn Oh I haven't seen your comment, I just suggested the Verlet algorithm ! Which is maybe more stable? I am not a specialist abot numerical scheme though
@tiancilliers
@tiancilliers 4 жыл бұрын
@@SebastianLague The creators of Principia, an n-body gravity mod for Kerbal Space Program, used a 5th Order Runge-Kutta integrator to simulate orbits if I remember correctly. You should be able to find more info on their GitHub page, they have a folder with resources. Also, maybe it could be a cool idea to draw the predicted path of the spaceship as a line visible from the cockpit?
@SystemfehlerK
@SystemfehlerK 4 жыл бұрын
@@adrienreynaud9668 The (Störmer-)Verlet algorithm _is_ the leapfrog algorithm. It just has many names, is all.
@match_mc114
@match_mc114 4 жыл бұрын
These are my favorite videos on KZbin.
@theghastlygamer2484
@theghastlygamer2484 4 жыл бұрын
Petition to rename this series to "Sebastian's Bizarre Coding Adventure"
@LynSpoon
@LynSpoon 4 жыл бұрын
Please don’t do that....
@MrNerd-ll9my
@MrNerd-ll9my 4 жыл бұрын
No.
@aeyempire
@aeyempire 4 жыл бұрын
You tought it was a working code but it was me, errors!
@LuRybz
@LuRybz 4 жыл бұрын
This is gettig funny from how absurd it became. Seriously Sebastian, what the frog man? This Coding Adventure is the most over powered thing in coding I ever seen.
@Rouverius
@Rouverius 4 жыл бұрын
“Space,” it says, “is big. Really big. You just won't believe how vastly, hugely, mindbogglingly big it is. I mean, you may think it's a long way down the road to the chemist's, but that's just peanuts to space.” - Douglas Adams
@gala_vs
@gala_vs 4 жыл бұрын
Hitchhiker's guide ?
@ruroruro
@ruroruro 4 жыл бұрын
And yet, if your car could drive "up", it would only take a couple of hours to go to space.
@c0l370
@c0l370 4 жыл бұрын
i've been reading the first book,it's really good
@skepticmoderate5790
@skepticmoderate5790 4 жыл бұрын
@@ruroruro And then another few months just to get to the moon.
@iCore7Gaming
@iCore7Gaming 4 жыл бұрын
@@ruroruro I mean you are always in space lmao.
@aetherdust
@aetherdust 4 жыл бұрын
8:00 Me: Hmmmm... that looks like outer wilds 8:45 Sebastian: I've recently been playing a brilliant game called outer wilds. Me: surprised pikachu face
@niddlesgaming6211
@niddlesgaming6211 4 жыл бұрын
You should make a game using everything you’ve learnt from coding adventures like the clouds or terrain deformation and include biomes, poles, planets/solar system and ai animals
@juozasdomarkas848
@juozasdomarkas848 4 жыл бұрын
Yo dawg, I heard that heat kills viruses! So I made a game that makes your computer catch fire so you can play while you disinfect yourself!
@magmaslasher7604
@magmaslasher7604 4 жыл бұрын
He'd need one crazy supercomputer for that one
@disrespecc9678
@disrespecc9678 4 жыл бұрын
Seeing as his PC could barely handle the clouds, this will not happen
@hedgehog3180
@hedgehog3180 3 жыл бұрын
I don't think his clouds would work for a planet based system seeing as they're a flat plane. He'd need to figure out a way to wrap a planet in clouds.
@YurgenGrimwood
@YurgenGrimwood 2 жыл бұрын
2:00 anyone else who found the orbits and music together just absolutely beautiful? Something about it mesmerized me.
@jakubkicmal282
@jakubkicmal282 4 жыл бұрын
Next episode - Coding Adventure: Theory of Everything
@sleepi5550
@sleepi5550 4 жыл бұрын
8:10 *NASA wants to know your location*
@TiagoRodrigues-zp7ux
@TiagoRodrigues-zp7ux 4 жыл бұрын
Here's a tip: If the planet's orbital periods are multiples of each other you should get a stable system. If think it's similar to how harmonic oscillators work.
@MortimerKerman
@MortimerKerman 2 жыл бұрын
It's called orbital resonance
@Zenya101
@Zenya101 2 жыл бұрын
Amazing to see the start of so many wonderful coding adventures from this project!
@Deanin
@Deanin 4 жыл бұрын
Coding adventures might be my favorite programming content on the platform! Looking forward to watching this while I edit, please keep up the great work!
@NicholasOrlowski
@NicholasOrlowski 4 жыл бұрын
Awesome stuff!
@SebastianLague
@SebastianLague 4 жыл бұрын
Thanks Nick!
@inkkles
@inkkles 4 жыл бұрын
@@SebastianLague how wholesome
@viofthecollective2031
@viofthecollective2031 2 ай бұрын
What's more incredible than your work here is that men long before computers ever existed were able to derive, understand. And solve the exact equation you used entirely within the confines of pen, paper and their vast minds. But now, you, or i, if i wanted too, could code that. Encode the universe itself. Or at least, an incomplete fraction of it
@qryguy
@qryguy 4 жыл бұрын
Absolutely loved the editing in this one, the early music sections were top notch. Keep up the good work!
@supergamerfr
@supergamerfr 4 жыл бұрын
Me : struggle to make an fps camera Sebastian: I made a universe simulation, cheers
@blackfrogstudios6670
@blackfrogstudios6670 4 жыл бұрын
Imagine if he had procedurally generates worlds with clouds, ecosystems, and boids
@DylanHedger
@DylanHedger 4 жыл бұрын
By far my absolute favourite coding adventure. I really hope you continue this one and explain it more.
@Drizzle015
@Drizzle015 3 жыл бұрын
Just found this channel and I'm hugely impressed by everything. What you're doing, how well you explain it, how relaxing and easy you make it all seem... It's a good insight into some ways games and computers do things as well. And we get extra real-world information on the side. And I love the lines like the one about the purple planet people :D This is all-round quality content.
@MrQwerty2524
@MrQwerty2524 4 жыл бұрын
You make me feel inadequate as a Software Engineer. Which is exactly why I'm subscribed!
@cholasimmons
@cholasimmons 4 жыл бұрын
You and me both
@squeakybunny2776
@squeakybunny2776 4 жыл бұрын
God: this is perfect Sebastian lague: hmm let me improve a few things...
@singularhealer9720
@singularhealer9720 3 жыл бұрын
Dude ive been following you for a while now and every video i find from you is more impressive then the last
@ptitjo9475
@ptitjo9475 4 жыл бұрын
this has to be the coolest thing ive seen someone make in unity. this opened my mind to so many things & the way you brought real life equations in & made it work just was so cool & i was understanding everything too
@ExileOfBrokenSky
@ExileOfBrokenSky 4 жыл бұрын
Love this kind of stuff. I was always kinda peeved when games kept you on rails and space was either a small 2D box to shoot lazers around in, or you click a button and watch a video of a ship going into hyperspace and then it just loads the next small next level. So I always wanted to make a simulator that used scale astronomical distance and then I ran into the same problem every dev has. Good old floating point precision limits and memory limits. So I tried to problem solve. Why? Because why not. maybe I like experiencing the boring nothing of empty space :p I found that when using scale astronomical distances with scale models, one way to be able to see objects that are impossibly far away but still visible due to massive size is to make all these massive objects, say the solar system, scaled them down by some ratio, set them on a new layer, make a new same scale camera to see that layer, and them match that camera and main camera's rotation. This solar system camera would only view these objects. Likewise the main camera would not see that layer, but would use the solar camera as background. Objects on any sub layers cant interact with the player since the player and those scaled object would occupy the same space, but because of camera trickery would appear far away. The ratio of distance to apparent size is a very easy ratio. 1:1. Something twice as far will be twice as small. This concept can be nested within itself as well. i.e. The normal scale camera's background can display the solar scale camera's view, which can take it's background from the stellar cluster camera, which can take it's background from the next step in scale, and so on and so on to whatever is useful. It would only take a handful of layers at a decent step to reach galactic scale. (Which is far beyond what any of us can fill with meaningful content, just think of No Man's Sky, but that's beside the point.) Also the step doesn't all have to be the same between all layers. Each camera can't see more than it's own layer but uses the next layer as background. The final layer camera would use a normal background of a whatever or pure black. You could simulate the starfield with actual objects if you wanted.(DOTS and the burst compiler can help with rendering all that, esp if they are very simple glowing spheres.) A distance threshold is a good tool to keep the player somewhat centered at origin, but also to make sure that the sub layers shifted around their centered cameras properly at their scales. Each layer would shift relative to the threshold and scale of the layer above or below it. I found that centering the world on the player at origin at increments too small would lead to syncing problems with the other layers, again due to floating point errors, which is why we need to nest the concept within itself. So a bit of thought into what the minimum movement possible on a sub layer will determine what the threshold will be on the next highest or main layer. For objects: when an object on a sub layer got too close or too far from it's camera, that object or a replacement would be scaled up or down, moved appropriately and then set to be visible only to the new proper layer. In game-world space all the sub layer cameras would be at same point, the game-world origin. When an object would enter the main layer or secondary layer, say a very large starship that can still shoot at you from hundreds of thousands of KM away, one could load in a new object that has all the components needed for player interaction. Then return it back into data when it's out of range. For something like a planet you'd need a solution for modeling planetary pieces of terrain, prolly only loading the nearest terrain cells or w/e. I never got that far. I should really dig into unity city and content streaming. While scaled small, they layer objects still have the same memory footprint, so consider ways to turn convert each sublayer further into data, or make cheaper to render. Really though most planetary bodies are only visible up to maybe a million KM, and after that, they either twinkle like a star or are too dark to see. Though I was able to do stuff like earth to moon distances easily enough within the normal scale layer, representing a scale solar system and a handful of nearby stars took 2 sublayers, and allowed a player to move around at warp speeds and see the small amount of star stars shift accurately, yet remain fully immersive with no loss of player agency at any time. One thing that I find interesting about modeling astrological distances and such at scale, is that in real life we are getting photons at the terribly slow speed of light so the further away it is, the more off from the real position the image is, where in a simulation we can see their actual positions instantly. I often wonder what it would take to program it so that we can model the real, but only see based on light being so slow compared to the distances and giving it time to reach the camera.
@celiacasimiro465
@celiacasimiro465 4 жыл бұрын
When I finished watching the whole episode. KZbin: This video was published 22 seconds ago Ok, KZbin. I think
@kilianlaszlo
@kilianlaszlo 4 жыл бұрын
Your stuff is always of such a high quality! Admirable
@flippert0
@flippert0 3 жыл бұрын
Whoa, the planets are dancing tango really well!
@Sciman0231
@Sciman0231 4 жыл бұрын
I'm *very* curious how you made that orbit visualizer, my guess is rendering line segments one at a time, but regardless it looks fantastic!
@ZardoDhieldor
@ZardoDhieldor 4 жыл бұрын
I would guess he is calculating the orbits first and then rendering them.
@Booone008
@Booone008 4 жыл бұрын
Judging by the "num steps" parameter on the script, it's probably as simple as repeatedly calling his update functions for a bit and making a line out of the positions. Pretty low computational cost with this few objects :)
@DB-pt6zj
@DB-pt6zj 4 жыл бұрын
@@svthal1 If using unity, you could render mesh procedurally, just little low poly spheres at a high sample rate to simulate a line. I've made some ridiculously high poly counts with DrawRenderMesh, it ends up being called every frame and the render thread gets big, but is very low cost to cpu since no GameObjects are created, and if it's the only thing running can perform very well in real time. Like... millions of triangles and barely a hit on your fps. And given how much he does this stuff I wouldn't put it past him to just have a bunch of DLLs using native code or compute shaders all pre-made that do various things.
@chewico3d133
@chewico3d133 4 жыл бұрын
This is what makes me feel happy
@alatan2064
@alatan2064 4 жыл бұрын
I am grinning like a child in a toy store.
@veskfourveskson7016
@veskfourveskson7016 4 жыл бұрын
Thank you for videos like this! You are an inspiration to keep learning! I like how you questioned the or it of the purple planet's inner moon and then showed us what was going on. The mathematical function playing out....awesome.
@chrisellis1163
@chrisellis1163 4 жыл бұрын
I’ve been waiting to finish school before focusing on too many extra hobbies. But coding was always a desire of mine. I love your videos and watching you progress. I don’t intend to do anything major with it but your tinkering around videos are a perfect representation of just having fun with learning
@prakharlondhe3876
@prakharlondhe3876 4 жыл бұрын
10:51 Oh look, an Earth eclipse
@davawen9938
@davawen9938 4 жыл бұрын
"I would like to experiment" "Maybe some procedurally generated planets" "The planets don't even rotate yet" good job but please. don't make me hope :'(
@herlantmajor5883
@herlantmajor5883 4 жыл бұрын
It's actually something he already did in the past, there's a whole series about it on his channel
@ballistictiger3197
@ballistictiger3197 4 жыл бұрын
please do another episode this was a lot of fun to watch!
@anticom1337
@anticom1337 4 жыл бұрын
I really enjoy watching your Coding Adventures since they illustrate how (sometimes even simple) math is not just boring formulas but can do really cool stuff.
@Baleur
@Baleur 3 жыл бұрын
2:22 just beautiful.. And to think, this is how our planets move around our moving star, in real life.
@poopsikins3522
@poopsikins3522 4 жыл бұрын
11:34 You basically just made The Planet Express Ship from Futurama.. The ship stays still but the space around you moves.
@kaylebtennant3317
@kaylebtennant3317 8 ай бұрын
I built an overly accurate model of the solar system and I was really proud I got accurate sizing and distancing and now I'm insecure because this guy brought up newtons equations.
@zennvirus7980
@zennvirus7980 4 жыл бұрын
WOW... just... wow. The beauty of simplicity. You have in your hands the potential to create an unparalleled work of art. This is but the beginning, and already you have something that captures the imagination with its possibilities. I can't wait to see what you would do with it.
@Maggiethegsd
@Maggiethegsd 3 жыл бұрын
He sounds so excited when he explores stuff in his own game - it's really awesome!!
@LionileBruh
@LionileBruh 4 жыл бұрын
Am I the only one who was smiling throughout the whole video because of how cool this is
@maugre316
@maugre316 3 жыл бұрын
You have a great way of making these both informative and entertaining. As someone starting to play with shaders and game programming I thank you.
@emptybed8055
@emptybed8055 4 жыл бұрын
I am an undergraduate in computer science, and the coding adventures are really enjoyable.to watch! I can't wait to see more of your works. I am subbing to see what you show next!
@ethanoch
@ethanoch 4 жыл бұрын
As an aerospace engineer, I absolutely love this --- I've been wanting to take my engineering knowledge and love of orbital mechanics to make a game kinda like this, but I need to get a better hang of coding in Unity and C# first. Fantastic work! Love your videos man.
@goodie9911
@goodie9911 4 жыл бұрын
Exactly what I've been waiting for
@matthewmccloud9719
@matthewmccloud9719 4 жыл бұрын
Your videos really inspire me to get back into Unity. I'm a self-taught programmer and seeing what you're able to do in this engine just with programming is really eye-opening.
@renecejasbolecek4954
@renecejasbolecek4954 3 жыл бұрын
Fantastic emulation Sebastian, thanks for sharing your work. It makes easy for newbies, like me, to learn and to understand how Unity works. Keep it up, cheers
@jpowell69
@jpowell69 4 жыл бұрын
3:24 It would be great to see a tutorial on the orbit visualisation you have here.
@brugna4158
@brugna4158 2 жыл бұрын
I know it's been a year but I had the same exact thought as you and am actually trying to replicate that in unity using the code that he gave us, hopefully I'll be able to do it
@nickgennady
@nickgennady 2 жыл бұрын
Good idea but you got to be careful. When you scale down to much physics and movement gets less precise (what I mean is less “resolution” for numbers). Now Unity could get around or really make this less of a problem this by upgrading Unity to be a 64bit system (Use doubles instead of floats). Unreal Engine just upgraded to be 64Bit and I think Unity should as well.
@maggie2556
@maggie2556 3 жыл бұрын
"But there's a fire extinguisher, so at least it's safe."
@vistuurco13
@vistuurco13 4 жыл бұрын
Simple and amazing at the same time. I truly believe that this kind of projects could be used at schools for educational purposes.
@Musiques1988
@Musiques1988 4 жыл бұрын
Awesome! Can't wait to watch the next episodes.
@subzeroelectronics3022
@subzeroelectronics3022 3 жыл бұрын
11:04 “As you can see, everything is jiggling like there’s no tomorrow.” This is an amazing string of words.
@chrisdock8804
@chrisdock8804 4 жыл бұрын
"these masses actually cancel out." Einstein has entered the chat.
@MonolithproductionsT
@MonolithproductionsT 2 жыл бұрын
The tango music fit so incredibly well with the 3 body problem
@Krittera
@Krittera 3 жыл бұрын
I love your videos Sebastian. This was a fun coding adventure
@filipunderstreckh
@filipunderstreckh 4 жыл бұрын
Great stuff, can't wait to see Coding Adventure Episode 420 when you combine everything you've made and create universe 2.0! This video reminded me of a neat android game called Orion's Comet where you get to explore gravity and solar systems, thought I'd share it in times like these, hope it might cheer someone up
@heydudestudios9495
@heydudestudios9495 4 жыл бұрын
Thanks for the suggestion! Great game :D
@Slashscreen
@Slashscreen 4 жыл бұрын
KSP resolves this precision issue (as well as issues with the rocket parts) by instead moving all of the planets *around* the player, keeping the spaceship at the origin. Also, the planets are on rails, but that takes the fun out of the whole exercise, doesn't it?...
@linuspauly2380
@linuspauly2380 4 жыл бұрын
The concept of moving everything relative to yourself is embedded everywhere, OpenGL "moves" it's camera around the same way
@TheAmazingCowpig
@TheAmazingCowpig 4 жыл бұрын
I mean, if you want to take the planets off-rails in KSP, there's always Principia for proper n-body physics.
@PeterSeres
@PeterSeres 4 жыл бұрын
@@TheAmazingCowpig IIRC, planets still won't be off the rails with Principia, but the orbit of your spacecraft will use N-body physics instead of Kepler orbits.
@TheAmazingCowpig
@TheAmazingCowpig 4 жыл бұрын
Peter Seres I'm pretty sure planets are off-rails in Principia; they specifically have to adjust the orbits of the Joolian moons from their original orbits, or else they'd cascade into Jool.
@charleslambert3368
@charleslambert3368 4 жыл бұрын
kzbin.info/www/bejne/Z4PXfoCrpcmCeZY
@thaddiushs4000
@thaddiushs4000 2 жыл бұрын
I am so so so glad you highlighted the three body problem!!!!
@HBon111
@HBon111 4 жыл бұрын
I am not a coder, no little to nothing about it. But I hecking love your channel and I get pretty excited when you post a new video. It's just very soothing hearing you go through your process. Very cool!
Coding Adventure: Portals
16:06
Sebastian Lague
Рет қаралды 1,3 МЛН
Coding Adventure: Procedural Moons and Planets
22:48
Sebastian Lague
Рет қаралды 1,7 МЛН
Суд над Бишимбаевым. 24 апреля | ОНЛАЙН
7:26:50
Парковка Пошла Не По Плану 😨
00:12
Глеб Рандалайнен
Рет қаралды 14 МЛН
Coding Adventure: Simulating Fluids
47:52
Sebastian Lague
Рет қаралды 1,5 МЛН
Better Mountain Generators That Aren't Perlin Noise or Erosion
18:09
Josh's Channel
Рет қаралды 221 М.
Coding Adventure: Ray Tracing
37:58
Sebastian Lague
Рет қаралды 1 МЛН
Coding Adventure: Atmosphere
22:00
Sebastian Lague
Рет қаралды 1,1 МЛН
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,3 МЛН
I coded one project EVERY WEEK for a YEAR
13:13
Carter Semrad
Рет қаралды 409 М.
Coding Adventure: Ant and Slime Simulations
17:54
Sebastian Lague
Рет қаралды 1,8 МЛН
Exploring How Computers Work
18:12
Sebastian Lague
Рет қаралды 3,3 МЛН
Non-Euclidean Worlds Engine
5:15
CodeParade
Рет қаралды 11 МЛН
Something Strange Happens When You Follow Einstein's Math
37:03
Veritasium
Рет қаралды 6 МЛН
Why didn't Nika like the picture? #cat #cats
0:25
Princess Nika cat
Рет қаралды 67 МЛН
ISSEI funny story😂😂😂Strange World | Magic Lips💋
0:36
ISSEI / いっせい
Рет қаралды 11 МЛН
#上快手学农技 #快手幸福乡村带头人 #土拨鼠
0:14
嘉祥成福养殖场
Рет қаралды 20 МЛН
Спасательный трап за 30.000$! 😱
0:23
Взрывная История
Рет қаралды 10 МЛН
НАПОИЛ СОСЕДЕЙ ПИВОМ🥹
0:32
ИССЛЕДОВАТЕЛЬ
Рет қаралды 7 МЛН