videogames development

Unity – Build – Web Player

Unity – Build – Web Player

0. MAIN TOP MENU> File> Buil Settings> Select Web Player

1. MAIN TOP MENU> File> Buil Settings> ‘Player Settings’> Inspector to setup

2. MAIN TOP MENU> File> Buil Settings> ‘Build’> Scenes in Build> DRAG AND DROP the _Scenes> YourScene

3. 2. MAIN TOP MENU> File> Buil Settings> ‘Build’> Create Folder ‘Builds/space_shooter’> Save

Web Player Streaming

1. MAIN TOP MENU> File> Buil Settings> check ‘Streamed’
2. MAIN TOP MENU> File> Buil Settings>’Player Settings’> Inspector> Other Settings> First Streamed Level

Advantage:

1. If there is a fast download of the first level you will not see the loader progress bar
2. Not annoing download time improves web gaming experience for the end user

This is the best way:

50 KB display the logo and menu (4 seconds)
320 KB let the user play a tiny tutorial level or let him do some fun interaction in the menu (20 seconds)
800 KB let the user play the first small level (50 seconds)
Finish downloading the entire game within 1-5 MB (1-5 minutes)

There is no reason why all music must be available when the game starts. Externalize the music and load it via the WWW class

Reference:
http://docs.unity3d.com/Documentation/Manual/WebPlayerStreaming.html

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – Build – Web Player

Unity – Build – Flash Player

Unity – Build – Flash Player

0. MAIN TOP MENU> File> Buil Settings> Select Flash

1. MAIN TOP MENU> File> Buil Settings> ‘Player Settings’> Inspector to setup

2. MAIN TOP MENU> File> Buil Settings> ‘Build’> Scenes in Build> DRAG AND DROP the _Scenes> YourScene

3. 2. MAIN TOP MENU> File> Buil Settings> ‘Build’> Create Folder ‘Builds/space_shooter’> Save

WARNING: Development Build it is not compressed!

Errors

‘Error building Player: Exception: Could not start java’ you need to install 32-bit JRE:

1. Download: http://www.oracle.com/technetwork/java/javase/downloads/java-se-jre-7-download-432155.html

2. For Win7 64bit is: jre-7-windows-i586.exe (it is 32 bit jre because Unity is 32 bit!)

3. Run the installer as Administrator

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – Build – Flash Player

Unity 3D – Pathfinding – NavMesh Agent – Adventure – Point ‘n Click

Unity 3D – Pathfinding – NavMesh Agent – Adventure – Point ‘n Click

1. Create a NavMesh

2. Create a Sphere, Inspector> TOP RIGHT uncheck ‘Static’, name it ‘hero’

Hierarchy select ‘hero’> Inspector> ‘Add Component’> Navigation> NavMeshAgent, setup:

– Radius: l’ingombro dell’agente

– Speed: massima velocità dell’agente (utile per i giochi di corsa!)

– Acceleration: accelerazione massima dell’agente

– Angular Speed: velocità con la quale è in grado di girare

– Stopping Distance: distanza alla quale inizia a rallentare in prossimità di ‘targetNavigation’

– Auto Traverse Off Mesh Link:

– Auto Braking: se attivo l’agente si ferma automaticamento al raggiungimento di ‘targetNavigation’

– Auto Repath: se attivo l’agente ricalcola il percorso se quello precedente non è più valido

– Height: l’altezza dell’agente

– Base Offset: offset verticale del collider dell’agente

– Obstacle Aviodance Type: High Quality – Low Quality – precisione del calcolo per schivare gli ostacoli (meno è accurato, meno risorse occupa)

– Avoidance Priority: priorità nella navigazione, un personaggio con priorità 1 avrà la precedenza (passa prima) rispetto un personaggio con priorità 2

– NavMesh Walkable: quale ‘Navigation Layer’ può attraversare

4. Select the ‘hero’ and assign:

SimpleAgentScript.js


#pragma strict


        // Script to move a NavMeshAgent to the place where
        // the mouse is clicked.
	private var agent: NavMeshAgent;
	function Start () {
		agent = GetComponent.<NavMeshAgent>();
	}
	function Update () {
		var hit: RaycastHit;
		// When the mouse is clicked...	
		if (Input.GetMouseButtonDown(0)) {
			// If the click was on an object then set the agent's
			// destination to the point where the click occurred.
			var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
			
			if (Physics.Raycast(ray, hit)) {
				agent.SetDestination(hit.point);
			}
		}
	}

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D – Pathfinding – NavMesh Agent – Adventure – Point ‘n Click

Unity 3D Game Engine – Pathfinding – Offmesh Links

Unity 3D Game Engine – Pathfinding – Offmesh Links

With Offmesh Links you can link two or more NavMesh.

1. Create EmptyObject, name it ‘targetNavigation’

2. Create a Sphere, name it ‘enemy’ with:
– NavMeshAgent
– SimpleAgentScript.js

SimpleAgentScript.js:


#pragma strict


    public var target : Transform; // inside Inspector assign the Target object
	private var agent: NavMeshAgent;
	
	function Start () {
		agent = GetComponent.<NavMeshAgent>();
	}
	function Update () {

				agent.SetDestination(target.position);
					
	}

Inspector> DRAG AND DROP over variable Target the ‘targetNavigation’ object

Automatic

3. Create 2 Box

4. Select the 2 Box (CTRL+LMB)>

> Navigation> Object> check OffMeshLink Generation

> Navigation> Bake> Generated Off Mesh Links>

– Jump Distance = 10 (maximum agent jump distance)

– Drop Height = 10 (maximum agent drop height)

> Bake

Manually

3. Create 2 Box, name it ‘start’ and ‘end’

4. Select the 2 Box (CTRL+LMB)>

> Navigation> Object> uncheck OffMeshLink Generation

> Navigation> Bake> Generated Off Mesh Links>

– Jump Distance = 10 (maximum agent jump distance)

– Drop Height = 10 (maximum agent drop height)

> Bake

4. Inspector> Select ‘start’> ‘Add Component’> Navigation> OffMesh Links>

OffMesh Link> Hierarchy

– DRAG AND DROP ‘start’ game object over public variable ‘Start’

– DRAG AND DROP ‘end’ game object over public variable ‘End’

> you do not need to re-Bake

The Character not jumping!

Try to re-setup Navigation> Bake> General> – Height
– Step Height

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D Game Engine – Pathfinding – Offmesh Links

Unity 3D Game Engine – Pathfinding – NavMesh Agent

Unity 3D Game Engine – Pathfinding – NavMesh Agent

1. Create a NavMesh

2. Create EmptyObject, name it ‘targetNavigation’

3. Create a Sphere, Inspector> TOP RIGHT uncheck ‘Static’, name it ‘enemy’> Inspector> ‘Add Component’> Navigation> NavMeshAgent, setup:

– Radius: l’ingombro dell’agente

– Speed: massima velocità dell’agente (utile per i giochi di corsa!)

– Acceleration: accelerazione massima dell’agente

– Angular Speed: velocità con la quale è in grado di girare

– Stopping Distance: distanza alla quale inizia a rallentare in prossimità di ‘targetNavigation’

– Auto Traverse Off Mesh Link:

– Auto Braking: se attivo l’agente si ferma automaticamento al raggiungimento di ‘targetNavigation’

– Auto Repath: se attivo l’agente ricalcola il percorso se quello precedente non è più valido

– Height: l’altezza dell’agente

– Base Offset: offset verticale del collider dell’agente

– Obstacle Aviodance Type: High Quality – Low Quality – precisione del calcolo per schivare gli ostacoli (meno è accurato, meno risorse occupa)

– Avoidance Priority: priorità nella navigazione, un personaggio con priorità 1 avrà la precedenza (passa prima) rispetto un personaggio con priorità 2

– NavMesh Walkable: quale ‘Navigation Layer’ può attraversare

4. Select the Sphere and assign:

SimpleAgentScript.js


#pragma strict


    public var target : Transform; // inside Inspector assign the Target object
	private var agent: NavMeshAgent;
	
	function Start () {
		agent = GetComponent.<NavMeshAgent>();
	}
	function Update () {

				agent.SetDestination(target.position);
					
	}

Inspector> DRAG AND DROP over variable Target the ‘targetNavigation’ object

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D Game Engine – Pathfinding – NavMesh Agent