Dear Hive Workshop community
First of all: Thanks to, WILLTHEALMIGHTY for the sun, RightFieldfor the earth and wertyn for the background stars.
In a map, I have created a miniatur solar system. It is very simpel, only containing a sun, an "earth" and a asteroid field. However there is 30-50 asteroids. All asteroids and the earth is orbiting the sun using real gravitionell physics. I think that it looks beatifull! At least for the first 10-15 seconds. Then warcraft 3 starts to lag, and later go "not responding".
All the motion of planet and asteroids have been done with triggers. Each celestial body has a varibel for: its position, its velocity in X direction, Velocity in Y direction. And X and Y vectors for the sun's gravitionell Pull, could also be called acceleration vectors.
Every 0.03 second a trigger calculate new vectors for the gravitionell Pull, for all bodies. Then uses them to calculate new velocity vectors, for all bodies. Uses them to calculate a new positions, for all bodies. And then moves them to the new position. So each 0.03 second all the bodies move a tiny bit. And watching this in real time, makes it look like a continous motion, around the sun.
However this means a lot of varibels. Five varibels for each orbiting body. 155 varibels for having, 1 earth and 30 asteroids. Or 255 varibels for having 1 earth and 50 asteroids. But when runing this map, nothing is wrong the first 10-20 seconds. So the problem is not that the varibels are to many, and my computers processer to weak. Having checked and re-checked the loops of my triggers finding no errors (it could be that the clever people in this community, could find an error though ) I think that the problem is else where.
I think that the "warcraft game program" somehow memories all previous values of varibels. And this causes the game to slowly be flooded with old varibels, as every 0.03 new second another 155-255 new varibels will have to be memerised.
Do you know a way to stop the game from remembering old varibels? And could those of you knowing "JASS", tell me if it would be easier to make this in "JASS"?? All segustions to this problem are welcome.
I hope to hear from you. Thank you very much.
Kindly Orange Cat
PS: I am new to this site and dont know how to post my map. But would like to do so, making it easier for you to see the problem. How to do so?
First of all: Thanks to, WILLTHEALMIGHTY for the sun, RightFieldfor the earth and wertyn for the background stars.
In a map, I have created a miniatur solar system. It is very simpel, only containing a sun, an "earth" and a asteroid field. However there is 30-50 asteroids. All asteroids and the earth is orbiting the sun using real gravitionell physics. I think that it looks beatifull! At least for the first 10-15 seconds. Then warcraft 3 starts to lag, and later go "not responding".
All the motion of planet and asteroids have been done with triggers. Each celestial body has a varibel for: its position, its velocity in X direction, Velocity in Y direction. And X and Y vectors for the sun's gravitionell Pull, could also be called acceleration vectors.
Every 0.03 second a trigger calculate new vectors for the gravitionell Pull, for all bodies. Then uses them to calculate new velocity vectors, for all bodies. Uses them to calculate a new positions, for all bodies. And then moves them to the new position. So each 0.03 second all the bodies move a tiny bit. And watching this in real time, makes it look like a continous motion, around the sun.
However this means a lot of varibels. Five varibels for each orbiting body. 155 varibels for having, 1 earth and 30 asteroids. Or 255 varibels for having 1 earth and 50 asteroids. But when runing this map, nothing is wrong the first 10-20 seconds. So the problem is not that the varibels are to many, and my computers processer to weak. Having checked and re-checked the loops of my triggers finding no errors (it could be that the clever people in this community, could find an error though ) I think that the problem is else where.
I think that the "warcraft game program" somehow memories all previous values of varibels. And this causes the game to slowly be flooded with old varibels, as every 0.03 new second another 155-255 new varibels will have to be memerised.
Do you know a way to stop the game from remembering old varibels? And could those of you knowing "JASS", tell me if it would be easier to make this in "JASS"?? All segustions to this problem are welcome.
I hope to hear from you. Thank you very much.
Kindly Orange Cat
PS: I am new to this site and dont know how to post my map. But would like to do so, making it easier for you to see the problem. How to do so?