WEBVTT
Kind: captions
Language: en

00:00:00.130 --> 00:00:02.639
All right so having been a dev for a good minute or two

00:00:02.639 --> 00:00:08.159
I thought I'd make a tutorial to help you guys create the most basic simulation, which is of course known as "Hello Universe".

00:00:08.410 --> 00:00:10.590
This program obviously isn't too complex

00:00:10.590 --> 00:00:16.800
But it's got everything you need to be able to integrate yourself and play from the planet earth as the human player type.

00:00:16.800 --> 00:00:18.300
Okay, so I'm gonna be using

00:00:18.310 --> 00:00:24.269
Google's online development simulator for most of the project because it has a user interface and Google pretty much owns me.

00:00:24.269 --> 00:00:26.309
But feel free to use your simulator of choice.

00:00:27.189 --> 00:00:32.308
Okay, so go to new file, and we'll name it "Hello Universe" and it'll ask us for the game speed.

00:00:32.340 --> 00:00:37.829
It's just how quickly players experience the passage of time in your simulation. I'm gonna base this on the speed of light

00:00:37.930 --> 00:00:39.480
It doesn't really matter what you choose

00:00:39.480 --> 00:00:41.820
I just usually prefer to code in C.

00:00:41.820 --> 00:00:45.000
So the first thing we have to do is import all our planets, stars,

00:00:45.000 --> 00:00:48.580
galaxies, and all the characters. So make sure you've downloaded the asset library.

00:00:49.080 --> 00:00:52.720
Most of the universe is going to be empty, so storage won't be a problem.

00:00:53.540 --> 00:00:55.120
It's why we call it space.

00:00:55.280 --> 00:00:59.720
So most things in the universe are procedurally generated by the computer over millions of years

00:00:59.740 --> 00:01:03.740
But when someone integrates into your simulation you have to designate who they're gonna play as.

00:01:04.089 --> 00:01:06.839
Some devs like to make the playable characters in their own image

00:01:06.840 --> 00:01:10.590
But if you saw what most developers look like, you'd know how bad an idea that is

00:01:10.860 --> 00:01:15.540
So I like to design a joke character the players might like but nature would of course never allow.

00:01:17.340 --> 00:01:19.340
Yeah, just- just import that.

00:01:19.750 --> 00:01:24.449
Now, when you do more complex simulations, you can enable life for as many planets as you want

00:01:24.449 --> 00:01:27.840
But for Hello Universe, Earth is the only planet with life on it.

00:01:27.840 --> 00:01:31.840
The players will probably never find out, so don't worry about that.

00:01:31.840 --> 00:01:34.940
There are also some other settings you can change for Earth individually.

00:01:35.760 --> 00:01:40.240
Uhh... Number of players for Hello Universe, the only real player is you.

00:01:41.400 --> 00:01:43.220
All the other players are simulated.

00:01:44.360 --> 00:01:47.660
Difficulty: this is just how hard it is for you to get through the day.

00:01:49.920 --> 00:01:50.800
Yeah

00:01:51.660 --> 00:01:55.140
Okay, now keep in mind that simulations tend to run pretty processor-heavy.

00:01:55.140 --> 00:01:57.120
You might have heard the programming quip:

00:01:57.140 --> 00:02:00.400
"You need more than one thread to make the fabric of space and time"

00:02:01.040 --> 00:02:05.020
Like most niche interest jokes I don't find it funny, but I at least understand it.

00:02:05.400 --> 00:02:09.460
Simulations use fewer resources the longer they go on for but if you have a lot of them running simultaneously

00:02:09.820 --> 00:02:12.980
you can free up some resources by deleting some of the older players.

00:02:14.160 --> 00:02:18.500
Okay, so next are the universe settings and we have map size.

00:02:18.600 --> 00:02:22.040
That's how big you want the observable simulation to be when players go in.

00:02:22.260 --> 00:02:25.800
The bigger you make this the harder it will be for them to find your mistakes.

00:02:26.440 --> 00:02:28.440
[typing noises]

00:02:29.460 --> 00:02:32.820
Number of perceivable dimensions, just leave this at four

00:02:32.820 --> 00:02:37.340
Not much point doing tutorial on five dimensional simulations because you'd already know what that looks like.

00:02:37.500 --> 00:02:40.260
And bit rate: 300,000 kilometers a second.

00:02:40.920 --> 00:02:44.740
Okay, so that's the primary programming done, so go ahead and compile that

00:02:46.580 --> 00:02:47.860
Alright, no errors...

00:02:48.220 --> 00:02:49.280
That's unusual

00:02:49.820 --> 00:02:51.640
and all right. We're good to launch but before we do

00:02:51.650 --> 00:02:54.290
it's critical that you scrub through the timeline check for bugs before publishing.

00:02:54.480 --> 00:02:58.849
A lot of new devs have a hard time telling the difference between a bug and poor designs

00:02:58.850 --> 00:03:01.760
So I thought I'd go through a few of the most frequently asked questions I get.

00:03:02.310 --> 00:03:06.260
"My stars are collapsing after billions of years." Yeah, this is a bug

00:03:06.260 --> 00:03:09.529
and we don't have a solution so we just make them invisible and call it a feature.

00:03:10.890 --> 00:03:15.559
"What happens if the players discover the source code?" This almost never happens

00:03:15.560 --> 00:03:19.790
But I don't worry about it 'cause most of my code is almost completely unintelligible anyway.

00:03:20.940 --> 00:03:26.540
"What happens when the simulation is over?" You get a screen to choose your payment method and you can see the high scores.

00:03:27.150 --> 00:03:30.890
Okay, so let's get back to our program. Go ahead and hit run, and...

00:03:32.010 --> 00:03:39.439
It's as easy as that just remember you can't patch the simulation once it started, so no interaction is possible from outside the program

00:03:39.900 --> 00:03:42.380
But you can always integrate yourself and go through as a player.

00:03:42.720 --> 00:03:46.489
Keep in mind that millions of years of game time are processed in just a few seconds.

00:03:46.489 --> 00:03:48.709
So if you choose a later point in time to integrate yourself,

00:03:48.780 --> 00:03:50.730
you can actually build another simulation

00:03:50.730 --> 00:03:56.299
inside that simulation, and another sim inside that one, and so on, and so on. I think that's called inscription.

00:03:56.520 --> 00:04:01.070
Or encryption or recursion, or might just be a nested loop. It's not really my field.

00:04:01.590 --> 00:04:03.500
Anyway, that's more than you worry about right now.

00:04:03.500 --> 00:04:10.339
So, congratulations on creating the Hello Universe simulation. Give yourself a pat on the back and feel free to take a hard-earned day of rest.

00:04:12.200 --> 00:04:14.709
So, today's video is sponsored by Audible.

00:04:14.709 --> 00:04:19.040
And I was gonna suggest using this free book credit at audible.com/explained

00:04:19.040 --> 00:04:21.780
for something a bit more on topic.

00:04:21.780 --> 00:04:28.860
But I actually just saw the movie IT and I've been really wanting to read the book until I realized the 'You'll float too' tagline.

00:04:29.000 --> 00:04:30.880
It's because the books the size of an aircraft carrier.

00:04:30.919 --> 00:04:36.399
So, I went on audible.com/explained, signed up for my own 30 day free trial,

00:04:36.760 --> 00:04:38.500
because [mumble] I've never used audible before...

00:04:38.900 --> 00:04:41.420
and got 45 hours of book for free

00:04:41.420 --> 00:04:43.420
that I don't have to carry around.

00:04:43.660 --> 00:04:47.139
So, now I can mathematically survive up to two day road trips,

00:04:47.140 --> 00:04:50.740
and I can walk anywhere or ride the bus without having to talk to someone,

00:04:51.380 --> 00:04:52.920
but someone is still talking to me.

00:04:53.380 --> 00:04:58.780
So again, if you'd like to take advantage of that you can sign up for a free 30-day trial and a free book at audible.com/explained

00:04:59.420 --> 00:05:01.809
where you can follow the link in the description

00:05:02.540 --> 00:05:07.100
[outro music]

