• Register

Your average, everyday, 9-5 zombie, 5-9 game developer.

  • View media
RSS My Blogs

Update: June 2014

Lazouskie Blog

Hello again,

Small update - I scrapped the 3d work in favor of a 2d game with a friend online, as he does some pretty darn good pixel art, and I want to get a little bit more into the coding side of things this time around.

So I've set up Unity with Photon, spent the last few weeks researching and building a fairly solid standalone server base for a future server that I will be building. In the meantime we will be using the free 20 ccu Photon Cloud service, which is n2b, actually.

This game is going to be an action multiplayer game, top down, with lots of up close melee combat. The combat is actually what I will be focusing the most on at first, after all this fun with network setup :)

So far I've run into several problems with unity and photon. Using the cloud, I have had to ditch using a network view and work with rpc calls instead:

For an action-melee network game, any lag between players whilst fighting will be immediately noticeable. I resorted to making the controlling player call an rpc every update that gets sent to the server first, then to everyone from there, including the sender of the rpc. The call was to send a set of update parameters, the least amount of data necessary, to sync all of the network instances of this player character with each other.

A secondary reason for sending the data to the server and back to the sender as well, is because when all instances receive the update call, they will all update with the same information at the same time. This is in contrast to simply moving the local instance of the player, and sending the data to be picked up afterward by the server for all other players. This occurs when overriding the OnPhotonSerializeView method, which has an IO stream for when the object instance is either a) writing to the stream (owner of instance), or b) reading from the stream (network instances). As far as I can tell, you can't receive updates you send using a network view, which is why I can't use them.
It will be different when I am using the server that I programmed using the Photon SDK, because I have created custom operations and things to specifically support the type of server interaction that I need for this application.

The latest issue that I have seen after finally getting this setup to work for me is a slight desynchronization between clients. I have done a couple of things to reduce the problem, like rounding any floating point numbers before they are used to reposition the player, and sending a buffered rpc call once every 5 unbuffered rpc calls. I am looking for other solutions at this time.

I have also created a group of classes that manage a sprites' animation state, play speed, etc. which seems to be working just nicely so far. All I need to work on is adding some dynamics to it, such as turning off the default looping, maybe put an optional callback function that would get called
when the animation finishes, so as to help give a bit more control over the animations. And I will eventually hook the loading of the animation list to the mysql database that will be set up at some point.

Currently I am working on getting the attack animations to work correctly, and then it will be on to setting up the prototype combat and health system.

So, this project is coming along quite nicely, still needs a lot of tweaking to smooth things out, like some fancy movement prediction algorithms and some breaking down of large bits of code into separate processes to fine-tune and carve out a less buggy, hopefully somewhat dynamic tester app for the next steps of this happy fun development adventure.

Couple thoughts about the current chosen path:

I could have easily gone without unity, as there are quite a few limitations to it that aren't very friendly to a coder. At the same time, if you can get a handle on the way the scale system works,
and set up the artwork pipeline correctly, it is not too hard to work around at least. There are plenty of advantages to a graphic editor such as theirs, though, for this 2d game, I have had to scrap using most of their tools, including the Animator. I have even tried to use the state machine and all that, but they simply wouldn't cooperate with my project.. also had to scrap using Rigidbody2D, which, if you are thinking what I'm thinking, that sucks. So like I said, I could have gone with one of my old engines written in c++, or, why not have a bit of fun, and go for an engine that's already mostly pre-built, yay!

Photon Cloud is easy, but I found the standalone server SDK to be a great learning experience to mess around with; building a proper server. If you are good with network code, and you want a free server, I would suggest at least checking it out.

Anyways that's all from me this week, thanks to whoever actually read all that.. good to get all this down on ... paper?

Greetings

Greetings

Lazouskie Blog
Start a group Groups
3D Artists Group

3D Artists Group

1,262 members Arts & Literature

Are you a 3D artist? Are you looking for some inspiration? Do you just want to collaborate or know who your fellow ModDB artists are? Doesn't matter what...

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

X