Friday, September 21, 2012

A Football Game

Ive been working on a small yet ambitious game over the last 3 months.

It's almost baked, so we're starting up the Hype Machine.

You can see a small preview here.

It follows my usual MO, with a Python backend and a Unity3D client. More coming soon! :-)

Wednesday, September 12, 2012

Spacecraft shading cont...

Today I discovered that Unity3D will let you apply multiple materials to a single mesh. So I used a bump mapped triplanar material, an image based lighting material and a triplanar emissive material on the one ship. I had to adjust the shaders so they would work together, Eg. the IBL shader only uses the emissive channel and blends on top of the previous material.


Monday, September 10, 2012

Spacecraft Shading

After revamping my Spacebox tool I implemented a little shader which uses the spacebox cubemap to apply image based lighting to a model. Realistic lighting in space adds a lot of immersion factor to a scene.


I really want to texture this ship procedurally. I've played with some tri-planar shaders, but am not super happy with the results. Who can tell me a good idea on how to approach this? :-)





Tuesday, September 04, 2012

UniWeb, WWW and crossdomain.xml explained.

I get many confused emails from people trying to get UniWeb to work in the Unity WebPlayer. It works, but you have to set things up correctly, as described in the manual. I'll explain it again here, maybe it will reduce the influx of support emails!


Situation #1.
You want to use the builtin WWW class to fetch stuff from a HTTP server.

In this case, you MUST have a crossdomain.xml file that is hosted by that SAME HTTP server,

This will allow, and ONLY allow Unity's builtin WWW class to work. It has no effect on the usage of .NET sockets within Unity.

This particular setup will NEVER help you get .NET sockets (and by
extension UniWeb) working within Unity WebPlayer.


Situation #2.
You want to use UniWeb to fetch stuff from a HTTP server.

In this case, you MUST have a server process running on a port on the SAME host, which follows the behaviour specified in the manual.

This will allow .NET sockets (and therefore UniWeb) to work within a Unity WebPlayer. The Security.PrefetchSocketPolicy MUST be called before .NET sockets will successfully connect to a host on ANY port.

Particularly note this section from the manual:
Specifically the server expects to receive a zero-terminated string
that contains . It only sends to the client the socket policy xml document when this string (and exactly this string) has been received. Further, it is required that the xml header and xml body are sent with a single socket write.

Also note:
Note: Whilst the crossdomain.xml and socket policy files are both xml
documents and are broadly similar, the way that these documents are served are very different. Crossdomain.xml (which applied to http requests) is fetched using http on port 80, where-as the socket policy is fetched from port 843 using a trivial server that implements the <policy-file-request/>. You cannot use an http server to issue the socket policy file, nor set up a server that simply sends the socket policy file in response to a socket connection on port 843. Note also that each server you connect to requires its own socket policy server.

Monday, September 03, 2012

JS Games

I'm clearly not under enough pressure so I've decided to have a go at the 13K Javascript Game Competition.

I spent some time looking at existing libraries, and it seems clear that very few were designed for tiny 13k games! Obviously I must therefore write my own engine. Chortle. It will be fashioned after the superb design of Unity3D.

Code is on github, and I'm happy to say my base framework weighs in at 612 bytes compressed. Next up, adding things that draw stuff.


Popular Posts