Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sega 500 Combo Mutator Jeff “Ezeikeil” Giles

Similar presentations


Presentation on theme: "Sega 500 Combo Mutator Jeff “Ezeikeil” Giles"— Presentation transcript:

1 Sega 500 Combo Mutator Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles

2 Last day Explored exactly what mutators are and what makes them tick. We also created our first simple mutator that doubled the jump height of the player.

3 Today We’ll expand on this by building a more complicated mutator. The goal is to add a new adrenalin combo option to our bag of tricks via the mutator.

4 The plan Keeping it somewhat simple, we’re going to wrap up our jump doubler function into a mutator… In such a way that the bots will prefer to use it also. And change the velocity at which we take falling damage.

5 Jump mutations Well, what’s the logical place to start? Since this is a combo mutator, step one is to define the Combo…then implement the mutator. I dervied a new class from combo: class SuperJumpCombo extends Combo;

6 Jump mutations And set our inherited defaults. defaultproperties { Duration=30 ExecMessage="On the bounce!" ComboAnnouncement=sound'AnnouncerMain.ComboWhore' keys(0)=1 keys(1)=1 keys(2)=2 keys(3)=2 }

7 Jump mutations Most of this is pretty self explanatory. The only newness here is the keys array. These are used in the xPlayer controller class to see if the logged input triggers the combo. We’re not going to worry about how the xPlayer know to trigger the combo. For now, it’s enough to know that this is where it happens.

8 Jump mutations The Keys array is read form the highest index number (3) back. So our combo is set up as: back  back  forward  forward

9 Jump mutations Now we inherit 2 functions that actually DO the combo. And surprisingly, they do exactly what their name suggests. But do notice that it’s only for an xPawn. function StartEffect(xPawn P); function StopEffect(xPawn P);

10 xPawn…Having a quick boo. So lets crack this class open and find out how these combo’s are implemented.

11 xPawn…Having a quick boo. Right near the top of the file, well find this. The name of the current active combo and a bunch of flags. var Combo CurrentCombo; var bool bBerserk; var bool bInvis; var bool bOldInvis; var bool bGibbed;

12 xPawn…Having a quick boo. Now there’s lots of interesting stuff that goes on in xPawn, particularly related to the combos… You can track each of the flags down to see what they do, but were just going to track the CurrentCombo.

13 xPawn…Having a quick boo. Doing so leads use here: It is in this function that the combo is actually spawned. function DoCombo( class ComboClass )

14 xPawn…Having a quick boo. But notice what else it’s doing here. UnrealMPGameInfo(Level.Game).SpecialEvent(PlayerReplicationInfo, ""$CurrentCombo.Class); if ( ComboClass.Name == 'ComboSpeed' ) i = 0; else if ( ComboClass.Name == 'ComboBerserk' ) i = 1; else if ( ComboClass.Name == 'ComboDefensive' ) i = 2; else if ( ComboClass.Name == 'ComboInvis' ) i = 3; else i = 4; TeamPlayerReplicationInfo(PlayerReplicationInfo).Combos[i] += 1;

15 xPawn…Having a quick boo. It’s actually changing the replication info on the fly… Thus changing how this pawn looks/acts and behaves on other machines.

16 xPawn…Having a quick boo. We’ll talk more about replication in a couple of weeks, but for now it’s a good idea to keep an eye out for this kind of thing.

17 Jump mutations Right, back to the Jump mutator. As mentioned, we have the start / stop effect functions to play with, so getting ours online…

18 Jump mutations We define these functions as: function StartEffect(xPawn P) { P.jumpZ=P.default.jumpz*3; } function StopEffect(xPawn P) { P.jumpZ=P.default.jumpz; }

19 Jump mutations Well that was simple! But it’s not in the game yet…We need our mutator. Deriving from mutator: class AdrenalinBounce extends Mutator;

20 Jump mutations And modifying an int file so that it shows in the menus: Object=(Class=Class,MetaClass=Engine.Mutator,Name=Eze.Adren alinBounce,Description="Doubles jump height for duration of adrenalin.")

21 Jump mutations Set up some appropriate defaults DefaultProperties { IconMaterialName="MutatorArt.nosym" ConfigMenuClassName="" GroupName="ASuperBounce" FriendlyName="Adrenaline Super Bounce" Description="Doubles jump height for duration of adrenalin." }

22 Jump mutations And we’re in! But the catch is that the game still doesn’t know about the new combo. In effect the mutator does nothing…yet.

23 Jump mutations Now this is where things get different from yesterdays example. If you recall, we used the ModifyPlayer function to change the default players jump height…We don’t want that anymore since the combo does this for us.

24 Jump mutations So somehow, we need to find a way to modify the pawn from the combo. …AND, we have to register the combo so that UT knows about it.

25 Jump mutations After some poking around, I found this in xPlayer: var string ComboNameList[16]; var class ComboList[16]; With defaults as: ComboNameList(0)="XGame.ComboSpeed" ComboNameList(1)="XGame.ComboBerserk" ComboNameList(2)="XGame.ComboDefensive" ComboNameList(3)="XGame.ComboInvis"

26 Jump mutations Hrmmmm! This is the is the list of all the combos that UT knows about…interesting. Somehow, if we could just get our combo into this list through our mutator…

27 Jump mutations Actually it’s pretty simple, one line of code. However, it’s a bit odd to read the first time through. In our mutator we over ride the PostBeginPlay function

28 Jump mutations function PostBeginPlay() { class'xGame.xPlayer'.default.ComboNameList[4]="Eze.SuperJumpCombo"; super.PostBeginPlay(); } All this is doing is accessing the default ComboNameList in xPlayer and adding ours to the fray. And then calling the super.

29 Jump mutations From here, we can trigger the combo…

30 Jump mutations And get some SERIOUS air when we jump. But notice that there are no effects to tell everyone our combo is active AND we can jump high enough that we take damage when we land.

31 Jump mutations Dealing with the fall damage first, is a simple fix…In effect, we just have to change another default in the xPawn. Add this line to the starteffects function in the SuperJumpCombo class P.MaxFallSpeed=P.default.MaxFallSpeed*1.5;

32 Jump mutations And no more falling to your death from a simple jump. Oh, don’t worry. You’ll still go splat if you fall far enough. The MaxFallSpeed variable is, in effect the terminal velocity for the pawn. Once you fall fast enough, the abrupt stop at the other end hurts some.

33 Jump mutations And now for some effects. I’m going for total cheese here. So We’re going to attach some pretty streamers… Now, we’ve already seen how to attach stuff to pawns, but this is going to be a *bit* different. We’re going to attach them to specific locations on the pawn.

34 Jump mutations Notice the streamers are in fact not coming from the pawns feet like in the speed combo. I’ve attached them to the thigh.

35 Jump mutations So how did we do that? It was pretty easy, the hard part was finding the bone names. The code to add them was: var TransTrail LeftTrail, RightTrail; … function StartEffect(xPawn P) { LeftTrail = Spawn(class'TransTrail', P,, P.Location, P.rotation); P.AttachToBone(LeftTrail, 'lthigh'); RightTrail = Spawn(class'TransTrail', P,, P.Location, P.rotation); P.AttachToBone(RightTrail, 'Rthigh');

36 Jump mutations And then destroy them in: function StopEffect(xPawn P) { if (RightTrail != None) LeftTrail.Destroy(); if (RightTrail != None) RightTrail.Destroy();

37 Jump mutations You can attach xEmitters to any bone in the pawn. Here are all the bones in the Jugg mesh. The alias names should be the same for all the character meshes.

38 Jump mutations Bone nameAlias name Bone_weapon Bip01 R Clavicle Bip01 L Clavicle Bip01 R Foot Bip01 L Foot Bip01 Head bip01 Spine Bip01 R Calf Bip01 L Calf Bip01 R Forearm Bip01 L Forearm Righthand FlagHand Rshoulder Lshoulder Rfoot Lfoot Head Spine Rthigh Lthigh Rfarm lfarm

39 Jump mutations I also found this image online which has a good layout of the bone structure for a human character.

40 Jump mutations To find out more about specific bones in ANY mesh, you can view them through the animations browser in the editor. I would recommend using this as a reference only. Give preference to what the editor says.

41 Jump mutations

42 Animations List View area, watch the ani play Settings Play controls

43 Jump mutations All the bones are listed in the sockets pull down of the settings window. And you can attach you emitter to ANY of the AttachAlias names.

44 Jump mutations Lastly, as promised, getting the bots to use the jump mutator. This is done through the RecomendCombo function found in the mutator class.

45 Jump mutations function string RecommendCombo(string ComboName) { if ( NextMutator != None ) return NextMutator.RecommendCombo(ComboName); return ComboName; }

46 Jump mutations Notice that is uses stings to determine what combo to play. So we override this & give it a preference to use ours. Essentially, cut & paste the function & insert our preferences…

47 Jump mutations local float rnd; if ( (ComboName != "xGame.ComboSpeed") && (ComboName != "xGame.ComboInvis") && (comboName != "eze.SuperJumpCombo")) { rnd=FRand(); if ( rnd < 0.4 ) ComboName = "xGame.ComboInvis"; else if(rnd < 0.7 ) ComboName = "eze.SuperJumpCombo"; else ComboName = "xGame.ComboSpeed"; }

48 Jump mutations In effect, we’re simple providing a list of combo’s that are available for the bots to use. And assigning ours as one of the options. The only thing that’s now missing is to get to bots to prefer vertical movement as this makes for a much more difficult target. But that’s something we will go over when we deal with controllers.

49 End of the road That’s enough bouncing around for today… Next day we’ll wrap this up into a UMOD installer for distribution to the world.


Download ppt "Sega 500 Combo Mutator Jeff “Ezeikeil” Giles"

Similar presentations


Ads by Google