KillThemAll [Mod]

Need some nice Mods? Here, you are right!
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

KillThemAll [Mod]

Post by JackGriffin »

Made this pickup last night because I was testing some stupid MH maps last night. 600 monsters alive in a map at one time? Hey MH mappers: go fuck yourself. Learn what a creature factory is and then use them. Seriously. One map I tested had a monster count that was in the high 900's. -Deleted-

What it does:
Summon the item as admin. It's an inventory item. Pick it up. When activated it will start destroying 2 monsters per second across the map. Can be turned off and on as much as you like. Killed monsters are credited to the person with the item so it will not break triggers, etc. It looks like this:
PIeANH7HM1w

Summon with "KillThemAll.KillThemAll"

Feel free to convert this so it will only kill visible monsters or monsters in proximity to you, whatever floats your boat. I just needed it to clear maps in a way that preserved functionality.
KTA.zip
(95.68 KiB) Downloaded 121 times
Actor and source. As always use any way you like.
So long, and thanks for all the fish
User avatar
FXANBSS
Skilled
Posts: 231
Joined: Thu Dec 26, 2013 7:03 pm

Re: KillThemAll [Mod]

Post by FXANBSS »

I have played maps with 2000 monsters at the same time, monsters that explode in more monsters.

Since isn't possible to have more than 1100 monsters in UED when saving, then put a lot of spawn points and creature factories and instantly trigger them, i have some tons of lag.

They are just a few.
Image
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: KillThemAll [Mod]

Post by sektor2111 »

JackGriffin wrote: Hey MH mappers: go fuck yourself. Learn what a creature factory is and then use them.
:oops:
Yo ! Those people making such things are not mappers, so you might refrain a little bit. :? - I'm kidding (maybe)...

Else it's an interesting idea to get rid of excessive "content" slowing down everything.

My initial, idea was to track them inside an iterator if are linked with something. Monsters linked would be intended to get killed by hunters in order to "enjoy the moment". Useless creatures spamming Level would be removed randomly (causing a different Level appearance from a session to another). Tuesday night was a monster in that spot, Thursday nothing was there :wink: .
FXANBSS wrote: Since isn't possible to have more than 1100 monsters in UED when saving, then put a lot of spawn points and creature factories and instantly trigger them, i have some tons of lag.
Can you stop posting non-senses ? Did you ever see maps MH-MeltTown ? How about MH-Crescendo ? I can list others as well but I'm not really interested.

Aside, I might write something as described above with priority to remove Non-Stock manure.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: KillThemAll [Mod]

Post by JackGriffin »

If you don't do this Nels I think I might. I'm going to create this as a 'cheat' command on my server. I think I'll set it so that it just destroys all non-critical monsters in a map if the player chooses exploration mode instead of combat mode. Let me know what you do with this, I'd like to use it too.
So long, and thanks for all the fish
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: KillThemAll [Mod]

Post by sektor2111 »

First I have to be clear, because if I'll get drunk for sure Xidia craps are going to be replaced with pupaes or destruction (lotery mod ?).

Let's say shortly: foreach.. if S.Event != "" ... foreach with tag something = Exception. Else if FRand() > whatever,
then Monster.died.... somehow pulverized by... a toy-gun. Might lag the start but later will be smoother.

I'm guessing it will be priceless even after 1 second.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: KillThemAll [Mod]

Post by JackGriffin »

It's better to tie it to a timer Nels and let the monsters delete in order versus all at once. It will save the player from seeing server pausing while the actor list gets all reordered. If you use the code I posted it will work just fine. I set the timer to a half second but it was running as one-tenth a second without any problems. That was just too fast to allow the owner to toggle it where they specifically wanted in the monster count. If you are going to run this in the background in postbegin then there's no reason not to let it cycle pretty fast.
So long, and thanks for all the fish
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: KillThemAll [Mod]

Post by sektor2111 »

Alternate version.

Introducing a bit of load:
[attachment=1]Spam.JPG[/attachment]

Introducing smoothing at 300 pieces using stepping iteration:
[attachment=0]NoSpam.JPG[/attachment]

I think I'll do some testing and if things are cute will be a ServerActor as follows:

Code: Select all

class NoSpam expands Actor;

var bool bMapAnalized, bNeedDestroy;
var int NumPwn, Stepping;

event PostBeginPlay()
{
	log (Self$" loaded and started...");
	SetTimer(Level.TimeDilation,False);
}

function Timer()
{
	local Pawn P;
	local int Step;
	local Actor A;
	local bool bNotThis;

	if ( !bMapAnalized )
	{
		bMapAnalized=True;
		Foreach AllActors( class'Pawn',P ) //Debate all sort of shite including XPawn and so on
		{
			if ( P.PlayerReplicationInfo == None )
			NumPwn++;
			if ( NumPwn > 300 )
			{
				Stepping = Clamp(NumPwn/300,1,NumPwn/300);
				bNeedDestroy=True;
			}
		}
		SetTimer( Level.TimeDilation,False );
		if ( bNeedDestroy )
			log (Self$" reporting "$NumPwn$" creatures. Will allow a creature at each "$Stepping$" creatures aiming 300 pieces." );
		return;
	}
	else
	{
		if ( bNeedDestroy )
		{
			Foreach AllActors (class 'Pawn',P)
			{
				if ( P.PlayerReplicationInfo == None )
				{
					if ( bNotThis )
						bNotThis = False;
					if ( P.Event != '' )
					{
						foreach AllActors (class 'Actor', A, P.Event)
						{
							if ( A != None && A != P ) //Warning!
							{
								bNotThis = True;
								break;
							}
						}
					}
					if ( !bNotThis )
					{
						if ( Stepping > 0 && Step < Stepping  )
						{
							P.LifeSpan = 0.100000;
							NumPwn--;
							if ( NumPwn <= 300 )
								break;
						}
						Step++;
						if ( Step > Stepping )
							Step=0;
					}
				}
			}
		}
	}
}
Put this with no RemoteRole and not a very priority. It's a temporary thing applying 2 hits: 1 - Checking the load, 2 - Removing non-critical creatures until target number is arrived (can be configurable if it needs that).

I well recall that movie called "300" if memory doesn't cheat me... :mrgreen:
Attachments
NoSpam.JPG
Spam.JPG
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: KillThemAll [Mod]

Post by JackGriffin »

Ok, now the creative juices are flowing....I think I'm going to take your actor and add proximity checks so it starts skipping actors that are alone or only have a couple of monsters nearby. This should help 'thin the herd' in a way that won't create empty spots in the map.
So long, and thanks for all the fish
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: KillThemAll [Mod]

Post by sektor2111 »

An Edit
First timer session might wait let's say 3 seconds, if I'm using new tech replacement I don't wanna mess those tiny fragments used, purpose is to wait replacements and tweaks to take place and then garbage out. This (my bad Now) involves Skaarj and wepsy. So I have to add after P.LifeSpan=0.1; something against left-over trash:

Code: Select all

if (P.Weapon != None)
P.Weapon.LifeSpan = 0.100000;
Perhaps that's much better... :|
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: KillThemAll [Mod]

Post by Higor »

Loop all monsters every 1 second.
Sum their health in FLOAT format
Cap overpowered monster's health to a sane value.
Recommended HealthThreshold: 1000 * 300

Code: Select all

- local float HealthSum;
- local int MonsterCount;
- ON EACH MONSTER:
-- MonsterCount++;
-- if ( Monster.Health > (HealthThreshold * 0.1) )
--- Monster.Health = HealthThreshold * 0.1;
-- HealthSum += Monster.Health;
If HealthSum is above a threshold, do this:

Code: Select all

- local float HealthToSubstract;
- HealthToSubstract = (HealthSum - HealthThreshold) / MonsterCount;
- Loop all monsters with (Monster.Health > 0) and do:
-- Monster.Health -= HealthToSubstract;
-- if ( Monster.Health <= 0 )
--- Monster.TakeDamage(...);

That will regulate monsters and make playtests good.
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: KillThemAll [Mod]

Post by papercoffee »

It's funny that coder improve playability of MH maps afterwards everything is actually lost...
I've never understood those mapper who think 1000000000000 monsters with zillions of health points cramped in a room would be fun to play.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: KillThemAll [Mod]

Post by JackGriffin »

It's UT's version of "Cookie Clicker". Some people find that soothing I guess.
So long, and thanks for all the fish
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: KillThemAll [Mod]

Post by sektor2111 »

I could see at a moment in a MH2 type tick-rate going down at 1000+ creatures. Using this tool, rarely is messing speed. I gotta admit when Bot is racing through them and battle is about to start there are tiny deviations but Level is more playable and smoother.

Aside if monster's problem is solved, polys problem is not + the rest of dumb setup, to not forget how many Levels are crashing because "ThighPads is path and there is not need for InventorySpot" or such stupid idea to break Navigation Network. I though that such occurrences are rare and happened in the past but no, after 2010 Level of dumbness was growing, so we have maps and failed mapping experiments making admin job a hell in working to a server.
JackGriffin wrote: This should help 'thin the herd' in a way that won't create empty spots in the map.
Note that stepping iterator won't very cause empty places. It removes creatures like: 1 on, 1 off, 1 off, 1 on, allowing from a big group to stay a smaller group in the same spot untouched and ready to rock. Using multiplier, challenge is different, there are 30 powerful creatures rather than 400 stupid, and game-play is balanced different.
Forum|User
Experienced
Posts: 98
Joined: Fri Aug 08, 2014 6:07 pm

Re: KillThemAll [Mod]

Post by Forum|User »

ASLYE702'S - UNREALED2.0 TUTORIAL - CREATURE FACTORY

+ Trigger
+ CreatureFactory
+ Spawnpoint
+ BigCounter (MyLevel.BigCounter)


• Trigger Options:
Events > Event: CREATUREFACTORY-X
Trigger > bTriggerOnceOnly: True

• Creature Factory Options:

Events > Tag: CREATUREFACTORY-X
ThingFactory > bCovert: False
ThingFactory > bFalling: True
ThingFactory > bOnlyPlayerTouched: False
ThingFactory > bStoppable: False
ThingFactory > Capacity: 151 (Pawns Number)
ThingFactory > MaxItems: 3 (Spawnpoints Number)
ThingFactory > Prototype: Class'PAWN’ (Pawn)

• Spawnpoint Options:
Events > Tag: CREATUREFACTORY-X

• BigCounter Options:
Events > Tag: CREATUREFACTORY-X
BigCounter > bShowMessage: True
BigCounter > CompleteMessage: Completed!
BigCounter > CountMessage: Only %i Class’PAWN’ more to go...
BigCounter > NumToCount: 151

• Other:
ThingFactory > Capacity + BigCounter > NumToCount - Set plus one pawn. (151=150)

BigCounter
Spoiler

Code: Select all

//=============================================================================
// BigCounter.
//
// Waits until it has been triggered 'NumToCount' times, and then
// it sends Trigger/UnTrigger events to actors whose names match 'EventName'.
//=============================================================================

//=============================================================================
class BigCounter expands Triggers;

#exec Texture Import File=Textures\Counter.pcx Name=S_Counter Mips=Off Flags=2

//-----------------------------------------------------------------------------
// Counter variables.

var() int        NumToCount;                // Number to count down from.
var() bool       bShowMessage;              // Display count message?
var() localized  string CountMessage;       // Human readable count message.
var() localized  string CompleteMessage;    // Completion message.
var   int        OriginalNum;               // Number to count at startup time.

//-----------------------------------------------------------------------------
// Counter functions.

//
// Init for play.
//
function BeginPlay()
{
	OriginalNum = NumToCount;
}

//
// Reset the counter.
//
function Reset()
{
	NumToCount = OriginalNum;
}

//
// Counter was triggered.
//
function Trigger( actor Other, pawn EventInstigator )
{
	local string S;
	local string Num;
	local int i;
	local actor A;

	if( NumToCount > 0 )
	{
		if( --NumToCount == 0 )
		{
			// Trigger all matching actors.
			if( bShowMessage && CompleteMessage != "" )
				EventInstigator.ClientMessage( CompleteMessage );
			if( Event != '' )
				foreach AllActors( class 'Actor', A, Event )
					A.Trigger( Other, EventInstigator );
		}
		else if( bShowMessage && CountMessage != "" )
		{
			// Still counting down.
			switch( NumToCount )
			{
				case 1:  Num="one"; break;
				case 2:  Num="two"; break;
				case 3:  Num="three"; break;
				case 4:  Num="four"; break;
				case 5:  Num="five"; break;
				case 6:  Num="six"; break;
				default: Num=string(NumToCount); break;
			}
			S = CountMessage;
			while( InStr(S, "%i") >= 0 )
			{
				i = InStr(S, "%i");
				S = Left(S,i) $ Num $ Mid(S,i+2);
			}
			EventInstigator.ClientMessage( S );
		}
	}
}


Voilà!
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: KillThemAll [Mod]

Post by sektor2111 »

And jokes removal
ThingFactory > bOnlyPlayerTouched: TRUE I'M THE ONLY ONE AUTHORIZED TO LAUNCH CRAP not Monsters else Factory's instigator is marked as enemy for Monster spawned by Factory.
And also for spawning monsters dedicated is CREATUREFACTORY.

ThingFactory > Prototype: Class'PAWN’ (Pawn) - Fascinating... or...

Code: Select all

class Pawn extends Actor 
	abstract
	native
	nativereplication;
...
The problem of people is misunderstanding that PAWN is an abstract class - is a main root for player and the rest of Life-Forms from UT. ABSTRACTS won't SPAWN - so to speak is pointless to say what will do a Factory in such Case :loool: .
Counter receives HITS using TAG. Everything fired by a Factory will have as Event Factory's TAG automatically. So our prototype if is not an abstract crap will fire an Event when dies doing hit to Counter, and later Counter will do EVENT to whatever Actor when maximum hits are reached.
Forum|User wrote: ThingFactory > Capacity + BigCounter > NumToCount - Set plus one pawn. (151=150)
To avoid a crap Accessed None it's wise to fire Factory directly not using Trigger and then will match counter properly. TRIGGER DOES a wild Hit to Counter and it needs bOnceOnly else is doing an earlier completion of counter by repeated hits/touching/triggering the same Counter as dedicated for Factory - quit using TRIGGERS and do correct setup at Factory (collision radius/height and the rest letting player to touch it because Factory itself might react as a trigger), else creatures are not killed all of them, but Counter will already operate its mission too early if trigger is touched multiple times, AND HAPPENS especially at new Zones when player respawned/entered will re-trigger factory and might hit Counter.
Let me guess, this is another sort of counter, a spammer type ?

Like I said already somewhere: Mapping without knowing any tiny UScript code will deliver the mostly BAD SETTINGS.
Last edited by sektor2111 on Mon Feb 08, 2016 8:42 pm, edited 3 times in total.
Post Reply