Further progress with Unity Game

Hi folks,

I’ve made a bit more progress with my Unity game, as per this video here, which I recorded using QuckTime.  Essentially I’ve succeeded in getting three animations to sync across the server to other player screens – an idle animation (when the avatar(s) are still), a walking/running animation, and an ‘axe-slash’ animation (attack & jumping).

In the video I also demonstrate how the game can theoretically support more than 2 players at once – to be more precise, I show three (although I haven’t figured out how to use the same browser to host more than one login at once without crashing – it may be something silly that is port-related or somesuch).  I am using a Chrome window, a Firefox window, and the Unity development window.

Finally in at least part of the video I show some of my method, in terms of debugging within the server trace – when a message for ‘GoodIdle’, ‘GoodWalk’, or ‘AxeSlash’ is sent to the server it pops up in the monitoring window.  I found that invaluable when figuring out how to get the thing to work – in particular I discovered that the reasons I wasn’t able to get the Idle animation to play at first was because I required that the velocity of the avatar be precisely zero to trigger the change in the state machine, and this became clear when ‘GoodWalk’ was the last message passed to the server according the the log, even when on my client the avatar was still.  Sure enough, I found that on another client, the walking animation of the other avatar was still looping on the spot, which was not what I wanted!  The reason for the bug was because computers are approximate in floating point calculation so this was never going to work – instead I found that setting the absolute speed to be less than 0.1 units for the Idle animation to trigger was what was required.

Consequent to this success, my next order of business will be to determine how to figure out remote targeting, ie targeting of another player’s avatar by server messaging, as well as figure out how to build global chat into the game.  Consequent to building global chat I will see if I can construct a local analogue, ie, that can only be read within a limited range of the individual in question.

Then, following that order of business, I would like to handle combat damage, respawning, and combat / noncombat zones.  And also allow for player groups.  Wish me luck.


Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: