Sega 500 More replication Jeff “Ezeikeil” Giles

Slides:



Advertisements
Similar presentations
The people Look for some people. Write it down. By the water
Advertisements

What happens during MATTs Family Fun Night at BOUNCE-IT-OUT? By Darcy Spinello, M.S., Ed. Special Education Teacher.
Modifying existing content Adding/Removing content on a page using jQuery.
CS0007: Introduction to Computer Programming Introduction to Classes and Objects.
OEDIPUS THE KING ESSAY FORMAT
Lesson 10: Dealing with Criticism
Welcome to 5 th Grade! Getting to know one another!
Inanimate Alice Episode 4: Greece My name is Alice. I’m 15 years old. >>
Multiplication Staff Tutorial. In this tutorial we run through some of the basic ideas and tricks in multiplying whole numbers. We do a bit of stuttering.
Speaking at GenCon: People Really DO Care!  Super easy to submit talks  Your description is your pitch  Your description should match your talk  Supply.
Scripts for Success.
JUDICIAL BRANCH DEEP DIVE!.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
28-Jun-15 Recognizers. 2 Parsers and recognizers Given a grammar (say, in BNF) and a string, A recognizer will tell whether the string belongs to the.
Second Grade English High Frequency Words
Lesson 4: Percentage of Amounts.
Spelling Lists. Unit 1 Spelling List write family there yet would draw become grow try really ago almost always course less than words study then learned.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
The Speech of Self-Introduction and Introducing a Speaker
How to make a good presentation
Welcome to the Village Elementary School Media Center Quiz Mrs. Antoniewicz Mrs. Strawn School Library Media Specialists Click here to begin.
Making a Timer in Alice.
Do Now: In your journal, write about a memory in your life (good/bad) that has had a major impact on who you are today. What is the memory? How has it.
The Five Step Sales Process The Five Step Sales Process Step One: Plan and Prepare May 11, 2011.
Sega 500 Making a Flamethrower Jeff “Ezeikeil” Giles
Sega 500 Intro to Bot AI Jeff “Ezeikeil” Giles
.:::The EA FEAR Division Presents:. When you download FEAR you should be able to load it pretty quickly, so if it’s taking long consider the problems.
Bill's Amazing Content Rotator jQuery Content Rotator.
Sega 500 Close Combat weapons Jeff “Ezeikeil” Giles
I am ready to test!________ I am ready to test!________
Step By Step Windows Server 2003 Installation Guide Step By Step Windows Server 2003 Installation Guide.
REVIEW On Friday we explored Client-Server Applications with Sockets. Servers must create a ServerSocket object on a specific Port #. They then can wait.
Sega 500 Placing target boxes on the HUD Jeff “Ezeikeil” Giles
Adventurer!! Summer is here!!! I yell along with the rest of the teenagers at the last second of school. After arriving home, I throw down my bag, grabbed.
Sight words.
.Scales When your music teacher announces the annual scale test of the month, quarter, or year, everyone pretty much says “ Oh gee, another scale test,”
Sega 500 An Introduction to Replication Jeff “Ezeikeil” Giles
Some Thoughts about Hits, Geometry etc Rob Kutschke, Hans Wenzel Fermilab March 13, 2007.
Sega 500 Mutators Jeff “Ezeikeil” Giles
Game Maker – Getting Started What is Game Maker?.
Optimizing Your Computer To Run Faster Using Msconfig Technical Demonstration by: Chris Kilkenny.
1 CS161 Introduction to Computer Science Topic #9.
Sega 500 Creating a New Game Jeff “Ezeikeil” Giles
Stuff the Kitty By: Kayla Lischner. Stuff the Kitty First Iteration: 2 Players.
Opening Slide You’re About to Discover the One Secret “__________” That Makes it Super- Easy to ____________________ That Allows You to __________________and.
“Done with Bullying”. Session 4 - Buddying What can you do instead of bullying?
SCHOOL BUS & ROAD SAFETY. Hi friends, I am Buddy. I travel by the school bus everyday. I understand the importance of school-bus safety in our lives.
Sight Words.
Session 11- Ending Stories Writers, you are reaching the end of the second bend and putting the final touches on your pieces. Endings are the last words.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
Sega 500 Scripted events and Sequences Jeff “Ezeikeil” Giles
Sega 500 Combo Mutator Jeff “Ezeikeil” Giles
Sega 500 Precaching in UT2003 Jeff “Ezeikeil” Giles
Network Replication Possibly the ugliest thing to learn this semester Many different states Simulated Functions Is it an Event or function? Roles.
Helpful Hints for Paper Writing Let’s get it right the first time…
A PC Wakes Up A STORY BY VICTOR NORMAN. Once upon a time…  a PC (we’ll call him “H”) is connected to a network and turned on. Aside: The network looks.
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
THE “COLLEGES I AM THINKING ABOUT” LIST IN YOUR FAMILY CONNECTIONS ACCOUNT.
Object Orientated Programming in Perl Simulated Models of Termites.
1. Free Will and Determinism Determinism: given a specified way things are at a time t, the way things go thereafter is fixed as a matter of natural law.
The Hidden Secret of The Circling Game Not every horse wants to go in circles!
Welcome to My Reading Recovery Lesson. Rereading Familiar Books In every lesson every day I get to read lots of little books. I get to pick some of my.
课标人教实验版 高二 Module 6 Unit 3. Listening on workbook.
Sega 500 More on Possession and Using Stuff Jeff “Ezeikeil” Giles
11 Making Decisions in a Program Session 2.3. Session Overview  Introduce the idea of an algorithm  Show how a program can make logical decisions based.
Linked Lists in Action Chapter 5 introduces the often-used data public classure of linked lists. This presentation shows how to implement the most common.
Writing Functions( ) (Part 5)
Lesson 2: Building Blocks of Programming
BE MORE INVOLVED IN YOUR HEALTH CARE
Presentation transcript:

Sega 500 More replication Jeff “Ezeikeil” Giles

More Replication Yes…that’s the plan for today. Replication in UT is so important that it really is worth taking another class to look at another example.

Rolling back the clock I figure I’d have some fun with this lesson and reuse some code that you are already familiar with. We are going to create the network functionality for the King of the Hill Gametype we made in lesson 9.

As you recall… The rules were fairly straight forward. When a player was killed for the first time, a special damage doubler would be spawned. This doubler would be carried by the player until he was killed. At which time it get dropped for the next player to pickup.

As you recall… Only the player with the special doubler was able to score and there could only ever be one in play.

And as you no doubt recall… When we did the network test, it fail miserably. The reason was that the client and server for the EzeUdam would go out of sync… in effect, being in 2 different locations, with only the one on the server being valid. However, it worked fine in single player.

Now at this point… It would be a good idea to refer back to lesson 9 and look at the code intend to modify. It boils down to three classes: Gametype EzeUdam Message class

Gametype Was essentially our rule of play with most of the work happening in the Killed function. The Killed function did the spawning of the EzeUDam and broadcasting of messages to the player.

EzeGameMSG Was simply the localized message class which is used for two reasons. 1. Formatting and placement of messages of that class is super easy. 2. Network optimization. As opposed to sending a string, it sends an index into this class… much more efficient.

EzeUDam Essentially the pickup which enabled the player Pawns UDamage parameter. The only real difference between ours an the UDamagePack was that ours broadcasted messages as well

EzeUDam And spawned navigation information so that the bots would take after it… Other than that, no real significant differences.

Making replication Now, working with these classes, things replicate differently then they did with the KRock. And this cause me much grief. I spend a couple of hours just trying to figure out why the client wouldn’t replicate properly.

It came down to the Gametype Now as I said yesterday, and I’ll say it again…Clients don’t have gametypes. And Because it was in the Gametype that I was updating and tracking changes. This really caused me some puzzlement in trying to figure out how to track who had the EzeUdam, not to mention it’s location.

But as it turns out… Once I got my head around it, it wasn’t that big of a deal. I just had to remember that the clients don’t need the game info class because the server is the authority on what goes on in that level…It’s word is law.

Thus… The client never makes any decisions for itself. The server makes all the decisions and then tells the clients. Hence, most of the replication conditions are based on whether or not I am the server. If I am, replicate the condition. If not…skip it.

Getting started In the Gametype, there are 2 variables that the clients have to be aware of These are who has the EzeUDam and the EzeUdam itself. var pawn HasUDam; var EzeUDam dam;

The Gametype The server will use these to track who has the Udamage and if it can be pickup (not out of play). Hence our replication statement : reliable if(role==ROLE_AUTHORITY) HasUDam, dam, snd;

The Gametype If I am the server, these variables are reliable and I can safely send them to the client. reliable if(role==ROLE_AUTHORITY) HasUDam, dam, snd;

The Gametype Which brings us down to the Killed function. Now there is not a lot of anything new in this class…mostly some gameplay tweaks which we will come back to. Right now, we only care about the replication…Which in this case, is related to how the EzeUDam is flung into the air.

The Gametype Which occurs here: if(HasUDam == none && dam == none) { dam=spawn(class'EzeUDam',,,KilledPawn.location); //toss the UDamage in to the air dam.Toss(); snd=none; } Does the flinging

The Gametype Now this is a very important difference to make note of. In the previouve version of the code, we just applied the velocity to the EzeUDam here. We can no longer do that. We have to go into the EzeUdam itself and call the Toss function.

Why? Well, it comes down to a matter of replication and we need to access a simulated function to ensure that it get run on the right machine. Now, the Toss function itself is not simulated, but the one it calls, is.

EzeUDam function Toss() { bOnlyReplicateHidden = false; //if I am the server, tell the clients the velocity if(Role==ROLE_Authority) { ClientToss(); return; } If I am the server call the Clienttoss. Otherwise, do nothing

EzeUDam And the ClientToss function is was does the actual flinging. simulated function ClientToss() { Velocity= 500*VRand(); Velocity.Z= RandRange(500,800); SetPhysics(PHYS_Falling); }

EzeUDam Notice that the ClientToss is simulated where the Plan-Jane Toss is not. By making the actual fling method simulated, it get replicated over the wire. I was not able to get this to run by simply calling the ClientToss from the Gametype.

EzeUDam Which brings us to EzeUdam’s replication statement. Not much, If I am the server, trust in the client toss function for replication. reliable if(role==ROLE_AUTHORITY) ClientToss;

EzeUDam And before we go any further with this class, we should have a look at the Defaults. bStatic=false bNoDelete=false bHidden=false No to surprising

EzeUDam if true, only replicate actor if bNetDirty is true - useful if no C++ changed attributes (such as physics) bOnlyDirtyReplication only used with bAlwaysRelevant actors. bOnlyDirtyReplication=false bAlwaysRelevant = true bReplicateMovement=true NetUpdateFrequency= NetPriority= bNetInitialRotation=True

EzeUDam Still not any newness: But do notice that I’m using DumbProxy. If I were using some other replication property, the server would try to replicate its rotation as well…Very ugly. RemoteRole=ROLE_DumbProxy bUpdateSimulatedPosition=True

EzeUDam And finally, we also update the gametype…if we are the server….from inside the touch function: if(Role== ROLE_Authority) { EzeGame(level.Game).HasUDam=P; EzeGame(level.Game).PlayClientSeekSound(); }

EzeUDam Update the player who has the EzeUdam with whoever just picked it up. if(Role== ROLE_Authority) { EzeGame(level.Game).HasUDam=P; EzeGame(level.Game).PlayClientSeekSound(); }

EzeUDam And have the server make some noise. if(Role== ROLE_Authority) { EzeGame(level.Game).HasUDam=P; EzeGame(level.Game).PlayClientSeekSound(); }

Gametype Now, for the PlayClientSeekSound function I’m reaching into my bag of tricj on this one… What I plan to do is play a sound on the client side only…excluding the player who has the EzeUdam.

Gametype And because of where we are calling this from, we know that we are the server… Hence, we have the gametype… Hence, we have access to all the players in the game… Hence, we can manipulate any one (or all) of them. Remember, the server makes the rules.

Gametype So how am I going to pull this off you ask? Well, being the server, we have the gametype, which has a list of all the controllers in play… Just going to iterated over all those…

Gametype simulated function PlayClientSeekSound() { local controller c; snd=sound'XEffects.LightningSound'; For ( C=Level.ControllerList; C!=None; C=C.NextController ) { if(c.IsA('Playercontroller') && c.Pawn != HasUDam) Playercontroller(c).ClientPlaySound(snd); }

ClientPlaySound Which allows me to introduce a very interesting function. ClientPlaySound. The function will only play sound on the client side…no other players will be able to hear it.

ClientPlaySound Which, in of itself, is really cool…not to mention handy. But even better, go over to playercontroller and look at how its implemented… Not how you might expect.

ClientPlaySound simulated function ClientPlaySound(sound ASound, optional bool bVolumeControl, optional float inAtten, optional ESoundSlot slot ) { local float atten; atten = 0.9; if( bVolumeControl ) atten = FClamp(inAtten,0,1); if ( ViewTarget != None ) ViewTarget.PlaySound(ASound, slot, atten,,,,false); }

ClientPlaySound Now, most of this dosen’t rate to highly on the “YIPPEE” scale of things…except for the last line… Where it’s using the viewport to play the sound.

ClientPlaySound ViewTarget? What the heck is that? We are using the clients machine to play a “none specific” sound to the client player. More exactly, we are playing the sound through the clients player, kind of like the announcers voice.

ClientPlaySound What this results in is a sound that only plays for that players who do not have the EzeUdam, giving a heads up that its been picked up. As for the sound, well I found a really pleasing thunder clap effect.

Another effect… And just to furthur make the player stand out, back in the ouch function of the EzeUdam class I added. This is the derez effect material seen when you die…what it does for us: p.OverlayMaterial=FinalBlend'DeRez.DeRezFinalBody';

Another effect… A green techno ghost

And this should Leave use some time today for poking at it and playing with the code… Replication is a rather opaque thing, and the only way to get good at it, is to practice.

A wrap… I hope today’s lesson helps to clear up the relation between client and server in UT and further illustrates how they talk to each other.