Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Project TaO

Discussion in 'Works In Progress - Archive' started by Ivanskodje, Mar 30, 2015.

  1. Ivanskodje

    Ivanskodje

    Joined:
    Mar 29, 2015
    Posts:
    57
    Greetings everyone!

    I am Tyboroth, and have started a long term game project I wish to share with you - in hopes to get constructive feedback and criticism to help me improve the game as I go along.


    Short info about me
    I am a student B.S. Computer Science, almost finished with my education and will jump right to M.S. with the focus being A.I. and Simulation :)
    In my spare time I hit the gym or make videos for YouTube from time to time.

    What drives me is the ability to make anything using the power of COMPUTER PROGRAMMING! Which is very awesome. Even after 2-3 years of programming, I know little to none about all there is. So much to learn, so much to do.

    I will be updating this topic regularly with info and videos of my progress. :)

    Development Progress (YouTube Playlist): TaO Project's Playlist

    About the Game (unrefined description)
    My vision is simple. A free for all open world city game where you can do anything from working as a police officer to growing crops of Cannabis and sell it illegally (duh) to the black marked, or to other players that want to use it to make use of their "Chemistry" skills for other purposes.

    There will be plots of land (empty or with buildings) that you can buy or rent (buying is much more expensive, so renting is a good option until you get hold of enough money to buy a permanent residence).
    In the early stages there will not be any option to create your own home - but there will hopefully be in the future if the work goes well :)

    Because this will be a top-down 2D game, it will not be any trouble allowing players to build their own little bases / residences / villas / whatever - which I am looking very much forward too!! This functionality will probably be implemented after the "base game" is ready.

    NPC Stores! You will be able to buy furniture for your home (mostly decorations, but some will have functionality such as a stove). Buy cooking equipment! Or perhaps a chemistry set for... "educational" purposes. Want to grow a garden? Why not! Buy a Pot and dig up some dirt! You will be able to get water from the spring (assuming you have access to a sink somewhere, or a lake) to water them.

    Want to buy guns? Well, too bad... Guns will probably be very limiting to prevent people from going rampant. It will be important for the server admins to decide how they want the server to run. Guns should be difficult to attain regardless! However, nothing is set in stone - might be easier :)

    You will be able to craft. Be it weapons, furniture, drugs and more. The goal is to make pretty much everything craftable (a few exceptions like "Canned Beans" and so on, but you know where I am going with this). The most basic stuff will be purchasable, which will give the player an incentive to learn craftsmanship!

    You will be able to rent a storefront and make your own store, selling the items of your choice. Any and every item in the game will be sell-able. Of course, if you start selling cannabis seeds and whatnot - watch out for whomever is working for the police!
    I do not intend to make Items that are marked as "on sale" to be easy to steal. In fact, it might be disabled all together - or perhaps we'll add a long timer (i.e. you have to wait 30 seconds to pick it up without getting interrupted?), uncertain for now. It will be interesting regardless.

    Speaking of the police, there will be jobs! Plenty of jobs!
    To mention just a few, you can become a Police Officer! You can become a fireman, and stop those pesky individuals that buy a lighter and starts fire in your home! Call the cops and the fire men to stop the villain and, of course, put out the fire. Got wood? Work as a Lumberjack and chop those timbers! Chop your leg off and become a pirate! (No, not really)

    Cops will get paid extra if they are able to apprehend the perp without killing him (hand cuffs). The firemen will get some extra cash every time they put out a fire!

    Want to become a chef and make your own bakery? Sure, why not! There will be cooking!
    There will be cake!

    It will be heavily based on customization. Because we live in a day and age where our computers are super-awesome, we can let it out and give players the power to create their own hats and upload it to the server! (16x16 pixels so far - in the future it might increase, we'll see!)

    There will be skills and attributes that will enhance your performance - be it fishing, swimming or driving. Yes, I said driving! There will be vehicles! Have someone you hate? Why not drive him/her over with the "Hydra"! A cool looking car that doesn't even exist yet! It will probably be blue. Just make sure there are no witnesses.

    Want to get inside someones home? Got several paper clips? Try to pick the lock! (It won't be easy!)
    Or, if you got the skills for it - use a Lock Pick and get it done faster! (Still won't be easy, but it will be easier!)


    The game is very dependent on players RPing - so I will have to look into some sort of "vote kick" system, to discourage people from breaking the server rules. Server rules will depend on individual servers. In some servers, PVP might be disabled all together - in others, there might be Anarchy because there are no one enforcing the town rules! Whatever you like, to have a relaxing RP or to raid your ugly neighbors; there will be a server for you!

    First Floor and Second Floor images included - to give you an idea of how it "might" look. There will be fog of war to prevent people from seeing inside your house. MIGHT not be any fog of war in public properties (government buildings and so on) - Also work in progress. Too early to tell :)

    For those of you that want to follow my progress, you can access my hidden playlist on YouTube here.
    Development Progress (YouTube Playlist): TaO Project's Playlist

    Any and all feedback appreciated! Every reply will feed my motivation as well :)
     
    Last edited: Mar 30, 2015
  2. Ivanskodje

    Ivanskodje

    Joined:
    Mar 29, 2015
    Posts:
    57
    Today I will be working a bit on the HUD and if I have time; inventory and possibly implementing a weapon and shooting :)

    HUD v1.0

    I will later on add an ingame clock with night/day cycles - but that will happen late in the development, as there is much work to do before that.
     
  3. adamh1

    adamh1

    Joined:
    Apr 10, 2012
    Posts:
    124
    great idea, sounds like a hell of a lot of work though! and unlimited scope so the project could go on forever if you arent careful :p
     
  4. Ivanskodje

    Ivanskodje

    Joined:
    Mar 29, 2015
    Posts:
    57
    Very true! However I have a long list of features to implement. When all of them are implemented, the foundation of the game will be complete. After then, all coding and updates will be to add or improve functionality :)

    HUD + Minimap update vid



    UPDATE:
    Managed to get the basic inventory bag to work perfectly! Next up is to make it and the inventory bar usable for shortcuts - so we can press 1 -> 9 to do stuff! As well as implementing the ability to be able to drop any and every item by dragging it out of the bag!
     
    Last edited: Mar 31, 2015
  5. Ivanskodje

    Ivanskodje

    Joined:
    Mar 29, 2015
    Posts:
    57
    Looking for background music (Royalty Free / No copyrighted) for Project TaO.

    https://www.youtube.com/playlist?list=PLbnlgu1-5R1UB7xIeZlZSFgTgfRf_hs78

    If anyone know of good royalty free music like this, please send them my way!! :)

    EDIT:
    While looking for ways to get the gameObject of teh player that is mouse clicking an object, I discovered how to make the player face the cursor. Took some doing but it finally works perfectly! :)



    Problems that I need to overcome before I can continue:
    - Implementing a shortcut bar that works with the inventory bag
    - Player interaction with items that are on the ground (need a way to find the player that is clicking the item!)

    EDIT:
    I will be away for a few days, so no update until get back :)
     
    Last edited: Apr 1, 2015
  6. Ivanskodje

    Ivanskodje

    Joined:
    Mar 29, 2015
    Posts:
    57
    Currently in the process of rebuilding code. I have discovered a tool for creating maps very easily, which means I can focus on the programming part of the development.

    I intend to begin with the player code, give him attributes, skills and basic methods that would be expected on a player.
    Movement and animation will be handled by a separate class, so will the player attributes and misc. The player code has never looked this clean before. Only a few lines :)

    After I am done with the player part, I will continue to adding multiple floors in homes. Not sure how to do that, but I figure I can manipulate layers and the camera (with the player) to display "top layers" that are on a separate plane, so only other players on the same plane can see them. This is all theoretical and in my head for now, but we'll see :)

    Here are some screenshots of a tiny map I made in around 10 minutes (including setting up collisions).

    Scene view:


    Game view:
     
    Last edited: Apr 8, 2015
  7. Eths

    Eths

    Joined:
    Mar 5, 2015
    Posts:
    184
    Very Lovely Project! Great job,Keep it up! :D
     
    Ivanskodje likes this.
  8. Ivanskodje

    Ivanskodje

    Joined:
    Mar 29, 2015
    Posts:
    57
    Finally managed to have multiple floors and a roof in a building. I will have to do some adjustments to prevent being able to see inside other buildings inside the same layer - not quite sure how to do that yet.



    Every player starts on "Floor 1" layer. This includes outside and inside. The camera can see everything except any floors above Floor 1 (which means it can't see Floor 2, Floor 3, and so on).

    Items and collisions are also on each individual floors. Which means collision on Floor 2 will not interact with anything on Floor 1 (which the player currently is on by default).
    This was done by changing Project Properties -> Physics2D and disable floor interactions between each other like so:


    As for the "Roof" layer - that layer can interact with all other layers as it is the layer that contains the 2D Box Collider trigger and script that detects whether or not the player is inside the house. If he leaves the premises, OnTriggerExit2D will trigger and display the roof.

    In case you would like to know how the roof script works - feel free to come with suggestions for improvement! :)
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4.  
    5. public class RoofScript : MonoBehaviour
    6. {
    7.     // Main camera
    8.     private Camera mainCamera;
    9.  
    10.     // Use this for initialization
    11.     void Start()
    12.     {
    13.         // Get the main camera
    14.         mainCamera = Camera.main;
    15.     }
    16.  
    17.  
    18.     // Inside the building
    19.     void OnTriggerEnter2D(Collider2D other)
    20.     {
    21.    
    22.         // Get player
    23.         if (other.gameObject.name == "Player")
    24.         {
    25.             // Hide roof
    26.             HideLayer("Roof");
    27.         }
    28.     }
    29.  
    30.  
    31.     // Outside the building
    32.     void OnTriggerExit2D(Collider2D other)
    33.     {
    34.         // Show roof
    35.         ShowLayer("Roof");
    36.     }
    37.  
    38.  
    39.     // Show layer
    40.     private void ShowLayer(string layerName)
    41.     {
    42.         mainCamera.cullingMask |= 1 << LayerMask.NameToLayer(layerName);
    43.     }
    44.  
    45.  
    46.     // Hide layer
    47.     private void HideLayer(string layerName)
    48.     {
    49.         mainCamera.cullingMask &= ~(1 << LayerMask.NameToLayer(layerName));
    50.     }
    51. }
    52.  

    EDIT:
    Found a very very simple solution! Instead of using the roof as a layer, we use the roof's MeshRenderer!
    New Script:
    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5.  
    6. public class RoofScript : MonoBehaviour
    7. {
    8.     // Roof tiles render
    9.     private MeshRenderer meshRenderer;
    10.  
    11.  
    12.     // Use this for initialization
    13.     void Start()
    14.     {
    15.         // Get the roof's mesh render
    16.         meshRenderer = GetComponent<MeshRenderer>();
    17.     }
    18.  
    19.  
    20.     // Inside the building
    21.     void OnTriggerEnter2D(Collider2D other)
    22.     {
    23.      
    24.         // Get player
    25.         if (other.gameObject.name == "Player")
    26.         {
    27.             // Hide roof
    28.             meshRenderer.enabled = false;
    29.         }
    30.     }
    31.  
    32.  
    33.     // Outside the building
    34.     void OnTriggerExit2D(Collider2D other)
    35.     {
    36.         // Show roof
    37.         meshRenderer.enabled = true;
    38.     }
    39. }
    40.  
    41.  




    When I implement multiplayer; other players will not be able to see other players that are indoors unless they themselves enter. I suspect there is a lot of code I will have to change - more specifically the camera scripts - so it will handle multiplayer. I suspect the camera will move around if I implement networking right away :S

    This is the script I made using the camera layer visibility and player layer. It is put on a trigger area that is accessible from both floor 1 and floor 2 - using a custom Layer called "Stairs: Floor 1-2" which the player can interact with from Floor 1 layer and Floor 2 layer.


    Made a custom "Feel free to come with suggestions for impovement!
    Set in Unity: string layerName1 = "Floor 1", string layerName2 = "Floor 2"
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class StairsScript : MonoBehaviour
    5. {
    6.     // Layer name 1
    7.     public string layerName1;
    8.  
    9.     // Layer name 2
    10.     public string layerName2;
    11.  
    12.     // The layer numbers
    13.     private int layer1, layer2;
    14.  
    15.     // Main camera
    16.     private Camera mainCamera;
    17.  
    18.  
    19.     // Use this for initialization
    20.     void Start()
    21.     {
    22.         // Get main camera
    23.         mainCamera = Camera.main;
    24.  
    25.         // Convert the layer names to numbers
    26.         layer1 = LayerMask.NameToLayer(layerName1);
    27.         layer2 = LayerMask.NameToLayer(layerName2);
    28.     }
    29.  
    30.  
    31.     // Enter stairs (change floor)
    32.     void OnTriggerEnter2D(Collider2D other)
    33.     {
    34.         // If the player enters (The name of the player game object is "Player")
    35.         if (other.gameObject.name == "Player")
    36.         {
    37.             // Get current layer number from player
    38.             int currentFloorLayer = other.gameObject.layer;
    39.  
    40.             // If we are on layer1 or layer2
    41.             if (currentFloorLayer == layer1 || currentFloorLayer == layer2)
    42.             {
    43.                 // Layer 1 Toggle
    44.                 ToggleLayer(LayerMask.LayerToName(layer1));
    45.  
    46.                 // Layer 2 Toggle
    47.                 ToggleLayer(LayerMask.LayerToName(layer2));
    48.  
    49.                 // If player is on layer1, set layer to layer2 - else set to layer1.
    50.                 other.gameObject.layer = (currentFloorLayer == layer1) ? layer2 : layer1;          
    51.             }
    52.         }
    53.     }
    54.  
    55.  
    56.     // Toggle Layer
    57.     private void ToggleLayer(string layerName)
    58.     {
    59.         mainCamera.cullingMask ^= 1 << LayerMask.NameToLayer(layerName);
    60.     }
    61. }
    62.  
     
    Last edited: Apr 10, 2015
    hms0589 and chelnok like this.