Overzealous Scavs

Ideas and suggestions for how to improve the Warzone 2100 base game only. Ideas for mods go in Mapping/Modding instead. Read sticky posts first!
Post Reply
User avatar
Olrox
Art contributor
Posts: 1999
Joined: 03 Jul 2007, 19:10

Overzealous Scavs

Post by Olrox »

Okay, this is something that has been bugging me for some time now, but I think that it may actually be a fairly simple solution to a problem that simply disallows some very nice map features.

I'm talking about "Overzealous Scavengers".

They are those folks who walk all the way across any map, with rivers or not, cliffs or not, defenses or not - anything that blocks everything but at least one tile of passage. They will even find their way through mazes just because one of their units have been attacked - every single one but those absolutely blocked (can be done with structures).

This simply ruins the possibility of having multiple scav bases, like we have on campaign, which is a pity because it's much nicer to have scattered scav forces instead of a huge pile of them - allows rush prevention and values scouting even more, if they are all over the map in small quantities.

I mean, the way they currently are, you just have to attack one of them, and then watch their trajectories, wiping them with flamers (they are too busy going help their comrades), and it is very annoying to have two hundred scavengers and fifty buggies down on a corner, also.

Thinking about that during a short time, I've came up with a nice idea, that shouldn't be too hard to implement, I believe. This would be the addition of an "Aid Radius".

This is simply a radius (in tiles) that limits the range of the "zeal" of the scavs. Within this set radius, they would aid other units, just like they do, but they wouldn't move outside of this radius to aid other units. Personally, I think that, to simplify the calculations, this radius could function not from the unit, but from a more resonably important target - scav base structures. Every unit within a set radius from every scav-owned base structure will run to the structure to defend it, if it is attcked.

This radius could be something reasonable, like, let's say, some 24 tile radius. This way, in a 256x256 map, the theoretical maximum number of completely independent scav bases would be (256x256):(πx24)^2 = 11.5, which would give us, considering a practical usage of 70% of the space, a total of 8 feasible independent scav bases (if the map maker concentrate on this and gives due attention to bas spacing).

Of course I'm simply speculating values, and there's also the fact that if you place a base in the edges of the map, their "ais area" would be halved, and if on the corners, would be only a quarter of the value I've used in my "(πx24)^2". perhaps the radius could be even smaller, I think. 256x256 maps are huge, having a maximum of 8 bases wouldn't be that great :P

The fact is that, the current way things are, we can't even have 2 separate bases with units inside, that they are going to concentrate wherever you attack them, never returning to their original places.

Therefore, I kindly ask that the devs think about it, and give me an evaluation of the idea (in terms of feasibility/if we could see that in the near future/it's a goodxbad idea) :)

That would very well allow/disallow a whole dimension I'm trying to implement in The Lost River, and would certainly help every single map maker that wants to use scavs in their creations.

Thanks from this very moment for your attention,

~Olrox
skype272
New user
Posts: 4
Joined: 29 Mar 2010, 23:13

Re: Overzealous Scavs

Post by skype272 »

Great idea man
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Overzealous Scavs

Post by Per »

If you send me the map with the problem, I will look into makes some changes to the scav script. It should not be difficult. There must be a building that is present in each scav base that it can use as a return-to-base marker, I suppose this will be a scav factory?
User avatar
Olrox
Art contributor
Posts: 1999
Joined: 03 Jul 2007, 19:10

Re: Overzealous Scavs

Post by Olrox »

Per wrote:If you send me the map with the problem, I will look into makes some changes to the scav script. It should not be difficult. There must be a building that is present in each scav base that it can use as a return-to-base marker, I suppose this will be a scav factory?
Hi Per, glad to see you're willing to help with that.

I'm currently working in The Lost River, so I think that it'll take some time until I can send it for you to make those scripts on it. I thought about this issue when I was testing if, and remembered that the same problem used to occur in Garond Valley (which has 3 bridges, held by scavengers).

Since it's a generalized issue with scavenger AI, perhaps it'd be better to solve it once and for all, don't you agree? I mean, of course I won't hurry you, but it's definetely something I think that should be added to the to-do list ASAP, because, as I said, it opens new horizons for pure map-making (without scripting scavs like you propposed), which is very interesting since we can get more diverse maps if this improvements are made (I wouldn't feel ok to continue developing TLR if the scavs would act like they do when I release it, it wouldn't be nice. And if you can change the AI script to avoid having to change every single scavenger-supporting map's script, why living with this issue?).

I don't have the slightest idea of how hard or time-consuming it would be to add the "Aid Radius" to the standard scav AI, but I do guess that it would be a effective solution to the problem, removing a huge deal of necessity to make scripts for the map to make up for AI issues.

If those changes (or any other better solution to this same problem) are unlikely to happen in the next 1-2 months, I'll gladly accept your offer to help me with the scripts for The Lost River, I appreciate that very much if you can do this favor to me.

Thanks for the answer!
skype272 wrote:Great idea man
Thanks :)

~Olrox
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Overzealous Scavs

Post by Per »

Yes, the change can be general for all maps. I can make the 'aid radius' change in like 5 minutes when I back at my dev box, but the difficult issue is how to make them return to (the correct) base once their attack is done, since I am not sure what/where their closest 'base' means. Should they return to the closest scav owned building, or closest scav factory, or something else?
User avatar
Olrox
Art contributor
Posts: 1999
Joined: 03 Jul 2007, 19:10

Re: Overzealous Scavs

Post by Olrox »

Per wrote:Yes, the change can be general for all maps. I can make the 'aid radius' change in like 5 minutes when I back at my dev box, but the difficult issue is how to make them return to (the correct) base once their attack is done, since I am not sure what/where their closest 'base' means. Should they return to the closest scav owned building, or closest scav factory, or something else?
I think that making them return to the closest factory would be nice, as the factories are the most important structures for the scavs (do they replenish their forces? I didn't test that yet, but they could build units to replenish their starting forces).

Meanwhile, simply making them only aid something inside a radius, without having to return to their original positions, would be already a good advancement, If you script them to go back to the factory they were near to before aiding their allies, itl be even better, surely! :D

~Olrox
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Overzealous Scavs

Post by Per »

The following script change to data/base/multiplay/script/scavfact.slo will make scavs only attack if within 24 tiles. I need a map to test on to make the return part.

Code: Select all

Index: data/base/multiplay/script/scavfact.slo
===================================================================
--- data/base/multiplay/script/scavfact.slo	(revision 10466)
+++ data/base/multiplay/script/scavfact.slo	(working copy)
@@ -122,10 +122,21 @@
 // watch for structures being attacked. Send the cavalry as required.
 event structureAttacked(CALL_STRUCT_ATTACKED, enemy1, ref structure, ref attacker)
 {
+	local DROID mydroid;
+
 	if ((gameTime - lastAttack) > 300)
 	{
 		lastAttack = gameTime;
-		orderGroupLoc(attackGroup, DORDER_MOVE, attacker.x, attacker.y);
+		initIterateGroup(attackGroup);
+		mydroid = iterateGroup(attackGroup);
+		while (mydroid != NULLOBJECT)
+		{
+			if (distBetweenTwoPoints(attackGroup.x, attackGroup.y,attacker.x, attacker.y) < (24 * 128))
+			{
+				orderDroidLoc(mydroid, DORDER_MOVE, attacker.x, attacker.y);
+			}
+			mydroid = iterateGroup(attackGroup);
+		}
 	}
 }
 
And yes, scav factories do replenish scav forces. Quite quickly, actually.
User avatar
macuser
Regular
Regular
Posts: 1052
Joined: 19 Mar 2010, 23:35
Location: USA
Contact:

Re: Overzealous Scavs

Post by macuser »

how bout making them return to where they were before they were attacked?

-regards macuser
ArtRev Website

ImageImage

System: AMD Phenom II x4, 4GB RAM, 640GB HD, Nvidia GeForce GT 240 1GB, Mac OS X 10.6
User avatar
Olrox
Art contributor
Posts: 1999
Joined: 03 Jul 2007, 19:10

Re: Overzealous Scavs

Post by Olrox »

Hi Per, here's a testmap I've made, I hope it serves the purpose of test course for the "return to base" part of the code.
2c-scavtest.wz
scavtest map.
(4.53 KiB) Downloaded 288 times
There is a large scav base hidden in the rockies, they've managed to recover HPV cannon artifacts and used a local research facility to develop the technology. A group of Super Cyborgs was dispatched to eradicate the installations :geek:
And, of course, observe the behavior of the scavengers as their secondary factories are attacked :wink:
minimap with markers.
minimap with markers.
scavtest minimap.PNG (7.15 KiB) Viewed 6317 times
0 - Your cyborgs' starting position.
1 - Contains 3 scav units, to see how they react to attacks on...
2 - A scav factory with 2 units defending it. Scavengers from the main base shouldn't help it since its distance from the main base should be greater than 24 tiles, but the scavs from spots 1 and 3 should help defend it.
3 - Another scav factory, with a single unit defending it. Scavs from the main base should help to defend it, as well as the units from spot 2 (if they are still alive)
4 - The scav main base, should be helped by scavs on spot 1 and 3 if they are still alive.

Again, thanks for your patience of looking into it, and hope that this map helps you testing the scavs' behavior. I can make it bigger if you want, it is very small right now :P

~Olrox
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Overzealous Scavs

Post by Per »

macuser wrote:how bout making them return to where they were before they were attacked?
The scripting system is not really adequate to store such information.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Overzealous Scavs

Post by Per »

Olrox, the map worked fine, and the new baba script for 2.3 is attached. Just replace the existing one, and it should work.
Attachments
scavfact.slo
Baba script++
(3.83 KiB) Downloaded 317 times
User avatar
Olrox
Art contributor
Posts: 1999
Joined: 03 Jul 2007, 19:10

Re: Overzealous Scavs

Post by Olrox »

Per wrote:Olrox, the map worked fine, and the new baba script for 2.3 is attached. Just replace the existing one, and it should work.
Works like a charm, thank you very much! They are really aiding themselves in a much more coherent manner now.
:D

~Olrox
User avatar
macuser
Regular
Regular
Posts: 1052
Joined: 19 Mar 2010, 23:35
Location: USA
Contact:

Re: Overzealous Scavs

Post by macuser »

Hmm do you think this should be implemented in the game? Just a suggestion.

-regards macuser
ArtRev Website

ImageImage

System: AMD Phenom II x4, 4GB RAM, 640GB HD, Nvidia GeForce GT 240 1GB, Mac OS X 10.6
User avatar
Olrox
Art contributor
Posts: 1999
Joined: 03 Jul 2007, 19:10

Re: Overzealous Scavs

Post by Olrox »

macuser wrote:Hmm do you think this should be implemented in the game? Just a suggestion.

-regards macuser
I don't see a reason why this shouldn't, so probably it will be in the next betas already, I guess.

~Olrox
Post Reply