Wednesday, 21 May 2014

Adding the Framework to an Existing Project: Unity Bootcamp.

The final part of my dissertation was to show how easy it is to integrate the Survival Framework into a new or existing project.  I choose an existing project from the Unity Store, called Bootcamp.  The Bootcamp project was created by Unity to showcase and outdoor environment with new lighting functions; I thought it would be apt to add my framework to this.

Integration was fairly easy and took 5 minutes.  I only needed to make a couple of changes, first to create and Input for Sprinting and second to identify where the movement speeds were contained in the Bootcamp scripts.

First, I imported my package to the Bootcamp project.


(Click the image for a larger version)
Next, I located the Survival Prefab folder which imported from the package and dragged the _Environment prefab into the Scene, then set a weather preset; in this instance Clear (Cold).




(Click the image for a larger version)
As we can see from the following image, upon pressing play we have the Environment Control Script working as it should, by seeing the Debug Information on the upper-right hand side of the screen.




(Click the image for a larger version)
Once this feature had been identified as working, I went on to integrate the Player Control Script; turning on the Debug Information and adding the Input identifier I'd created earlier from Sprinting.



(Click the image for a larger version)
Now that everything has been set up in the editor, all that was left to do was to identify the variables for movement speeds in the SoldierController script, and modify them using our SlowMovement() function.




(Click the image for a larger version)



(Click the image for a larger version)


The framework has now been set-up and successfully applied to an existing project with no more than 5 minutes of work. All that is left to do is test functionality, you can try yourself by clicking the link after the image.



(Click the image for a larger version)

Try the Web build here:  http://goo.gl/OAjfic

The build size is 50mb, loading times will vary depending on your connection speed.









Functionality of Player and Environment Scripts complete.

I have now completed all scripts for my artefact, the Environment Control Script has a Debug Output much like that of the Player Control Script and can be seen below.



(Click the image for a larger version)

I will be posting links to Web Builds for the Final Artefact in the next few posts; one of which will be the package applied to an existing Unity project; which is not of my own making. 


Let's Talk: Weather Zones

This was mentioned in earlier posts, but let's do a re-cap. A weather zone, within the development of this artefact, is an area of game-space that can have a different weather preset than that of the one created globally; by the Environment Control Script.  When a player enters the area, which is a trigger, the script saves information such as the current weather preset and/or custom values set by the end-user.  It then alters them to those created for within this zone.  When a player leaves the zone, the script sends the previously saved information back to the Environment Control Script, thus restoring the normal weather settings.  I have created a Prefabricated Object from this, which is essentially a drag & drop object.

The Inspector View for this script is simple and did not require a custom Inspector View, as you can see below.



(Click the image for a larger version)

The script for this object can be seen below, along with the translated version to C#; in that order.


Monday, 19 May 2014

Translation Completed.

As mentioned in earlier posts, I have also completed translation of all scripts to C#.  There are minor differences, such as variable declarations and function layouts.

In order of appearance:

- PlayerControl.cs
- PlayerControlEditor.cs
- EnvironmentControl.cs
- EnvironmentControlEditor.cs




Environment Control Script - Editor & Inpector with Inspector View

The environment control script has now been finalized in Javascript.  A much simpler set of controls than the other script, but can still be quite powerful as it defines the global environment which effects the player physically.

I have created the script around some simple helper functions, so the end-user can set weather conditions via code from anywhere they wish during runtime.  They will also be used by the 'WeatherZone' prefab, which as described early is an area in which the environment variables can be different from those set globally, and override the global variables accordingly.

For now, here are the final scripts for the Environment Control; starting with the Inspector viewpoint.



(Click images for larger versions)
As you can see, the end-user can select from a handful of weather presets or create their own.  Now for the Environment Control Script and Inspector Scripts accordingly.



I have finished the translations for all scripts aswell, I shall be displaying those in the next post.

Saturday, 17 May 2014

A Minor Deviation.

The development of this framework has been lengthy and time-consuming; as such I hadn't allocated myself enough time to gain user-feedback as I had originally intended, and will not be able to before the artefact has been submitted.  I have discussed this with Chris Janes.

On a much brighter note, development is coming to an end. I have learned a lot, and will reflect upon it in the coming week with my final posts, including how I plan to use my new-found knowledge in the future.

Thursday, 1 May 2014

Player Control Script - Editor & Inspector with Inspector View

The player control script has now been finalized in Javascript.  I have avoided giving the developer finer control over the Hypothermia and Hyperthermia features due to their heavy link to the Environment Control Script.  I will be including prefabricated trigger objects that will work with the Environment Control Script to allow for multiple "Regions" of weather effects.  These triggers will effectively switch between weather presets on the Environment Control Script, and affect the player accordingly.

For now, here are the final scripts for the Player Control; starting with the Inspector viewpoint.



(Click images for larger versions)
As you can see, I have allowed a large amount of customization; in fact, nearly every variable related to the physiological effects can be altered by the end-user. Now for the Player Control Script and Inspector Scripts accordingly.



I will be posting the scripts for the Weather Control in the next few days.  It will also have a custom inpector, allowing the end-user to change variables in various presets.  I will then finalize the translation to C#.