In-game Replays Update and Preview

One of the things I want to do going forward is to talk about what I’m working on and what my near-term priorities and plans are…basically I want to put my todo list up on the blog somehow so you all can see what’s coming down the pike for SpyParty. Some indies, like Klei, actually schedule their updates and make an event out of releasing them on a certain day, but I don’t think I have the production competence to hit those kinds of tight dates consistently, so I figure the next best thing is to at least talk about what I’m doing and how it’s going more regularly. While I figure out how to do that effectively here on the blog, here’s another ad hoc post on my current focus, “in-game replays”.

What are replays?

In a skill-based competitive game like SpyParty (or Starcraft or Counter-Strike or Go or Poker…), watching and studying games is an important part of learning and improving your skills. Right now, the only way to watch a game of SpyParty that you’re not participating in as a player is to watch a stream or a video. I stream on the SpyParty twitch.tv channel, and I post videos to the SpyParty YouTube channel, and lots of other beta testers stream and post videos too. You can catch a lot of streams by signing up for the SpyParty Streams Notifier, and you can check out all the Let’s Plays by searching YouTube, but if somebody didn’t capture their game, there’s no way to go back and study it and it’s gone forever. Even if somebody did capture the game to video, if their camera angle wasn’t right, you might miss the thing you want to see.

Replays are the solution to these problems. A replay is a recording of the game, but it’s a recording of the stream of animation commands and events and movements instead of just a stream of images like a video, so you can move around in the replay while it’s playing, freeze it and look at the layout of the party, where the Sniper’s laser is relative to the Spy, and even rewind and study a section from different camera angles. Once replays are in, they’re going to revolutionize the study of elite SpyParty games; the plan is to capture a replay of every game ever played, and add them to a database that can be queried by any beta tester to study any game. About to play in a tournament against kcmmmmm? Study the last 100 of his games against other high level players and try to get a feel for his play style. Heck, you can even sort of play the games from the Sniper’s point-of-view, trying to find the Spy, although since the Spy won’t repond to the laser sight it’s not going to be a real test. I don’t know whether this is going to benefit Spies or Snipers more,1 but it’s definitely going to raise the level of play across the board.

After I get replays working, the same technology will be used to implement “spectation”, which will allow you to log onto a game in-progress and watch it live, which is like watching a stream, but you can move the camera and see the action from either side, or even from a different camera position. At that point, if you join the lobby and everybody else is playing, you can just go spectate until somebody else joins to play. This will be huge for streaming, since it will allow people to cast other games, and commentate on the play! I’ll even implement mini-tournaments and simple betting within a spectation match, like some of the Starcraft mods do.

First, though, will come raw replays saved locally. You’ll be able to review your games, but to see somebody else’s you’ll have to get the replay file from them. The files should be pretty small, like hopefully one or two megabytes. After the bugs are worked out for that, I’ll get the replay database server up and running, and then spectation.

I really excited about replays, and I think they’ll increase the depth of the meta-game, and help the community share and discuss strategies.

Video Previews

Here’s a video I recorded from last night’s stream for drawnonward‘s 10,000th game (!). I gave a short preview of the current state of the replay system, which is still buggy but the hard part (rewind) is mostly working:

If you’d like to see videos of the terrible things I did to the partygoers as I was getting rewind working, you can check out these two videos:

  1. my hunch is Snipers will benefit a bit more, but I don’t know []

Release Notes for 3076 and 3091! (Let’s forget about 3075, shall we?)

Here’s the latest release notes stream, co-hosted by virifaux.  It is just release notes.  It is not 2 hours and 44 minutes of me trying to fix showstopper bugs live on stream.1

These builds were a long time coming because I had to re-do the entire inside of the game in preparation for spectation and replays, which aren’t quite done yet, but are getting closer.  However, I put in a bunch of really important bug fixes, the cool looking “menu party”, the oft-requested “back button” on the game setup screens, and Practice Mode is now handled properly so it can be used for bug repros much more reliably.  Also, you can see some nascent spectation action developing with the addition of hitting <tab> to switch between Spy and Sniper views in Practice Mode.

Oh, and of course:

santalanterns!

Santalanterns! Inspiration courtesy of zerotka, as per usual with our holiday Easter Eggs!

 

  1. If you really want to see that, here is your link. []

Zero’s Notebook #2: Breaking News

We interrupt your regularly scheduled blog visit with this important news bulletin:  There is a gunman on the loose and the local police department refuses to comment!  There have also been reports of an unknown illness in Spypartia! Citizens are advised to stay away from classy houses until further notice.

You can catch the full story below.

This Week in SpyParty, Week 2: A Bug In Plain Sight

This week there was a recent bug discovery that caught my attention. With any game, especially one in beta, there are going to be bugs regardless of how hard you try to prevent them. The nature of the beast is if you have a game then you have bugs in your code. Some bugs are minor and some are absolutely game-breaking. This one in particular seems like it should have been found ages ago.

What is This Bug?

The bug that was discovered allows your laser to pass through certain sections of certain characters. This makes it seem like you miss some of your shots even though you really shouldn’t. This bug is easy to reproduce as well. All you have to do is aim at these imaginary holes and that’s it. For example, you can aim your laser at the stomach region of Alphonse “Snaps” Mcgee, or at his hat: 

shoot-through-bug

Since there was a good repro, checker was able to find and fix it pretty quickly. I asked him if he could give us a more technical side to this bug and he agreed. Here is his response:

Okay, so the characters are made out of triangles. For the old characters, there are about 1.5k tris, and for the new ones there are about 11k tris.  It’s slow to do a raycast against all these triangles, so you do check on the overall bounding box of the character first, since that’s much faster.  If your bounding box is conservative, then that means all the triangles are inside it, so if the ray doesn’t hit the bounding box, you don’t have to test all the triangles.  But, since that test assumes all the triangles are inside the bounding box (hence the word “bounding”), if that’s not actually true, you won’t test the triangles at all. 

This is what the bounding box looked like before the fix:

snaps-busted

 

This is what it looks like after the fix:

snaps-fixed

I looked into this bug so I could gain my own understanding of it. I noticed the holes seemed to disappear during animations and while holding a drink. I asked checker if he could give some insight into what’s happening. Here is what he had to say:

With animated characters, you really don’t want to build the bounding box from the triangles as they move around because that’s slow, and you often don’t have access to the posed triangles because that happens on the video card, so you build the bounding box from the bones themselves, and then expand it a bit (20% in this case) to get all the triangles. Well, with the old skeleton, it’s almost flat on the xz plane in the rest pose, so the expansion doesn’t do much.  When you’re holding a drink, your arm is forward, and that makes the bounding box actually bound the whole body! 

These are images with the old bounding box built from the bones:

snaps-busted-bones snaps-busted-bones-drink

So what was the fix?

I looked at the code, and with the current (read: slow) animation code I decided it wouldn’t actually be any slower if I just computed the triangle-accurate bounding box.  Once I optimize the animation code, I’ll have to come up with a better solution, potentially having bounding boxes for each bone authored in Maya, or something smarter, I’m not sure yet.

How was it Discovered?

krazycaley took on challenger virifaux in Spy on the Hill week 7. It was during one of these games the Sniper appeared to shoot through one of the characters to both the stream viewers and to himself.  Interestingly enough, he did!

You can hear  krazycaley exclaim “Noooo! Miss!” right after the shot. He knew who virifaux was and virifaux knew he was dead to rights. Yet somehow he was still alive. This was enough to pique the interest of virifaux and he chose to pursue it more deeply a day later. Once he discovered a reliable way to reproduce the bug, he made a quick video showcasing it in action, marking the beginning of the end for this bug.

Streaming was a big help in squashing this bug.  SpyParty doesn’t support replays yet, which makes bug hunting difficult sometimes. Streaming is probably the next best thing. If pictures are worth a thousand words then videos are probably worth a couple million. In this case, the video gave clues to virifaux for where to start looking. He knew exactly what it looked like when the bug occured. He could watch it over and over until he formulated his hypothesis. Then he could go into practice mode and test it out. 

Streaming and videos give us great insight into reproducing pesky bugs. Streaming may not always be the main tool in bug hunting, but streams and videos are almost always helpful for gathering more evidence and figuring out a clean repro.   This was the case with another bug’s story. I don’t think streaming was the main reason this bug was caught and squashed but it certainly played a role. 

Why is This Interesting?

I find it very interesting the bug was discovered only now. When first looking over the new bug report, checker made a post stating he remembers this happened a long time ago and that it was super rare, so we know this bug has been in the game for quite some time.

I am going to throw some numbers your way to help give an idea of the scope of this thing. There are currently over 11,000 people who have registered with the beta. The top 100 players have a combined total of 185,520 games played. It’s safe to say there have been a lot of games played across the entire community. This isn’t even counting the number of people who have played at conventions. In all of the games that have been played, this bug is just now being talked about and reproduced.

That’s not the only thing about this particular bug that makes it so interesting to me. Not only have there been tons of games in which it could have been discovered, the steps needed to reproduce the bug are really simple. When you combine these two characteristics together, it’s crazy how long this bug has lasted! However, thinking about it more deeply, maybe it’s not so crazy after all…

There are a few things that need to align correctly in order for this to be spotted. The main thing is looking at the character from the side. Next the character can’t be doing the vast majority of animations nor can he or she have a drink in their hands. Finally, the sniper has to aim in the correct spots. Perhaps you also need to be streaming for Spy on the Hill week 7.

Whatever the case, the bug is nearing the end of its lifetime since it’s fixed on checker’s local copy, but until the patch goes live you might be able to utilize this bug in a game mode. As beta tester virifaux said, “Now that we have a reliable reproduction, we’ll have skill shots where we shoot through McGee to hit the spy.” Bugs can be fun to play with so get in your skill shots before it’s too late!

Zero’s Notebook #1: Your Brain, Your Opponent

Playing SpyParty is hard work. If you come to the booth at a convention, you have to read the manual before you can play for the first time. If you play online, you are highly encouraged to read the manual, watch the tutorial video, and play around in practice mode.  Finally, you start to play other humans and learn the plethora of ways the Spy can die and the madness of trying to sift through a party as a Sniper. These first moments of everyone’s SpyParty career can be tough. Luckily, we have an awesome community that’s always willing to help mentor new players and answer their questions. 

So, you ask for and receive some mentoring and you feel like you’re starting to get everything down. You know the missions and you know the tells associated with them. You now feel ready to face off against more experienced opponents. The thing is, when you play SpyParty, you are playing against more than just your opponent. You will also be fighting off your own brain and the mischievous AI. This first episode of Zero’s Notebook takes us through some of the odder things that you may encounter, including Chronostasis, and shooting the Spy even though you misremembered the statues.