Saturday, 30 November 2013

Milestone One: 1st December.

Code; it's a beautiful thing.  I've been thinking a lot about user-friendly interfaces and making the scripts easy for the end-user to implement, and stumbled upon EditorGUILayouts.  These are just parts of Editor based scripts which allow the customization of Inspector Elements.

So, to create a highly customizable script and set of interfaces for the end-user, I've created an editor script that coincides with my playerControl Script.  The outcome of which can be seen below.



Now, the Editor script essentially organizes my variables in a fashion that is incredibly explanatory; rather than just being greeted by a list with which the end-user has no clue as to the function.

The actual playerControl script is very simple, and will have extended function very soon in regards to fluctuation in _heartRate, _respirationRate and _coreTemperature.



The playerControlEditor script is a little more complex, and took a little research to get right; but I am very happy with the results.  Ease of use for the end-user is key in a project such as this, the script can be seen below.



The scripts are still very much a work in progress, as the project continues it will become a lot more advanced.  So far though, I am happy with the results.

Saturday, 23 November 2013

Producing Core Variables, Continued...

The first milestone on my timeline is to produce a list of variables that create the core of the framework, and that can be customized by the end-user. These variables will require some explanation of their use, and as such will aid the production of the instruction manual for the final product.

I will continue from my last post on the subject of Core Variables.  I have realised that I am not describing certain components of my variables, apologies; description as follows.

Integer:  A numeric variable that is without a fractional or decimal component.
Float:  A numeric variable that can be to multiple decimal places.

Core Body Temperature

_coreTemperatureLow:float;
_coreTemperatureCurrent:float;
_coreTemperatureHigh:float;

_coreTemperatureCurrent will the current body temperature of the player, that will be maintained by the Ambient Temperature of the environment and/or the Weather Conditions (Coming Soon).  The _coreTemperatureLow and _coreTemperatureHigh variables can be adjusted by the end-user and will dictate, along with other variables, which condition to inflict upon the player; an example would be Hyperthermia, inflicted when the _coreTemperatureCurrent is Equal To _coreTemperatureHigh.

Ambient Temperature

_ambientTemperature:float;

_ambientTemperature is a variable that will define the temperature of the environment, this will be used heavily in later features of the framework, including; Weather Conditions and Physiological Conditions.


Driven by Feedback

My proposal has received good feedback, and has made me think about the way I will be creating my artefact.  An excerpt from the feedback given:

"I have concerns that the final product will be so niche that no matter how well put together, you may struggle to get any feedback in the time-frame you have. If that's the case, you need to consider a fallback position to work from, how else can you get feedback about the ease of implementation and other factors?"

The market for this type of code-framework is incredibly niche, but there will be someone out there that will want to use it, but what type of developer and how much interest will be expressed?  I propose to create a forum thread on the Unity developers website, where I will describe the framework I will be creating and try to gain an idea of how much interest there will be; via polls, etc.

I will attempt to kill two birds with one stone, fine out how much interest there will be and allow people to give feedback on the artefacts ease of implementation during development.

Saturday, 16 November 2013

Producing Core Variables, the first of many.

The first milestone on my timeline is to produce a list of variables that create the core of the framework, and that can be customized by the end-user.  These variables will require some explanation of their use, and as such will aid the production of the instruction manual for the final product.

Heart Rate

_heartRate:int;
_heartRateLimit:int;

_heartRate will be the current Heart Rate of the player during the simulation, as beats per minute.  This variable will update according to any other that requires it or affects it.

_heartRateLimit will be the the limit at which the player reaches Tachycardia, or an increased heart rate that is outside of a normal threshold, as beats per minute.  The player will be able to define a script that runs when this is reached, by default a message will be displayed.  A typical use for this would be:

if (_heartRate >= _heartRateLimit)
{
        // Run a script, or display the default message.
}

In layman's terms, the above translates to; If the Heart Rate is Greater Than or Equal To the Heart Rate Limit, run a script or display the default message.

I have decided that, after a little more research, Blood Pressure plays very little part in any of the features that I had previously planned.  After a little more research, it would prove more useful for Respiration Rate to be included, rather than it's predecessor.  Respiration Rate is directly linked to heart rate and as such is valuable when trying to reproduce the symptoms of the conditions in my extended features.

Respiration Rate

_respirationRate:int;
_respirationSpeed:int;

_respirationRate will be the current rate of respiration of the player, whereas the _respirationSpeed will relate to the speed at which a sound re-occurs.  The average respiration rate of an adult is 12 - 20 times per minute at rest.  A highlight of having this variable, aside from the fact that it's linked to the _heartRate is that you can add a sound that can play relating to the _respirationSpeed, ie; the sound of one breathing in and out.  The end-user will have the option to define a sound, it's pitch and volume as well as the _respirationRate and _respirationSpeed.

Friday, 8 November 2013

A Formal Proposal

Title

Can I accurately represent physiological effects caused by the environment on a character in a digital game world?

Outline

I propose the development of a code-framework that will attempt to accurately simulate various environmental conditions, including weather; this framework will be applied to a game world and a character to create realistic survival mechanisms, creating a feeling of spatial immersion. The intended end-user for this framework would be a developer wishing to utilize and represent harsh survival mechanics in a game or project; and have a code-base that is customizable and can be easily integrated. The framework will be programmed as such that it can be applied to new of existing games or projects using the Unity Engine. The framework will be built upon five core aspects which are Heart Rate, Blood Pressure and Core Body Temperature; which can be widely affected by the condition of the environment and the weather and as such a final two core aspects will be Ambient Temperature and Precipitation.

I propose that the framework will be highly customizable, where the end user can tweak everything from temperature ranges to defining their own inventory; where they can check if the player is wearing adequate clothing or not. This, of course, will all be a part of this framework. The framework will not define external systems such as an inventory, but the user will be able to use the framework without one, by simply defining several alternate options.

There are five additional features which will extend from the core features of the framework. They are: Hypothermia, Hyperthermia, Dehydration, Starvation and Fatigue. All of these can be depicted in a game world in some manner and there are many games that have, but not many have produced the accuracy that I propose for Hypothermia and Hyperthermia.

I will be spending the year producing an artefact that will demonstrate in a small simulation that of all the features I propose, Hypothermia and Hyperthermia can be represented as accurately as possible. The project time-line will reflect this.

I wish to be marked upon the efficiency of the code itself, the potential implementation, the relevance to research and its adherence to my initial concept. I do not wish to be marked on the quality of assets (if any) in the final simulation demonstrating the code-framework.

Finally, I propose that during the development of the framework that I allow public access to it, via the Unity Asset Store, to gain valuable feedback; such as whether the framework was easily implemented, if there are any bugs I should know of and a gauge of how much demand there is for such a framework. I hope as an addition, to translate the final artefact into a second language, C#. This will make the framework available to a wider market audience; however this is dependant on milestones being met according the project time-line.

Rationale

I wish to increase my collective knowledge of Javascript, C# and the Unity Engine; in order to produce a high quality and professional piece of work that will become a portfolio piece. This will aid me in interviews for post-graduate employment. Most companies in my job search required a piece of work that could be demonstrated in real-time in which they could access the potential employee's skills. I feel that the artefact I propose will aid me when applying for work in the near future.

Some examples of jobs I have found:

Graduate Programmer / Junior Programmer (Brighton, 18-22k per annum)
Requirements (Filtered): Strong skills in either C++, Java, C# or LUA & Examples of work in the form of source code or an online portfolio.
http://www.cwjobs.co.uk/JobSearch/JobDetails.aspx?JobId=57832584

Junior Programmer (Brighton, Negotiable)
Requirements (Filtered): Solid programming skills, Experience working with C# and object oriented code, Confidence in moving to new languages and platforms, experience making games.
http://www.gamesindustry.biz/jobs/second-impact-games/uk-and-europe/junior-programmer-id64599

Unity Games Developer (Cirencester, Negotiable)
Requirements (Filtered): Created a previous Unity game or demo, Full understanding of the Unity API, Strong knowledge of C#, Strong sense of game design for usability and great user experince.
http://www.glosjobs.co.uk/it-high-tech-engineering-and-creative/it-programming-analysts-etc/programming-analyst-system-testing/gj278554/ 

The aforementioned jobs, as well as the others I have found, require a strong programming skillset and knowledge of the Unity engine. I believe that the artefact that I produce will aid me greatly in gaining the experience required to apply for them.

Creating this artefact is something that I've been thinking about doing for some time, it is a task that requires careful thought and attention; whilst also needing to be user-friendly. I plan for the final piece of work to be available to the general public and in two languages.

I am currently participating in a group project that requires heavy use of Javascript and the Unity engine, I have a particularly good demonstration to show for this and my proposed framework will aid greatly in learning new ways to tackle obscure tasks.

There is currently nothing on the Unity Asset Store that resembles my proposed artefact in a way that creating it would be committing plagiarism. This has been identified as a niche artefact

Annotated Bibliography

Vital Signs (Hopkin's Medicine)
This website displays adequate documentation of three of the five core features of my proposed framework. The text is adequate enough for me to take away knowledge of how vital signs can be read, what can happen if they are too high or too low and there is also some documentation on the temperature ranges I should be looking for to indicate Hypothermia or Hyperthermia.

Hopkins Medicine, Unknown. Vital Signs (Body Temperature, Pulse Rate, Respiration Rate, Blood Pressure). [online] Available at: <http://www.hopkinsmedicine.org/healthlibrary/conditions/cardiovascular_diseases/vital_signs_body_temperature_pulse_rate_respiration_rate_blood_pressure_85,P00866/>[Accessed 30 October 2013].

Dehydration, Starvation, Hypothermia, Hyperthermia & Fatigue (Oxford Medical Dictionary)
This medical dictionary has had great use in the past two weeks, it has a very concise description of the symptoms and effects of Hypothermia and Hyperthermia on the human body as well as other applications; such as lowering the body temperature of a patient in surgery to reduce the requirement for oxygen. It also has more than enough detailed documentation on Dehydration and Starvation that I can and will visually document in my final proposed artefact.

Oxford University Press, 1998. Concise Colour Medical Dictionary. Oxford: Oxford University Press.

Surviving Hypothermia – Part 1 & 2 (YouTube)
In this short two part series, a member of the Backwoodsman's Institute gives a very dramatic example of how Hypothermia affects the body and how to prolong the effects. John survived the ordeal but did give a very good indication of how he felt during the process which was fairly accurate, in accordance to medical documentation.

The Backwoodsman's Institute, 2010. Surviving Hypothermia Part 1. [video online] Available at: <http://www.youtube.com/watch?v=Kpefb1Ia2Q0>[Accessed 8 October 2013].

The Backwoodsman's Institute, 2010. Surviving Hypothermia Part 2. [video online] Available at: <http://www.youtube.com/watch?v=aKa8IMm1p6I>[Accessed 8 October 2013].

ARMA II Modification: DayZ (Game)
DayZ is an artistic modification in which the player is forced to survive the environment of a fictional post-soviet country called Chernarus. The environment contains Zombies, very little supplies to survive on and other players. As a player, you are confronted with adverse weather effects which can bring on the symptoms of Hypothermia. The game mode itself monitors visibility, audibility, heart rate, blood level, temperature, hunger and thirst. This is a good example for me, however the symptoms of Hypothermia aren't very bold; the player gains a blurred vision and must use a heat pack to remove the adverse effects.

DayZ Mod, 2010. DayZ Modification. [online] Available at: <http://dayzmod.com/>[Accessed 5 October 2013].

S.T.A.L.K.E.R: Shadow of Chernobyl (Game)
This is a survival game set in a world shortly after the nuclear reactor failure in Chernobyl in 1986. The player is rescued and awakens in a small camp of survivors, he is tasked with quests the involve going into the radiation zone. This game is beautifully created, the game monitors health, hunger, thirst and radiation level. What makes this game a choice for my research is the detrimental effects of radiation poisoning on the player, which debilitate him over time in different ways.

THQ, 2007. S.T.A.L.K.E.R: Shadow of Chernobyl. [online] Available at: <http://www.stalker-game.com/en/?page=home>[Accessed 5 October 2013].

Hypothermia: Indie Game (Game)
This is a great little flash game, produced by Jacob Albano. The player must access a small wooden house during a snow storm to gain warmth. This is not as easy as you think though, you must use the mouse to search various objects and locations to complete one very simple task; light a fire and stay warm. This, I feel, is a great little example of a game revolving around the symptoms and effects of Hypothermia.

Jacob Albano, 2012. Hypothermia – Experimental Gameplay Challenge. [online] Available at: <http://jacobalbano.com/2012/12/hypothermia-experimental-gameplay-challenge/>[Accessed 19th October 2013].

Shackleton: Part 1 & 2 (TV Drama)
This two part drama tells the story of Ernest Shackleton's expedition to the South-Pole. It depicts the hardship of him and his crew when forced to live on the frozen wastes of the Antarctic when their ship, the Endurance was crushed by ice floes and sank. The crew drag life boats across the ice floe to the sea, where they would endure a 90-mile journey to Elephant island; where Shackleton would leave some crew behind at a camp and travel with five of his crew alone to get help. This series showed me what a man would do to save his crew from the most hazardous environment know to man.

Shackleton: Episode 1, 2002. [TV Programme] 4oD, Channel 4, 2 January 2002. [online] Available at: <http://www.channel4.com/programmes/shackleton/4od#3051711>[Accessed 15 October 2013].

Shackleton: Episode 2, 2002. [TV Programme] 4oD, Channel 4, 9 January 2002. [online] Available at: <http://www.channel4.com/programmes/shackleton/4od#3051712>[Accessed 15 October 2013].

UniStorm 1.6 (Unity Plugin/Extension)
UniStorm is an incredibly powerful dynamic day and night weather system that creates realistic storms and weather in real-time. It is programmed in both Javascript and C#. It features a lot of different weather conditions and gives the end-user the ability to define AI work patterns to time of day and or weather condition.

Black Horizon Studios, 2012. UniStorm v1.6.3. [online] Available at: <http://forum.unity3d.com/threads/121021-UniStorm-v1-6-Dynamic-Day-amp-Night-Weather-System-RELEASED>[Accessed 30 October 2013].

Simulating Weather in Virtual Environments (Article)
In this article, Matt Barton examines the use of weather in games from both a gameplay perspective and an ecological perspective. He argues that whilst weather in most games is decorative, it can be used to create a form of immersive gameplay. This is great viewpoint to read from and describes games such as Microsoft's Flight Simulators as an example for weather-affected gameplay environments; as well as others.

Barton, M., 2008. How's the Weather: Simulating Weather in Virtual Environments. Game Studies, [online] Available at: <http://gamestudies.org/0801/articles/barton> [Accessed 30 October 2013]. 

Property Drawers in Unity (Scripting)
This is a nice bit of documentation that divulges how to give a little bit of meaning to groups of variables. This will aid me, when coding the framework, in grouping relevent variables as not to confuse the end-user.

Unity Technologies, 2012. PropertyDrawer. [online] Available at: <http://docs.unity3d.com/Documentation/ScriptReference/PropertyDrawer.html> [Accessed 30 October 2013].

Timeline

1st November: Submit my Formal Dissertation Proposal.
1st December: Have researched into Heart Rate, Core Temperature, Blood Pressure, Ambient Temperature and Precipitation; create a list of customizable variables that will be user-friendly.
15th December: Have the core elements coded.
1st January: Have researched into Hypothermia, Hyperthermia, Dehydration, Starvation and Fatigue.
1st February: Have the five extended features coded.
7th February: Have done a feedback run, make changes if necessary. (Unity Asset Store, if possible).
1st March: Have researched into specific weather conditions relating to extended features.
7th March: Have made sure that features are customizable, and work correctly.
15th March: Begin work on a user manual, documentation must be thorough.
21st March: Have done a second feedback run, make changes if necessary.
1st April: Go through code, make sure it is correct.
15th April: Create the simulation environment using outsourced assets if necessary.
1st May: Have translated to C#, bug test thoroughly.
7th May: Make sure blog is up to a professional standard, documentation must be up to date.
16th May: Submit final completed artefact.

Glossary

Ambient Temperature
Ambient temperature is a term which refers to the temperature in a room, or the temperature which surrounds an object under discussion. 

Blood Pressure
Blood pressure, measured with a blood pressure cuff and stethoscope by a nurse or other health care provider, is the force of the blood pushing against the artery walls. Each time the heart beats, it pumps blood into the arteries, resulting in the highest blood pressure as the heart contracts. 

Core Temperature
The body’s internal temperature, which is optimal at 37ºC; death generally occurs when the core temperature exceeds 42ºC; cardiac arrhythmias occur at 28ºC or below; asystole occurs at 20ºC 

Dehydration
Dehydration is the excessive loss of bodily water, ie sweating; with an accompanying disruption of metabolic processes. 

Fatigue
Fatigue is a subjective feeling of tiredness which has a gradual onset and can be rectified with periods of rest.

Heart Rate
Heart rate refers to the speed of the heartbeat, specifically the number of heartbeats per unit of time. The heart rate is typically expressed as beats per minute (bpm). 

Hyperthermia
Hyperthermia is elevated body temperature due to failed thermo-regulation that occurs when a body produces or absorbs more heat than it dissipates. 

Hypothermia
Hypothermia is a condition in which core temperature drops below the required temperature for normal metabolism and bodily function.

Precipitation
Precipitation is any product of the condensation of atmospheric water vapour that falls under gravity, ie rain.

Starvation
Starvation is a severe deficiency in calorie, nutrient, and vitamin intake. It is the most extreme form of malnutrition.