Saturday, October 13, 2018

BFIG Judge Mayor Max

Listen, I totally don't care at all about winning awards. What I truly care about is getting nominations. And I realize I've made a huge mistake. Or maybe I simply just don't belong. When you submit to BFIG, you have to pick a category for your game. These were the options:

"Compelling game Mechanics"
"Innovation in Art and Design
"Experimental Game Design"
"Multiplayer and Connected Gameplay"
"Student"

Both last year and this year I've chosen "Multiplayer and Connected Gameplay" as my category. Described thusly:

Description: 
The Multiplayer and Connected Gameplay category seeks games that promote a shared experience with multiple people at its core. This includes both online and local multiplayer games. Local games include traditional turn-based play by sharing a controller and simultaneous play by having multiple people play using the same controller or multiple controllers at once. We are looking for games that are enticing to bystanders, encouraging those not playing to be a part of the experience. This can include the audience guiding the individual(s) playing, aiding the player(s) by sharing information, cheering for a close match, and anything else that can make a spectator feel invested in the game even if they aren’t the ones directly playing it. Games designed with live streaming in mind that compliment game streaming culture are highly encouraged. 
Examples of games:Towerfall, DayZ, Rocket League, Jackbox Party Pack 
This is the Category for You If……you would like your game to be judged primarily by its multiplayer experience, both as a player and as a spectator.

And I should have learned. Because after you submit, you get some judges to play your game and provide personalized feedback, whether or not you're accepted into the festival (which is awesome). Last year, I noticed that the question prompts that the judges use for their feedback didn't apply very well to my game. What I didn't realize is that they were specific to my category. So this year, when I submitted my game and choose the same category and got back the same form with the same questions, I realized that my game just doesn't fit the "Multiplayer and Connected Gameplay" as it is judged. These were the questions the judges used to evaluate Flock of Dogs [my own responses if I were in a judge are in brackets below]:


1. Controls: Are the controls easy to pick up and understand?

[Flock of Dogs has very many different control schemes, bc there seems to be a limitless number of ridiculous and wondrous things you can do in this game! Admittedly, the recent changes to whale piloting has been frustrating for some, but I hear the dev plans to change that ASAP. Also, many fine folk are not familiar with twin-stick shooters and that has a learning curve, but pays out in the end because of the sweet feeling of twin-stick action! So neither here nor there for 'easyness'.]


2. Competition: How well does this game bring out the competitive side of you when playing with others? 

[Flock of Dogs provides a much needed respite from the deluge of competitiveness in multiplayer games and especially local multiplayre games. There is no PvP, so no arena or rounds. There is the flock and the whale and they either fly or fall together. And where the few games that claim to provide a system for cooperation, you're often left still imbrued in underhanded competition for high score, or being the first to collect loot. Flock of Dogs outstandingly creates a sense of being part of something bigger than yourself, more important than your self. Like mopping a dirty whale. Or protecting the pups of the flock, while your brother and sister dog riders fend off flying monsters. Or something. So basically like anti-competitiveness.]


3. End Game: When someone wins the game, does it feel fairly awarded? Does the winner feel a sense of accomplishment beating others?

[Can someone have the dev notify me know when someone gets to the end of Flock of Dogs, pls? I've literally played this game for hundreds of hours and I seldom get to the third level. From treehouses, to whalesmiths, to beast caves, to floating sky inns, there's so much to discover. And also I always feel like a winner, so I don't what it feels like to not feel like how I feel so...N/A.]


4. Audience Engagement: Does a bystander watching the game feel invested in the experience? Are they likely to provide advice during the game to a friend or root for a player or certain outcome?

[Most bystanders don't know what the heck is going on tbh, oftentimes approaching the screen feeling compelled to utter their thoughts, "What is going on?" I've heard the dev mutter that they hate explaining to people 'what is going on' or answering 'what am I supposed to do' because they've created a new display of the fantastic in the form of a video game, which is supposed to be played and discovered. If the Flock of Dogs dev wanted to write a book, (well, I heard they want to write a book, too) then they'd have written a book. I might offer an extremely minimal critique, which some might even say is a plus, but while the bright colors are alluring, providing hope in a dismal, irony-saturdated, post 2016 world, the imagery is a little busy, difficult to determine what's important. The environmental art is unfinished and there is difficulty in distinguishing between ineratctable objects and cosmetic details. The relentless hue saturation is also fatiguing to the eye, but I heard the developer is struggling with restricting his palette while maintaining readability while having up to 8 players on screen together. I do not envy him or her. Also, the music, both the intro tune created by the dev's cousin and the song that ushers in the beginning of the adventure that was created by the dev's step brother, are lovely. Audiences cannot be pulled away.]


5. One More Turn: How likely are you to continue playing after the game has ended and a winner is declared?

[Very, very likely.]


6. Streamer Appeal: Is this a game a Twitch audience may find enjoyable to watch and interact with?

[Belies a misunderstanding of Twitch. In my experience, one watches (a) games one is into and/or (b) streamers that one finds charming. Actual Twitch integration seems gimmicky and doesn't really drive regular viewership, except for maybe that marbles game. Anyway, pretty sure I saw Lirik and LethalFrag wearing Flock of Dogs t-shirts on stream the other day. So yeah. Huge appeal.]


7. Final Comments/Suggestions for Developers (Open Ended): Please say a few final words to the developer about their game including suggestions moving forward with the game and if there were any technical difficulties starting or playing the game. 

[This game is a miracle. From one dev to another, my highest respects. I simply cannot wait until you finish this game. Believe in yourself and your beautiful, sensitive, heart.]



*********************************************************

Welp, I won't pretend to understand how, but Flock of Dogs didn't receive a nomination for best "Multiplayer and Connected Gameplay" game.

Monday, September 10, 2018

Movie Stars With Flashy Cars and Life With The Top Down

Oh boy I'm living the LA dream now. I went to the Strawberry Game Jam at Glitch City LA.

Glitch City LA is a coworking space created by successful indie devs in LA. It's not quite the Hollywood of game making, which...idk where that would be. Maybe sf. But it's cool.

See, the meetups I go to usually have mostly hobbyists and dreamers, full of passion and naivete. Oftentimes, people are trying to transition from other related fields and most are working on their first game. I fit right in. Hanging out at Glitch City feels like the indie big leagues. The members have actually released games and have expertise. I've been there twice and and I've chatted with a guy who is a game designer on the Last of Us 2, which is the first triple A dev I've ever met. And I met the guy who made Threes (you may have played its clone 2048) and he's also worked at Thatgamecompany. I was first invited to Glitch City by the guy who made Quadrilateral Cowboy (and Thirty Flights of Loving, which was influential to me a long time ago). Also part of their community is the guy who made Hyper Light Drifter, people who worked on Frog Fractions 2, Where the Water Tastes Like Wine, and more!!!!!!!!!!!

Anyway. It's a cool place and the people are friendly and it feels LA hip. It's in a converted warehouse with a loft, electronic equipment everywhere, open space desks, half empty bags of the trendy flavors of chips, messy fridge, moderately clean bathroom. This is in contrast to the Boston IGC, that shares a coworking space with Kayak in their slick, highly funded, tech startup Cambridge nook, fitting for an episode of Silicon Valley. Not unlike the OC Indies in their highly funded business complex with their delivery pizza, pallets of bottled water, and regularly cleaned floors, which could also do for an episode of Silicon Valley. Whereas the Nashville Indies group that meets in an extremely bland office building after hours and everyone is a little dorky, which would be fitting for an episode of The Office.

To be honest, The Office is better than Silicon Valley. But I do love both. And I can't think of a sitcom that would use Glitch City as a set piece.

I've been to Glitch City for a board game night and I went for their 'game jam', which is really more of a work jam. Glitch City opens to the public from noon to 7 pm on every other Sunday. You pay $10, you work on whatever you want, you can ask for help, about half way thru there's a time when the group gathers and everyone can ask a question, and at the end anyone can showcase what they've been working on. And there's snacks. I ate my fair share of snacks. It's recommended that you eat lunch before you go, since they only have snacks, but whenever I see such recommendations, I figure that my snack intake is generally a fixed rate. So I'm better off not skipping the meal before, from a purely caloric point of view. Nutrition is so complicated!

Right, so what I did with my time was to fix up the reworked solar panel and do some environment art. I'm excited about replacing the old monster spawn structures, which were just brown squares and lines. Going to replace it with a thorny monster den, which can catch fire, and can prick the dogs when they fly over. And with a rocky monster den, which can only be destroyed by cannonballs and ramming. And then in later biomes, or whatever I call the different sets of proc gen rules I come up with for the different levels, I'll make variations of the  monster dens.

Here's a gif from some of the new environment art: https://twitter.com/flockofdogs/status/1039044973084078081

After the jam was over, three of the Glitch City members played my game for about 20 minutes, then talked to me about its design and my goals for another half hour or so.

Here were some of their thoughts:

- Switch the docks on the whale to nests. This is cuter and disambiguates from the 'whale dock' affixed to the islands that the whale docks at. (Simple, perfectly fitting suggestion; implemented it when I got home)

- Can the A button and the X button be consolidated? The A button is used for accessing stations or 'getting on' things, while the X button is for picking up and putting down items. (Sounds like a very desirable goal, but I'm not sure how well it would work with how crowded it gets on the whale and if players' intention would be hard to guess when they're touching, for instance, a dog they might want to mount, the sack of dog food they might want to pick up, and also touching the laser turret underneath the whale flipper they may want to man...idk. I probably ought to try it, test it with folks, and make a decision then. Could be a huge help with the learning curve.)

- Maybe use a mini cam for entering the belly of the whale and make it 'bigger on the inside'. (Imaginative idea. Would allow me to replace the barrel inventory system, which I don't like the aesthetic of. There's something I do like about the consistency of the physical space in the game as it is, however. The treehouse and the buildings take up exactly the space they appear to. Same with the whale. The only time, currently, that I 'cheat' is when the whale enters a beast lair and then gets warped to a big brown cavern for the beast fight. Anyway, low priority at the moment, but maybe.)

- More discovery! They liked the opening area with the fast pace discovery after discovery, such as finding the solar panel, finding flying dogs, finding a whale, packing up the whale...and then that kinda slows down as you get in to combat. (This is a hard one to implement. It's like yeah...I'd love to be full of quirky, novel world building interactivity ideas endlessly, but it's taken me a long time to come up with the ones I got. Tough to replciate the million dollar idea of pegasus dogs....And while I get that the feel of the game once you enter the crew combat is very different from the whimsical discovery beginnings, I love both, and I'm hoping that they can interplay with pacing, help create a full world, and provide replayability)

- Submit to Indiecade? (Turns out I would be too late. And one guy said he'd wait until I'm finished.)

- Try to incorporate more 'physical' UI, such as the inventory circle. Suggested maybe show the area
from which dogs can nest - previously known as docking - on the whale. (I think it's a good idea. Something to keep in mind. I have a few ideas.)

- Why can't the dogs fly over the whale? This would feel more consistent with expectations, one guy said. (Not sure about this one, but I could easily test this out, which I've had it this way before, probably over a year ago tho. Currently, I like the physicality of the game and the things in the air bumping into each other, the dogs with the monsters, the dogs with other dogs, and dogs and monsters with the whale. It also makes it more difficult to access the open nests - previously known as docks - on the whale when your dog is dying. Also, it allows for the dogs to push the whale, which has been helpful in rare instances when the whale has gotten stuck. Idk.)

- The red ring of death looks like it's filling up, instead of being a count down. (To be honest, this was a placeholder animation. I implemented a quick fix when I got home making the ring gradually totally disappear, instead of only the top layer disappearing, which was giving the impression of the ring filling up, because the lower layer, that didn't disappear, was a brighter red. Would like to redo this UI/animation, but low priority atm.)

- One of them, like a minute into it, asked if I'm going to do online multiplayer. Then afterwards when discussing, one said he's not so sure he'd even be interested in playing it online. (Eh. I mean, they're both privileged to be part of a great gaming community with super easy access to local multiplayer on almost any platform. Glitch City has like 20+ coworking members. like 18/20 of my best friends don't live in my state.)

They disliked the idea of simply putting it up on itch.io and see what happens and see what people ask for, such as online mp. Maybe putting it on itch would be ok if done in conjunction with other things. (Yeah, I have no idea what to do in terms of marketing and release and community building.....except for Parsec!)

Overall, they said they enjoyed it. Wanted to play more of it and encouraged me to come back to Glitch City, which is in my plans.

Ayaya. Every time I go to blog I say to myself, "This time, only spend half an hour." but then I take a few hours. For no good reason. I reread this post and I just don't understand what took me so long. Whatever, doesn't really Matterhorn. Hafta walk my dog now. Bye bye.

Tuesday, August 28, 2018

"There's nothing to do here. Some just whine in complain."

LA Game Night was great. My friends were there. Some people really liked my game. Met the indie dev who made Thirty Flights of Loving and Quadrilateral Cowboy and he was cool (and liked Flock of Dogs).

LA Game Night also gave me a clear goal: fix up my demo. Which let me not worry about online multiplayer.  Which means now that LA Game Night has passed, what should I do?

How about make a Steam page? https://store.steampowered.com/app/812380/Flock_of_Dogs/
How about make an online store? https://shopofflockofdogs.bigcartel.com/
How about start Instagramming? https://www.instagram.com/flockofdogsgame/

Well, I did that. I ran a 10k. I asked a girl to go hiking with me. I hosted youth gaming all nighter. Time marches on.

However, the trouble with working alone is that when you return to your solo project, it's not like some invisible helper did anything while you were away. Nothing changes without you. Anyway, so I decided to add dog landing/taking off/and extra flying animations. Which I've been posting on social media for your information.

Anyway. The next event I'm doing is Boston Festival of Indie Games on September 29th.

Here's my plan:
- draw a new thorn bush and make the thorn bush block both air and on ground movement, so that players with the new ability to land their dogs on islands, can't skip the opening section of the Flock of Dogs demo
- figure out some kind of visual indicator for 'whale low on water' and 'whale low on health'
- make 'press y to show color' work even if you haven't 'pressed b to wake up'
- redo the solar panel with a solar vacuum backpack thing (think Ghostbusters, except sucking up suns, wait....what is Super Mario Sunshine gameplay like? You shoot water, right? Do you suck up suns? Didn't have that game....waaaitt...what about Luigi's Mansion...I didn't have that game either...what do you do in that game?)

Then do online mulitplayer!

It's beginning to feel like this is dragging on a long time. I mean the whole 'make a video game' deal. At about 2.5 yrs since starting the project. About 9 months since I quit my job. The negative thoughts I have vary between a fear never finishing or fear of not being able to solve certain outstanding technical problems I have and then scared I'm getting lazy. Those bother me more than a fear of poor reception or no sales. Although I think I would feel pretty horrible if I achieve the quality of game I think I can make and then it just is a total commercial flop. I'm still pretty happy working on the game and, honestly, I have this nagging feeling that someone is going to beat me to market and I feel this need to rush. Even though I've felt most satisfied recently by going back through code and fixing up stuff and fixing bugs. And I hate feeling rushed when I do art and animation. I've always hated feeling rushed doing art. I remember at summer camp you had 1 hour each day to get your craft finished and the crafts lady was always shouting at us to get your scissors, get your glue, go go go. Stressful. When I took a painting course in college that was just a Friday studio day, it was lovely. You had 6 hours of studio time, if you wanted. Chill.

Monday, July 23, 2018

You Leave Me No Choice But to Smoke You Out

Now, adding fire as an environmental hazard is nothing new in video games. But howabout smoke that gets your whale smokey so you have to use your mop more? Pretty dope.

Everyone knows whales love to roll around in fluffy smoke stacks. Now that I say that, I realize that I programmed a whale roll ability a long time ago, but didn't do that in this gif below. Oh well.



You can't tell from the gif, but when dogs fly into the flames, they take damage. And yes, I do realize that the flames and the mud and the smoke currently do not affect the enemies, but that's on my to do list. As well as a adding whale and dog medicine for smoke induced asthma. And maybe like the fire can be used when the flock goes camping and someone wants to make hot dogs or whatever.

Also, piles of dirt. Piles of dirt that splash mud on your whale so that you can use your mops more!



There's no limits on how dirty a whale can get.

Sunday, July 22, 2018

Getting Ready For LA Game Night: Level 3

So at the LA indie Meetup, I met a guy who has just started hostong indie game devs night at a bar in Hollywood. And now, Flock of Dogs will be there yipeee!

https://www.facebook.com/events/214179942753851/

It's free, it's a bar that's themed after the Star Wars cantina, which is kinda cool, but it's so hard to love something so broken. By which I mean, Star Wars. The bar is cool. There'll be like 3-4 indie games being showcased and then several of the booths at the bar will have old school games set up, like Goldeneye, Mario Kart, Smash Bros. Beware. Parking isn't easy!

Anyway, in anticipation of this, I've gone back to smoothing the opening of Flock of Dogs. When I describe the changes, they sound very minor, but this whole 'teach without telling' approach that I value so much has been challenging to implement and I'm only getting there by bits and pieces. For instance, last night, night before last, I demo'd the game with 4 non-video game players and 1 grown up ex-video game player.

(They also found a new bug that like any of you reading this never did! Which is that if you place an item at the top of the ladder inside the treehouse on the 1st floor of the treehouse, in just the right spot, when you get off that ladder you can be forced out of the treehouse and then you can walk around in the sky! It's funny how excited that makes people and it makes me wonder if it's just like...better to leave that kind of thing in. It was a recoverable situation, all that sky-walker had to do was walk next to the ladder, or sky walk up to the nests and get on a dog.)

They struggled and solved many things, like many groups of players have and that was rewarding, such as "Oh! I can get water from the cloud!" and "Can the whale fly? Oh my god" and with my new mop and hose delivery animation in conjunction with the new environmental hazard: the dirt pile, they figured out the purpose of mopping! Anyway, they struggled a lot with getting out of the treehouse beds and up and down the ladders. It's strange how with more experienced players, I've seen these same struggles, but because they figure out it quickly, I haven't considered changing certain design stuff, but really, I shouldn't ignore what a player's intuitive understanding of how the ladder should work in the treehouse, regardless of how quickly they figure out how it actually does work. For instance, when players are trying to climb up to the dog nests, it seems weird you can walk up the nearly vertical branches of the left and right of the treehouse but not up the trunk on the 2nd floor. So I extended the 2nd floor ladder by a bit and now you can go straight up to the top dog nest. You can see the slight difference below, but I think this will be a significant anti-frustration change for some players.



Also, there's not really much of a purpose in ever getting back into the beds at the start of the game, except for the simple thrill of it (which I do enjoy), but they cause a lot of frustration and confusion when people keep accidentally going back to bed. And most new players are just trying very hard to just do 'the right thing' and not test the limits of the game's rules. So I just simply made the beds' hit boxes waay smaller. I also removed the instruction to 'Press X to Grab' which gets in the way in those first few seconds because then players start grabbing their blankets prematurely. And while I could just disallow all this 'unwated behavior', I would never do that. Discovery and world interactivity are super important to me. It's just a question of matching intentionality to player input, which is hard. Also, I made the tree carvings different colors and the camera now starts zoomed waay in, until at least one player has made it out of the treehouse, then it zooms back. This will help players (a) read those instruction tree carvings and (b) it creates a island reveal moment, which is cool. These design decisions seem clearly like good to me ones and they've been sitting in front of eyeballs for 6 months. Anyway, feels good to make improvements, even if they're slow in the coming. And the results will be tested July 29th at Scum & Villainy!

And I've made other changes too!

Thursday, July 5, 2018

Californian Independents

I have now attended meetups of both the Indie Dev Club (the LA indies) and OC Indie Developers. The LA meetup was at a bar and had a lot of people showing up for the first time. Probably more audio devs than game devs. Around 30ish people showed up and I was able to demo my game along with a few other games on a crowded wood table on a back patio with no power outlet. A little awkward.

I met several people and made some connetions and missed some connections. First, there was Evan from Ohio who'd just moved to LA to work for a tech startup after spending 5 years as a solo indie dev and having no success. He said he wanted to warn people to not go full time. Whoops. He and I did get along tho, just chatting about the games we liked and didn't like. He made an arena shooter where you play as a laser crab like thing and that can climb walls and lunge at people.

https://deceivergame.com

His laptop ran out of power before mine and then he decided to leave, so I didn't get to play it. By the time my laptop got low on power, the one table in the back patio that was near an outlet was available to I moved to that one.

So, you think it's infuriating to watch well intentioned lovely people struggle to play your game? Well, watching a mildly interested drunk Australian who frequently receives text messages was the worst. We may end up being friends, because he was a chill dude and I saw him at another LA game relate event, so if he reads this, oh well. But man.

Also, two men in collared shirts and ties approached me and turned out to be a principal and a teacher at a local elementary. They saw my game and people playing it and wanted to know what was happening. I explained we were part of a meetup. They were interested in having me/us come to their school and teach kids programming for games. They were also very drunk. I directed them to out meetup coordinator and gave them my number. I don't think anything's come of it. You know, I'm like that super hot girl at the bar who gave her number to a guy who's just too scared to call back because I'm just so super hot.

So while the LA indies was like at a cool bar, but outdoor on a back patio with no outlets, the Orange County meetup was at a tech office space with excellent graphically designed logos in a business park in Irvine. All nerdy dudes and no women, with a formal structure of each game being demo'ed one at a time. And free pizza. It effectively had something that I've been wanting the Boston indies to do: a focus group experience. While the other games were single player, I was able to have 8 guys playtest my game for 15 minutes and then the whole group listened to me explain abotu the game and then I posed a few questions and got some helpful feedback.

Specifically, I told them my struggle with playeres identifying themselves at the start of the game.  Some players very quickly leave the treehouse and then deciding on whether or not to zoom the screen out or follow them is tricky and so I had been thinking about adding a player select screen. Somebody proposed using just the treehouse as a starting level and everyone can still wake up there and then once every player has gone down the ladder, it transitions. This was a pretty elegant solution, I thought. Better than my half bakead idea of using the cloudy background and players 'waking up' in the clouds and then when everyone's ready, it drops away.

I have sorta implemented this, but not exactly. What I've currently done is to make the island the treehouse is on much smaller and to immediately zoom out to the normal viewing distsance as soon as one player leaves the tree, instead of waiting for the whold group. This way, no matter where you walk on the island, and no matter if other players are still in the treehouse, everyone's on the screen together. The issue remains though that if someone climbs up to the dog nests and takes flight, then the camera has to choose whom to keep on screen. I'm considering starting with the nests empty and the players have to work together to summon their dogs. As in, if 5 people are awake (read: 5 people are playing), then all 5 have to climb down from the treehouse and simultaneous light a magic fire that will summon the dogs. Or something. This means that no one will be able to get off screen until everyone has figured out what color they are, which buttons are A and B, and how walk around.

Anyway. I'm going back and forth working on that and network code. I'm excited about these indie groups. Especially 2 of them! I get to go to 2 meetups a month, which is good, because it gives me deadlines that aren't too stressful, but still motivating, and they also have cool people into gaming, which is nice.

Thursday, June 28, 2018

Flock of Dogs Online

So there's not much to show, literally, for progress on game. I'm just redoing everything with networking!

There's basically been three things to solve. How to connect players' computers through the internet, how to sync things between those computers during gameplay, and how to sync computers that join late.

I've opted to use the Photon Unity Networking (PUN) plug-in. There are a few reasons for this. (a) It's been around for several years and has a decent sized community and good documentation. (b) It provides servers (read: computers that are always on and waiting for people to access them), instead of relying on connecting players diretly to each other, because that fails a lot because of firewalls and/or routers, or so I've read. (c) Those servers are free for up to 10 concurrent users, which means it will be free while I'm still developing (this pricing scheme is common to other server providers). (d) When you do start having to pay, it's a per user basis, rather than per data. This is good for me, because each user will be passing around a lot of data (contrast this with turn based mobile apps, like Words With Friends, where each user only passes a very tiny amount of data every minute or so versus a persistant action game where you're constaly syncing positions, triggering animations and sound cues, syncing large game states.)

So PUN is fun. Following their tutorial is pretty easy and solves the first big problem of connecting players into the same room. The method is to register your game with a unique id with PUN's database. Then, in game, use PUN's API to call some connection methods that connects the local computer to PUN's server (or lobby). Then PUN recognizes your application's id and can then lump you together with other PUN connected computers matching your id. So if you and I both run Flock of Dogs, connect to PUN's server, then we can initiate a game together. Currently, that means one of us creates a game with a game name and other person types that game name in and connects to it. Then Flock of Dogs Online begins. Yayay.

Then comes the second big problem. Both players are in the same 'game', but all that means is that they're both running copies of the same application (Flock of Dogs) on their local computer and they also have a way of communicating with each other via the internet (!) which is facilitated by their connection to PUN's server. So a connected game rather is just two copies of the game running concurrently with behavior synced by passing data on the connection, which means I have to write code that says 'player 1 moved left a few inches' and 'player 2 just got on the blue dog' and 'the whale died' and send that in a message to the connected computers. Now, you want to be careful about how many/how frequently you send these messages over the connection because (a) it takes many milliseconds to send the data from your computer, to PUN, to the other players' computers. (b) I think there's still a cap on data / user from PUN's pricing scheme, so I might eventually hit that if I pay no attention.

So I read stuff about how networking works at a low level and that was interesting, but I'll just tell you the way that PUN implements stuff.

So the first way to send info using PUN that I learned was through Remote Procedure Call (RPC). You add a tag to a function in your code and when you call that function through using PUN's RPC calling method, it will alert the other connected computers to also run the matching method. So when you press the shoot button, instead of just having a normal bit of code for that you have an RPC tagged bit of code and then PUN knows to tell the other computers to have their copy of your player also shoot. So exacmples of PUN use are like 'player 2 just got on the blue dog' and 'the whale died'.

The second way to send info through Photon serialization stream. This is a function you implement on certain game objects that you want to send information about. You also have to define the ownership of the object as either locally owned or owned by another computer on the network. Then you define the function in two parts: if the object is owned locally (by you) or owned remotely (by another connected computer). In the first case, you send serialized data. That is, you send data that has to be serialized (or serializable) which means reduced to bytes. You can't just send your objects, like an instance of the dog class or an instance of the whale class. You have to break it down into integers, floats, or bools. Vector3s also work, because there are built in functions that automatically serialize Vector3s. So the use-case for this is for syncing the position of a flying dog or a flying whale. PUN will automatically call the OnPhotonSerialization () function many times a second. So you send the position of the dog you're in control over every fraction of a second. And in this case, since you care more about the current position of the dog on your friends' computers as it is on your computer more than you care that your friends see your dog travel through every position you did, you can tell PUN to send the data as fast as possible and don't wait to verify if they were received. That's something that RPCs do by default, which is to resend the call, if it never gets acknowledged by the remote computer. The message not getting through is a possibility every time you send something over the internet. If you turn on 'unreliable' in your Photon serialization settings for that gameobject, then, yes, it won't be reliable, but it will be faster. And if you're sending the position of your dog many times per second, then hopefully your friend will regularly receive the data that is only a fraction of second old, instead of having to wait for any resends sometimes.

So anyway, that explains the sending part of the OnPhotonSerialization() function. On gameobjects where you're not the owner, Photon will the OnPhotonSerialization() function object with the data that was sent (e.g. a Vector3 that represents the position of this dog, as sent by its owner a fraction of a second ago). So inside the function you check if you're not the owner. If you're not the owner, then you read the data passed in and cast it as a Vector2 and set your dog's position to that spot. Cool.

Now, there's details I'm leaving out, but I'm getting antsy. But generally speaking, RPCs and serialization streams is how I solve the moment-to-moment synchronization of gameplay.

Now, how to handle joining a game late? Once you're in the game, sure, every moment that Photon streams you data you'll update your dogs's and yoru whale's position. Every time an RPC is called to let you know that your buddy in Nebraska fired a bullet or did a flip or landed his dog then you'll know. But how do you know how many hearts that dog has when you join? How do you what upgrades the whale has gotten? How do you know how much water or health or solar energy the whale has stored up? Or what items in its belly? Or if a particular player has any harpoons? Essentially, how do you know the state of the game?

(Notice this is essentially the same question as loading a save game file, and I've never implemented game saves).

So this is where using PUN's RaiseEvent() function comes to the rescue and it's fantastic. This is most similar to low level networking and using it feels satisfying in a way I rarely feel when I program. The way RaiseEvent works is that when you call it and pass it some info, it createse and sends an 'event' over the network. And you define some special functions that lie in wait or 'listen' for network events. The low level part is that the info you pass in an event is usually in the form of an array of bytes. Which means that the listener function will receive just that array of bytes and not much else. Maybe the network identity of the sender and an event code (in the form an byte). And this is cool. This feels like big boy networking. I'm like only one step away from having to parse actual 1s and 0s. Anyway. I'm using the RaiseEvent() to send arrays of bytes representing the state of different game objects.

Now, some game objects, you don't need to sync, because once they're in the game, they don't do anything. That would be for all the static background objects. Those will spawn the same on any computer, whether they join early or late. But for everything else. Dogs, players, whales, enemies, destructible/interactable environment, enemies, NPCs, all those are subject to change. So I defined a GetState() function on each of them which returns a byte array. I have to custom define
the byte array for each of those objects. For instance, for a dog, the bytes in the byte array from byte[6] to byte[17], which is 16 bytes, is where I store 3 floats, (4 bytes per float). Those floats are the red, green, blue valus of the dog's color. I made the ReadState() function which takes in a byte array and it knows to read byte[6] through byte[17] and then convert them back into floats and then uses those floats as the RGB of a new color and sets the dog's color to that color. So after I defined a GetState() and a ReadState() for all those kinda of game objects I mentioned above, the entire game state can converted into a byte array and then read back. So, I'm in the process of doing that. But I went ahead and set up the state synchronization of some stuff using the RaiseEvents.

That involves when a new computer joins the game, it asks the computer who created the game to give them the state of the game to the best of their ability. I've set this up to initiate sending a sequence of RaiseEvent calls that the newly joined computer waits to hear about. This sequence is just the game creator going through game object by game object, calling their GetState() function, then taking that byte array and raising an event and sending that byte array. The new computer listening for an event, taking the  byte array, checking the first couple bytes to see if it's the state of a dog, or a whale, or an enemy, and then based on those first few bytes, it will know what to expect in the rest of the byte array.

And voila. Anyway. Today's World Cup games are well over and therefore this blog post is too.