Simulating Galactic Evolution in a Game

In summary, the galaxy is simulated by the computer and stars are created by adding energy to the interstellar medium. Stars have mass, luminosity, color, and lifespan determined by their mass.
  • #1
Bob65536
5
0
I am writing a browser based multiplayer game. The basic idea is that you are the leader of a very advanced spacefaring civilization. Your objective is to gather resources and develop your technology further. You gather resources by mining stars. The more stars you control, the more resources you have available. Everyone plays in the same galaxy and fights with each other to control as many stars as possible. The galaxy was artificially created by an even more advanced race, that also ensures game play fairness.

The galaxy is a dwarf starburst galaxy that will start with about a million objects (stars, black holes, neutron stars, etc.). More galaxies can be added later depending on the number of players. The galaxy will evolve over time with stars dying and new stars being created. My objective is to make a galaxy that is as realistic as possible given practical limitations on computational resources and development time. One i7 computer should be able to run the galactic simulation and act as a server for 100 players.

I'm not very knowledgeable when it comes to astronomy and astrophysics. Most of my knowledge comes from reading every article related to astronomy on Wikipedia last night. So I'm going to layout my plan for simulating a small galaxy and let people poke holes in it, or provide any alternatives.

The galaxy is discretized into squares. Each square has a certain density of interstellar dust. The galaxy is initialized by creating a galactic boundary and creating a distribution of interstellar material inside that boundary.

I have written a small program that generates a random boundary and initial distribution. Here is when it looks like. Brighter areas have a higher density of matter. The circle indicates the center of mass where I will place a supermassive black hole.

[PLAIN]http://i.min.us/jmlgwY.png

The movement of interstellar dust will be approximated by a fluid mechanics simulation. The assumptions of compressible inviscid flow should work well. I plan on using the fluid dynamics algorithm described in http://scannapieco.asu.edu/finite_diff2.pdf .

However, we have to add gravity or diffusion will make for a strange galaxy. So after each iteration of the CFD, the universal gravitation equation is applied between adjacent cells to update the mean velocity of the fluid. This should create an equilibrium so diffusion isn't a problem, although the universal gravitational constant may have to be modified to make sure is equilibriates where I want it to.

In the interstellar dust simlution, I am ignoring most of the affect stars have on it. This includes thermal effects, solar wind, and gravitational attraction. The only way stars affect it is by novas. If there is a nova in a cell, it will add internal energy to the fluid and increase its density. This will cause a shockwave to propagate through the interstellar medium.

Shockwaves in turn can create new stars. Determining whether or not the dust starts forming into a star is a function of the magnitude of the pressure wave and the density of the dust in a cell. I will set some sort of minimal density and pressure change. If both quantities are above the threshold, then
[tex]P\rho \geq c[/tex] will cause a star to be created.
Where P is the pressure difference over a fixed period of time and rho is the density of dust in a cell. The constant c is empirically determined. The value is chosen so that star creation isn't too common or not common enough.

Only a single star is created in a cell at a time. The location of the star is a random point inside the cell. The mass of the star is found by subtracting all of the dust in a fixed radius around a star. The percent area of this circle that overlaps a cell is the percent of mass that cell donates to the star.

When the star is created, another small shockwave is set off. If there is enough matter nearby another star will be created. This will help make sure there are multi-star system. The radius that star creation consumes has to be determined so that the size and distribution of stars appears realistic.

The star effective temperature, radius, luminosity, color, and lifetime is determined by its mass. It will be linearly interpolated from the table below with a little bit of randomness thrown in.
Code:
Class	Min Temp	Max Temp	Min Mass	Max Mass	Min Rad	Max Rad	Min Lum	Max Lum	Lifetime [years]	Lifetime [days]

O	33000			16		6.6		30000		1.00E+06	
B	10,500	30,000	2.1	16	1.8	6.6	25	30,000	3.00E+07	3.000
A	7,500		10,000	1.4	2.1	1.4	1.8	5	25		4.00E+08	13.746
F	6,000		7,200		1.04	1.4	1.15	1.4	1.5	5		4.00E+09	21.806
G	5,500		6,000		0.8	1.04	0.96	1.15	0.6	1.5		1.00E+10	23.821
K	4,000		5,250		0.45	0.8	0.7	0.96	0.08	0.6		6.00E+10	28.657
M	2,600		3,850		0.45	0.2	0.7	0.2	0.08	0.02		1.00E+11	30.000
Mass, radius, and luminosity are relative to the sun. The color of the star is the color of a black body with the effective temperature of the star. A table of colors is found at http://www.vendian.org/mncharity/dir3/blackbody/UnstableURLs/bbr_color.html.

The last column has the number of real time days that a star lives. I could not make it proportional to the actual time for gameplay reasons. One star shouldn't last 3000 times longer than another. If you average it out, it is about 42 million years of simulated time per real world hour.

I initially wanted stars to move around the galaxy based on gravitational influence, but I decided against it for gameplay reasons. A star will remain in the same location it was created until it dies.

When a star dies it turns into a white dwarf, neutron star, quark star, or black hole. This is determined by its mass.
Code:
		Min Mass	Max Mass
White Dwarf	0	1.4
Neutron Star	1.4	4
Quark Star	1.5	1.8
Black Hole	4

Eventually more and more of the mass in the galaxy will be converted into these end products. Players with sufficient technology will be able to mine white dwarves, but the others are unusable.

When there are too many black holes and neutron stars, the super advanced alien race that created the galaxy will renew it by annihilating all dead stars with antimatter. They will then add an equivalent mass to the nearby interstellar medium. The shockwaves and new matter will trigger the creation of new stars.

So that's my plan. I would appreciate any comments or improvements. Thanks.
 
Last edited by a moderator:
Astronomy news on Phys.org
  • #2
First off, I would just like to say that this an awesome project! Please don't give up working on it and I want to play when it's finished!

Sounds like you've got a great plan going, would you be able to explain a little bit about what you intend to do with the game play aspect of it and why you didn't allow for the rotation of stars around the galactic center due to gravity?
 
  • #3
There are three types of resources: light elements, heavy elements, and exotic elements. These elements are used in creating ships, defences, infrastructure, and a small amount is used in research. You can mine them yourself or give permission for others to mine from your star as well. You can force them to give you a percentage of what they mine.

Infrastructure is basically the size of the mining operation. The more you invest, the more you can mine. It also creates some cool structures around the star. At the highest level you can get a Dyson sphere. But if another player takes control of the star, they keep your infrastructure.

Everywhere is rich in light elements, but heavy elements and exotic elements are hard to find in large quantities. You can trade with players in a radius around you determined by your propulsion technology. You can trade resources, ships, common artifacts, or trade for a star. You can also in effect convert resources from one type to another by trading with the super advanced aliens who control the center of the galaxy.

You design your ships based on the current technology you posses. You pick the body, armor, propulsion, power source, main weapon, secondary weapon, etc. So that there is thousands of different combinations of ships that are possible. This adds another level of complexity to battle by trying to exploit the weaknesses in your enemies ship design. If you are attacked, the behavior of your ships is determined by very simple macros that you setup.

I lied above. The game actually starts with two galaxies. The normal galaxy and a pirate galaxy. You can only own stars and ships in one at a time. The pirate galaxy has no rules on battle. This galaxy is intended for hardcore PVP types. The other galaxy has hard rules on the number of stars you can lose, the frequency you can be attacked, etc. Also in this galaxy you can enter a peaceful mode in which you cannot be attacked or attack others. Although you can break any rule, the consequences will be severe.

Interstellar travel is slow, building ships and infrastructure takes time. This is done intentionally so that someone that plays the game a lot does not have an overwhelming advantage. So that there is always something to do, you can get a task. They involve things like puzzles, battle objectives, exploration, etc. When you finish a task you can choose to receive resources or artifacts.

Artifacts are required for research and rare ones cannot be traded. Research is not tradeable its also what limits the speed you can advance. You have to acquire specific artifacts and spend a small amount of resources in order to start researching. You can get artifacts from tasks or randomly in battle. I could say a lot about what I have planned for research, but I won't. There will be some very interesting things like quasi-materials and matter inverters. The research tree will be very vast. There will be many branches and most dead end. After taking some branches you cannot choose others. In the end you choose between small fast ships made from 2D materials that fire antimatter, or ships the size of gas giants that fire every weapon in the book.

One goal I have is that no matter how many stars you control, it always takes the same amount of time to control your empire. If you choose to you can micromanage each star, but its not required. This is why I do not want the stars to move. If you owned 10,000 stars and they were all moving, managing those stars would be much harder than if they were static.

Looking at the galaxy will be done with something like google maps interface. It will also have the option of coloring the galaxy based on criteria like pogpulation density, mass density, max technology, etc.

The game will be written in JavaScript and the graphics rendering will be done either with HTML5 canvas or dynamic SVG images, whichever turns out to be faster. It will also use web workers to allow multithreaded processing. Because flash sucks.
 
  • #4
Bob65536 said:
However, we have to add gravity or diffusion will make for a strange galaxy. So after each iteration of the CFD, the universal gravitation equation is applied between adjacent cells to update the mean velocity of the fluid. This should create an equilibrium so diffusion isn't a problem, although the universal gravitational constant may have to be modified to make sure is equilibriates where I want it to.

In the interstellar dust simlution, I am ignoring most of the affect stars have on it. This includes thermal effects, solar wind, and gravitational attraction. The only way stars affect it is by novas.
If stars do not contribute to the gravity of a cell its gravity will be reduced by the production of stars. If a star were to be created in a region of uniform density, it would have the effect of reducing the density of the cell it is in and eventually those around it as well (since gravity will tend to pull in the direction opposite the low density cell/region).
 
  • #5
That's a great point. Thanks for the input.

When I update the velocity of the fluid due to gravity, I will first apply it to adjacent cells from the center of the cells. Then I will apply it individually between the center of nearby stars to the center of the cell.

I also forgot to mention that if stars are within a certain range of each other, the larger star will steal mass from the smaller star(s). This will increase the number of stars that are capable of going nova. I'm not sure what kind of function I'm going to use for the rate of mass transfer, but it will be a function of their masses and distance. As a star's mass increases or decreases its lifetime is updated.
 

What is "Simulating Galactic Evolution in a Game"?

"Simulating Galactic Evolution in a Game" is a scientific concept that involves using computer simulation techniques to model and study the evolution of galaxies in a virtual environment. This allows us to better understand the complex processes that shape and drive the formation and evolution of galaxies in our universe.

Why is it important to simulate galactic evolution in a game?

Simulating galactic evolution in a game allows us to explore and test different theories and hypotheses about the formation and evolution of galaxies in a more interactive and visual manner. It also provides a platform for engaging and educating the public about the fascinating field of astrophysics.

What are the benefits of using a game for galactic evolution simulations?

Using a game for galactic evolution simulations allows for a more intuitive and user-friendly approach to understanding complex scientific concepts. It also allows for a more collaborative and interactive experience, as players can contribute to the simulations and help improve our understanding of galactic evolution.

What are some challenges in simulating galactic evolution in a game?

One of the main challenges is accurately representing the vast scale and complexity of galactic processes in a game. This requires advanced computer programming and high-performance computing capabilities. Additionally, ensuring the accuracy and validity of the simulations is crucial in order to draw meaningful conclusions from the results.

How can "Simulating Galactic Evolution in a Game" be applied in real-world scenarios?

Simulating galactic evolution in a game can have practical applications in fields such as astrophysics, cosmology, and even aerospace engineering. By studying and understanding the processes that shape and drive galactic evolution, we can gain insights into the origins and fate of our own galaxy, the Milky Way. This knowledge can also inform our search for habitable planets and potential extraterrestrial life.

Similar threads

Replies
1
Views
2K
Replies
12
Views
3K
Replies
2
Views
1K
  • Astronomy and Astrophysics
2
Replies
51
Views
8K
Replies
15
Views
2K
  • Astronomy and Astrophysics
Replies
8
Views
5K
  • Astronomy and Astrophysics
Replies
7
Views
4K
Replies
1
Views
2K
  • Astronomy and Astrophysics
Replies
1
Views
6K
  • Beyond the Standard Models
Replies
4
Views
2K
Back
Top