Page 1 of 2

BRespawn (mainly for MH)

Posted: Fri Dec 15, 2017 7:07 pm
by JackGriffin
I started the groundwork for the MH basic gamestyle and a system of place save and checkpoints was suggested. I took apart the !Checkpoint mutator by Spongebob and added some code from BobIsUnreal and simplified everything so it requires no input from the player.

What: Every 10 seconds your player drops a marker and creates a respawn point for themselves (and only themselves). B-points are only used once and will not place anywhere but normal ground. No movers, flying, swimming, damage zones, etc. B-points can only be seen by the person who placed it. Your B-point will have your player's face on it so you'll know it's yours. There is a default in case your player texture pack does not have a talk texture.

When: May be used with any gametype but I crafted this one specifically for MH. If you add it to your gametype other than MH think about whether it could be used to exploit the way your game plays out. For instance in CTF it would make the flag carrier fairly unstoppable lol. It would certainly make AS games go faster. Maybe you want that, I don't know...

Anyway here's a video of usage
M8xzmRnptp0

If you get stuck at the bottom of a pit or in a dead end just suicide quickly and it will take you back to the normal playerstart. If you are interested in testing this let me know. I'd like to get a little feedback before I openly post the mod and source code.

Beta version:
BRespawn.zip
(33 KiB) Downloaded 97 times
This version is cleaned up and much more efficient. I added Nel's proximity pawn check but I have a feeling I'll end up needing to do more. It's possible that players could grief each other by trying to block the other person's spawn point. This version does not work with bots but they wouldn't be hard to add if anyone wants that. If you have the alpha version please overwrite it with this one.

Re: BRespawn (mainly for MH)

Posted: Fri Dec 15, 2017 7:11 pm
by Terraniux
Nice! :agree1: :gj: That is insanely useful.

Re: BRespawn (mainly for MH)

Posted: Fri Dec 15, 2017 7:49 pm
by Chamberly
Interested to test it and provide my feedback here.

Re: BRespawn (mainly for MH)

Posted: Fri Dec 15, 2017 8:03 pm
by SC]-[WARTZ_{HoF}
Very useful. :highfive:

Re: BRespawn (mainly for MH)

Posted: Fri Dec 15, 2017 8:34 pm
by sektor2111
JackGriffin wrote:Every 10 seconds your player drops a marker and creates a respawn point for themselves
Perhaps I can look at it and try converting into a "portable" one without to spawn a new one for each 10 seconds. MHBotyMan4 has almost permanent RouteCache stuff and are only moved in the required spot preventing stacking and reusing them.

Re: BRespawn (mainly for MH)

Posted: Fri Dec 15, 2017 8:47 pm
by OjitroC
This is very interesting and potentially very useful indeed. So I don't want to be negative in putting forward these two points
  • 1 This works fine in the situations shown in the video - in a scenario where one has just been killed by, say 3 SkaarjWarriors, would one want to respawn again close to this point? The question is then could the player select the marker at which to be respawned (within a reasonable distance of the kill point)?
    2 Imagine one has gone quite a way into a map and acquired a few weapons along the way - in the video the player respawns with the Enforcer, not with the Stinger which had been picked up. So would it be possible to respawn with the weapons the player had acquired upto that maker (helping possibly to deal to some extent with the situation in (1)?
Would be interested in testing it.

Re: BRespawn (mainly for MH)

Posted: Fri Dec 15, 2017 8:59 pm
by JackGriffin
I'm sure there are a bunch of scenarios where you could highlite potential problems but I've tried to account for what I can. B-points are recycled every 10 seconds, so bearing that in mind let's look at the questions.
1. If you are killed by a strong enemy then yes you will likely respawn back there against him. Two things will happen though. You will die again and be sent back to the normal playerstart or you will finish killing him(or run away). I had this same discussion with paper and I'll say what I said to him. If you are killed by a stronger monster then what have you got to lost with a second chance? You are already dead in the first place. Besides this is more designed to assist with tougher environmental obstacles than aid in monster slaying. If a monster kills you then most likely this is only going to delay the full restart unless you retreat quickly.

2. In the gametype I'm building that will be dealt with. As far as this mod goes I'm openly encouraging people to recode this in any way they like. If you want weapons spawning with you then feel free to add them. As far as this mod goes though, it's a second chance at things and you don't get the full advantages because it makes dying not that serious if you don't.

@Nels: I'll send you the code. Let me know how you'd improve or change it, or feel free to release your own. Whatever you want to do brother.

Edit: Sent mod out to requests. You are free to do whatever with it but I will be doing some improving as we go.

Re: BRespawn (mainly for MH)

Posted: Fri Dec 15, 2017 9:11 pm
by OjitroC
JackGriffin wrote:I'm sure there are a bunch of scenarios where you could highlite potential problems but I've tried to account for what I can. B-points are recycled every 10 seconds, so bearing that in mind let's look at the questions.
1. If you are killed by a strong enemy then yes you will likely respawn back there against him. Two things will happen though. You will die again and be sent back to the normal playerstart or you will finish killing him(or run away). I had this same discussion with paper and I'll say what I said to him. If you are killed by a stronger monster then what have you got to lost with a second chance? You are already dead in the first place. Besides this is more designed to assist with tougher environmental obstacles than aid in monster slaying. If a monster kills you then most likely this is only going to delay the full restart unless you retreat quickly.

2. In the gametype I'm building that will be dealt with. As far as this mod goes I'm openly encouraging people to recode this in any way they like. If you want weapons spawning with you then feel free to add them. As far as this mod goes though, it's a second chance at things and you don't get the full advantages because it makes dying not that serious if you don't.
Yes, I take your points - the B-points are essentially a one-off second chance - actually it's only now reading through your reply that I fully understand what you meant by "B-points are only used once". The more I think about it the more fascinating the gametype becomes, with a greater emphasis on strategy and discretion perhaps.

Re: BRespawn (mainly for MH)

Posted: Fri Dec 15, 2017 11:08 pm
by papercoffee
Combine this "Second Chance" with PiƱata or helping hand... Wait, I havn't tested it with HH.
Ok I'll be back.

Edit------------------
It works perfect with helping hand. :tu:

Re: BRespawn (mainly for MH)

Posted: Sat Dec 16, 2017 5:11 am
by sektor2111
I got it and the source, I think is doable way more simple than actually is, even with adding some stuff for not be used if a Monster is in a closer range and using an unique checker for player all time. I think I'm gonna fully rewrite it. The key which I was thinking about is checker itself and its owner, not arrays, not timer, not that "addmutator" thing.

Thanks, Kelly, so far.

Re: BRespawn (mainly for MH)

Posted: Sat Dec 16, 2017 5:37 am
by JackGriffin
No worries, I'm glad you are inspired. This probably needs rewriting depending on how you want to use it. I just wanted to put out a standard version for testing and feedback. A lot of how my proposed simplerMH will work depends on this and the coming checkpoint to work like I need them to do. I've been playing with this on my MH NW3 server and it does very well in the longer run-back-to-the-action maps.

I do think in the next version I'll change the way the B-point is spawned and destroyed. I'll only spawn one and then move it depending on the player. When the player uses it or hasn't yet spawned a save spot I'll just disable and hide it until it's needed. This needs true recycling to be most efficient. Might be nice to add a few ini options in also. I'm still not going to add any commands to it though. Whatever it does it needs to do that without needing anything from the player. They should need to learn how it works by figuring it out as they play and then it needs to just be nearly invisible during the game proper. At least the way I want it to work, you may go a total new direction and that's great too.

Re: BRespawn (mainly for MH)

Posted: Sat Dec 16, 2017 7:10 am
by sektor2111
I cannot say that I'm totally loving it because in some maps you have no stuff around "old location", so far (unfinished maybe) I have these:
mutator core
Spoiler

Code: Select all

class Ns_SpawnPoint expands Mutator;

function ModifyPlayer(Pawn Other)
{
	local TournamentPlayer T;
	local CheckPoint C, C1;
	local bool bHasChecker;

	Super.ModifyPlayer(Other);

	foreach Other.ChildActors(class'CheckPoint',C)
	{
		bHasChecker = True;
		C1 = C;
		break;
	}
	if ( Other.Mesh != None && Other.bIsPlayer && Other.PlayerReplicationInfo != None )
	{
		if(!bHasChecker)
			C1 = Spawn( class'CheckPoint',Other,,Other.Location+vect(0,0,-35),Other.Rotation );
		else
		{
			if ( !C1.bDisabled && !C1.NearbyMonsters() )
			{
				Other.SetLocation(C1.Location+vect(0,0,40));
				Other.SetRotation(C1.Rotation);
				Level.Game.PlayTeleportEffect(Other, False, True);
			}
		}
	}
}
And the checker
Spoiler

Code: Select all

class CheckPoint expands Decoration;

#exec TEXTURE IMPORT NAME=DefaultCpoint FILE=Textures\DefaultCpoint.bmp

#exec mesh import mesh=CheckpointMesh anivfile=Models\CheckpointMesh_a.3d datafile=Models\CheckpointMesh_d.3d x=0 y=0 z=0 mlod=0
#exec mesh origin mesh=CheckpointMesh x=0 y=0 z=0
#exec mesh sequence mesh=CheckpointMesh seq=All startframe=0 numframes=1

#exec meshmap new meshmap=CheckpointMesh mesh=CheckpointMesh
#exec meshmap scale meshmap=CheckpointMesh x=0.03320 y=0.03320 z=0.06641

var Pawn P;
var bool bDisabled;

function PostBeginPlay() 
{
	if ( Pawn(Owner) != None && Pawn(Owner).PlayerReplicationInfo != None )
	{
		P = Pawn(Owner);
		log (Self.Name$" has been spawned for "$P.GetHumanName());
			InitialState = 'SpawnTracking';
	}
}

final function TrackMovement()
{
	local Teleporter T;

	if ( P == None || P.bDeleteMe || Level.Game.bGameEnded )
	{
		GotoState('SpawnTracking','FinishHim');
		GoTo EndTrack;
	}
	if((P.Region.Zone != none) && (!P.Region.Zone.bWaterZone) && (!P.Region.Zone.bPainZone) &&
		(!P.Region.Zone.bKillZone) && (!P.Region.Zone.isA('WarpZone')) && (!P.Region.Zone.isA('TeleporterZone')) &&
		(!P.Region.Zone.isA('VacuumZone')) && (P.health >= 1) && (!P.PlayerReplicationInfo.bWaitingPlayer) &&
		(P.Physics != PHYS_Falling) && (P.Physics != PHYS_Swimming) && (P.Physics != PHYS_Flying) &&
		(P.Base != none) && (!P.Base.isA('Mover'))
		&& !NearbyMonsters())
		{
			bDisabled = False;
			foreach RadiusActors(class'Teleporter', T, 24.0, P.Location)   //too close to teleporter
				return;
			SetLocation(P.Location+vect(0,0,-38));
			SetRotation(P.Rotation);
		}
		else
			bDisabled = True;
EndTrack:
}

final function bool NearbyMonsters()
{
	local bool bResult;
	local Pawn P1;

	if (P == None || P.bDeleteMe)
	{
		bResult = False;
		GoTo Resulting;
	}

	foreach RadiusActors(class 'Pawn',P1,1200,Location)
	{
		if ( P1.PlayerReplicationInfo == None && FastTrace( Location+vect(0,0,30),P1.Location ) )
		{
			bResult = True;
			break;
		}
	}
Resulting:
	return bResult;
}

state() SpawnTracking
{
Begin:
	Mesh = Mesh'CheckpointMesh';
	Sleep(0.00);
	MultiSkins[1] = Pawn(Owner).PlayerReplicationInfo.TalkTexture;
	Sleep(0.00);
	log (Self.Name$" is initialized and tracking ready...");
	Sleep(0.1);
LoopTrack:
	if ( P == None || P.bDeleteMe )
		GoTo('FinishHim');
	TrackMovement();
	Sleep(10.00);
	Goto('LoopTrack');
FinishHim:
	LifeSpan = 0.08;
	GoToState('');
}

defaultproperties
{
	Drawscale=0.5
	bOnlyOwnerSee=True
	DrawType=DT_Mesh
	Mesh=Mesh'CheckpointMesh'
	Skin=Texture'Botpack.FacePanel0'
	bUnlit=True
	bStatic=False
	bCollideActors=False
	bCollideWhenPlacing=False
	CollisionRadius=17.000000
	CollisionHeight=39.000000
	RemoteRole=ROLE_DumbProxy
	NetUpdateFrequency=3.000000
	MultiSkins(0)=Texture'BotPack.Icons.HudLine'
	MultiSkins(1)=Texture'DefaultCpoint'
}
I know, initially it was done for saving position but I really don't like those useless scientific codes since for MH is doable very simple - MH has already a load which I won't charge more and more. See how I was thinking and compiling it (works so far). It won't allow you to spawn in "lion's mouth".

Edit:Extra note/question for OFF-Line users: We can have a cheap fix here for Bot running in walls like is being retarded ? Because, yes, version which I posted has Bot/Botz support too.

Re: BRespawn (mainly for MH)

Posted: Sat Dec 16, 2017 3:57 pm
by JackGriffin
I like your idea of nearby monster checks. Do you mind if I include that as an option into my version? Thanks for the improvement Nels! I'll try to get this redone tomorrow and posted up.

BTW, found something interesting and I just haven't had the time to run down the "why" part. I set the B-point to the default of

Code: Select all

defaultproperties
{
	bOnlyOwnerSee=True
so that you will not see a bunch of these scattered all over and interrupting the map experience. You'll only see your own and I will allow for that to be even smaller/hidden if admins find the B-point intrusive to the map experience. While I was testing it I wanted to get a screenshot of the player model standing next to the point and so I used behindview. Surprise, it doesn't render with Bview set to 1. I guess when it's set to 1 you are not the "player" any more, you are the "camera", or at least that's my theory. I just thought that was worth bringing up in case anyone else ran into this odd combination and had the same problems.

Re: BRespawn (mainly for MH)

Posted: Sat Dec 16, 2017 5:24 pm
by sektor2111
Wait a minute, that code is a kid code, it has to grow up. I wrapped some things because I could test it On-Line and I wanna prevent spawning in really wierd spots - even if no monster is around.
Code works as follows:
- Spawn this checker tracker if player don't have one and update spawn timer;
- it will update location if player is not in a closer monster range;
- player die - if nearby monster - don't move player from original location;
- if player died recently then leave it again - in next seconds should have updated the spot;
- if last spawn was "a week ago" and no monster is around player is being relocated there at re-spawn updating timer;
- by any matter if game is ended we can stop tracking;
- no location update is performed in conditions set by you;
- I rotated mesh in order to gain the player face properly in Sty_Translucent mode;
- bOnlyOwnerSee - this toy won't be seen by any other pawn, but only by owner - the same as WayBeacon does, and... I like this way.

A.I. (Bot any) is more cute when is coming faster than running all map and... I'm using a random weapon toy for being minimal prepared. If Bot or human dies too fast during 5 seconds, checker is temporary deactivated and pawn spawns in original spot.

Cons:
Mad goats aka new player types jumping constantly and keep having PHYS_Falling will not have often updates and I won't do nothing here - I advice them to quit using drugs.

Tech notes:
- it will require mentioning as ServerPackage in order to figure checker;
- original one with "function killed" is probably never used - "killed" is called in game-type, I'm not sure if a mutator do executes that - maybe takedamage or such;
- I won't call other mutators in Post Pre begin - these are called by Engine automated - will cause a double execution of "NextMutator".
- Does it need other adjustments and exec commands ?
- mutator will not help if player has no "weapon-loader" - will spawn really empty.

Re: BRespawn (mainly for MH)

Posted: Sun Dec 17, 2017 10:07 pm
by JackGriffin
Just so we can keep the projects distinct can you make your own thread Nels? That will stop any confusion.

I used your proximity check (thank you!) and changed the mod from destroying checkpoints to just moving them. It will help a lot with efficiency. I also uploaded the beta to the first post. You are free to use any way you like (source in the zip). I'll probably be making some more improvements to prevent other players blocking your respawn spot or monsters being in the way but those will probably go into the actual checkpoint mod that I'm going to start now.