there is a Random spawnpoint mutator available

Search, find and discuss about Mutators!
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!

there is a Random spawnpoint mutator available

Post by MrLoathsome »

Here is the Readme.txt file:

Code: Select all

10:53 PM 3/12/2013

//*  Random Spawn Location Mutator -- RC4 -- 2013 MrLoathsome *//
//*  Players & Bots will Spawn at "random" locations *//

This mutator will cause players & bots to respawn at a much larger number of
locations.   The default startpoints will only be used if something in the
map is blocking the randomly selected location.

The new locations are not actually random, although the mutator selects them
randomly during games.

It builds a list at match startup of the locations of all pathnodes, inventory,
playerstarts, spawnpoints, flag bases, decorations, ambient sounds and lights.

It does exclude locations that are in either waterzones or painzones or
otherwise fail validation.

Not recommended for use in Assault, MonsterHunt or similar gametypes.
It would probably function fine, but will basically break your game by its
very nature.


Install.   Place RSL.u and RSL.int into your UnrealTournament/System directory.

Add mutator Random Spawn Locations to use in your games.

For servers, add RSL.RSL to your mutators= line in your server startup script.

No need to include in serverpackeges or on your redirect.


RC4 updates:

	Considerably more possible spawnpoint locations now found.

	Support for up to 4096 possible spawnpoints.

	Improved spawnpoint location validation code.

	Spawn telefrags eliminated.  (Including at match start)

	Full 4 team CTF and TDM support.  (Players/Bots now spawn in team area)

	Mutator will attempt to spawn Players & Bots a short distance away
	from other Players & Bots if possible.

Note regarding CTF & TDM:

Since I have no maps available for TDM that include Team Areas I just renamed
a couple of CTF maps to DM for testing.

This mutator uses the location of the FlagBases to calculate valid team locations.
I did it this way to preserve compatiblity with team games such as Domination, where
there are no bases.

If you were to modify or write a map for TDM play to use with this, you will need
to place at least 2 actors of class FlagBase on the map for this to work.
If you use 3 or 4 Bases, they should be placed roughly equidistant from each other
for this to work properly.

Enjoy !
I think this virtually eliminates the possibility of spawn camping. It may also eliminate the need for any spawn
protection, but others will need to test that out.

In testing so far, it seems to be very interesting, both in DM, TDM, LMS, DOM and CTF.
It should work and do what it does on any map in any gametype, although as mentioned in the readme, some are not recommended.

Again, others will need to test that out, and let me know what they think.

Only "bug" discovered so far, is that there will be a player telelporting effect at whatever default playerstart the engine
picks before this mutator has a chance to move the player. (It will also spawn the effect at the players new location however.)
Due to the amount of work that would be needed to eliminate the effect at the default playerstarts, if it is even possible, I am
leaving that alone.
It is a notification that a player or bot has respawned elsewhere on the map.
It is not a bug. It is a feature.

Also, regarding telefrags at match start.

Due to the way UT does things, it would be difficult to eliminate that issue, if it is even possible.
The only way to fix that, is to either have fewer bots & players on the map, or to edit the map and
add some additional playerstarts. That only seems to occur if you have more players in the game
than the recommended maximum for that map....

Somebody give it a try and let us know what you think.

Download it from the attached, or get it here: http://ecoop.tk/load/random_spawn_locat ... 1/1-1-0-51

Edit - Credit due to Wises for his excellent question in the other thread that inspired this thingy.

Edit2 - I still can't believe nobody did this before.....

Edit3 - Download updated. The teleporteffect bug/feature is now gone thanks to Ferlidragons input.
If you were one of the people who downloaded RC1 or RC2, or RC3 delete it and grab this version.

Edit4 - I was all wrong about this not being able to fix telefrags at match start. They are gone in RC4.
Attachments
RSL_RC4.zip
Random Spawn Locations Mutator - RC4
(6.3 KiB) Downloaded 283 times
Last edited by MrLoathsome on Wed Mar 13, 2013 5:53 am, edited 5 times in total.
blarg
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: there is a Random spawnpoint mutator available

Post by Feralidragon »

MrLoathsome wrote: Only "bug" discovered so far, is that there will be a player telelporting effect at whatever default playerstart the engine
picks before this mutator has a chance to move the player. (It will also spawn the effect at the players new location however.)
Due to the amount of work that would be needed to eliminate the effect at the default playerstarts, if it is even possible, I am
leaving that alone.
To be honest I was expecting that one, but I thought you had handled it.
Anyway, it's possible to somehow fix it, if you're up to it:
1 - On ModifyPlayer, before you move the bot, check in a small radius (20.0 or less, using RadiusActors) and check for the UTTeleportEffect spawned actor, and destroy it;
2 - After you move the bot, call Level.Game.PlayTeleportEffect(leBot, True, True).

or just make 1) and move the teleport effect as well with the bot instead.

That should take care of it and make the respawns look more genuine.
User avatar
Sp0ngeb0b
Adept
Posts: 376
Joined: Wed Feb 13, 2008 9:16 pm
Location: Cologne
Contact:

Re: there is a Random spawnpoint mutator available

Post by Sp0ngeb0b »

Feralidragon wrote: Anyway, it's possible to somehow fix it, if you're up to it:
1 - On ModifyPlayer, before you move the bot, check in a small radius (20.0 or less, using RadiusActors) and check for the UTTeleportEffect spawned actor, and destroy it;
2 - After you move the bot, call Level.Game.PlayTeleportEffect(leBot, True, True).
:ironic2: And i was completely convinced that you couldn't remove that effect when I worked on BTCheckpoints. Well, better later than never, lol
Website, Forum & UTStats

Image
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************
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: there is a Random spawnpoint mutator available

Post by MrLoathsome »

Very nice.

I think I am up to it, just hadn't occurred to me that I could look for the default
teleport effect like that. I will attempt to move the effect with the bot 1st.

Either method will only be a couple of statements.

Sadly my mutator will lose a "feature".

I will look at that right now, and replace the download file soon as it works.

*Also, this thing doesn't just move bots. It moves human players as well.
blarg
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: there is a Random spawnpoint mutator available

Post by Feralidragon »

Btw, I am not sure if you use this, but: http://uncodex-ut.host56.com/classtree.html
Just as a side note, I didn't know how exactly to do it either a few minutes ago, then I went to check my UT manual (link above), and started to check the flow and function calls. I am just mentioning this since that way you can potentially fix some other things you may have deemed impossible in other mods you guys have.

Here's how my flow went:
- checked the Bot ReStartPlayer in its Dying state
- which calls Level.Game.RestartPlayer(), so I went to check the Gameinfo class
- there RestartPlayer() calls the spawn effect through PlayTeleportEffect(), so I followed it
- checked the subclass TournamentGameInfo since it's the one which applies directly to UT games, and there it was the spawn of UTTeleportEffect
- also noticed that the spawn occurs before modifyplayer is called, hence the bug

Uncodex pages are very powerful to check how things work exactly in UT, as far as UScript goes, and it's my personal UT manual, I read it like a book every time I want to know something about the game flow lol
Just my 2 cents.
User avatar
Sp0ngeb0b
Adept
Posts: 376
Joined: Wed Feb 13, 2008 9:16 pm
Location: Cologne
Contact:

Re: there is a Random spawnpoint mutator available

Post by Sp0ngeb0b »

Nice site Ferali, gotta check it out soon!

Btw, I also tracked down the issue that the effect was hardcoded in the gametype itself, and blamed once again the developers for implementing the mutator hook after the effect call :D But I was kinda lost not to come up with your idea to simply find and destroy the effect manually...
Website, Forum & UTStats

Image
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************
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: there is a Random spawnpoint mutator available

Post by MrLoathsome »

I bookmarked that reference. I have always just tracked things down the hard way....

Download updated in 1st post. As I suspected soon as I read it, Feralidragons suggestion worked great.

Initial attempt at moving the existing effect along with the player/bot, was only partially successful.
Sorta worked, but the effect would only get moved half the time or less.

However this seems to work perfect:

Code: Select all

function ModifyPlayer(Pawn Other)
{
	local UTTeleportEffect TelEff;

	Super.ModifyPlayer(Other);

	foreach RadiusActors(class'UTTeleportEffect', TelEff, 20.0, Other.Location) { TelEff.Destroy(); } ;

	If (Other.SetLocation(SpawnLocs[Rand(SpawnLocCount)]))		
		Level.Game.PlayTeleportEffect(Other, True, True);
}
Thanks again Ferli. You are some kinda wizard or something.
(I picture you in a tower, with a Gandalf hat and staff, conjuring up code....)

Edit - Looking at the above, it does have a minor flaw. On occasions when the
mutator is unable to move the player/bot, there will be no teleport effect for it
when it shows up at the default playerstart.

However, I am not going to fix that at this point, as it will happen rarely.

This thing finds 285 possible spawn locations on DM-Conveyor. 140 on DM-Agony. 121 on DM-Codex.

It will happen rarely...
blarg
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: there is a Random spawnpoint mutator available

Post by papercoffee »

This RSM is a must for the HoldTheFrigginBurger game type of Food Fight. Do you hear me Shadow???
User avatar
UnrealGGecko
Godlike
Posts: 2900
Joined: Wed Feb 01, 2012 11:26 am
Personal rank: GEx the Gecko
Location: Kaunas, Lithuania
Contact:

Re: there is a Random spawnpoint mutator available

Post by UnrealGGecko »

Tried this with a few more gametypes:
Rocket Arena - not sure if it works (has custom playerstarts and some other actors)
Jailbreak - works, but noone spawns at the jail when fraged (please please please tell me that this is fixable), I liked it because at the start of a round no bots USUALLY whent to atack someone, but with this mutator turned on, bots attacked when they should have :tu:
CTF4 - Well lock me in a jar and call me a pickle... :lol2: worked like a charm! I just needed to remember that the enemies could spawn anywhere :loool:
after 2 min of play I got a very small error:
''General protection fault!

History: UGameEngine::Tick <- UpdateWorld <- MainLoop''
Though I'm not sure if it's from your mutator or the team-coloured guns that I used.
Overall, I love this thingy!
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: there is a Random spawnpoint mutator available

Post by Feralidragon »

MrLoathsome wrote: Thanks again Ferli. You are some kinda wizard or something.
(I picture you in a tower, with a Gandalf hat and staff, conjuring up code....)
lol no problem :tu: :lol2:
MrLoathsome wrote: Edit - Looking at the above, it does have a minor flaw. On occasions when the
mutator is unable to move the player/bot, there will be no teleport effect for it
when it shows up at the default playerstart.

However, I am not going to fix that at this point, as it will happen rarely.

This thing finds 285 possible spawn locations on DM-Conveyor. 140 on DM-Agony. 121 on DM-Codex.

It will happen rarely...
Sorry to be a bummer, but I don't like those odds, here:

Code: Select all

function ModifyPlayer(Pawn Other)
{
local UTTeleportEffect TelEff;
local vector oldPLoc;

	Super.ModifyPlayer(Other);

	oldPLoc = Other.Location;
	If (Other.SetLocation(SpawnLocs[Rand(SpawnLocCount)]))
	{
		foreach RadiusActors(class'UTTeleportEffect', TelEff, 20.0, oldPLoc) { TelEff.Destroy(); } ;
		Level.Game.PlayTeleportEffect(Other, True, True);
	}
}
GEx wrote: Jailbreak - works, but noone spawns at the jail when fraged (please please please tell me that this is fixable), I liked it because at the start of a round no bots USUALLY whent to atack someone, but with this mutator turned on, bots attacked when they should have :tu:
That is probably because the JB gametype tries to spawn them in the jail, but this mutator sends them elsewhere. But it's likely fixable, it's mostly a matter of checking the JB gametype itself and check which flag or classes it uses to detect the ones within the jail, and having the mutator to ignore those spawns, theoretically.
User avatar
Wises
Godlike
Posts: 1089
Joined: Sun Sep 07, 2008 10:59 am
Personal rank: ...

Re: there is a Random spawnpoint mutator available

Post by Wises »

Welldone friends.. very impressive stuff indeed. I shall wait until Ferali's small fix is implemented and perhaps if doable Gex's one also.. as I would like to upload this (*looks at medor) to skillz public redirect.

one main reason personally why I request things like this is because I dislike punishing players for finding glitches and exploiting them.

like.. spawnkilling. It has been there since the beginning and causes untold (rage quits) on maps like ArchaneTemple and w00tabulous to name a few.

with this fantastic mutator! I think that we have addressed this issue and look forwards to testing it ASAP.

offtopic: regarding lastman standing and campers.. I use an anticamper mod to cater for that problem... just saying..
"instead of punish/make rules.. find alternative mods to counter the exploit and move on."

anyways thankyou all for your input and especially to you MrLoathsome or this would not be made manifest.Also Ferali for your guidence and expertise.

very much appreciated.. now my resident code187 won't be spawn camping Muahaha.. attempts DrEvil laugh.. sounds more like MrPowers with his nuts squished.

also.. Thankyou mr Loathsome for credits.. I have put a lot of ideas into current projects regarding UT but rarely get a mention.. I really do appreciate that.

hopefully with ferali's tutoring.. some day I will be able to compile my ideas into something and not need to.. hope? that someone will conjure up something for me.

:thumbup:
Last edited by Wises on Mon Mar 04, 2013 9:31 pm, edited 5 times in total.
User avatar
Sp0ngeb0b
Adept
Posts: 376
Joined: Wed Feb 13, 2008 9:16 pm
Location: Cologne
Contact:

Re: there is a Random spawnpoint mutator available

Post by Sp0ngeb0b »

Although I haven't looked into it yet, I agree that this definitly brings some advantages! For CTF games, you might consider checking the distance to the enemy flag so players wont be spawned right in the enemy base?
Website, Forum & UTStats

Image
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: there is a Random spawnpoint mutator available

Post by Feralidragon »

Yeah, this brings tons of advantages if expanded even further for team games.
Although, the game I play now (Blacklight) has a clever spawn system which spawns a player far from the enemies. However their system is a bit "stupidly" bugged (making spawn kills its biggest issue ironically when they should do the opposite, coding professionalism is not the strong point of the game, trust me, but the concepts are there) and it still has fixed spawn points which any "veteran" there (like me) can predict spawns and take advantage from there (like throwing nades and have some free kills).

Now, if you join the concepts of "best spawn spot" with hundreds of possible spots, plus derivatives from those points (like points close by), and randomize between the best ones, there's no way to spawn kill, unless the map is ridiculously small and filled with players.
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: there is a Random spawnpoint mutator available

Post by MrLoathsome »

Feralidragon wrote: Sorry to be a bummer, but I don't like those odds, here:

Code: Select all

function ModifyPlayer(Pawn Other)
{
local UTTeleportEffect TelEff;
local vector oldPLoc;

	Super.ModifyPlayer(Other);

	oldPLoc = Other.Location;
	If (Other.SetLocation(SpawnLocs[Rand(SpawnLocCount)]))
	{
		foreach RadiusActors(class'UTTeleportEffect', TelEff, 20.0, oldPLoc) { TelEff.Destroy(); } ;
		Level.Game.PlayTeleportEffect(Other, True, True);
	}
}
That should work, but I think this will also, and is even simpler:

Code: Select all

function ModifyPlayer(Pawn Other)
{
   local UTTeleportEffect TelEff;

   Super.ModifyPlayer(Other);

   foreach RadiusActors(class'UTTeleportEffect', TelEff, 20.0, Other.Location) { TelEff.Destroy(); } ;

   Other.SetLocation(SpawnLocs[Rand(SpawnLocCount)]);
   Level.Game.PlayTeleportEffect(Other, True, True);
}
Will test that out and update the file shortly.

Re: CTF, Jailbreak and other team games.

I may look at doing a CTF specific version that would build the 2 lists, to avoid the situation where somebody spawns
right next to the opponents flag, but I am still not sure about that.
In testing, it seems to balance things out very well as is, so neither team really has an advantage.
One practice match last night, a bot spawned right near my flag, killed me and grabbed it.
I respawned, and was right next to the other teams flag.... It evens things out nicely.

I suppose some lamers could start killing themselves over and over in the hopes of spawning next to the opponents flag, but
I don't think that would really help them much, as it might take them quite a number of attempts to get near where they
are trying to get respawned. Other team would be winning while they were killing themselves.....

Something could probably be done to make this work with Jailbreak or other gametypes, but not sure exactly what.
Primarily because I never played or even looked at Jailbreak, although I have heard of it.

I think it would be best to create separate versions of the mutator specific for those other gametypes.

---------------------
Edit -- Post 1 updated with RC3. There should be no issues whatsoever now with the spawn teleport effect.
If you downloaded any of the previous versions, just replace the RSL.u file with the new one. Readme.txt and RSL.int did not change.
Wises wrote: I shall wait until Ferali's small fix is implemented and perhaps if doable Gex's one also.. as I would like to upload this (*looks at medor) to skillz public redirect.
The fixes for this version are done. After I get a couple of other things wrapped up, I will take a look at a CTF specific version, and perhaps for other gametypes. (JB etc)
Any of those will be separate mutators with new class names. (i.e. RSLCTF.RSL or whatever)
This version, should be perfect for LMS games, although I haven't tested it with that gametype.

Re: Redirect site.
As mentioned in the readme, this thing does NOT need to be in the ServerPackages lines or on the redirect for use on servers.
It will run server-side only as a mutator. End users only need it if they want to use the mutator in practice matches or offline play.

Feel free to make this available anywhere else you want however. I am sure Medor will replace the obsolete RC2 file with RC3 on his site.
GEx wrote:after 2 min of play I got a very small error:
''General protection fault!

History: UGameEngine::Tick <- UpdateWorld <- MainLoop''
Though I'm not sure if it's from your mutator or the team-coloured guns that I used.
Even though this is the new factor in your game, I would tend to blame either those guns, or some
other glitch in the CTF4 gametype or who knows what in your install for that GPF. Would need to see the log file...
I made this so simple, I don't think it could cause a crash like that currently.

Even if you ran it on a map with zero pathnodes, worst thing it would do is throw 2 accessed=none errors
into the log file. (Would a map with zero pathnodes still be a map?)

I could probably make this even simpler, and eliminate the checks on the locations at startup to make
sure that a player has room to spawn there, but I left that in to maintain compatibility with poorly written maps. :mrgreen:
In testing when I was logging that info, I only saw it exclude 1 pathnode because the barrel could not be located there.
(On DM-Codex I think...)
blarg
Post Reply