546
top 50 comments
sorted by: hot top controversial new old
[-] merdaverse@lemmy.zip 17 points 2 days ago
[-] HiddenLayer555@lemmy.ml 4 points 2 days ago* (last edited 2 days ago)

I get what you mean, but programmers in 1969 would have had their minds absolutely fucking blown by a GUI in general, let alone modern websites.

[-] bagsy@lemmy.world 5 points 2 days ago

To be fair, there was only one moon lander, not 27 different ones that all worked slightly differently.

[-] Agent641@lemmy.world 5 points 2 days ago

No dependencies, no frameworks, no visual studio shenanigans. No mean forum posts.

Sounds like coding heaven to me.

[-] DupaCycki@lemmy.world 21 points 2 days ago

Just like with most open source code - I have absolutely no idea what to do with it, but I still love that it's freely available.

[-] SlurpingPus@lemmy.world 34 points 2 days ago

The article is technically correct in that the code has been open-sourced and published, except it happened in 2016, so I'm guessing the author just decided to ride the Artemis hype.

[-] 00Fuk2Givve@lemmy.zip 12 points 2 days ago

Can it run doom

[-] Zerush@lemmy.ml 25 points 3 days ago* (last edited 3 days ago)

Adding that the Apollo 11 soft isn't much more complex as the one of an current pocket calculator, I doubt that it can even run DOOM. NASA anyway has a huge OpenSource catalogue, all their soft used is OpenSource, despite some with restricted licenses only for official uses. Same for other Space agencies, eg. from the ESA. Good sources for astronomic fans.

[-] KoboldCoterie@pawb.social 89 points 3 days ago

Mark my words, someone's going to make a video game with 100% historical accuracy with this.

[-] altec@midwest.social 12 points 2 days ago
[-] dalekirkwood@lemmy.world 1 points 7 hours ago

This is the kind of game I would buy, install, spent 20 minutes trying to play normally and then aim to blow up something.

[-] KoboldCoterie@pawb.social 1 points 2 days ago

Ooh, this looks great!

[-] darklamer@feddit.org 35 points 3 days ago

This code was first published 10 years ago, but I haven't seen any such game yet.

[-] fakeman_pretendname@feddit.uk 25 points 3 days ago

They'll get round to it. They're doing the graphics first. They're currently making individual 3D models of "all the stars".

[-] KoboldCoterie@pawb.social 18 points 3 days ago

"If you want to make a historically accurate moon landing sim, you must first model the universe." -Carl Sagan

[-] AnUnusualRelic@lemmy.world 3 points 2 days ago

Don't we have the Universe Simulator already?

[-] NocturnalMorning@lemmy.world 3 points 2 days ago

Yeah, that's how they filmed the first moon landing.

[-] starman2112@sh.itjust.works 7 points 3 days ago* (last edited 3 days ago)

I'm not a computer graphics guy, but I wanna math. Theoretically, if I wanted to make the smallest possible 3d model, I would define it as four interconnected points. Each point has x, y, and z coordinates, so each model takes a theoretical minimum of 12 bytes of storage. Someone who knows computers can correct me if I'm off by a bunch.

The lower estimate is around 100,000,000,000 stars in the Milky Way. That's only 1.2 terabytes worth of my theoretical minimum 3d model. Doable! But you said all stars. The lower estimate is around 10^22 stars in the universe. That would be 120 zettabytes. That's only a few orders of magnitude off from the total available worldwide datadata storage!

Edit: I might have thought of a way to define a 3D model in just 2 bytes. You need four points that each have values for x, y, and z. They don't need 256 possible values for those, they can get by with two each. One bit can store two possible positions, so we can use as little as two bytes to define every point's position with 4 bits to spare. Behold, a tetrahedron: 0000 0100 1010 1110

Each set of four digits defines the x, y, and z coordinates for each point, as well as one extra dimension. You could use those extra four bits however you want. An extra spatial dimension, defining a color, etc. The theoretically smallest possible 3D model. Take the numbers I said up there and divide them by 6. A model for every star in the universe, and it would only take 20 zettabytes.

[-] AdrianTheFrog@lemmy.world 3 points 2 days ago* (last edited 2 days ago)

As an amateur computer graphics person, the best way to draw accurate stars is to just pre render it onto a cubemap. But if you really need that subpixel worth of parallax to be completely accurate for every star, there are a couple ways I can think of off of the top of my head. With any you'd want to make sure you only store position, size, and color, since stars are all spheres anyways. With effort, you can be very flexible with how these are stored. (4 bits color temperature, 4 bits size, 3*32 bits coordinates maybe)

  • splat each star into the screen texture with atomics
  • some sort of tiled software rasterization thing, like in Gaussian Splatting

Worse ideas:

  • instanced hardware rasterization
  • ray tracing

This is not that well suited to most usual rendering techniques, because most stars are probably going to be much smaller than a pixel. Ray tracing would mean you need to just hit every star by chance (or artificially increase star size and then deal with having tons of transparency), hardware rasterization is basically the same and additionally is inefficient with small triangles. I guess you could just live with only hitting stars by chance and throw TAA at it, there's enough stars that it doesn't matter if you miss some. That would react badly to parallax though and defeats the purpose of rendering every star in the first place.

It's much more efficient to do a manual splatting thing, where for each star you look at what pixel(s) it will be in. You can also group stars together to cull out of view stars more efficiently. Subpixel occlusion will be wrong, but it probably doesn't matter.

This is all just for the viewport, though. Presumably there are other objects in the game besides stars, which need to have reflections on them of the stars. Then that becomes an entirely different problem.

The real answer though is that you wouldn't try to render all of the stars, even if you want parallax. Maybe some of the closer and larger ones as actual geometry, simplify a ton of stuff in the background, render things as volumes or 2d billboards, have a cubemap for the far distance, etc

Edit: also ofc this presumes you know the position, scale, temperature of every star

I also like the idea of baking all of the stars into a volume in spherical coordinates, centered around the origin

[-] fakeman_pretendname@feddit.uk 6 points 3 days ago

That's some damn fine maths, thank you :)

[-] Cethin@lemmy.zip 24 points 3 days ago* (last edited 3 days ago)

You can automate control of your craft in KSP with a mod. All you need is to have it send the data to the Apollo computer and then send the output to the craft. It should probably work with the real solar system mod.

Now that I saw this though, I swear I saw this exact video already. Scott Manley or someone may have already done this.

[-] bl4ckp1xx13@lemmy.dbzer0.com 6 points 2 days ago

If that works with the real solar system mod that is honestly the finest testament KSP can get for its mathematical accuracy.

[-] NocturnalMorning@lemmy.world 4 points 2 days ago

KSP is not mathematically accurate and it can't be or it would have trouble running on computers. They split up and use simplified 2 body dynamics in the game.

We use super computers to model the n-body problem bcz of how complex it is.

[-] bl4ckp1xx13@lemmy.dbzer0.com 1 points 2 days ago

Of course, NASA ain’t modelling actual missions in KSP.

I imagine KSP is simple Newtonian physics which is accurate at macro-scales, whereas obviously NASA is going to use Einstein’s equivalent. Far more computationally intense but really important once you scale up the small errors in Newton’s equations.

[-] NocturnalMorning@lemmy.world 3 points 2 days ago* (last edited 2 days ago)

Actually, we don't use relativity so much. For some stuff like light time delays, yes, but for orbit determination we use newtonian mechanics still. It's just that once you start adding more than two bodies, you have to shift to doing numerical integration to find solutions, which doesn't work for real-time stuff like video games.

For most applications, F = -GM1M2/r^2 is still a valid approximation.

Edit: And by most applications, i mean sending a satellite to a planet in our solar system. If you were trying to go to Alpha Centauri, you damn sure better use Relativity to model your trajectory.

[-] Cethin@lemmy.zip 3 points 2 days ago

I haven't tried it, but yeah, at small scales KSP (which is just using floating point numbers) is pretty accurate. It's at large scales where it fucks up, which it does have to deal with too, being a game about traveling between planets.

I assume it probably would work though. The Apollo computers, as I'm sure you know, weren't super complex. They basically just assisted the pilot. I'm not exactly sure what math they did, but it probably just had to do with descent rate/time to impact and stuff like that. Again, this is all just guessing. I don't remember it.

[-] bl4ckp1xx13@lemmy.dbzer0.com 2 points 2 days ago

That makes sense, floating-point precision falls apart with large numbers but is pretty good with small numbers.

Perhaps there’s a mod that can swap out the position system to use doubles instead of floats? But I’m pretty sure that’s a Unity thing with its Transform positioning system so that’d be quite a challenge to change.

[-] Cethin@lemmy.zip 3 points 2 days ago* (last edited 21 hours ago)

Yeah, there's no way to do that. You can use doubles yourself to track things, but the engine is always going to use floats. When you send data to the engine, it has to be in float form.

IIRC, UE5 actually switched to using doubles for everything. Standard size float makes floating point math faster to perform, but computers are fast enough now they decided it was worth it. It can now accurately store positions much further away without losing as much precision.

KSA is also using doubles I think, on their custom engine. They can do a cool thing where they can render multiple vehicle views at once, in totally different locations. KSP couldn't do this because of floating point error.

[-] AnUnusualRelic@lemmy.world 4 points 2 days ago

Lunar Lander wasn't good enough for you?

[-] ace_garp@lemmy.world 19 points 3 days ago

Finally! An expansion pack for Lunar Lander(1979).

[-] wax@feddit.nu 3 points 3 days ago

It will be vibecoded with six-fingered physics

[-] AnnaFrankfurter@lemmy.ml 33 points 3 days ago

See ya losers I'm going to moon \s

load more comments (4 replies)
[-] vrighter@discuss.tchncs.de 10 points 2 days ago

i've had a copy for years.... Why is this news now?

[-] whotookkarl@lemmy.dbzer0.com 6 points 2 days ago

Space articles get clicks when something big happens like Artemis 2

[-] quick_snail@feddit.nl 8 points 3 days ago

the crucial 30 lines of assembly for calculating Apollo 11's navigation trajectories.

I was never skeptical we went to the moon until now.

How the hell can you do all that in 30 lines?!?

[-] Birch@sh.itjust.works 19 points 2 days ago* (last edited 2 days ago)
import MoonPy

MoonPy.LandOnMoon()

while MoonPy.OnMoon:
    print("john madden")
[-] DupaCycki@lemmy.world 3 points 2 days ago

Just applied to NASA with this code and they accepted me. Should have posted it under AGPL.

[-] HiddenLayer555@lemmy.ml 2 points 2 days ago

I mean, the math required is basically first year college level stuff.

Making a machine that will accurately follow that trajectory and not kill you is the hard part.

[-] Buddahriffic@lemmy.world 2 points 2 days ago

Very efficiently.

Or for a less cheeky answer, I believe the method they used at a high level was pointing a camera at a few guide stars, so the 30 lines of assembly might have been a loop that checked those cameras for any drift of those stars and did a correction pulse of the rotation boosters to keep them centered. Oh, one of the references might have been the signal strength from home, too (signal gets weaker if the antenna isn't aligned).

Unless it was an emergency, it might only need to look at 5 pixels to determine alignment and correction.

Also, just because it's assembly doesn't mean it can't call subroutines and functions, so that 30 lines might be misleading in the way those several lines in the other reply have way more going on. That said, if it's just doing a pixel brightness comparison, that's one line to read the central pixel, then for each direction one line to read that pixel, one more to compare, one line to jump to next comparison if center is brighter, one instruction to initiate correction burn, one instruction to stop it immediately after, then one instruction to return to the start of the loop... Which comes to 22 lines total, leaving 8 for logging or maybe timing the burn. And that's assuming their instruction set didn't have anything fancy like read and compare, compare and jump, or a single instruction burn pulse.

[-] j_elgato@leminal.space 6 points 3 days ago

Wait, our own space program? Is that a thing we're supposed to have?

load more comments
view more: next ›
this post was submitted on 13 Apr 2026
546 points (99.3% liked)

Open Source

46261 readers
49 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 6 years ago
MODERATORS