Monthly Archives: April 2014

It’s got the lot – metaverse development

My current project has kept me pretty busy with good old fashioned hands on development. However, sometimes it is good to step back and see just how many things a project covers. I can’t go into too much detail about what it is for but can share the sort of development coverage.

(*update 11/6/14 Just adding this picture from a later post that describes this environment)
It is a unity3d multi-user environment with point and click. It works on the web so it needs a socket server to broker the network communications. So it has a Photon Server. That Photon Server is not on their cloud but on a separately hosted box with a major provider. So that needs my attention sys-admin wise configuring and keeping it up to date.
The unity3d system needs to be logged into and to record things that have happened in the environment. So I had to build a separate set of web pages and php to act as the login and the API for the unity3d web plugin to talk to. This has to live on the server of course. As soon as you have login and data, users etc you need a set of admin screens and code to support that to.
The unity3d system also needs voice communication as well as text chat. So that’s through Photon too.
The actual unity3d environment has both regular users and an admin user in charge. So there are lots of things flowing back and forth to keep in sync across the session and to pass to the database. All my code is in c# though sometimes a bit of js will slip in. WE have things like animations using the animation controller and other unity goodies like Navmesh in place too.
I am working with a 3d designer so this is a multi person project. So I have had to set up mercurial repositories and hosting the repo on bitbucket. We sync code and builds using Atlassian SourceTree which is really great. I also have an error tracking system with Atlassian so we have a JIRA. It means when I check code in and push the repository I can specify the JIRA reference number for the issue and it appears logged on the issue log. That combined with all the handy notifications to all concerned.
As I have a separate server component running I had to set up another repository to enable me to protect and synchronise any server changes, the server has its own repository ID so it can pull the unity3d builds to the server too.
There are complications in doing a database communication as Unity will only talk to the server that is is served from using the www classes. So it makes local testing of multiuser a little tricky. The unity dev environment is able to emulate the server name but the built versions can’t so there is a lot of testing bypass code needed.
Oh I forgot to mention, this is all in Arabic too. There is nothing wrong with that except I don’t know the language. Also Arabic is a right to left language so things have to be put in place to ensure that text, chat etc all flows correctly.
A few little problems arose with this. Unity has an excellent Arabic component that allows you to apply right to left to any output text, however it does not work on input fields. That is a bit tricky when you need text chat, typing in questions and responses etc. So I have ended up writing a sort of new input field, I use a text label but capture the keys pass it to the Arabic fixer component which then returns the right to left version that is displayed in the label. I do of course loose things like cursor and focus as the label is an output device but needs must.
In order to support Arabic in html and in the database I had to ensure that the text encoding of everything is UTF-8, there is also a directive tag dir=rtl that helps browsers know what to do with things. However I have found that this works with HTML input fields but seems to not work with password fields. My password field will not let me type Arabic into it. The keyboard language chooser on the mac reverts to uk and Arabic is greyed out. This cause me a lot of confusion on logging in.
There is also the confusion of what to type, it is relatively easy to cut and paste translated Arabic labels into strings, but when testing a chat system or user names I needed to know what english keystrokes generated what Arabic phrase (that’s not a translation thats a how do I type something meaningful in Arabic and see it come up on the screen).
Luckily my good friend Rob Smart came to my aid with “wfhp hgodn” which equates to صباح الخير which is a variant of good morning. It helped me see where and when I was getting the correct orientation. Again this is not obvious when you start this sort of thing 🙂
Anyway its back to layering and continuos improvement. Fixing bugs, adding function. It is pretty simply on paper but the number of components and systems, languages and platforms that this crosses is quite full on.
The project is a 3 person one, Project manager/producer, graphic designer and me. We all provide input to the project.
So if you need any help or work doing with unity3d, c#, photon,html, php, MySQL, rtl languages, cloud servers, bitbucket, mercurial, sourcetree, JIRA then I am more than slightly levelled up though there is always more to learn.

Real life avatar

Over the years I have got very used to digital representations of physical things and have often paid attention and talked and written about the impact those avatars have on our interactions with one another. A few days ago my new Choi Kwang Do training partner arrived, a Century BOB XL.

I already have large punch bag but there is something very interesting that seems to happen when faced with a face, an avatar representing a human form. I had noticed this before training on BOB at the West End Dojang and various other places.
Bags and shields provide a good target to practice technique. We also practice target punching and kicking and defence drills with our fellow students. However in Choi we do not spar it is not a martial art to try and get hurt doing.
BOB on the other hand presents you with an interesting mental challenge. Whilst it is a monochrome coloured lump of rubber it does have human features. It makes you think whether or not you really could defend yourself against a real person and use the sort of strength of attacks we learn and practice. It also allows you to desensitise yourself to the human in front of you, to practice tuning them out. I don’t ever want to be in a situation where I need to use Choi techniques to defend me or someone. However I do want to be as mentally prepared as possible.

Like all things though this can be over analysed, and it is just good fun to use the various techniques to target the right pieces of the body, the irregular shape of a human form versus the symmetry of bag provides another level of practice.
So now my Choi self, an avatar in its own right as I switch modes can interact and have a conversation with the BOB avatar. Of course this is also for the rest of the family as we are all practitioners in the art. I know the predlets really like BOB and as the mini Dojang gets a little better organised (new garage door to maximise the room there) then we shall all get to play a bit more.

I hope I can put some tech instrumentation in too to add to the fun. A proper place to put the power meter/arduino contraption and who knows the Xbox Kinect too (though still need that dev kit form Microsoft!)
For more on Choi Kwang Do check out