unity3d


A bit of SL fun then onto real CKD Virtual World Coaching

It has been a while since I just went for a wander in Second Life. I have very little building space on my islands now as they are pretty much totally rented out so I just have 1 corner or Hursley. So I thought as I was in there I would pop off and have a look around. It always helps to have a subject or a reason or something to search for, but I started off just looking at some art.
Kinesis sculpture
Though it then dawned on me I had not explored martial arts in Second Life for a very long while and I thought I would take a look with my new Choi Kwang Do enabled brain. (enabled by SouthCoast CKD 🙂 )
There are a fair few martial arts related places, groups etc. None specific to CKD though. I did check out an arena for more kung fu and weapon related battles at Colibri.
exploring SL martial arts
Then I thought it was time the CKD logo made its way into SL and so my little plot now has the start of a virtual Dojang.
trying some ckd in SL
I popped along to Abraminations, just like in the old days back on ’06 (is it really that long ago!) and checked out the fighting systems and animations. The closest was a kickboxing one.
abranimation
Then I shot this little video to see how off the animations are from CKD. The guard hand and stance and a lot of the moves are not as flowing as CKD but it shows an interesting potential to people not yet versed in virtual world tech and sports.

Now I am wondering about taking the kinect tracking and seeing if I can mocap that to my patterns for CKD and get the BVH file up into SL. Just so I could use a lot of acronyms 🙂 I know the skeleton format is going to be different but it is something to work on.
This is initially just a bit of fun, but…. as we know with projects like The Coaches Center we are getting closer to being able to enable hold gathering and meetings and share more insights.
Here I am sat in my personal coaches office, with Choi Terms on the board and a synchronized version of the kinect ckd test playing, the same view anyone would get if I invited them in.
Snapz Pro XScreenSnapz021
(You can also load videos and graphics etc onto various other boards in the room to share with people)
So there I am with a virtual presence, a shared space and all the tools available voice, text, imagery, avatar placement reaching out to the web to pull in other content. All in Unity3d 🙂 check is out and register in the beta at The Coaches Center

Cool isn’t it? Imagine being able to attend a class from anywhere for those time when you just can’t get to the Dojang, or for blackbelts and masters all over the world to connect and share their insights.

Free Unity3d for iOS and Android

I noticed a few tweets on the #unity3d hashtag about there being a free licence for the already free Unity3d for iOS and Android. Sure enough if you pop along to download Unity3d at the store you can add the ability to publish directly to iOS and Android. (offer expires april 8th 2012)
unity3d
I already have the iOS basic licence and unity3d installed so it was a little less clear what to do.
On the store page there is a licence upgrade link in there you have yo paste in your existing licence number then you are able to “buy” for free the upgrade you need.
Unity will then send you a new licence number that you reactive in the unity client with the menus unity/serial number and away you go you now have targeting for publishing to web, windows, mac, iOS and android all enabled.
What are you waiting for ? It is a brilliant dev environment.
NB. As I point out at conferences when I rave about it I don’t work for unity3d I just really like what they do 🙂

Virtual campus tours for students

I know that if I need to check out somewhere or something new I try and experience it in as many ways as the computer in front of me will allow. We used to just have to sit and paw through prospectuses for places before deciding to visit and check out a place (which is quite a commitment). This 3d virtual campus tours from Designing Digitally and my surnamesake Andrew Hughes (no relation that we have figured out yet) shows the very real benefits of this mirror world application.

This is clearly not there to remove the need to travel and visit somewhere, but to give you the interaction with both a representation of the physical space and the people that are already there to give you tours. So unlike a prospectus you get to talk to people. Why wouldn’t you use something like this?
So here this is an specific industry vertical (in this case education admissions) using game style technology and the benefits of metaverses to engage with people. This is start of it all coming of age.
Well done 🙂
There is a live demo to go and see, just bear in mind if you are form the UK that the our US cousins are more proud of their further education that we are (yes I know they pay but we seem destined on dismantling our system)

All the pieces are falling in place – Unity3d

Back in late 2009 I wrote a post saying we had all the pieces to start seriously building virtual world toolkits and environments from off the shelf pieces.
Today I have seen two releases arrive of new hosted toolkits and services, both using Unity3d and some of the other pieces related to hosting a server component. They are both from stalwarts of the virtual worlds industry and both with former close ties to Linden Lab and Second Life.

In not particular order the first is from SecondPlaces.net called Unifier. As with all Unity environment this benefits from the browser plugin to let it run on most browsers. According to the site its using smartfoxserver to broker the positions of the other avatars and flash voice for VOIP.
The key is that it acts both as a hosted service on Amazon EC2 (i.e. thats where the server will be running for your instance) or as a run yourself service. Smartfoxserver is a relatively simple java application to get going on a server with some config for ports etc needed. The important parts are it knowing what it needs to keep a track of an what clients subscribe too. There also appear to be lots of interaction with other content, whiteboards etc and the sort of dynamic tools needed to interact online. So a lot of work has gone into productising this.
The second offering is from Tipodean which is both a service to run peer to peer unity3d (which looks like it uses the unity3d master server) and an OpenSim to unity3d conversion service. So you can pay to get your build moved from prims to the mesh of unity3d and then have some unity3d polish applied to it.
It is not clear how dynamic any of the environments are, as typically, whilst unity3d can load new assests on the fly it is more complicated to set that up than the ability for people to walk around a fixed environment.
The upshot of all this is that there is more choice and scope for the market to grow. These join the other services out there and form part of an SL counter culture, in a slightly different way to the counter culture of Opensim.
It’s all good.

The power of the prefab -unity3d

I have been diving into some more unity3d development for some mini games for a gaming startup. Once again the subtle power of Unity3d shone through with what is in effect object inheritance.
If you create an object on the stage it is a single instance, copying and duplicating that makes new instances. These are completely unrelated with the exception of any materials or script references they have.
However, if in the project file area you do the magical “create prefab” and then drag the object from the stage back onto the prefab you have created it automagically becomes a class.

Now if you use the prefab object to populate the stage you end up with multiple instance of the same base object. Are all you objects too big? resize one on the stage and say “apply to prefab” it will ripple the change back to the base class and then back out to all the instances.
Each object can still have its own configuration. e.g. drop a rotation script on the prefab, they will all rotate on stage/scene.
However if you expose parameters on that script you can set the rotation speed individually for each of those objects. i.e. overide the defaults.
The visual nature of the objects and the scene and the visual application of changes is a great teaching tool for those people not yet quite grokking the whole class and instance thing in regular code.
It would be nice if when creating a new object in the scene you were prompted to make it a prefab and 9 times out of 10 that’s what you want to do, but thats a minor thing.

A powerful part of the gaming recipe – Graphics

This video is doing the rounds and was used at the FCVW conference showing the powerful rendering capabilities of Cryengine 2, Unity3d and Unreal engines.

I think of all the elements in this the live linking to Maya showing the boned and rigged wireframe being manipulated at the start starts to open up peoples appreciation of what goes into these engines.
Also with the fantastic level of graphic quality you need a fantastic level of modelling and texturing. Awesome lighting still needs to be placed on set in the right place. All this is also before you get to the layer of gameplay, the way that a multiplayer environment might synchronise its data. The rules of any game, the testing of the entire product, the sound design, music etc etc.
A graphics and physics middleware selection is important, and these render tests really show the potential, but there is a lot more.
Having said that though lots of the rest is more standard software engineering and IT architecture. It has to blend with the rich visuals of the user experience. Many techies have traditionally not been interested in the front end, its too obvious when it goes slightly wrong I think 🙂
Anyway enjoy the video, think under the graphics and see what amazing creations can be put together for work and play.

Browser to unity3d communication and back again

I have been doing a fair bit of unity3d recently again. In particular I have been looking at the ways it can take data and parameters. It’s all in the unity documentation but there were a few subtle things I missed first time around that I thought it worth sharing, as much for my memory as anything.
The first useful thing is the unity plugin is able to simply talk back to the browser and call javascript functions in the page. So in C# for example I am able to do this.

void Awake ()
{
Application.ExternalCall( "callbackunity", "The game says hello!" );
}

Where the page that the unity3d is served from has

<script type=”text/javascript”>
<!–
function callbackunity(arg)
{
alert(arg);
}
–>


Obviously you can do more than just an alert so I looked at what I can send back into unity3d from the page and started to do this in the calling page.

<script type=”text/javascript”>
<!–
function callbackunity(arg)
{
alert(arg);
var unity = unityObject.getObjectById(“unityPlayer”);
unity.SendMessage(“Rezzer”, “inboundfunction”, “item1~item2~item3”);
}
–>
</script>

This gets the unity plugin module and calls a function called inboundfunction that is attached to a unity game object called Rezzer. It is only able to pass a single value so I send a string with a known seperator ~ to be able to send more than one piece of data.
So the flow is that unity loads, awakes and then makes a callback to the page which then injects the data into unity.
On the unity side I have this sort of function

void inboundfunction(string indata)
{

string[] words = indata.Split('~');

data1 = words[0];
moredata2 = words[1];
anotherpiece3 = words[2];

}

At first this all did not work (of course). I thought I had not put the right script on the right object as I was getting a callback to the page but not injecting the data into the unity object.
This turned out to be something quite simple in the end. The unity docs example shows var unity = unityObject.getObjectById(“UnityContent”); However the page I got generated out of unity3d that I used to then add my code to used a different label for the Unity plugin in the setup. It called it “unityPlayer”. So my failing code was because the js in the webpage was not picking up the right object. As we know computers need to have everything exact.
This was almost code blindness. I was thinking it was getting the unity object, of course it was how could it do anything other, but its an obvious school boy error “UnityContent” <> “unityPlayer” 🙂
Once that little bug was sorted out it was all plain sailing. The parameters I pass as item 1,2 3 etc are generated by PHP from Drupal that embeds the unity3d. So I can send anything to the unity based on which page is being served and by whom.
One of the other things I do though is use direct WWW communication to a server from inside the unity3d. This initial set up code is to establish some start parameters, once running communication is not via the browser, but a hotline to server instead.
That all just works as documented, though you have to make sure you are serving from and talking to the same server or dealing with the cross domain policy documents that help protect web apps from rogue applications in browsers.
This is all very basic code really, but if you are not from a web world it can seem a little unusual.
e.g. in .cs in unity3d

IEnumerator sendIt ()
{
// Create a form object
WWWForm form = new WWWForm ();
// set up fields
form.AddField ("data1", "some data");
form.AddField ("userscore", score );

// Create a download object
WWW download = new WWW ("http://someurltohandlethings", form);

// Wait until the download is done
yield return download;

if (download.error != null) {
Debug.Log (download.error);
print ("Error downloading: " + download.error);

} else {
print ("Sent");

}

}

Due to .cs needing to multi thread this is an enumerated function which means you have to call it like this when you want to send anything

StartCoroutine (sendIt ());

As most of my quick unity3d pieces had been in .js this StartCoroutine was not as obvious, though it is in the Unity docs.
The URL I call has some PHP that gets at the form elements, but we are in normal web territory then.

$somedata = $_POST["data1"];
$somescore = $_POST["userscore"];

Of course all the error handling and data handling can (and is) much more elegant but this all seems to work very nicely and the core of the communication I am able to drop into anywhere.

My series 1 TV showreel

I got to hang out in the edit suites at MTV Camden today where the magic of TV gets crafted together from all our bits of film. John was making a showreel for the entire show to take to New York and the Kidscreen summit a version of that will get posted soon.
Afterwards though I got to suggest some pieces for my own personal showreel. This is all very exciting as much of the official website doesn’t work outside the UK. We stuck to pieces of series 1 (apart from the end as a taster of the current series). It keeps the comedy spirit and shows a range of things. My acting is getting better I promise over time 😉

See what you think.
Dont forget The Cool Stuff Collective ITV1 9:00am Saturdays

Augmented Reality – Evolution in 3 mins

On The Cool Stuff Collective this week, that just aired. I got to talk a little about AR. Whilst we did not show any of the more traditional camera/marker overlay for various reasons I think we covered a lot of AR ground from marker triggering with fiducial markers and creating magic mirrors all the way to the Vtech kids video camera that acts as a live AR magic lens. Then mentioning the display contact lenses as a future way of delivering information to us in physical world.
Magic cubes
It was particularly cool for me to be able to use the Junaio triggering Royal Mail stamps that kick in a video of Bernard Cribbins.
AR video camera
Its a real bind getting a video feed out of some of these smartphones, this was a Droid, but the Iphone is also very awkward. So whilst we did connect and did trigger the video and it really does work it was better for Archie Productions to edit in the actual video.
I think we may end up with some more AR content down the line though as there are some really good products and demos like the ones we got to see in Finland OEM 2010 using Total immersion D’Fusion.
For the program I had created a Junaio channel for Feeding Edge which you get a floating Cool Stuff text model floating above the Cool Stuff TV logo if you point at it. Its all very doable! Just did not come out on the screen too well without that pesky video feed and screen shots don’t do AR justice.
Also the website going live with some Uk only video did mean I could pop into SL and do some virtual world augmented reality.
lego universe via TV in SL
Epredator getting to see G33K me streaming into a media texture talking about another virtual world the brilliant Ledo Universe Online which goes live in a few days. You have to love the meta loop !
Also great to see the CYGLO tyres running on the TV more on those at http://www.nightbrighttyre.com/

Unity3d Version 3.0 is live and looking awesome

I have been having a look at the beta of Unity3d 3.0 for a while, but nothing is as good as it going gold and live. It comes packaged with a wonderful looking demo called Bootcamp. There is a version of the demo (with a bit of an in game cutscene before getting to the 3rd person part.
The simplicity both of getting Unity3d running, i.e. its nicely self contained means you can just dive in and make things. There are some new scripts to help like a 3rd person script and a new demo character with animations of a construction worker. It really could not simpler, yet there are tonnes of features for the more pro focussed game programmer and graphic artist.
Snapz Pro XScreenSnapz076
The demo uses a very large terrain with lots of detail and debris. The player character is using a locomotion system to animate over and around the obstacles. Physics is in full effect if you enter the derelict building and start shooting at windows and cans. Things deform, break and fly around.
Snapz Pro XScreenSnapz077
Its all just sitting there on your hard drive ready to explore and see how its all created.
Snapz Pro XScreenSnapz079
There are some handy hooks into MonoDevelop to allow editing of code, breakpoints and inspection as we have got used to on other development platforms. In true Unity style it just works.
If you have not already downloaded the free version, and you are in anyway a techie or designer go and get it now !
It really should be something in every school IT lesson too. The ability to make things happen with real programming behind it will make more kids get to understand programming and the sciences behind that.
I really wish we had had this when I was starting out, so now I want everyone to go have a go look.