• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

General Relativity

Status
Not open for further replies.
I had a sudden thought in my head.. general relativity is an interesting subject which could easily applied to StarCraft II in the form of a map.

What I mean is rather basic: visualize the basic laws of physics to players in the form of a video game.

Say for example you wanted to demonstrate the act of gravity; take one unit and give it a strong gravitational pull. Have another unit with none or some, and let them loose. The effects would be obvious: the lesser unit (lets say marine) would be pulled to the bigger unit with strong force, while the bigger unit would do the same but slower. The effect would be one fast projectile being thrown towards a smaller one. The resulting effect (under normal circumstances) would be a looping effect as the smaller unit passed the larger unit and it's speed actually sent it flying the other way, but eventually pulled back towards it, obviously at a different angle. The laws of general relativity state that it would have a similar rotation path forming a short-lived orbit. Eventually the units would be locked together (like two magnets), with little to no motion (unlike planets which have extremely massive gravitational pulls and weigh enormous amounts, causing them to always break free from a pull through simple speed, then to be pulled back, creating an uneven orbit, or even planets which have been in the pull/push for so long that it has actually created an even orbit) but the simple act of showing this would be not only informative but interesting to watch.

Many many things like this could be explored in-game. The number of theoretical things that could happen is endless (the sky is the limit) given the right circumstances in a game based heavily on variables such as where the two marines are placed relevant to each other and the position of the screen, and is thus certainly and interesting idea.

My only stopping block is the fact I know little to none in the terms of Galaxy script. I could attempt to create a system of general relativity (engine) for such a game, but it would heavily rely upon numeric variables generated by random events, and done with basic GUI. Simply creating the effects of gravity in basic GUI is next to impossible unless you can get extremely creative. I haven't even explored SC2's ability to push and pull with force, let alone create entire engines built upon general relativity.

So I implore you, intelligent reader, to create an engine either for yourself or for me. With some basic UI, you could create an interesting playground for the average gamer. What I basically mean is - they click a button to spawn a medium gravity unit, they click a button if they want it to be static or randomly generated, and do the same for other objects, then watch the results. They then click another button to reset all fields and try other combinations.

I dunno. I was just thinking it would be cool.. and I'd be willing to give it a try if anyone else experienced with customizing engines for SC2 is as well. Obviously I cannot do this on my own.

Doctor.. dunno if you've ever created a map.. but I know for a fact you would love to see the outcome if not help build it.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
Doctor.. dunno if you've ever created a map.. but I know for a fact you would love to see the outcome if not help build it.
This sounds rather boring to me... I played with a 2D gravity simulator on an old mac system back when I was 6 and it basically did exactly what you ask here (with exception of objects being uncollidable).

There are 2 basic approaches.
1. The easy way which you apply the physics based on current displacement evert key frame. This is inaccurate as the forces acting on the object change as it is in motion. Often used where performance is critical due to simpler maths.
2. The correct way which you use deferential equations to generate functions that will calculate displacement between key frames. This is difficult to program and comutationally extreemly demanding. I can imagine some complex math being needed due to force depending on the outcome of itself.

Setting up 1 is very easy. You create a list of obects with the approiate values accompanying them (such as mass) which you itterate through every 0.1 seconds. You do 2 itterations through it, the first is a combination matching getting any 2 objects out of the list (so you can calculate the forces they create between each other) and the second is for updating the displacement of the objects (and applying any drag forces).
 
This sounds rather boring to me...

I wasn't just thinking of gravity, I was thinking of all kinds of things.
Such as how particles will always separate equally in a confined space.
Gravity was just one example.
I'm talking about general relativity tests in a very broad view.
Either way, the mathematics isn't the problem.
It's the galaxy editor coding/GUI experience I lack; numbers are easy to play with.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
Such as how particles will always separate equally in a confined space.
But they do not... Unless they are solid in which case they are subject to certain forces of attraction/repulsion between each particle. Infact at a sub particle level they are in constant movement (electrons in orbit, nucleus probably ossilating).

Either way, the mathematics isn't the problem.
It is if you want to simulate particles accuratly. Scientists have been trying for years.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
There is mathematics and mathematics.

Yes you could do a frame by fame model very easilly using highschool mathematics and the result would be acceptable next to at high speeds or obscure values.

However, if you start to use real mathematical models, you approach the realm of complex numbers and multi demensional fields. Although it may be possible to run a small scale model with such a system, it would certainly be a lot harder to script.
 
I would have to say finding a balance between complex and simple would be the appropriate field.
I'm not going to spend endless hours upon hours designing something that could never see the light of day.
I will however explore the basics of general relativity, to implore a sandbox scenario where the players have control.
However as I said before, I have a problem;
I cannot code physics with the SC2 engine.

Give me about a year, when I finish the basics of computer programming which I'll be taking next september.
Then I will =]
That is unless someone wants to help.
 
Status
Not open for further replies.
Top