Online Multiplayer! – Indie Game Devlog #4
Articles Blog

Online Multiplayer! – Indie Game Devlog #4

November 5, 2019

200 degrees! That’s why they call me Mr. Farenheit. Yeah I’m fine, why? Nothing. It’s all under control. Love you… Bye Hello boys! Welcome back to another game dev episode. This week I did a ton of work on the online multiplayer! Y’know really improving it. Getting it up to date with the game. So without further ado… Let’s just jump into it! Today I wanted to start off by creating a system where I can easily switch out different firing types. Now if you don’t know what I mean by firing type… I mean the way a gun fires. For instance, if the gun shoots instantly or if it charges up its shots. I’m gonna have a lot of different guns, some with very specific firing types that I’ll have to write. So it has to be able to switch out easily, instead of having everything in one shoot function. That’d be really messy, and I’m not a messy coder. Well I am a messy coder, but I’m trying to get better, okay? My solution wasn’t super hard to do. Basically I just have all the different firing types on the gun controller. And then whenever a new gun is equipped It says, “Hey this is my firing type!” And then it’ll active that firing type and disable the current one. After I got this working I was pretty tired, because today was a busy day for me in general. So it was time for me to hop in my bunny onesie and hit the sack! it was finally time for me to implement
online multiplayer so instead I implemented sound effects because that’s
way easier to do as Robert Frost once said there’s two roads one is easy the
other not so much take the easy one what a guy I upgraded from using the sound
effect randomizing program SFX are to BFX are I I know quite the difference
then I wrote a quick sound effect fooled I’ll play any sound that you request and
added a shoot sound and a jump sound if you notice when you double jump the
pitch is slightly deeper than the main jump this is just to indicate to the
player that they can’t jump again it’s a small touch but I like the small
things in life like the size of my dip it’s finally time to refine the online
multiplayer portion of the game I haven’t touched us in weeks so as you
can see it’s really far behind I started off by just adding a second player and
everything worked perfectly well other than all those errors everything worked
perfectly right now the network shooting is super
basic and won’t react to different types of bullets or guns it’s very critical
that the network shooting does react to different types of guns and bullets
since you don’t want a guy shooting a fucking machine gun in his perspective
and then some dinky little pea shooter fires for everyone else to solve this I
wrote a small class that carries all the gun data within some strings and is then
whenever that player shoots a new instance of that class gets created and
converted to a byte array then sent along the command which will then RPC it
to all the players if you didn’t understand any of that
I can promise it’s way simpler than it sounds it was finally time to synch
callers you may say Caillou isn’t it super easy to change the colors of a
player and I would say for everyone that’s like basic networking stuff
you’ve probably already done you seem to forget something I’m a complete dumbass
now I’ve done this before this is not the first time but for some reason I
could not figure this out first I tried making a network event that repeats and
syncs colors every time a player joins that did not work then I tried
customizing the spawn function for the player so that the player will
initializes a different color that also did not work then I tried watching My
Little Pony best clips on YouTube until I realized that had nothing whatsoever
to do with what I was trying to do after that I gave up and hit the sack
oh okay so I just woke up went out bought some milk from my meth dealer got
back drank the milk and everything clicked okay I’m gonna try my best to
explain this without sounding boring as fuck basically when a new player joins
they check and buy the version that has authority a que mi the version that’s
owned by the player who controls me if so then they’ll change the value of
its color sync bar based on how many players in the game simple now here’s
where I was tripping up before now all the other versions that player on all
other clients have to check if they don’t have authority then they change
their color to that same farm which already got changed by the route player
I don’t know how I can figure that out before but the now works in the end it
only took about 12 lines of code why are we still here
just suffer I need to kill something I need to let out my rage somewhere and
since I can’t kill someone in real life because though gal vermin I think it’s
finally time I add killing to the game I want these blocky dudes to suffer as
of now bullets aren’t technically synced objects I don’t know if this is a good
way to handle it but my method is to give a kill Authority to the original
version of the bullet and all replicate bullets are just phonies I can’t kill
her do anything like I said I don’t know if this is a good way to do this but
there’s only one way to figure this out playtesting i packaged up the game and
sent it off to my friend he didn’t respond to my request for help so I use
another method to get his attention this time it worked
it’s an installer yeah Staller but yeah just just follow the setup
wizard and then okay I hate installers why they scare me and you fucking
murdered you just fucking killed me you ended my life right there okay jeongae
game the biggest thing is I want to know if it’s if it’s synced up so I feels
like just I’m gonna shoot at you and just like dodge this okay okay like you
dodged that shit right yeah hey yo you dodging that shit yeah you can’t shoot
yourself I Drive tried many times I’ve tried to kill myself okay it makes me
feel really good the first play test went well
I mean don’t don’t get me wrong there’s a lot of problems and a lot of shit to
fix but I can shoot my friends and they can shoot me and that’s all that matters
I’m not an insecure little bitch who cares about some random number on some
random site so I’m not gonna thank you for likes but I will ask you to support I’m a sex machine ready to reload like
an eyeball

Only registered users can comment.

  1. I ASPIRE to make content as golden as this. I haven't enjoyed a devlog like this for a while so super happy to see this! Keep this up my friend. Subscribed and liked, of course — I don't want my dog (who is sleeping next to me) to be eaten.

Leave a Reply

Your email address will not be published. Required fields are marked *