TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How would you program a model of a universe?

7 pointsby calmchaosabout 5 years ago
Let&#x27;s assume you have nearly infinite computation resources.<p>The goal is to create a computer program that creates a virtual universe with the fewest possible rules and shortest amount of code. The model doesn&#x27;t have emulate our known universe.<p>The only requirement is that after injecting initial data the virtual universe becomes self-sustaining and ever evolving so that based on the fundamental rules and fundamental elements more complex structures and interactions can be formed.<p>So an advanced version of &quot;Game of Life&quot;.<p>1. How would you define the core model and rules of such virtual universe?<p>2. What would be the minimum amount of &quot;initial data input&quot; required to start and keep the virtual universe running (assuming ~infinite computational and memory resources)?

4 comments

mattbgatesabout 5 years ago
Google created this a while ago, was very cool.<p><a href="http:&#x2F;&#x2F;stars.chromeexperiments.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;stars.chromeexperiments.com&#x2F;</a><p>And I also had played this game on Steam like 10 years ago and loved it. Very basic, very simple. You started out as a small speck of dust in space and as you flew threw space, your gravity would begin to absorb the elements and you would get bigger, becoming a planet, a bigger planet, a sun, a black hole... while it was mostly simuluation and you had no real enemies, gravity is always our biggest enemy and you could be ripped apart by another black hole or even a giant sun, which made the game so enjoyable. You could drift and float and control it.. you flew through space and moved the arrow keys to avoid objects. You could change your speed too.<p>Let me see if i can find it and i only bring it up since I can&#x27;t answer your exact answer, but can show you an idea. Looks like it got a massive upgrade as it used to be 2D. <a href="https:&#x2F;&#x2F;store.steampowered.com&#x2F;app&#x2F;230290&#x2F;Universe_Sandbox&#x2F;" rel="nofollow">https:&#x2F;&#x2F;store.steampowered.com&#x2F;app&#x2F;230290&#x2F;Universe_Sandbox&#x2F;</a><p>And CodePen can at least get you started with a simulation.<p><a href="https:&#x2F;&#x2F;codepen.io&#x2F;search&#x2F;pens?q=universe" rel="nofollow">https:&#x2F;&#x2F;codepen.io&#x2F;search&#x2F;pens?q=universe</a>
评论 #23049217 未加载
rl3about 5 years ago
While I appreciate your question and realize what you&#x27;re asking, I hope you don&#x27;t mind my going a bit off topic here:<p>&gt;<i>Let&#x27;s assume you have nearly infinite computation resources.</i><p>I think it&#x27;s more fun to assume you don&#x27;t. You need not simulate every water molecule in the ocean for life to emerge.<p>Imagine you had a hash table of precomputed interactions between various simulation elements across all scales. In such a system, the computational cost of simulating a single protein would be similar to that of two galaxies colliding.<p>A planet for example would simply be a vast hierarchy containing a chain of approximated behaviors, each node in that chain containing its own hierarchy.<p>The really fun part is trying to envision how changes at very low levels in this chain would ripple upwards and affect the simulation at larger scales. Thus far I&#x27;ve only imagined it as analog to node invalidation in a typical scene graph data structure, where you flag it &quot;dirty&quot; and it&#x27;s queued for recomputation on the next frame.
评论 #23044359 未加载
jerome-jhabout 5 years ago
1&#x2F; Since we have an example of a working universe at hand, I think I would start by modeling the 4 basic interactions. And there is already a quite hard issue which is: 3 interactions are short range, and the 4th (gravitation) is long range. So you will need a large enough universe and a large number of particles from the start. Second issue is that you may not see interesting behavior emerging before your patience ends.<p>Compared to Conway&#x27;s game of life: only one interaction (short range), interesting behavior almost immediate.<p>Maybe there is middle ground. (game of life with a long range interaction?)<p>2&#x2F; Initial data to be chosen randomly. Works both for game of life and our own universe.
评论 #23054405 未加载
qubexabout 5 years ago
Obviously the minimum possible amount of data for a “Game of Life”-type setup would be a bunch of ‘ON’ voxels somewhere near the center.<p>As for the question itself, I think you’ve answered yourself: a Game of Life-type setup defined in three dimensions. I’ve seen a mention on HN of somebody implementing the (2D standard case) in 23 assembler instructions, so it’s very minimal.
评论 #23040645 未加载
评论 #23040551 未加载