Cluster system

For code related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Cluster system

Post by aubergine »

Anyone know what clusters are used for elsewhere in the codebase?

https://github.com/Warzone2100/warzone2 ... luster.cpp
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
i-NoD
Code contributor
Code contributor
Posts: 318
Joined: 30 Nov 2008, 00:42
Location: In the middle of nowhere

Re: Cluster system

Post by i-NoD »

Aren't those for sp remote missions?
Keeps your droid/buildings aside from homebase forces.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Cluster system

Post by aubergine »

Not sure - it looks like it's used in skirmish and mp too, but I'm not exactly sure what for.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
i-NoD
Code contributor
Code contributor
Posts: 318
Joined: 30 Nov 2008, 00:42
Location: In the middle of nowhere

Re: Cluster system

Post by i-NoD »

What makes you think its in mp?
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Cluster system

Post by aubergine »

I've just seen it used in several cpp files so far, and there doesn't seem to be any checks regarding campaign mode to filter out its use.

From what I can see the cluster code is actually finding clusters of droids/structures on the current map/level and then it's used in a bunch of other source files throughout WZ. If you grep to find files that include it and then look for cluster related stuff in them you'll see what I mean.

Note: I'm still struggling to understand the C code fully, so I could be totally wrong.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
i-NoD
Code contributor
Code contributor
Posts: 318
Joined: 30 Nov 2008, 00:42
Location: In the middle of nowhere

Re: Cluster system

Post by i-NoD »

No one told that one may only use that code in sp, simply put this code just idling when called from mp or skirmish.

Here is the entry point for droid: void clustNewDroid(DROID *psDroid)
Look into it, the only way for droid to be added is when current apsDroidLists has non-default cluster. Now you have to check when apsDroidLists assigned a non-default cluster. I haven't checked, but if memory serves me well its done when you go into remote missions...
Post Reply