Move along...
Move along...
Upon reading a post.... I decided to do some tests. (Let's see who will count up all the units there...)
Slide show time!
Ack, this is too slow....
Come on, move! move!
I said MOVE!
I can't take it anymore... All is well again!
Yeah, as I thought.Slide show time!
Ack, this is too slow....
Come on, move! move!
I said MOVE!
I can't take it anymore... All is well again!
/facepalm ...Grinch stole Warzone contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Super busy, don't expect a timely reply back.
Re: Move along...
Anyway, this is still basically the same Warzone engine as Pumpkin released it.
Sure, some things have changed since then, but, the bottom line is, the engine, as it stands now, can't handle anymore units than it could back then, ever since it was released.
Yes, we have 10p games ability, but, unless the host and most everyone else playing have a very good machine with a fast CPU, it becomes a lag-a-thon, with people seeing the "Zzz" trying to sync up to the slowest player. It isn't uncommon to have games run under 10 fps. That isn't fun.
The engine itself just isn't capable of displaying tons of units.
There are little to no optimizations done, and it shows.
While things are slowly changing, people should always keep in mind this is a very old engine!
Sure, some things have changed since then, but, the bottom line is, the engine, as it stands now, can't handle anymore units than it could back then, ever since it was released.
Yes, we have 10p games ability, but, unless the host and most everyone else playing have a very good machine with a fast CPU, it becomes a lag-a-thon, with people seeing the "Zzz" trying to sync up to the slowest player. It isn't uncommon to have games run under 10 fps. That isn't fun.
The engine itself just isn't capable of displaying tons of units.
There are little to no optimizations done, and it shows.
While things are slowly changing, people should always keep in mind this is a very old engine!
/facepalm ...Grinch stole Warzone contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Super busy, don't expect a timely reply back.
- Terminator
- Regular
- Posts: 1077
- Joined: 05 Aug 2006, 13:46
- Location: Ukraine
- Contact:
Re: Move along...
Is it possible that all this slows causing only path-finding ? and all load only on CPU, GPU usually idle or 10-15% max. I remember some guy a half a year back wanted to improve path-finding ...may be hire some freelancers from donation fond if there anything left at all, if only I'm right out path-finding.
Death is the only way out... sh*t Happens !
Russian-speaking Social network Group http://vk.com/warzone2100
Russian-speaking Social network Group http://vk.com/warzone2100
Re: Move along...
clustAddDroid() is at 25% in perf-top with ~400 droids (which means that ~25% of CPU instructions are executed directly inside this function, neither in its backtrace nor in sub-functions), above everything else (second place NEXTOBJ::operator DROID*<DROID>() const with 6%).
On 3.1, pie_Draw3DShape2() eats twice as much as clustAddDroid(), which indicates that graphics engine updates in master were actually quite effective.
P.S. This O(n) loop through all droids inside clustAddDroid() looks suspicious ... hmm, aint it recursive as well? No, i guess not too much recursive, just O(n). Probably resulting in O(n^2) time per frame.
P.P.S. Not sure, but the way NullBot does cluster analysis (re-clustering all objects on timer ticks) might actually be more effective
P.P.P.S. What does cluster.cpp do, anyway, apart from calling WZScript Seen and Attacked events and JavaScript Seen events? If nothing, then maybe just remove the whole system? We would soon hopefully scrap WZScript, and JavaScript's eventObjectSeen is not useful anyway (too throttled, and throttling can be done equally well without clustering).
P.P.P.P.S. Removing the inner loop in clustAddDroid() allows me to run smoothly at ~20fps at 400 own droids on screen (on master). Normally, the loop causes periodic lags (~2 seconds smooth, then lag for a little while, then again smooth).
On 3.1, pie_Draw3DShape2() eats twice as much as clustAddDroid(), which indicates that graphics engine updates in master were actually quite effective.
P.S. This O(n) loop through all droids inside clustAddDroid() looks suspicious ... hmm, aint it recursive as well? No, i guess not too much recursive, just O(n). Probably resulting in O(n^2) time per frame.
P.P.S. Not sure, but the way NullBot does cluster analysis (re-clustering all objects on timer ticks) might actually be more effective
P.P.P.S. What does cluster.cpp do, anyway, apart from calling WZScript Seen and Attacked events and JavaScript Seen events? If nothing, then maybe just remove the whole system? We would soon hopefully scrap WZScript, and JavaScript's eventObjectSeen is not useful anyway (too throttled, and throttling can be done equally well without clustering).
P.P.P.P.S. Removing the inner loop in clustAddDroid() allows me to run smoothly at ~20fps at 400 own droids on screen (on master). Normally, the loop causes periodic lags (~2 seconds smooth, then lag for a little while, then again smooth).
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
- Goth Zagog-Thou
- Regular
- Posts: 1582
- Joined: 06 Jan 2007, 08:08
- Location: Delta Base
- Contact:
Re: Move along...
What got changed, exactly? I'm a little confused. The color of the units?
Never mind, I see it now. Heh.
Never mind, I see it now. Heh.
Re: Move along...
For the path finding, we don't compute the path for every unit you have in a frame.
We only do X units, then next frame X more, and so on.
For the other stuff... unsure, would have to re-read the code.
We only do X units, then next frame X more, and so on.
For the other stuff... unsure, would have to re-read the code.
/facepalm ...Grinch stole Warzone contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Super busy, don't expect a timely reply back.
Re: Move along...
we currently use A* right?, i personally think FlowField was best.vexed wrote:For the path finding, we don't compute the path for every unit you have in a frame.
We only do X units, then next frame X more, and so on.
For the other stuff... unsure, would have to re-read the code.
i tried to make one but implementation requires high amount of system resource and it requires a "battle formation" which wz does not have.
Re: Move along...
Yes, A*.
The main problem isn't the search per se, that is fairly standard.
It is the other stuff.
While flowfield is an option, that won't solve everything wrong with the 'pathing' routines.
The main problem isn't the search per se, that is fairly standard.
It is the other stuff.
While flowfield is an option, that won't solve everything wrong with the 'pathing' routines.
/facepalm ...Grinch stole Warzone contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Super busy, don't expect a timely reply back.
Re: Move along...
We use A* over map passabilty. (accounting walls but not units). A little tweak could account for terrain movement speed without too much cost. I already tried that.
Also mentionned previously that adding a function that increase the resistance of the tile which are encumbered on the left side. Would most likely dramaticaly reduce the traffic jams in chokepoint. But nobody listen to me anyway...
Also mentionned previously that adding a function that increase the resistance of the tile which are encumbered on the left side. Would most likely dramaticaly reduce the traffic jams in chokepoint. But nobody listen to me anyway...
Heretic 2.3 improver and proud of it.
Re: Move along...
Hmm, nobody listens to whiners ? Imagine that.
You also got a knack for stating the obvious.
Anyway, NoQ, looking at an analysis, I get:
Looking at clustAddDroid() seems to me that this whole system needs to be rewritten.
Right now, thinking of something along the lines of using AABB to fix this mess.
That will get us out of the WZ brute force approach. (Could also use the same to fix the rendering pipeline... )
You also got a knack for stating the obvious.
Anyway, NoQ, looking at an analysis, I get:
Code: Select all
clustAddDroid
PointTree::queryMaybeFilter<0>(class PointTree::Filter &,int,int,int,int)
avUpdateTiles(void)
drawTerrain(void)
pie_RotateProject(struct Vector3i const *,struct Vector2i *)
pie_ActivateShader(int,struct iIMDShape *,union PIELIGHT,union PIELIGHT)
_alldiv
pie_Draw3DShape2
SyncDebugIntList::set(unsigned int &,char const *,char const *,int const *,unsigned int)
gridStartIterateFiltered<ConditionTrue>
pie_RemainingPasses(void)
_allmul
glm::rotate<float>(struct glm::detail::tmat4x4<float> const &,float const &,struct glm::detail::tvec3<float> const &)
pie_TRANSLATE(int,int,int)
Right now, thinking of something along the lines of using AABB to fix this mess.
That will get us out of the WZ brute force approach. (Could also use the same to fix the rendering pipeline... )
/facepalm ...Grinch stole Warzone contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Super busy, don't expect a timely reply back.
Re: Move along...
That's on 3.1, right? I'm not having this anywhere near the top on -master....
pie_Draw3DShape2
...
The system is only useful for wzscript, right? I'm still not sure it's worth fixing rather than removing.Looking at clustAddDroid() seems to me that this whole system needs to be rewritten.
Right now, thinking of something along the lines of using AABB to fix this mess.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Move along...
No, this was master.
Why, what does your findings show ?
As for the cluster system itself, I didn't look at what exactly uses it, I just looked at the brute force approach that pumpkin did.
Why, what does your findings show ?
As for the cluster system itself, I didn't look at what exactly uses it, I just looked at the brute force approach that pumpkin did.
/facepalm ...Grinch stole Warzone contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Super busy, don't expect a timely reply back.
Re: Move along...
No, if you look a bit closer, you would see that both systems use (need) it.NoQ wrote: The system is only useful for wzscript, right? I'm still not sure it's worth fixing rather than removing.
eventFireCallbackTrigger(...); is indeed for wzscript
triggerEvent____(...); is for qjscript
So, for example, eventFireCallbackTrigger((TRIGGER_TYPE)CALL_DROID_SEEN);
we have triggerEventSeen(psViewer, psObj);
/facepalm ...Grinch stole Warzone contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Super busy, don't expect a timely reply back.
Re: Move along...
I believe that cluster-based eventObjectSeen is not useful anyway. In fact, i cannot comprehend what's good about clusters for eventObjectSeen; there are easier and lighter ways of making it worse.me, a few posts above, wrote:JavaScript's eventObjectSeen is not useful anyway (too throttled, and throttling can be done equally well without clustering).
p.s.: whoops, forgot to post my perf-top, maybe tomorrow.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Move along...
So how would we like eventObjectSeen() to work?
Let's say we have two hundred unseen enemy units, and suddenly the map is revealed. Should the scripting engine fire off 200x eventObjectSeen() at once?
One solution is simply to queue them up, and rate limit how many we fire each script frame. (We always have 10 script frames each second.) Say we only fire off max 20 eventObjectSeen() each script frame. That means you could be handling the reveal of some of them a second after the fact. But that should be okay, I think.
I suppose another option is to queue up all revealed units until the end of the frame, and then fire off a single eventObjectSeen() with a list of revealed units.
Let's say we have two hundred unseen enemy units, and suddenly the map is revealed. Should the scripting engine fire off 200x eventObjectSeen() at once?
One solution is simply to queue them up, and rate limit how many we fire each script frame. (We always have 10 script frames each second.) Say we only fire off max 20 eventObjectSeen() each script frame. That means you could be handling the reveal of some of them a second after the fact. But that should be okay, I think.
I suppose another option is to queue up all revealed units until the end of the frame, and then fire off a single eventObjectSeen() with a list of revealed units.