BuyMeACoffee

Buy Me A Coffee
Mostrando las entradas con la etiqueta Unity3d. Mostrar todas las entradas
Mostrando las entradas con la etiqueta Unity3d. 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.




jueves, 11 de junio de 2015

Video games statistics using Web API 2 and SQL Server Reporting Services


Note: Remember you can click/touch over the images in order to enlarge them.

Implementing your own statistics is incredibly useful since you can customize and track all the data you want, you can track any action in your game and create reports based on the data you have captured, reports that will be very useful to analyze game status, players behavior and to make decisions based on your findings.

By combining SQL Reporting Services with Web API 2 you can create a cross platform system.
The only other required component is the actual client which will send the data, in Unity we can take advantage of the WWW class to build the message and post the data to the server.

First, in the server project, we implement a class to handle our data, in this case we created "GameSessionStatsModel", since we are tracking per session data.


Then we implement the actual Controller, we named it "GameStatsController"



We now proceed to implement the Post action


In this action we mark the parameter with [FromBody] because we have the data in the body of the message we receive, you could have it with [FromUri] instead in case you are sending the data in the url.

Now, if you are using Unity, you can take advantage of coroutines, and the WWW class


In this method, we create an instance of the WWWForm, we specify that the Content-Type is going to be in json format with the frm.headers["Content-Type"]
To add the field we need to send we use the .AddFields methods of the WWWForm instance object,
the name of the string must match the exact name of the properties in the class GameSessionStatsModel implemented before.
Then we build the url we need to send, by default Web API 2 will be [serverUrl]/api/[controller]
since our controller class is named "GameStatsController" our url will be [serverUrl]/api/GameStats

Note: replace serverurl with your correct url.

Then we create an instance of the WWW class, we send the url and the form as parameters in the constructor, and we use the yield keyword to execute the request and wait for a response to be received, since in our code we are constantly updating data, we also use WaitForSeconds, with the desired amount of seconds, in this case we are using 5 seconds for testing purposes.

Now, let's go to the reports.
Use the Business Intelligence templates to create a Reporting project in Visual Studio, and create a new empty report
Design Mode



Preview Mode


In this case we created a report to see how many sessions exist for each single platform we send data from.

Hopefully it has been useful to you.

Don't hesitate to contact us for our services:

US Phone: +1 (321) 200-0156
CR Phone: +(506) 8705-4494
Email: services@pticostarica.com

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.