Monday, November 15, 2021

Week 9( discord Session)

 

To do list

 

1.Environment

Arena

Towers

 

2.Player Units (3D Models,)

Tank

Soldier

Archer

Air

 

3.Enemy Units

Tesla Towers

Inferno Tower

Bomb Tower

Mother ships/ Fat jets

 

4. Player’s Spell

Freeze

Damage

 

5. 2D artwork (For Every unit)





Due to Lock down I wasn't able to use Maya and Unity software at home as my laptop didn't support them , I assume it's because of computer virus, as I use lots of pre cracked software. so I have to re Install windows and start it all again clean. 


while opening Maya/ unity, this happens.








Sunday, October 31, 2021

Week 17

 

30th/ fixing bugs

I did manage to correct most of the bugs from last session. I added the audio, that would constantly play the  game and change in different scene. next I was preparing for audio on/ off button. But for some reason I ended up having bug in my game. 




Fixing Errors and bugs

As I was trying to balance cards on Unity I did some changes that disconnected all my work mechanics in Unity. The min reason was the script being misplaced. Also while adding the sound on different scene for game play, I encountered conflicts within scripts and all my particle effects were acting weird and were not in one place. I assume that's what happens when script errors occurs. 

I have been contently in touch with the Tutor Joe for further help. and I was finally able to zip my files and send it to him. I also had many conversation on discord where I shared all the images/screen shots on problems regarding game. 

I was also saving my work while I was working, is a good practice. However increment and saving would save me from having this issue. For me as a Intermediate game student. It's hard to get stuff right. I am very grateful to have Joe as a Unity Tutor who's a beast at coding and game making. I wish I could code like him one day. :)  


It is easier to be discouraged when things goes wrong. Figuring out the issue, consulting with seniors would eventually fix the thing. Also Thanks to Tutor Chris for extending due date for assignment submission, where I could polish my game nicely. 


Creating animation keyframes inside Unity. 


Instruction Section:


It is a new experience for me to do key frame animation inside unity which is more similar to after Effects and other software. I did manage to give some basic instruction on how to play game as its a part of assignment. Hence, I created a new scene called 'Instruction 'and created some text for each text and animate them, I mainly tweaked some position, scale and rotation values for its dynamic result. One thing to keep in mind is that when we press record button, the key frames are automatically put on the first frame of any animated source. This took me some time to figure out as it was not functionally well.,


Base Layer in Animator panel. right click and make selection to hover over different functions/tab, eg: hello, exit as shown in the picture. 

Also different function have their own properties bar. where we can adjust its overall speed, offset values.

As my key frames were very fast, I did manage to change its speed by 0.3 times. and It appeared fine. 


Tuesday, October 26, 2021

Week 16

 Coding:

One of the best part of gaming making is coding, with which results are easy to achieve, for me the basics on coding got quite interesting as I carry to revise them thoroughly. 

Some of the basics code that I felt easy were, buttons for scene management, providing  options for character like health, attack, destroy, time frame etc. But Some were quite challenging for me to set up by myself which were written by game tutor, Joe.


Here are some of the sample of coding that we did which can be handy for future use and learning.


*Scene management

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.SceneManagement;


public class MainmenuScriptExit : MonoBehaviour

{

        public void MainMenuBtn ()

        {

            SceneManager.LoadScene(0);

        }


    }


*Destroy 

using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class Destroy : MonoBehaviour

{

    public void DestroyObject()

    {

        gameObject.transform.position = new Vector3(0, 0, 1000);

        if(gameObject.name == "cpuKT")

        {

            GameObject.Find("GameController").GetComponent<GameController>().gameWin = true;

        }

        //Destroy(gameObject);

    }

}



*Enemy
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class enemy : MonoBehaviour
{
    [SerializeField] public int health;

    private void Update()
    {
        if(health <= 0)
        {
            gameObject.transform.parent.GetComponent<Destroy>().DestroyObject();
        }
    }
}


*Enemy Controller

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyController : MonoBehaviour
{
    [SerializeField] private GameObject towerPlaceholder1;

    [SerializeField] private GameObject[] EnemyTowers;

    private bool tower1empty = true;

    public float shootWaitTime1 = 1.5f;
    public float shootTimer1;

    public float shootWaitTime2 = 1.5f;
    public float shootTimer2;


    private void Start()
    {
        shootWaitTime1 = Random.Range(5, 15);
    }
    private void Update()
    {
        if(Time.time > shootWaitTime1)
        {
            int ran = Random.Range(5, 15);
            shootWaitTime1 = Time.time + ran;
            int ran2 = Random.Range(0, EnemyTowers.Length);
            if (tower1empty)
            {
                tower1empty = false;
                GameObject go = Instantiate(EnemyTowers[ran2], towerPlaceholder1.transform.position, Quaternion.identity);
                go.transform.SetParent(towerPlaceholder1.transform);
            }
        }
    }
}


*Creating Minions( they are the attacking units with different properties like health, speed, attack, range etc.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class CreateMinion : MonoBehaviour
{
    private GameController GC;
    public Minion minion;

    private Transform goal;
    private NavMeshAgent agent;

    void Start()
    {
        GC = GameObject.Find("GameController").GetComponent<GameController>();
        minion = GC.activeMinion;

        //goal = GameObject.Find("cpuT").transform;
        agent = GetComponent<NavMeshAgent>();

        agent.speed = minion.speed;

        GameObject GO = Instantiate(minion.prefab, gameObject.transform.position, Quaternion.identity);
        GO.transform.parent = gameObject.transform;
    }

    private void Update()
    {
/*        if (agent.isOnNavMesh == true)
        {
            agent.destination = goal.position;
        }*/
    }
}

*Fire Tower Script
a fire tower shoots enemy that are projected by player, it does track and shoot ememies very well. this includes particle effects that follow enemy and reduces its health. 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FireTower : MonoBehaviour
{
    public List<Transform> unitsInRange = new List<Transform>();
    public float distanceTo = 99999;
    public float damage;

    [SerializeField] public Transform target;
    private float turnSpeed = 1;

    [SerializeField] public ParticleSystem fire;

    private void Start()
    {
        fire.Stop();

    }

    private void Update()
    {
        if (target == null)
        {
            fire.Stop();
            FindTarget();

        }else if (target != null)
        {
            fire.Play();
            Vector3 targetDir = target.position - transform.position;
            float step = turnSpeed * Time.deltaTime;
            Vector3 newDir = Vector3.RotateTowards(transform.forward, targetDir, step, 0.0f);
            //Debug.DrawRay(transform.position, newDir, Color.green);
            transform.rotation = Quaternion.LookRotation(newDir);
            target.GetComponent<MinionController>().curHealth -= damage * Time.deltaTime;
        }
    }

    void UpdateUnits()
    {
        foreach (Transform t in unitsInRange)
        {
            t.GetComponent<MinionController>().FindGoal();
        }
    }
    public void FindTarget()
    {
        foreach (Transform t in unitsInRange)
        {
            float distance = Vector3.Distance(gameObject.transform.position, t.transform.position);
            if (distance < distanceTo)
            {
                target = t.transform;
            }
        }
    }
}

* Canon shoot( I use this to shoot users units,

using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class cannon : MonoBehaviour

{

    public  List<Transform> unitsInRange = new List<Transform>();

    public float distanceTo = 99999;

    [SerializeField] public Transform target;

    private float turnSpeed = 1;


    //Shooting variables

    public float shootWaitTime = 1.5f;

    public float shootTimer;

    [SerializeField] private GameObject cannonBall;

    [SerializeField] private Transform spawnPoint;



    private void Update()

    {

        if(target == null)

        {

            FindTarget();

        }

        if (target != null)

        {

            Vector3 targetDir = target.position - transform.position;

            float step = turnSpeed * Time.deltaTime;

            Vector3 newDir = Vector3.RotateTowards(transform.forward, targetDir, step, 0.0f);

            Debug.DrawRay(transform.position, newDir, Color.green);

            transform.rotation = Quaternion.LookRotation(newDir);


            if(Time.time > shootTimer)

            {

                shootTimer = Time.time + shootWaitTime;

                Shoot();

            }

        }

    }


    public void FindTarget()

    {

        foreach (Transform t in unitsInRange)

        {

            float distance = Vector3.Distance(gameObject.transform.position, t.transform.position);

            if (distance < distanceTo)

            {

                target = t.transform;

            }

        }

    }

    void Shoot()

    {

        GameObject go = Instantiate(cannonBall, spawnPoint.position, Quaternion.identity);

        go.GetComponent<cannonBall>().target = target;

    }


/*    private void OnTriggerEnter(Collider other)

    {

        if(other.tag == "unit")

        {

            unitsInRange.Add(other.transform);

        }

    }


    private void OnTriggerExit(Collider other)

    {

        if (other.tag == "unit")

        {

            unitsInRange.Remove(other.transform);

        }

    }*/

}

*Cannon Ball
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class cannonBall : MonoBehaviour
{
    float t;
    public Transform target;
    float speed = 150f;
    private Transform startPos;

    private void Start()
    {
        startPos = gameObject.transform;
            ;
    }
    void Update()
    {
        if (target != null)
        {
            //t += Time.deltaTime / speed;
            //transform.position = Vector3.Lerp(startPos.position, target.position, t);

            transform.position = Vector3.MoveTowards(startPos.position, target.position, speed * Time.deltaTime);
        }
    }
}
these elisted scripts are working scripts that have been corrected overtime. Me recording Joe's class activities did help a lot to correct at the end. 

My next goal is to learn to code these by myself which would be a good skill to have. 
I am very much satisfied with the results. so far. and it works perfectly with the game. 

This image was taken after the all the enemies got killed by the AI's defense tower making them unable to rich Crown towers. This was because I changed some destroy value for for Ai defenses mainly, Inferno tower and Transformer. Both of them are functioning well. 







Tuesday, October 19, 2021

Week 15 (coding, audio check)

Joe recently game me a sample of a game that I was after. It worked perfectly. 




This is a sample made my Joe, while working with Joe at class. I got to know that while its a good thing to create a sample in the beginning with placeable units defined. This way, While assigning cards to the units it will follow the given path.


Special thanks cover for thanking my tutors for providing us with tremendous ideas, concept on 3D gaming.




A back button that I created for the game.

Unity comes with different version as it allows files to downgrade and use it in safe mode. I had some issue on graphics while getting files from Joe. It must be due to unsupported current graphic user interface that are not unto date on campus PC. Also, Its always good to archive successfully completed games, just to backup incase the current version goes wrong. 



Unity Hub Main folder locating to import game file. 


file Executing options.


Audio, for Audio, I decided to use only one background music as I need more time on learning and fixing codes that are not working like cannon is not shooting as it should be. Game making is all about building concepts, brain storming and implementing them on software/ coding. 


This is my audio file that I got for free on web. It sounds very old which matches my game theme. 

Percy_Wenrich_-_02_-_The_Smiler_1907_Zonophone_Concert_Band

Assigning audio is easy unity, just need to add component/audio source and assigning audio file to the source. 

For this, I watched lots of tutorials on YouTube which helped me for some extent. 






 

Tuesday, October 12, 2021

Week 14

 Animating In Maya, rig, bone, deformers

When Modeling giant, Golem, Barbs for my game. I realized that how complex these round shaped character are to model.

My first rig looks like this,

A walking scene with some boxing movemnet.





Tuesday, October 5, 2021

Wednesday, September 29, 2021

Week 12

 Making walk cycle for my characters.














As I go, I Practice with UV texturing as well, But I felt a bit complicated with those stuff. It requires lots of time and attention. Rather I'll make my game with ordinary colors. I followed some YouTube tutorials to get some idea regarding UV mapping. 



 

 




Giant Animation:

Try 1.


Try 2.


This animation took some time to finish, as it was broken in previous try. some of its upper body vertices weren't  connected with lowerbody, so when I exported its fbx version to Unity. I could only see its upper body with animation. So had a help from Chris and was able to finish. 

Due to the limitations on character number in Unity, I am not putting some of these characters and props in my game. But it's always been so productive working on these 3D models and Maya as general. 
But I will be putting Golem as it suits the scene and not much animation in it. 

Since I did, rigging last year in Maya and it's been quite helpful this year and I took a leave from my work just to give my time for game and Overall 3D modeling and rigging. 

Goblin Animation: 


This doesn't looks goblin at all but just to save time and effort I made this character in short time. 
I've tried to put some hair on it's head, but when I exported them in Unity, It doesn't show up. 



Air Ship:
I call this an Air Ship as it looks pretty bulky, My concept for the game is that when this unit is deployed it will shoot against AI's tower, while it also gets shot by AI tower, Once its health point is null. Some of the tiny planes would appear and shoot to the enemy tower however they have very less health point. 
My expectation for this game is big and I've realized, without learning basics we can't jump to advance. Even with Coding it takes a lot of time to figure out the working mechanics. Next Time I'll stick with general concept and advance them overtime. 


Golem:
A round looking shape really looks great for me. I've put just a random color texture on it. In terms, of animation, It is supposed to crawl. but with the deformers and bone rigs it just gets squashed. 
Same like Giant animation. I did walk cycle and poses several times. 




Monday, September 27, 2021

Week 4

 WhiteBoxing




Games

assult android cactus


Tower Defence


Unity
Capsule
prefab
blue print

ASSESSMENT BRIEF








Name: Clash With Titans
Platforms : PC, Android
Game type, Video Game
Era: Medieval
Genre: Top Down, Strategy
Target Audience/ age group: 9 years - 65 years
Geography/ arena : Arena I(land) , Arena II(Ocean), Arena III(Air)




A free-to-play video game ever created to outperform the AI's defenses. Pre-build traps and buildings appears within the game arena which are simultaneously deployed by the computer as the player keeps on marching. The main goal for this game is to reach safely towards opponents Crown towers and destroy them one by one. The game should be played in a defensive way, This strategy works by perpetuating  a strong attacking team from the beginning till it riches to the crown towers. (I would call it, Arena X1, X2, X3).

Every units in the game has its own counterparts or defensive mechanism. When played correctly with proper timing can  overcome obstacles. For Example, The Inferno tower takes down heavy troops such as Gollum, Giant. Bomb Tower kills Goblin, barbarians. Tesla destroys air units such as balloons, Jet flights.  Hence, Wile played smartly, It takes no time to overcome victory. 

With Three main Crown towers on AI's part namely queen Towers and King Tower. Queens towers are two in number allocated beside King Tower with two tiles further front. The game restricts Players to destroy king tower firsthand. In order to accomplish full victory, the Player has to destroy one of the queen towers first and only head to the remaining Tower Destruction. You will get rewarded with single stars for destring a single tower. Maybe, with the Future upgraded version, the Destruction of King Tower will be an instantaneous win. 

Game Time: Game time is generally set to 10 to 20 minutes, depending upon players' succession it can take faster than that. 

Game Mechanics.

Appearance> Startup>Intro>Layouts(vertical swap)Card selection>Game level/Complexity>Prizes/Rewards/upgrade


Startup:
Home screen>Settings(Sound, profile name, avatar)>Play>game level

Layouts: Arena selection option> Three Arenas/ Land, Ocean, Air

Collectables:

Player Card Selection

Melee units/ Troops: Giant, Gollum, Barbarian Tank, Dwarf Goblin, Barbarians, Fisherman, Archers
Air units: Air Balloon, Fat Jets (Mother ship), Air bomb
Wizardry  and Witchcraft: Sexy Witch, Fire Wizard
Spells: Freeze, Speedy Rage, Any Breaker(wall breaker), Magic Spell
Buildings/ Structure: War Ships, Recovery Hut

AI Defense 

Building: Inferno Tower, Tesla, Bomb Tower, Invincible walls, Invisible Air Trapper, Spring trap, Trap bomb, Ground holes.

Crown Towers: 
Ratio: 1:3:4 
Mid Level
Queen Tower 2*

Health Point(HP):1000
Range:6Tiles
Hit Speed: 0.9 sec
Damage: >4= 80  /  <4= 40

King Tower: Activates only after one of the queen towers is fully damaged.
Health Point(HP):1500
Range:4Tiles
Hit Speed: 0.9 sec
Damage: >4= 90  

Game Control:

With the selection of cards(8 cards in total) and Arena that you are fighting in. The player is straightly taken to the battlefield. The selected cards will get displayed four at a time on the bottom-most of the screen. It takes 3 seconds to deploy each card on the battlefield within the unrestricted area. As mentioned Each troop/unit has its own qualities including moving speed. Some walk slowly while others being fast, while pared after another, overall performance can be slightly fast. For Example; Gollum tends to walk very slow that is 4 secs per tile. when paired with a goblin that walks 1.5 sec per tile can push golem to move 2.8 sec per tile. Similarly, this technique can be applied to other units. 

Placing Units:
Units can be manually selected one at a time where individual have their own deploy time. In PC, the unit can be selected by clicking and holding the left side mouse button and be placed in the desired location.  This applies to Evercard in the game including spells. Where Spells can be directly emitted on AI's Crown towers. 




Gannt Chart:

Week 6: Develop ideas/ sketch models, troops
Week 7: 3D modelling/ referring Tutorials
Week 8:3D modelling/ Tutorials
Week 9:Integrate in Unity, Tutorials
Week 10: Coding and lots of coding, Tutorials
Week 11:Coding, Tutorials
Week 12:Sound Recording plus Editing
Week 13: Testing gameplay/ Correction/ Feedback
Week 14: final Correction, submission, Exhibiting.

Inspiration:
The main motive for this game came for the idea that's proposed by Supercell games namely Clash Royale and Clash of Clans. The Finland based company that emphasizes mostly on free to play game development and yields profit through In game- micro payments. 

Clash Royale: A real time strategy video game that was launched publicly on 2nd March 2016. The game combines various collective card games, tower defense, emojis, multiplayer online battle arena. 

I have followed the similar game principles and mechanism to Clash Royale integrating my own formulated troops and defenses with own story script.  













Making clouds in Photoshop:
 https://youtu.be/xAbsBUnzK3g


Using MAYA,



ctrl A = attribute editor


https://www.youtube.com/watch?v=GigCYmV3Ups&ab_channel=TrimitKala

Mesh>mirror>mirror_direction_'-'>mirror

surfaces>revolve

target weld to join vertices /Mesh>target weld
duplicate special>
Modify Center pivot

Making shield tuts> https://youtu.be/YPOo-dlSnp8 





Wednesday, September 22, 2021

Week 10

Starting 3D modelling


Bomb Tower


By watching Maya tutorials I am able to model this. a simple 3d model that includes extruding, adding vertices, bevel. I always think that Maya is super complex to learn, But with simple step, I can get somewhere.  I will follow the same techniques and working principles to model other models. 


Transformer idea, that throws electric shock to enemies.


https://www.gamedeveloper.com/production/creating-modular-game-art-for-fast-level-design




Tuesday, September 21, 2021

Week 11

 Modular modeling 

https://youtu.be/ztozExiiS-c


Merging objects together saves PC to perform better/ Delete history first

ctrl+shift+x

v and d 

X key>grid snapping

Shift>clone


3D Modelling in Maya continues.














Inside Unity everything is looking great.