BuyMeACoffee

Buy Me A Coffee
Mostrando las entradas con la etiqueta Unity. Mostrar todas las entradas
Mostrando las entradas con la etiqueta Unity. Mostrar todas las entradas

domingo, 12 de mayo de 2019

Amazing Assets for you #Unity3d Projects

Suburb Neighborhood House Pack (Modular)

This package created by Finward Studios allows you to create beautiful residential neighborhoods.
Take the advantage of the fact that is designed thinking on modulairty,
allowing you to create many different houses with little efforts.


Buy this package today and you will have your neighbor done in no time.



Digger - Caves & Overhangs

For a long time it has been very difficult to create caves in Unity3d, it's default terrain system was not designed for it, so one of the common approaches was to create 3d modles which would include the caves, holes, and similar structures to be placed into the scene.
This package by Amandine Entertainment, allows you to create caves in your scene very easily.
Buy it today, before it's too late (it's currently at a disccount)



martes, 6 de diciembre de 2016

Recommended Assets for Unity



If you are starting in Game Development or if you just want to speed up your development you will probably want to use resources from the Asset Store, in this post we will recommend you some of those we like the most.

Urban Construction Pack by Quantum Theory

This package gives you a lot of value, it allows you to quickly and easily create cities, from roads to modular buildings, allowing you to heavily customize your designs, it also has an integrated traffic light system.


100+ Magic Particle Effects by UETools

This package allows you to create cool particle based elements such as magic


2D Animated Fantasy Knight, Dragon and Princess Pack by Murlyka

This is a must package if you like Knights and Dragons, or if you want to create an interesting game such as Dragon Adventures (Videos are in spanish)

2D Platformer Art Pack by One Point Six Studio

This package can be used to create 2D platformers. Dragon Adventures (Videos are in spanish)



Substance Database 2.0 by Allegorithmic

If you want to have scenes looking awesome this is a must have, Substance Database gives you over 1000 substances including 650 Physical Based Rendering materials.

Low Poly City Pack by Dynamic Art

Another must have, this package allows you to quickly create amazing cities at a fairly low price.

Christmas Megapack / Low Poly by BRAiNBOX

This package will allows you to create a great X-mas based project.

If you have or know any assets you'd like to include in this list let us by writing an email to services@pticostarica.com

jueves, 28 de abril de 2016

Uso de #Resources en #Unity



En los videojuegos muchas veces resulta necesario poder agregar objetos a la escena bajo ciertas condiciones, por ejemplo en el caso de videojuegos RPGs con magias, el elemento que tiene la animación y las partículas que representan la magia, debería ser creado cada vez que se utiliza la habilidad, las balas por ejemplo podrían igualmente ser creadas programáticamente a la escena cuando se necesitan y destruirse (eliminar de la escena) cuando ya no se necesitan.

En Unity la creación de objetos se puede hacer con Resources.
Vea el siguiente video para aprender como crear y destruir objetos de la escena utilizando Unity.




martes, 21 de julio de 2015

Basic "shoot to target" in Unity 3D

First, let's create a new Unity 3d Project, and select 3D.

Let's add a terrain GameObject-3D-Terrain.
Import Characters package Assets-Import Package-Characters, select all, and click Import.
Find the ThirdPersonController in the Project pane(use the search tool if you can't find it) and add it to the scene.

Create a Cube GameObject-3d Object-Cube. Name it ShootBox.
Create a Sphere GameObject-3d Object-Sphere, set its scale to 0.5 for x,y,and z. Name it BulletPlaceHolder.
Create a folder Resources.
Drag the two recently created objects into the Resources folder.
Create a Scripts folder.
Create three scripts: Bullet.cs, Player.cs,ShooterBox.cs, and add their respective code

Bullet.cs

using UnityEngine;
using System.Collections;

public class Bullet : MonoBehaviour
{
    private float Speed = 3.5f;
    public GameObject Target = null;
    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (Target != null)
        {
            float step = Random.Range(1,5) * Time.deltaTime;
            this.transform.position = Vector3.MoveTowards(this.transform.position, Target.transform.position + new Vector3(0,0.5f,0), step);
        }
    }

    public void OnTriggerEnter(Collider other)
    {
        Debug.Log(other.name);
        Player playerComponent = other.GetComponent<Player>();
        if (playerComponent != null)
        {
            int newHealth = playerComponent.Health - 1;
            if (newHealth == 0)
            {
                Time.timeScale = 0;
            }
            else
                playerComponent.Health = newHealth;
            GameObject.Destroy(this.gameObject);
        }
    }
}

Player.cs

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Player : MonoBehaviour {
    public int Health = 100;
    public Text HealthText;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {

}

    void OnGUI()
    {
        HealthText.text = Health.ToString();
    }


}

ShooterBox.cs

using UnityEngine;
using System.Collections;

public class ShooterBox : MonoBehaviour {

// Use this for initialization
    private GameObject player;
    private float lastTimeShooted = 0;
    public int ShootIntervalInSeconds = 15;
void Start () {
        this.player = GameObject.FindGameObjectWithTag("Player");
}
// Update is called once per frame
void Update () {
        if  ((lastTimeShooted + ShootIntervalInSeconds) < Time.time)
        {
            GameObject loadedResource = Resources.Load<GameObject>("BulletPlaceHolder");
            GameObject newInstance = GameObject.Instantiate<GameObject>(loadedResource);
            newInstance.transform.position = this.transform.position;
            Bullet bullet = newInstance.GetComponent<Bullet>();
            bullet.Target = this.player;
            lastTimeShooted = Time.time;
        }
}
}

Add the Bullet.cs script to the BulletPlaceHolder prefab.
Add the ShooterBox.cs script to the ShooterBox prefab.
Add the Player.cs script to the ThirdPersonController in the scene
Create a Canvas object and add two objects to it: HealthLabel, HealthText
Go to the ThirdPersonController in the scene, in the inspector find the Health Text field below the Player script and assign the recently created HealthText object.

martes, 10 de marzo de 2015

Algunos tips para la creación de videojuegos

La creación de videojuegos es todo un arte, de eso no hay duda,
necesita creativad, dedicación y muy buena planeación.

A la hora de hacer un videojuego existen una serie de elementos que se deben de tomar en cuenta, de manera que el objetivo se cumpla.

¿Cómo se hacen los videojuegos?

Existen muchas herramientas que ayudan en esta tarea, desde lenguajes de programación hasta Game Engines, estos últimos son software frameworks especialmente diseñados para la creación y desarrollo de videojuegos.

Entre los Game Engine más populares se pueden encontrar:

¿Qué más se necesita para hacer videojuegos?

Una vez teniendo una idea, es sumamente recomendable hacer lo que se conoce como un Game Design Document(GDD por sus siglas en inglés)

El Game Design Document, es un documento de diseño que describe el juego que se desea realizar.
La recomendación general es que este sea de al menos 10 páginas, dentro de su contenido habrán elementos tales cómo:

  • Objetivos del Juego
  • Game Script
  • Conceptos de elementos del juego(personajes, mundos, niveles, pantallas, entre otros)
  • Género del juego
  • Controles (teclado, touch, mouse, acelerómetro, giroscopio)
  • Requerimientos Técnicos
  • Detalle de las herramientas a utilizar
  • Detalle de los personajes(nombre, vestimenta, colores, voz, movimiento, personalidad, fortalezas, debilidades, miedos, estilo de pelea, tipos de ataque)
  • Detalle de material de referencia(otros juegos, videos, películas, animaciones, etc)
  • Métricas(tamaño de personajes, peso, altura, velocidad, distancia según el tipo de ataque)
  • Tipo de cámara(2D, 3D, Frontal, Isométrica, Vista Aerea, etc)
  • Detalle de los elementos del Heads Up Display(HUD)
  • Detalle de Música, y sonidos a utilizar, y en que momento y situaciones del juego
  • Elementos de combate(habilidades, daño, etc)
  • Estrategia de mercadeo
  • Recursos requeridos(Herramientas, recurso humano, capital/financiamiento)
  • Duración estimada del proyecto
  • Cronograma estimado del proyecto
El GDD puede ser muy simple o muy complejo dependiendo del tipo de juego que se quiera hacer, sin embargo es altamente recomendable tener al menos un GDD básico donde se plasmen los detalle de la idea del juego, de manera que se pueda recurrir al mismo cuando sea necesario, así cómo para no salirse considerablemente de las guías básicas que se pongan en este.

El GDD puede ser un documento de texto, aunque también existen herramientas para hacer el trabajo mucho más amenos. En nuestro caso se trabaja con la versión de steam de Articy:draft 2 SE
ya que permite tener una representación visual de los flujos en el juegos tales cómo flujo de pantallas, flujo de la historia, etc, así cómo adjuntos para todo tipo de asset y la versión de texto del GDD.

Para mayor información sobre el GDD, se recomienda este libro:
Level Up! The Guide to Great Video Game Design

¿Pero y cuando entramos a la parte divertida, el desarrollo del juego?

Una de las tantas razones para hacer el GDD primero, es para tener una idea clara de lo que se desea implementar, así cómo los recursos de arte necesarios, estos recursos pueden estar en su fase conceptual.

De esta manera ahora podemos comenzar a implementar un protitipo.
Que funcionalidad implementar primero, dependerá usualmente de los gustos, sin embargo, es preferible comenzar con tareas pequeñas y que tengan un efecto visible, por ejemplo, diseño de pantallas y/o mecánicas de juego básicas. De esta manera se adelanta un poco el prototipo y se siente que hay un progreso en el desarrollo.

Durante la implementación del prototipo, se descubrirán aspectos que deberán se modificados, es recomendable, mantener el GDD actualizado con cualquier cambio que se realice.

Conforme se vaya progresando y corrigiendo aquellos aspectos que presenten la necesidad, el prototipo irá tomando forma y se convertirá en un Producto Mínimo Viable (MVP por sus siglas en inglés)

¿Quiero hacer mi personaje pero no sé cómo?

Para la creación de personajes se utilizan herramientas especializadas para modelado, animación y rigging, algunas de las más utilizadas son:
Sin embargo, todas requieren de un proceso de aprendizaje y dependiendo el tipo de personaje o elementos que se quieran modelar, se deberán utlizar técnicas específicas para tal proceso, adicionalmente para videojuegos, es recomendable hacer modelos clasificados cómo "Low Poly models".
Básicamente entre menos polígonos tengan los modelos, menos procesamiento y cálculos internos son requeridos, así cómo un menor uso de memoria, cabe destacar que menos polígonos también significa menor detalle de los modelos, es un balance necesario de tomar en cuenta y dependerá mucho del tipo de videojuegos y las plataformas sobre las que se planea correr el videojuego.

En PTI se ha probado una herramienta de Mixamo llamada Fuse, la cual permite a partir de plantillas, crear personajes y personalizarlos de acuerdo a las necesidades. También tiene una tienda virtual donde se pueden obtener modelos y animaciones. 

Esta herramienta es bastante útil si se tienen los recursos económicos para aprovecharla.

Aparte de las herramientas anteriormente mencionadas existen tiendas virtuales donde se pueden obtener modelos 3d, y algunos con rigging y animaciones, varían en costos desde gratis, hasta cientos de dólares.

Algunos de los sitios conocidos donde se pueden encontrar modelos, son:
Cabe destacar que es necesario fijarse en el tipo de licenciamiento de cada asset, así cómo su facitibilidad de uso (muchos no estarán pensados para ser utilizados en videojuegos o en determinadas plataformas)

¿No sé programar, que hago?

Con los game engines como Unity y Unreal, es posible hacer pequeños videojuegos sin escribir una sola línea de código, y los respectivos mercados virtuales de dichas herramientas tienen recursos que aumentan considerablemente la calidad y tipos de juegos que se pueden realizar.
Sin embargo para aprovechar todo el potencial de las herramientas es recomendable aprender a programar en los lenguajes respectivos soportados por el game engine de preferencia, o aliarse con personas que tengan conocimiento en el área de programación y que preferiblemente (aunque no necesario) conozcan las herramientas.

OpenGameArt.org

El sitio OpenGameArt.org cuenta con una serie de recursos gratuitos especialmente diseñados para ser utilizados en videojuegos.

Sonido:

El sitio https://www.freesound.org/ ofrece una colección de sonidos bajo la licencia Creative Commons.

Substance Painter

La herramienta Substance Painter es un recurso sumamente útil para la creación de texturas para assets 3D. Básicamente se puede pintar cualquier material sobre cualquier sección del mesh. Esta herramienta combinada con el Substance Database ofrece una infinidad de posibilidades sobre los diversos tipos de texturas y combinaciones que se puedan hacer y en poco tiempo. Tiene un costo económico considerable, pero si se le saca provecho es una buena inversión y aumenta las posibilidades de recuperación de la inversión no solo en assets de modelado, sino también en los videojuegos al aumentar la calidad de los mismos.


Otros recursos

lunes, 16 de febrero de 2015

Mini games

Explode The Bombs!


Find all bombs and make them explode, before there are too many.

First Stage



Second Stage



domingo, 15 de febrero de 2015

Update on works in progress

We are working in two owned video-games:

1. Zephyr: 

Conceptualized as a 2D RPG isometric game. The story focuses on a young female hero, who needs to restore the peace between humans and animals. The main message of the game is the need to protect animals.

A gameplay concept can be seen here:



2. Detective Kids:

Conceptualized as a 3D simulation game. The story focuses on a young boy who gets lost and needs to find his way back home. He needs to put his skills to the max. The main objective of the game is to enhance kids deductive reasoning.
Currently we are working on building a city layout and AI, which will be used on multiple owned video-games.
A video on progress can bee seen here:


Integrating Crowds:

Crowd is using Audience Crowd package by 8bull:


Note: The credits for the assets are in the youtube video descriptions

viernes, 9 de enero de 2015

Unity3D - Basic Gamepad setup


Here I'll try to explain a simple way to setup a gamepad to work in Unity3D.
First, we have to configure the editor(Edit->Project Settings->Input), by creating as many buttons as required create a name of your choice for each and in the value of Positive Button use "joystick button 0" for first one, then, increase the number accordingly for the rest.


This will create an axis for each.
Then we create our script, which we also have a Name.
This Name will later be set accordingly in the inspector.
The Actor field in the script is just a shortcut to simulate click a button of your choice, not required, but certainly a shortcut for my own purposes.

[Serializable]
public class GamepadButton
{
    public string Name;
    public Button Actor;
    public bool ButtonState
    {
        get
        {
            bool _buttonState =Input.GetButtonUp(this.Name);
            if (_buttonState)
                this.OnPressed();
            return _buttonState;
        }
    }

    private void OnPressed()
    {
        this.Actor.onClick.Invoke();
    }

    internal bool IsPressed()
    {
        return this.ButtonState;
    }

}

[Serializable]
public class Gamepad
{
    public GamepadButton Button0;
    public GamepadButton Button1;
    public GamepadButton Button2;
    public GamepadButton Button3;
    public GamepadButton Button4;
    public GamepadButton Button5;
    public GamepadButton Button6;
}



Then we add a Gamepad type property to our player's script

public Gamepad GamepadConfig;

which will allow us to configure it from the inspector


Notice that on the Name configuration we had used the same names as when configuring the gamepad in the Project Settings Input.

In my personal situation what I am doing is detecting which gamepad button was pressed and based on that execute the respective action of the Actor button.


I hope you have liked it and that it works for anybody.

As always, This is just a basic sample, I'm not an expert myself and there will always be much better ways to do things.
Feedback is always welcome

jueves, 1 de enero de 2015

Unity3D - Easily Handling Player's Objectives

A really easy way to handle player's objectives in Unity3D, is by taking advantage of these features:

  • Game Object hierarchy
  • Using public fields in scripts
  • Drag and Drop objects into public fields



With that said, this is what we can do:
  1. Create an empty game object
  2. Create a new child object per objective we want to represent
  3. Move each objective to the corresponding position(To make it easier you can click on the cube in the inspector once you have selected the objective, this will show the icon and name of the object in the Scene view)
  4. Attach a collider marked with trigger so that it does not block the player movement.
  5. Create a custom Objective script which will contain it's Name, Description, and other aspects required to handle it's behavior, including the action to perform when collider is reached. One of the important keys here is that each objective would have a "NextObjective" field, which is of the same type of the script(Objective). This helps reducing harcoded logic strings to go into the next objective.
  6. Create a Objectives script, which will contain a field for CurrentObjective and internally retrieves the list of all of the objectives in the hierarchy.
  7. Attach the Objectives script into the player's object, and drag your initial objective into the CurrentObjective field








These are the sample scripts:

Objective.cs:

using UnityEngine;
using System.Collections;
using System.Linq;
using System.Linq.Expressions;

public class Objective : MonoBehaviour
{

    public enum ObjectiveType
    {
        Reach = 0,
        Talk = 1,
        Defeat = 2,
    }

    public enum ObjectiveStatus
    {
        Pending = 0,
        Achieved = 1,
    }

    public enum ActionOnReach
    {
        MarkAsAchieved = 0,
        PlayCinematic = 1,
        PlayAnimation = 2,
        SetTrigger = 3,
    }

    public string Name;
    [Multiline(10)]
    public string Description;
    public ObjectiveType Kind;
    public ObjectiveStatus Status;
    public GameObject Target;
    public Objective NextObjective;
    public ActionOnReach[] ActionsOnReach;
    public Animator animator;
    public MovieTexture ClipToPlay;
    public string TriggerName;

    private void OnReach()
    {
        if (this.ActionsOnReach.Contains(ActionOnReach.MarkAsAchieved))
            this.Status = ObjectiveStatus.Achieved;
        if (this.ActionsOnReach.Contains(ActionOnReach.PlayCinematic))
            this.PlayCinematic();
        if (this.ActionsOnReach.Contains(ActionOnReach.PlayAnimation))
            this.PlayAnimation();
        if (this.ActionsOnReach.Contains(ActionOnReach.SetTrigger))
            this.NextObjective.Target.GetComponentInParent<Animator>().SetTrigger(this.TriggerName);

        ParentScript.CurrentObjective = this.NextObjective;

    }

    private void PlayAnimation()
    {
        Debug.Log("On PlayAnimation: Not implemented yet");
    }

    private void PlayCinematic()
    {
        Debug.Log("On PlayCinematic: Not implemented yet ");
    }

    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player" && this.ParentScript.CurrentObjective.name == this.name)
        {
            OnReach();
        }
    }

    public Objectives ParentScript { get; set; }
}


Objectives.cs

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Objectives : MonoBehaviour {

    public Objective CurrentObjective;
    private Objective[] PlayerObjectives;
    public Image CurrentObjectiveArrow;

    public Text CurrentObjectiveDescription; 

    void Start()
    {
        var objectiveParentGameObject = this.CurrentObjective.transform.parent.gameObject;
        if (objectiveParentGameObject != null)
        {
            this.PlayerObjectives = objectiveParentGameObject.GetComponentsInChildren<Objective>();
            if (this.PlayerObjectives != null)
            {
                Debug.Log("Succesfully found all player objectives");
                foreach (Objective singleObjective in PlayerObjectives)
                {
                    if (singleObjective != null)
                    {
                        singleObjective.ParentScript = this;
                    }
                }
            }
            else
                Debug.LogError("Unable to find objectives");
        }
    }

    void OnGUI()
    {
        this.CurrentObjectiveDescription.text = this.CurrentObjective.Description;
    }
}


This is just one way to do it, although it is not the only way, there are always other ways, some easier, some more complex, and complexity would be based on your game specific needs.