| 09-25-2008, 04:55 PM | #1 |
Ya 600 dynamicaly moving and colliding spheres =) // no i don't have a quad core CPU :P here is the demo map. ©Toadcop xD loled... |
| 09-25-2008, 05:04 PM | #2 |
Oh, the food quantity is the number of balls, not "COUNT" That is a lot of balls; it is almost as though each ball is executing almost no code per interval, which would explain why they bounce and collide in such an ugly way... Here's my demo. |
| 09-25-2008, 05:35 PM | #3 |
i want to try this tonight when I get home, I bet I can't get mine above 75-85w/o massive fps drops, and that is with a damn good CPU and GPU |
| 09-25-2008, 05:35 PM | #4 |
Mine dies out at around 50. Edit: The food count is at 600, but the moving balls are at 50. It's probably important to note also that when the food is at 600 and there are 0 moving balls, my framerate is still shit. And yes, I obviously did test it toadcop... |
| 09-25-2008, 05:37 PM | #5 | ||
n/c ... test before post something =) Quote:
grim001 well you demo is slow ~35 fps. Quote:
|
| 09-25-2008, 06:16 PM | #6 | |||
Quote:
Quote:
Quote:
The "other stuff" is the fact that your collision and bouncing are so flawed that they are useless. |
| 09-25-2008, 06:25 PM | #7 |
What I want to know is... WHY? Why would you want 500 balls in a map? Anyway, my partially-GUI physics system can't do 500 balls playably but it can do a more reasonable amount, like about 100 or so. |
| 09-25-2008, 09:20 PM | #8 |
I think he may compile jasshelper and other stuff externally to the WE. I had similar problems running Vex's hero contest 2 entry. |
| 09-25-2008, 09:38 PM | #9 |
Sure 600 balls can be present without moving at full fps for me, but it starts dropping when the moving amount is around 50... |
| 09-25-2008, 09:40 PM | #10 | ||
Quote:
war3map.j -> JASS:function Nr takes nothing returns boolean set Xv=GetUnitUserData(GetFilterUnit()) if Xv!=0 and Ve[Xv]!=Ve[Ev]and not IsUnitInGroup(Ve[Xv],Ee[Ev])then call GroupAddUnit(Ee[Xv],Ve[Ev]) set jv=false set Ov=Xe[Ev] set Rv=Oe[Ev] set Iv=Xe[Xv] set Av=Oe[Xv] set Gv=le[Ev]+le[Xv] set hv=Le[Ev] set Hv=Le[Xv] set Nv=Mx[Ov]-Mx[Iv] set bv=px[Ov]-px[Iv] set Bv=Px[Ov]-Px[Iv] set cv=Mx[Rv]-Mx[Av] set Cv=px[Rv]-px[Av] set dv=Px[Rv]-Px[Av] if Nv*Nv+bv*bv+Bv*Bv<(Gv-D)*(Gv-D)then set Dv=SquareRoot(Nv*Nv+bv*bv+Bv*Bv)+.001 set fv=(Dv-Gv)/(Dv*(hv+Hv)) set Mx[Ov]=Mx[Ov]-Hv*Nv*fv set px[Ov]=px[Ov]-Hv*bv*fv set Px[Ov]=Px[Ov]-Hv*Bv*fv set Mx[Iv]=Mx[Iv]+hv*Nv*fv set px[Iv]=px[Iv]+hv*bv*fv set Px[Iv]=Px[Iv]+hv*Bv*fv set be[Ev]=true set be[Xv]=true set Nv=Mx[Ov]-Mx[Iv] set bv=px[Ov]-px[Iv] set Bv=Px[Ov]-Px[Iv] set gv=.0 set jv=Nv*cv+bv*Cv+Bv*dv<.0 else set Dv=cv*cv+Cv*Cv+dv*dv if Dv>.001 then set fv=Nv*cv+bv*Cv+Bv*dv set Fv=fv*fv-Dv*((Nv*Nv+bv*bv+Bv*Bv)-Gv*Gv) if Fv>=.0 then set gv=-(fv+SquareRoot(Fv))/ Dv set jv=gv>=.0 and gv<=N endif endif endif if jv then set Ae[Ev]=Ae[Ev]+gv set Ae[Xv]=Ae[Xv]+gv set Mx[Ov]=Mx[Ov]+Mx[Rv]*gv set px[Ov]=px[Ov]+px[Rv]*gv set Px[Ov]=Px[Ov]+Px[Rv]*gv set Mx[Iv]=Mx[Iv]+Mx[Av]*gv set px[Iv]=px[Iv]+px[Av]*gv set Px[Iv]=Px[Iv]+Px[Av]*gv set Dv=SquareRoot(Nv*Nv+bv*bv+Bv*Bv)+.001 set Nv=Nv/ Dv set bv=bv/ Dv set Bv=Bv/ Dv set fv=(Nv*(Mx[Rv]-Mx[Av])+bv*(px[Rv]-px[Av])+Bv*(Px[Rv]-Px[Av]))*(1.+ue[Ev]*ue[Xv])/(hv+Hv) set Mx[Rv]=Mx[Rv]-Hv*Nv*fv set px[Rv]=px[Rv]-Hv*bv*fv set Px[Rv]=Px[Rv]-Hv*Bv*fv set Mx[Av]=Mx[Av]+hv*Nv*fv set px[Av]=px[Av]+hv*bv*fv set Px[Av]=Px[Av]+hv*Bv*fv set Dv=-fv*hv*Hv*(1./ ue[Ev]*ue[Xv]) if Dv>Ue[Ev]then set Jv=Ge[Ev] loop exitwhen Jv<0 call Go(Ce[de[Ev]+Jv],Xv,Dv) set Jv=Jv-1 endloop endif if Dv>Ue[Xv]then set Jv=Ge[Xv] loop exitwhen Jv<0 call Go(Ce[de[Xv]+Jv],Ev,Dv) set Jv=Jv-1 endloop endif set kv=We[Ev] if kv!=0 and Dv>ye[Ev]then set Kv=Hx[jx[kv]+GetRandomInt(0,Jx[kv])] call SetSoundVolume(Kv,R2I(((Dv-ye[Ev])*Ye[Ev])*1.27+.5)) call AttachSoundToUnit(Kv,Ve[Ev]) call StartSound(Kv) endif set kv=We[Xv] if kv!=0 and Dv>ye[Xv]then set Kv=Hx[jx[kv]+GetRandomInt(0,Jx[kv])] call SetSoundVolume(Kv,R2I(((Dv-ye[Xv])*Ye[Xv])*1.27+.5)) call AttachSoundToUnit(Kv,Ve[Xv]) call StartSound(Kv) endif endif endif return false endfunction it's the Enum callback aka collision algorithm. Quote:
every unit in range requires TriggerEvaluate action + stuff inside of the callback. |
| 09-25-2008, 09:50 PM | #11 |
I'm fairly sure having 600 units moving at once is the cause of the lag, not GroupEnumUnitsInRange. The damned game isn't designed to support having 600 units moved at once, even without triggers in the whole map that rapes my computer. |
| 09-25-2008, 09:56 PM | #12 |
Well you said in the first post that 600 can be dynamically moving and colliding, which isnt really the case, only around 50 - 100 can be moving and colliding before alot of lag |
| 09-25-2008, 10:08 PM | #13 | ||
show me an other map with 600 active objects =) (war3) aka you can manipulate them at any time and you will get the request completed. in my case is simply don't waste performance on objects which does have to low action (movement). and in fact it's the whole sense of this demo =) what uneeded objects should be switched of. (it's like in any normal physic engine is (not wc3 =)) ) and the other part of the story is what. 1) jass is slow 2) war3 have own limitations on moving alot of units. Quote:
Quote:
he allways optimized his oe. btw |
| 09-25-2008, 10:16 PM | #14 | |
Quote:
|
| 09-25-2008, 10:41 PM | #15 |
So I tested it with 600 balls, the most moving I could get was around 60. No lag at all, and I was running WoW in the background too. [edit] Tested it a little more still with half of my CPU being taken by wow, I started lagging at 900 balls with 100 moving. So people who are lagging without anything moving at all need to get new computers. |
