| 04-29-2007, 11:06 PM | #1 |
After alot of testing and fixing, i managed to make this system as fast as i can still with customizeability. When running pure system power, without any external functions it can get up to 300 objects with all collisions (object collision and terrain) lagfree. It can handle like 50 object collisions at the same time lagfree, maybe more but not sure. Still i have to fix the rolling, that part still sux atm. Seems like i have been too arrogant, if i just listened to grim001 and used real physic laws :P but it isnt much to do to fix this anyway. Anyway, here is my system, it isnt completed, this is just to show how it is so far. to grim001: using unit group increased object collision performance alot!. But sadly using loop is still faster than using unit group in terrain collision. |
| 04-29-2007, 11:22 PM | #2 |
First of all, please spell "acseleration" correctly within your engine, it is "acceleration" JASS:
local group InRange = CreateGroup()
set CurrentMotion = M
//---
call GroupEnumUnitsInRange(InRange,pX,pY,(MaxRadius+C.Radius+10),null)
call ForGroup(InRange, function CollisionCalculationLoop)
call DestroyGroup(InRange)
It seems like you have added bounciness and friction and well as increasing the performance, good job on that. Although the actual sliding and collisions aren't very well shown in the demo map, so I can't tell if it's working correctly. The biggest problem is that the code is too ugly, so I don't really want to look at it in-depth, it hurts my eyes. |
| 04-29-2007, 11:37 PM | #3 |
i know that it looks very ugly, even i have problems :P But its only the calculation part that looks bad, im not good at naming them. And thnx for pointing out that acceleration thing... but i dont wanna rename it all now :P But using global group is nice, i made this in hurry so didnt think much of it. i even forgot to not double collision check. so here it double check alot! Which means bad for performance. The sliding doesnt works correctly now, but it does make it hard to climb up the cliffs. I will try fix these things tomorrow and reupload. |
| 04-29-2007, 11:51 PM | #4 |
Throw the code into Notepadd++ / Textpad / dreamweaver / anything. Use Find & Replace. Replace every instance of 'acseleration' with 'acceleration' in 1 second. Not exactly hard to do.. |
| 04-30-2007, 01:36 AM | #5 |
I know that, but i dont want to replace ^^ |
| 04-30-2007, 01:58 AM | #6 |
Wow; that's just lazy. |
| 04-30-2007, 02:56 AM | #7 | |
Quote:
|
| 04-30-2007, 03:35 AM | #8 |
i know i know, sry. But no one care about the name anyway -.- Its just some vars. Also i just discovered there was a huge bug in my system, not cus of code but cus of wc3. I used 2 hours try figure out, but finally i figured out problem, which is that UnitsInRange does not count units with locust ability, so all my projectiles tat was supposed to collide didnt collide with eachother, but only with mountainking, that is why it was so damn fast. I was surprised too tat it could run over 70 objects lagfree with object collision. But now when that is fixed by not adding locust, it isnt that fast anymore :( It is still alot faster than the old one where i used loop, but not like 70 objects. Now it can only handle 15-17 object collisions at the same time without lag. And 23-27 collisions on above 40fps. And also ExecuteFunc and function interface isnt much different in performance, pretty much the same from my tests. Also wanna ask if anyone know if there is possible to get units in range even the units have locust? |
| 05-01-2007, 07:14 PM | #9 | |||
MaD[Lion] well nice sys at all ! i just checked it and well looks nice but i got 5-15 fps (no video stress) =(. in whole i like you don't "give up" and continue modifing ur sys ! now something more about =) Quote:
Quote:
Code:
... call UnitAddAbility(u,'Caos') // your allterantive unit. the unit id must be different ! call UnitAddAbility(u,'Aloc') ... and btw i'm not 100% sure what UnitInRange event will work with this unit's but i think it will ! Quote:
1) MORE handly for usage 2) well my current test (just yet tested !) shows what ExecuteFunc() is only ~2.1x slower than to use TriggerEvaluate() // btw i use more realistic conditions for testing so i run it in a loop to show "performance under preasure" and this tests have ever shown logicaly results ! as for me i trust this results... i thinks thats all ^^ |
| 05-01-2007, 10:19 PM | #10 | |
Quote:
Wrong. Locust units cannot be obtained from anything, except for variables pointing directly to the unit (kind of like a local unit). And regions are just a group of rects; you create a rect or more, and assign them to a region. |
| 05-02-2007, 02:55 AM | #11 |
unit in range event ignore locust units BUT they still in game, enum in rect will group them well. |
| 05-02-2007, 04:33 AM | #12 | |
Quote:
Seriously? hmm... I don't think so, cause I tried locust units for my pathing system's nodes and I could not add locust units in radius to a group. I also had another map a while back that had locust units move about a board. I could not detect when they entered a region, but I could detect when their order became 0 (hence they arrived) and then move them to the next region. |
| 05-02-2007, 07:04 AM | #13 |
Locust units can also be picked up by picking all units of a player and I think all units of type. |
| 05-02-2007, 02:53 PM | #14 |
well Toadcop - right DioD - wrong... Ammorth - wrong... blu_da_noob - right // if you don't belive you can simple test it... |
