• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Solar System Crash

Status
Not open for further replies.
Level 1
Joined
Feb 2, 2009
Messages
2
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?
 
Level 1
Joined
Feb 2, 2009
Messages
2
Hello again

Dont bother to answer my message, as I found a lot of usefull info, reading the trigger-tutorial. The problem is due to "leaking", and I am now hunting leaks, in my triggers. The solar system is now stabel for 10 minutes instead of 10 seconds. And i'm still searching for leaks, hoping to improve stability.
 
Status
Not open for further replies.
Top