Random Monster Sizer mutator - UT99

Search, find and discuss about Mutators!
Post Reply
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Random Monster Sizer mutator - UT99

Post by MrLoathsome »

Drafted up a mutator that will randomize monster sizes in any map or
gametypem. (At least all of em I tried so far)

Randomizes sizes of all the default creatures in the map, as well as any
that get spawned during the level. Within the range you specify in the ini file.

All the testing was done either offline on SP maps via the OldSkool mutator
or online on a live coop server with the EXU2-Demo4 Exu2CoopGame2 running.

Note I did a few brief tests with standard UT maps/gamestypes using other
mutators that spawn monsters, and it seemed to be working fine there as well.

Would be interested to know if this works with MonsterHunt. It should, but I don't
have MH installed, so haven't tested it with that....

Source code is included of course. Welcome any comments or suggestions.

*Thanks to Feralidragon for helping me out with a function this needed that wasn't cooperating with me. :gj:
Last edited by MrLoathsome on Tue Jul 05, 2011 1:56 am, edited 1 time in total.
blarg
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Random Monster Sizer mutator - UT99

Post by JackGriffin »

Loath I tested it and it does not work with MH or MH2. There were no adjustments made to the monsters at all.

I looked at the code and there are some problems if you want to market this to monsterhunt players. First off if you adjust drawscale you will also adjust health (can't be avoided) and most of the MH controllers as well as the mappers already are doing that. Your mod will mess that relationship up and might make an intended final boss just a simple adversary.

If you want to get this to MH you might consider adding these checks:
Exclude if
1) drawscale is *anything* but 1.0 because the mapper has done this on purpose already
2) health is anything but within a 'normal' range for the same reason
3) if multiskins has any entries for this same reason too
4) if the monster is any sort of subclass (not a default)

These are just a few off the top of my head. MH mappers will purposely subclass a monster or change it's settings so it fits a certain need they have in a map. Going in and doing a mass adjustment will only break maps (I should know :loool: ). If you want to do this, do everything you can to ignore anything non-standard and you ought to even entertain the idea of excluding specific classes or allow a class-by-class adjustment instead of an overall swipe.
So long, and thanks for all the fish
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Random Monster Sizer mutator - UT99

Post by MrLoathsome »

Hmm, well this does scale whatever the monsters current health value is, as well as the pawns Mass.
Did test out a version that excludes any monsters who had a drawscale != .default.drawscale.
Took that check out at the last minute for no apparent reason....

Didn't even consider #3 or 4 on your list there...

Seems odd that it does nothing with MH at all.
On the exucoop server, it resizes all monsters, regardless of how they show up in the map.
It even resizes monsters if I login as admin and start summoning them.

Oh well, guess the MH players are out of luck for this one.
blarg
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Random Monster Sizer mutator - UT99

Post by JackGriffin »

The problem with adjusting health is that an end boss may be a standard pupae or skaarj (somewhat common practice) but will have lightning fast speed and/or major attack power. Since it's a boss the health can be 100,000 or more. Doubling that makes a monster that could be nearly insurmountable, so that's why I would stress checks for default monsters only.

If you REALLY want to make something that admins would use, do this same sort of mod but do some random swapping of projectiles for certain default monsters. Bob and I did this for the stronger monsters mutator, but a stand-alone that would allow some variety of projectiles that monsters use would be very popular. If you look at the code for strongmonsters in MH2 you'll have a nice template to use. It really breaks up the monotony of the standard projectiles and you notice right off that things are different (hence cooler).
So long, and thanks for all the fish
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Random Monster Sizer mutator - UT99

Post by MrLoathsome »

Well, this version should handle most of those situations. They needed to be addressed for use with SP and coop games anyway
even if this does not work with MH.

Here is the updated CheckReplacement function:

Code: Select all

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
	local float F;
	local Vector V;

	if (ScriptedPawn(Other) != None)
	{
		if ((Other.DrawScale == Other.default.DrawScale) && (!ScriptedPawn(Other).bIsBoss))
		{
			F = FMax(MinMSize, (FRand()*MaxMSize));
			V = Other.Location;
			if (F > 1.0)
			{
				While ( (F > MinMSize) && (CheckCollision(Other, F, V)) ) 
					{ F = FMax(MinMSize, F - MinMSize); if (bDebugMode) { log("RMS: Scaledown -> "$F); } }
 			}
			Other.DrawScale = Other.DrawScale * F;
			Other.Mass = Other.Mass * F;
			ScriptedPawn(Other).Health = ScriptedPawn(Other).Health * F;
			if ((bDebugMode) && (Other.DrawScale != Other.default.DrawScale))
				{ log("RMS: Monster size randomized.... "$Other$" DrawScale = "$Other.DrawScale); }
		}
		if ((bDebugMode) && (Other.DrawScale == Other.default.DrawScale) && (!ScriptedPawn(Other).bIsBoss))
			{ log("RMS: Monster size NOT randomized.... "$Other$" DrawScale = "$Other.DrawScale); }
		   else
		   	if ((bDebugMode) && (ScriptedPawn(Other).bIsBoss))
				{ log("RMS: Boss Monster size NOT randomized.... "$Other$" DrawScale = "$Other.DrawScale); }
	}
	bSuperRelevant = 0;
	return true;
}

Seemed to be skipping bosses and resized monsters without issue in preliminary testing.
Will try it out on a coop server for a while and see how it goes.
Last edited by MrLoathsome on Sat Jul 16, 2011 9:43 pm, edited 1 time in total.
blarg
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Random Monster Sizer mutator - UT99

Post by MrLoathsome »

Hi. Here I am bumping my own thread. :loool:

Consider the above version of this a beta. (alpha even perhaps....)

I basically re-wrote the thing completely today, and now have a version of it that does work with MH 503 and
seems to be working on any scriptedpawns that get summoned or added into other game types via another mutator.
(MonsterSpawn, BadNews, or whatever is adding monsters.)

Still need to test it out with MH2Gold and with oldskool SP/Coop and make sure it all works online.....

One of my main goals with this mutator, is to make it work with everything, and not have any map/gametype/mod specific stuff in
it anywhere.
The problem with adjusting health is that an end boss may be a standard pupae or skaarj (somewhat common practice) but will have lightning fast speed and/or major attack power. Since it's a boss the health can be 100,000 or more. Doubling that makes a monster that could be nearly insurmountable, so that's why I would stress checks for default monsters only.
This should be fixed in next version. The mutator will do nothing to Boss monsters. Whatever is adjusted, should get adjusted with
the health value it has * the rescale value.
Anything that does get health adjusted by the rescale value, will have it clamped in between the 40-5000 range.
(currently hardcoded. config vars might be added for min/max there. EXU and other games might need higher max...)
If you REALLY want to make something that admins would use, do this same sort of mod but do some random swapping of projectiles for certain default monsters. Bob and I did this for the stronger monsters mutator, but a stand-alone that would allow some variety of projectiles that monsters use would be very popular. If you look at the code for strongmonsters in MH2 you'll have a nice template to use. It really breaks up the monotony of the standard projectiles and you notice right off that things are different (hence cooler).
Not ignoring that suggestion, but decided I should probably find a way to make the current project work with MH before attempting anything
else for it... Now that I have finally installed MH, who knows what might happen. That idea really is a whole different mutator.

It is a fun mod. Need to play it some more, and think... :omfg:

Hope to have next beta of this posted here sometime tomorrow. Testers will be needed.
blarg
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Random Monster Sizer mutator - UT99

Post by JackGriffin »

Sign me up.

BTW are you bald? That's a germane question seeing as you are considering coding in MH. :help:
So long, and thanks for all the fish
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Random Monster Sizer mutator - UT99

Post by MrLoathsome »

Nope, not bald, yet.... :rock:

Well, here it is. Should probably consider it a beta still, as more changes might be made.
Seems to be working with everything I tested now, including MH & MH2.
(No MH specific code in it....)

Added a few config vars. See readme here:

Code: Select all

RMS_RC1.9 - Adjustment to location of resized Tentacles.
RMS_RC1.8 - Re-wrote core mutator to increase chances of this working with all mods & gametypes.

Mutator will attempt to randomly resize all monsters in any map
within the range you specify in the ini file.
Health and mass are also rescaled.

To Install, simply place files RMS.ini, RMS.int and RMS.U into
your UnrealTournament/System folder.

Dedicated servers add RMS.RM to the mutators= section of your server
startup script.  No need to add as serverpackage.

To use, add the mutator as usual and play.

*For OldSkool SP play, Go to the Options menu in UT, then OldSkool
configuration, then click the Options tab there, then click the
SP Mutators button, and add the Random Monster Sizer mutator there.

Configuration file RMS.ini:

bDebugMode=False  // Set to True for extra info in the log file
MinMSize=0.25000  // Min value to multiply monsters drawscale by
MaxMSize=1.75000  // Max value to multiply monsters drawscale by
MinMHealth=40.0   // Min value for monster health
MaxMHealth=3000.0 // Max value for monster health
ScaleDown=0.2500  // Value used when scaling down oversized monsters until they can be resized
ReSizeRate=20.00  // Rate at which mutator will check for new monsters that need resizing
I will await a flurry of bug reports now.
:loool:
*Minor glitch discovered, but it wont generate any errors, and you wont notice it unless you are testing with EXU and are watching the Tentacles
very very closely.....
Will be fixed in next revision. (The EXU specific stuff might just get ripped out....)
Updated version will be posted shortly....
Last edited by MrLoathsome on Wed Jul 20, 2011 2:52 am, edited 2 times in total.
blarg
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Random Monster Sizer mutator - UT99

Post by MrLoathsome »

Boink
blarg
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Random Monster Sizer mutator - UT99

Post by JackGriffin »

It's been a really busy week for me Loath, but I'm for sure gonna test this tomorrow.
So long, and thanks for all the fish
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Random Monster Sizer mutator - UT99

Post by MrLoathsome »

Took some time today and tweaked this thing some more.
Fixed a few minor bugs, and removed some unneeded and redundant code.
Was making parts of it overly complicated..... :ironic2:

Been testing it the last 2 days, and seems to be working fine with all gametypes I have tested.
(MH, SP, Coop, all the default gamestypes)

This does work with any other mutators you might have spawning monsters into your game as well.

If you downloaded the 1st version, delete it and use this one.
Attachments
RMS_RC2.0.zip
RMS_RC2.0
(4.65 KiB) Downloaded 221 times
blarg
Post Reply