Wednesday, 15 May 2013

Application.OpenURL vs Application.ExternalEval

To address one of the problems mentioned in the previous post, the fact that Application.OpenURL only opens the website in the current browser window rather than in a new tab, I did some research on the Unity Community forums and found the using Application.ExternalEval will actually open the page in a new tab, so it is less disruptive to the enjoyment of the viewer. Here is the code I used:

 function OnMouseUp()
    {
    Application.ExternalEval("window.open('http://www.youtube.com','YouTube')");
    }

And the code I replaced:

 function OnMouseUp()
{
    Application.OpenURL('http://www.youtube.com');
}

I still haven't attached it to my own website though. That will be next.

Note: Since originally creating this post, I have added functionality allowing for a page of the project to be opened rather than YouTube, calling the file from my folder structure like so:

 Application.ExternalEval("window.open('../../K00123456_Project_2013/macehead.html','Macehead')");

Splash Screen and web embedding

I created a basic splash screen and loaded the game to playing on clicking the button. It looks dreadful but at least I have the functionality there; I will edit it later.

The problem with the stretched application continues; I have uploaded to the web page but it stretches across the entire browser and does not look good. The code I used is available here:

http://docs.unity3d.com/Documentation/Manual/WorkingwithUnityObject.html#initPlugin 

I have posted on the Unity forums to find out if anyone can help, as I can't figure it out. Hopefully that will show something up. 

Another issue is that, in the finished application, when you click on an object to open a web page, it doesn't open in a new tab, rather it opens in the tab you have open so you have to browse back to the application and restart it. This is a pretty big problem so I am looking into ways to fix this now.

This is how much the application stretches :(
 

Tuesday, 14 May 2013

Level complete!

I've just finished the level - you can navigate round the environment, and click on objects to retrieve information on them. You can also rotate the macehead to get different angles on it. Now all I have left to do in Unity is create a start screen and possibly add some audio, anything else I need to do within Unity is optional. I also still need to work on the website and the embedding process but the main task is done. I'm going to go and reward myself with some GUI tutorials. Hooray!

First Person Controller and terrain constraints

My terrain is essentially finished, I might add some trees and grass later on but at the moment it is the shape I want it to be, apart from one small problem: I can't currently prevent my first person controller from going into the lake and not being able to get out. I have used step offset and slope limit to prevent him from going up the hills, but unfortunately I'm not sure how this works in the opposite direction. I've tried smoothing out the terrain by raising the parts of the lake that I've lowered, and it may just end up being a tedious process of doing that, but I'm sure there is also a scripting method I can use so I have to find that out.


This is what you can see from the lake. But you can't really do anything!

Sunday, 12 May 2013

Outdoor museum?

I rebuilt the terrain to look more like the natural landscape of Lough Gur. I roughly copied the shape of the lake. I placed mountains around it. These do not follow the topography of the real Lough Gur, as I would need access to digital maps to be able to do a really accurate depiction, so I decided it was best to approximate it and take artistic license with it. I imported my assets with textures, and the size of the assets compared to the terrain was not what I expected it to be. I tweaked things a little bit, and then placed the plinth and macehead next to the lake. I really like the way this looks, and I would actually really like to leave it like this and do away with the architecture. The idea here would be to dot several plinths around the landscape and have the user navigate to them, clicking on each item for information. It allows for an outdoor museum where you can look at the objects in the context of the environment rather than inside a building. I may still place the crannog somewhere as a museum object, but I think the idea of the openair museum is much more engaging, and I prefer the aesthetic sense of it.



Thursday, 9 May 2013

Unity file embedded to web

I've had a certain amount of success in that I have managed to create the basics of my Unity application and embedded it to the homepage of my online museum. It has not been seamless; the textures still aren't there, and I have a basic rotation on the macehead but it is not working the way I want it to. This I will sort out soon. At the moment the main problem is the way the web player appears in the page; I was hoping for a small window like in the actual Unity file in game mode, but the window is elongated. I also haven't compiled it at my desired start point and will have to look at creating a GUI as well. That said, I'm very happy with the way things are going so far. This is still my trial file so hopefully I will have these problems ironed out before I get the real thing sorted out.


As you can see, this screen shot shows just how problematic the game window is, but I should be able to sort this out.

Wednesday, 8 May 2013

Inside the museum


I may not have the textures sorted out yet, but I have a macehead on a plinth inside the crannog-museum, which is progress. I'm not made about the scaling here - I modelled all the game assets to scale in 3ds max and it looks like I have a lot of extra space in the museum that I don't need. I think the scaling is actually correct though, I think it's just that I expected it to look a little bit different. I thought I might have time to model some extra objects, but because the macehead took so long, coupled with the fact that many other Lough Gur objects are of much more unusual shape, made me stick to just one. In a larger scale production I would definitely model more - I would have liked to have the shield done. I tried to get the texturing sorted as well, but to no avail as yet. I think the key is to obtain full functionality at the moment, and to worry about the rest later.

I do also have a first person controller in this scene, but I need to add colliders to the objects to prevent the FPC walking where it shouldn't be walking, and I also need to animate the macehead and add the webpage with all its information.