is there a Random spawnpoint mutator available

Search, find and discuss about Mutators!
Post Reply
User avatar
Wises
Godlike
Posts: 1089
Joined: Sun Sep 07, 2008 10:59 am
Personal rank: ...

is there a Random spawnpoint mutator available

Post by Wises »

just wondering if anyone has a mod which removes all standard playerstarts from a map and spawns random ones instead.. or a mutator that spawns extra player starts into a map.. I can see now that in some cases this would be problematic. wondering if Helen's medtoggle can do something like this?.. as there are certain maps Archane-Temple for example where lamers/idiots just spawn kill outside the front doors.. this is why Iwould like such a mod.

thanks.
User avatar
Cronoloop
Skilled
Posts: 223
Joined: Sat Feb 16, 2013 10:16 am

Re: is there a Random spawnpoint mutator available

Post by Cronoloop »

Wises wrote:just wondering if anyone has a mod which removes all standard playerstarts from a map and spawns random ones instead.. or a mutator that spawns extra player starts into a map.. I can see now that in some cases this would be problematic. wondering if Helen's medtoggle can do something like this?.. as there are certain maps Archane-Temple for example where lamers/idiots just spawn kill outside the front doors.. this is why Iwould like such a mod.

thanks.
I remember a mod (DominateDM?) that spawned random domination points in DM maps. It used pathnodes, and of course this is going to be a problem, because it could be that a domination point is on top of a secret structure, or in a dangerous zone, or somewhere that bot hardly access, etc. The main idea is making all spawnpoints uneffective, and make something that spawn the players on a random path node.

but I'm talking as a noob here, wait others ; )
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: is there a Random spawnpoint mutator available

Post by Feralidragon »

Playerstarts cannot be removed at all, and new ones cannot be added either, unless a playerstart subclass is created with that ability (aka removing bStatic=True from there, which is what makes that restriction).

However adding playerstarts won't work either since the gametype restricts the randomness to just the first 16 "valid" playerstarts when they are in the navigation list (which is only created in Ued when paths are rebuilt), or to any of the first 16 playerstarts of all placed in the map if the former fails (valid or not, that's why that in CTF maps and other team-based maps, if you don't build paths in Ued in your map, the game will spawn the teams randomly instead of always spawning them in their team bases).
User avatar
Wises
Godlike
Posts: 1089
Joined: Sun Sep 07, 2008 10:59 am
Personal rank: ...

Re: is there a Random spawnpoint mutator available

Post by Wises »

aha.. so.. nothing.

well it is mainly one/2 maps so i guess i could just edit them
no biggy cheers.
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: is there a Random spawnpoint mutator available

Post by MrLoathsome »

Don't give up yet.....

Last night I read this post, and thought to myself... "I think I can make that happen".
It sort of wrote itself in my head while I was reading this thread.

Then tonight I sat down and played with it for a few hours, and made it happen.

The Random Spawn Location Mutator. (class RSL.RSL)

Spawns Players & Bots at "random" locations in the map. Current list of locations is all pathnodes and inventory locations on the map.
(Other locations could be added easily I think.)

Only gametype it is totally incompatible with is Assault. (I think...) Just because it breaks that gametype by its nature.

Still considering how it will work with CTF, but I think it will be OK. You have just as much chance of spawning near the enemy's flag as they do
of spawning near yours. Didn't get around to testing that this evening, before I ran into the little glitch.

This was one of the best questions asked here ever.

Changes the game more than you would imagine.

Worked perfectly offline in practice mode. In both DM and DOM maps.

However....... The little glitch. :loool:

When I put it on my server for testing, the server never stopped spawning new bots until the match was over.
I was sort of surprised the server didn't crash, but it didn't. It was however unresponsive and unplayable.
Nothing in the log file of course. Quit the online tests after about 3 maps of that....

Only thing I still had on the list for this before that, was to make the swirly blue spawn animation thingy show up at the new locations.

I made the source as short and efficient as possible, so I will post it in its entirety here in the hopes that somebody will see what
is making it freak out when used on a server. Hopefully is it something simple and obvious that I overlooked. (I need sleep.)

Feel free to compile it for use offline or testing/feedback, but please don't compile this "Alpha" source code and
release it anywhere yet.
It is only 2 hours old, and I would like to get it working the same on-line and off-line before I release what will hopefully be the final and
only release of it.

Here is what I got so far:
Spoiler
//* Random Spawn Location Mutator -- 2013 MrLoathsome *//
//* Players & Bots will Spawn at random locations *//

class RSL expands Mutator;

var Vector SpawnLocs[1024];// array of spawnpoints
var Vector NewLoc;
var int SpawnLocCount; // amount of navigation nodes in this map
var Actor SWtmp;

function PostBeginPlay()
{
local NavigationPoint N;
local Inventory Inv;
local int i;
local class<Pawn> aC;
local vector L;

Super.PostBeginPlay();

for (N = Level.NavigationPointList; N != NONE; N = N.NextNavigationPoint)
{

// **Initial version included SpawnPoints/PlayerStarts in the location array. I excluded those as they will be the defaults if the attempted relocation fails....
// if ((N.IsA('PathNode') || N.IsA('SpawnPoint') || N.IsA('PlayerStart')) && !N.Region.Zone.bWaterZone)
if (N.IsA('PathNode') && !N.Region.Zone.bWaterZone)
{
if (SpawnLocCount <= 1023)
{
SWtmp = spawn(class'BotPack.TMale1Bot',,,N.Location);
if (SWtmp != None)
{
SpawnLocs[SpawnLocCount] = N.Location;
SpawnLocCount++;
SWtmp.Destroy();
N.bPlayerOnly = False;
}
}
}
}

forEach AllActors(class'Inventory', Inv)
{
if ((!Inv.Region.Zone.bWaterZone) && (!Inv.Region.Zone.bPainZone))
{
if (SpawnLocCount <= 1023)
{
L = Inv.Location; L.z = L.z + 90;
SWtmp = spawn(class'BotPack.TMale1Bot',,,L);
if (SWtmp != None)
{
SpawnLocs[SpawnLocCount] = Inv.Location;
SpawnLocs[SpawnLocCount].Z = SpawnLocs[SpawnLocCount].Z + 90;
SpawnLocCount++;
SWtmp.Destroy();
}

}
}
}
log("RandomSpawnLoc Init - Spawnpoint count: "$SpawnLocCount);
}

function ModifyPlayer(Pawn Other)
{
// log(Other.Location);

Super.ModifyPlayer(Other);
Other.SetLocation(SpawnLocs[Rand(SpawnLocCount)]);

// log(Other.Location);
}

defaultproperties
{
}

If anybody looks at it or checks it out, let me know if you have any ideas what might be causing the endless bot spawn issue that
only happens online. I did not try adding it to the ServerPackages in the servers UT.ini file yet, but that is my next desperate attempt, unless somebody
else notices what I omitted or did wrong.

Also, should I set the max array size of locations higher than 1024? Haven't tried it with any maps that get close to that number yet, but it could be set much higher if needed.

-Start Edit 1-

You said it is only an issue for 1 or 2 of your maps, but it actually has a lot more potential than that I think.
Was just skimming thru the log files from the last test, and in DOM games it is throwing a few warnings and errors into the log file.
Nothing critical, and game seems to be working fine, but I HATE accessed nones and similar errors in any of my stuff.

No warnings in DM or TDM games noticed so far. Pretty sure I can track down and eliminate the issues generating the errors in DOM
games before I actually release anything on this.

-End Edit 1-

-Start Edit 2-

Was just staring vacantly at the source code, and it occurred to me that the online issue might go away if I move the Super.ModifyPlayer(Other);
line to the end of the function instead of the start. Will try that tomorrow after work. Or I might be way off track. I need sleep. :idea: :omfg: :noidea :sleep:

I also need to delete the unused var Vector NewLoc; declaration since NewLoc is no longer being used in this version....

-End Edit 2-

-Start Edit 3-

Is this the best quartet of Smilies ever or what? ---> :idea: :omfg: :noidea :sleep:

-End Edit 3
blarg
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: is there a Random spawnpoint mutator available

Post by Feralidragon »

It's a very nice solution without using Playerstarts, but instead of spawning a new bot every single time at the start, spawn just one and try to SetLocation it to check if either succeeds or fails, and then destroy it when you're done. Or, instead of using a bot, you can get it more cleaner by spawning another actor with just the collision properties of a bot (that way the pawn list doesn't get touched during the whole process).
User avatar
UnrealGGecko
Godlike
Posts: 2900
Joined: Wed Feb 01, 2012 11:26 am
Personal rank: GEx the Gecko
Location: Kaunas, Lithuania
Contact:

Re: is there a Random spawnpoint mutator available

Post by UnrealGGecko »

Interesting...
So if the ''apples'' will be playerstarts, will this mean that there won't be any telafrags at the start of matches?
User avatar
Wises
Godlike
Posts: 1089
Joined: Sun Sep 07, 2008 10:59 am
Personal rank: ...

Re: is there a Random spawnpoint mutator available

Post by Wises »

oh wow! really do appreciate your efforts there Mr L!
yes I had accounted for incompatibilities in Teambased games.
however was thinking perhaps if this concept could assist.

for CTF anyways.. possible?
calculate distance between flags..
ie; 1000 units
set spawn radius to pathnodes within 500 units of each flag base.
if this can be done.. perhaps.. make customisable setting for bRadius=50% perhaps.
so based on players skin/team colour.. spawn them accordingly?

mod was specifically for DM mode when I thought of it.. but if it can work with others.. Awesome.

hopefully you are well rested.. we tend to overlook things and make errors when sleep deprived
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: is there a Random spawnpoint mutator available

Post by MrLoathsome »

Feralidragon wrote:It's a very nice solution without using Playerstarts, but instead of spawning a new bot every single time at the start, spawn just one and try to SetLocation it to check if either succeeds or fails, and then destroy it when you're done. Or, instead of using a bot, you can get it more cleaner by spawning another actor with just the collision properties of a bot (that way the pawn list doesn't get touched during the whole process).
Exactly correct Ferali. Of course all your comments regarding the Playerstarts in your first post in this thread were exactly correct also.
This is sort of a brute force workaround to get the results I wanted. I don't actually change anything, it just moves the player right after
they spawn so quickly that for all practical purposes they seem to be spawning at the new location.

And of course that is exactly what was causing the horror that happened when I tested last nights version on the server.

By using a bot for the list building in the PostBeginPlay function, the server was sending replication info for each one I spawned... DERP :wtf:
Realized that today before work while I was brushing my teeth. I was planing on switching the Bot to another actor without all that
replication associated with it. Probably a seaweed. And of course your idea to only spawn it once will make that function much quicker and
reduce any performance impact this has to almost zero.

Don't think I will be able to optimize what I have in the Modifyplayer function much, as it is only 1 freaking line.

@Wises - Yes, I am not so tired tonight. I had considered something for CTF like you suggested, but that will complicate things a bit.
Once I get tonights version tested a bit and running on my server, I will play a bunch of CTF with it and see how it works with that gametype.
Might do a separate version for CTF later that builds 2 lists, one for each team. For DOM games, this will work perfect as is.

@GEx - This should greatly reduce the number of telefrags at start, however can't guarantee that there will be none. I suspect they will become
very rare however. This should relocate the players quick enough that they will be gone before the next player/bot has a chance to telefrag them
at the default playerstart location, but will need to test that a bit to make sure.

Hope to post something very soon on this, so I can get back to updating the MoreBlood mutator with the fixed splat decals that Nuff
provided a while back. I had just started up on that 2 days ago, before this thread sorta distracted me.....

Edit 1 - Few hours later....

Sadly I had to use something than the seaweed for my dummy actor while building the spawnpoint list. The Seaweed doesn't seem to collide with or
block anything. So I used an UnrealShare.SteelBarrel, and set its collision radius and height to the same as the TournamentPlayers classes defaults.

All was looking well for several hours of offline testing, so I got all crazy and decided to add a 2nd line to the ModifyPlayer function to try and spawn
the cool spawn effect animation thingy.

Well UT sorta locked up and froze for about 5 minutes, then crashed.

Attempted to look at the UnrealTournament.log file for a clue as to what may have happened, and got this cool error:
Image

UScript Coding Tip: If you add 1 line to your project, and get that cool error, you should take a 2nd look at that line you just added.

It might also be a sign that you should go sleep again for a while..... :loool:

Have to work again tomorrow, but then have 2 days off. This will be done shortly, with or without that spawn effect.

Thanks again for tuning into the thread that I hijacked into a development blog. :mrgreen: :help: :lol2:
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: is there a Random spawnpoint mutator available

Post by papercoffee »

No problem ...You are welcome :mrgreen:

Should we now rename this thread?
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: is there a Random spawnpoint mutator available

Post by MrLoathsome »

I will make a new thread soon as I get something ready for download.

And it is ready. Go here: http://www.ut99.org/viewtopic.php?f=7&t=4570
blarg
Post Reply