Sunday, 26 May 2013

Image gallery, upload to server

I made my first attempt at uploading to the MM server yesterday, and it worked perfectly. I had a few more bits and pieces to correct in the meantime, and now I have all that done and the project is uploaded. Mission: complete!

I created an image gallery for the about page because I thought the text needed to be broken up a bit. I used a simple solution using the CSS box model rather than using any jQuery. Again, I just wanted it to be nice and simple, as the Unity application is the main focus of the website and, if scaling this out, it would be affiliated with an official site and would not need this page, other than to explain the concept of the museum.


I am very happy to be finished, now I just need to put the finishing touches on the report. It's been a long process, often interesting and sometimes very frustrating, but I now know how to create a web application in Unity and this could be very useful in the future.

Wednesday, 22 May 2013

Rectifying issues in testing

Based on the feedback I received from testers, I had to make some changes to the lake scene. I created cube barriers around all the walls of the terrain so the user can no longer fall (or jump) over the edge. I initially tried to use planes, but there are some fall-through issues with these, so cubes were a better option.

I took on board the feedback about the sparsity of the scene, and did some experiments with the default tree in Unity. However, because the scene was not done to scale, it was difficult to get the tree looking realistic next to the hills and objects, so I decided to leave it out.

An average-sized tree, dwarfing everything in sight.
I also changed the music to something more appropriate; I am using Christy Moore's Ride On, which is Irish-sounding without being too cheesey. I may have to change this based on copyright issues. I then included player instructions on the splash screen.

I think I now have the Unity part of things totally completed. Yay! It's just a case of fixing up the website.

Saturday, 18 May 2013

Testing

I have tested the nearly-finished project on two groups, one in the 20-40 age bracket and one in the 60-70 age bracket. 

A female tester aged over 60 really liked the project; she thought the landscape and models were impressive. She also found the controls very simple to use, an issue I had been worried about. She suggested that there were not enough objects to click on and look at; this is a valid criticism, but for purposes of this project it was necessary only to have one working object as making more would be repeating work already done. I would definitely expand the amount of objects if continuing work with the project, however. She also suggested the landscape was too sparse and that I should add trees and vegetation, a suggestion borne out by members of the 20-40 group.

A male tester aged over 60 thought the project was useful from a historical point of view. However, he had no interest in learning to use the controls and asked that I navigate around it for him. This could be a problem, as many people of this age group will not have  used similar applications such as video games and may not be interested in trying. It may be necessary to make more intuitive controls of a click-and-drag nature. This was my original plan but time constraints did not allow for it. He also wanted to get inside the crannog, which was part of my original plan but I did not follow through on it due to my decision to make the museum open air. In later incarnations I would be willing to make explorable architecture, which will involve significant work with lighting and baking textures. Again, time constraints do not allow me to do this at the moment, but it is something to think about. Both members of this group wanted the Unity player to be smaller, so that the whole player is viewable as you click into the homepage, so I will attempt to do this.

There were four testers in the 20-40 group, 3 male and 1 female. All enjoyed the project, but many were curious about what would happen if they went off the edge of the terrain, so it will be necessary to add more barriers to prevent this. One expressed a desire to explore the lake, but this goes beyond the scope of the project, as there is no facility at Lough Gur to explore beneath water level. One male, aged between 25 and 30, thought the texture on the crannog needed work. I agree, but this is again something I would do in conjunction with making it explorable.

During the testing process, some of the browsers were more suitable than others. Safari is currently my preferred browser for this project. It works well on Firefox as well, but many people use very restrictive pop-up blockers when using this browser, making it impractical. I will advise my users on the best choice of browser on the homepage, perhaps in the splash screen on the web application.

Thursday, 16 May 2013

GUI - Sound toggle and exit button

I have added sound to the project, and I have created button functionality whereby the user can toggle sound on and off, and also exit the Unity application to go back to the home screen. I think sound makes the project more interactive and immersive. The button functionality involved more JavaScript code, which the Unity Community is very useful for. With a lot of this kind of functionality, it's considered quite basic so a lot of people have already done it, and it's not too hard to find examples online.



This one was useful for the on/off button:

http://answers.unity3d.com/questions/303807/music-onoff-switch.html

The exit button really only required the use of the Application.LoadLevel command.

Unity embedded!

I finally succeeded in embedding the web player with suitable dimensions. I decided to use the web page generated by Unity in the build stage and adding my home page elements, rather than attempting to get the player into my already-created homepage, and it works much better. Now all I really need to do is get the cursor constrained to the centre of the application and it has all the functionality I need it to have. Exciting times!

 

Wednesday, 15 May 2013

Terrain barriers

I have just solved the problem of the player falling into the lake and/or off the terrain by placing cubes at the sides of the terrain and turning off the mesh renderer. I placed a plane on top of the water of the lake and again turned off the mesh renderer, and the controller can now happily traverse the lake should he/she so wish. I feel like I've solved a lot of issues today. My website and Unity application are now more or less complete, I just have to iron out a few more issues. Nearly there! (I hope.)

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.

Tuesday, 7 May 2013

Progress with Unity and 3ds max

I have created most of my sample scene using Unity. If I have time I will go back and create one that matches more correctly the shape and topography of the Lough Gur area, but at the moment I just want to make sure everything works. I have imported the crannog, and the plinth is in there somewhere as well. The textures have not transferred. They transferred easily the last time I tried this so I will have to go troubleshooting. I might also make the terrain smaller as there is only a small playable part of the scene and it is a little swamped by all the scenery. I used an overcast skybox, because it's probably more realistic for the Limerick area.

Note: I think the issue with the textures is just a settings problem ie. I didn't check a box that I should have checked. Will sort this out later on, going to continue with the functionality of the scene for now.

     

Friday, 3 May 2013

PHP assignment - useful for the project


Yesterday I handed up  30% assignment for the Advanced Web Programming class that I think will be very beneficial to the project. The task was to create a database with full CRUD functionality in order to make a static website dynamic. Below is an example of the 'read' code and the resulting web page. 



It was quite a difficult project and not all of it works, but hopefully I will be able to iron out the problems to achieve full functionality within the project itself.