Search Unity

Games WIP Small Works Game / Programming Thread

Discussion in 'Projects In Progress' started by Tim-C, Aug 6, 2012.

  1. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    Some progress is made with my bezier fence system.

    That’s new:
    - Adaptive Fence Spawning
    - Correct Spawn Distance aspects on uneven Surface.
    - New UI (well cheanges the whole time)
    - Three Choosable Styles for Spawning Prefabs
    - Performance consumption Reduction

     
  2. crandellbr

    crandellbr

    Joined:
    Apr 3, 2013
    Posts:
    137
    Hello, folks. Just seeing if anyone's interested in a visualization of my first major A* test. The path traces from lower left to upper right, avoiding the red obstacles. Green is the closed set, while light green is the open set.



    Unity's navigation has come a long way, especially now that it allows agents with different radii, but I'm interested in creating my own solution. A major reason is to have access to navmesh polygon data, since it seems Unity still likes to hide things. I've completed a successful test with RVO2 Library (glad to see that's open source now), then I'll adapt A* to navmeshes and try Recast for generating the actual mesh.

    Anyway, this test seems inefficient due to how complex the grid is, including the maze-like bit at the end. It made more sense to me after I displayed g and f scores on each tile. If it really seems inefficient, or if anyone has other feedback, I'd love to know!
     
  3. reallyjonas

    reallyjonas

    Joined:
    Jun 14, 2013
    Posts:
    3
    I've been working on on a 2D action RPG for some time. The plan is to build up a collection of scripts which would make it easy to build different games by switching the assets without needing to change the scripts. The long term plan is to offer it on the Asset store to see if there is any interest. Or make a full game if I find the time.

    I've come quite far and try to make simple assets (as I'm no artist) with subtle lighting effects to make a sample scene.
    My main issue right now is the environment and level design. I'm not using a tilemap, I instead place large sprites with a sliced texture. This is quite limiting but makes it very simple to build a level with just one asset.

    The latest version looks like this:


    I think the next step will be to think about some automatic level generator, and maybe use 3d blocks for the walls to enable shadows.
     
    tylerguitar75 and GarBenjamin like this.
  4. SkyYurt

    SkyYurt

    Joined:
    Dec 12, 2010
    Posts:
    234
    Grappling Hook or Infinite Rope?

     
    Metron, Slaghton and RavenOfCode like this.
  5. SkyYurt

    SkyYurt

    Joined:
    Dec 12, 2010
    Posts:
    234
    Untangling your Grappling Hook

     
    RavenOfCode and dan_wipf like this.
  6. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    2D grid for spatial queries. What's great about grid based spatial queries is that it's size, or amount of entities in it doesn't affect queries performance.
    Whole system is runinng asynchronously and takes less than .5ms for updating 1k entities on grid.
    Turns out it can be used for rasterization also as you can see in video lol! :D ;
     
    RavenOfCode likes this.
  7. PhantomProgramming

    PhantomProgramming

    Joined:
    Jan 16, 2019
    Posts:
    61
    I've been working with the unity navmesh system and have been trying to get a smooth amount of 1000 navmesh agents all with targets, models, and animations. Sadly my FPS drops insanely low. When I checked the profiler, it said the main issues were scripts and physics.
    Does anybody know how to optimize physics?
    I'm also currently using this as my AI location script.
    Any ideas on how to optimize it?

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.AI;
    5.  
    6.  
    7.  
    8. public class AILocate : MonoBehaviour
    9. {
    10.  
    11.  
    12.     public LayerMask detectionLayer;
    13.     private Transform myTransfom;
    14.     public NavMeshAgent myagent;
    15.     private Collider[] hitColliders;
    16.     private float checkRate;
    17.     private float nextCheck;
    18.     public float detectionRadius = 180;
    19.     public bool moving = false;
    20.     public float extraRotationSpeed;
    21.     public float AI_Delay = 0.1f;
    22.  
    23.  
    24.  
    25.  
    26.  
    27.     // Start is called before the first frame update
    28.     void Start()
    29.     {
    30.         AI_Delay = Random.Range(0.1f, 0.8f);
    31.         myagent.enabled = true;
    32.         sir();
    33.     }
    34.    
    35.  
    36.  
    37.  
    38.     // Update is called once per frame
    39.     void Update()
    40.     {
    41.            
    42.            
    43.  
    44.     }
    45.     void FixedUpdate()
    46.     {
    47.      
    48.         StartCoroutine("DelayEnemy");
    49.        
    50.         //CheckIfInRange();
    51.         myagent.enabled = true;
    52.      
    53.      
    54.     }
    55.  
    56.  
    57.     void sir()
    58.     {
    59.        myTransfom = transform;
    60.        myagent = GetComponent<NavMeshAgent>();
    61.        checkRate = Random.Range(0.2f, 0.5f);
    62.     }
    63.  
    64.     public IEnumerator DelayEnemy() {
    65.  
    66.         yield return new WaitForSeconds(Random.value * AI_Delay);
    67.         if (Time.time > nextCheck && myagent.enabled && myagent.pathPending == false)
    68.         {
    69.             nextCheck = Time.time + checkRate;
    70.  
    71.  
    72.             hitColliders = Physics.OverlapSphere(myTransfom.position, detectionRadius, detectionLayer);
    73.             hitColliders = Physics.OverlapSphere(myTransfom.position, detectionRadius, detectionLayer);
    74.             hitColliders = Physics.OverlapSphere(myTransfom.position, detectionRadius, detectionLayer);
    75.             hitColliders = Physics.OverlapSphere(myTransfom.position, detectionRadius, detectionLayer);
    76.  
    77.             if (hitColliders.Length > 0 && myagent.pathPending == false)
    78.             {
    79.                 myagent.destination = hitColliders[Random.Range(0, hitColliders.Length - 1)].transform.position;
    80.                 //myagent.SetDestination(hitColliders[Random.Range(0, hitColliders.Length - 1)].transform.position);
    81.                 moving = true;
    82.  
    83.             }
    84.             else { moving = false; }
    85.  
    86.  
    87.  
    88.  
    89.  
    90.  
    91.         }
    92.  
    93.     }
    94.  
    95. }
    96.  
     
  8. RavenOfCode

    RavenOfCode

    Joined:
    Apr 5, 2015
    Posts:
    869
    First off, wrong section of the forum. This should be posted in scripting

    Secondly, you're starting like 100 co-routines every second by putting the startcoroutine in fixed update. Why?

    Thirdly, lines 72, 73, 74 are all useless and an expensive physics calculation. They should be removed.

    Lastly, if you want 1000 units smoothly, I'd hightly recommend ECS for increased performance.
     
    Last edited: Mar 25, 2019
  9. PhantomProgramming

    PhantomProgramming

    Joined:
    Jan 16, 2019
    Posts:
    61
    Sorry about the posting in the wrong section, I removed the coroutine and placed the code into update.
    Removed 72,73, and 74.

    Do you have any good recommendations on ECS tutorials?
     
  10. RavenOfCode

    RavenOfCode

    Joined:
    Apr 5, 2015
    Posts:
    869
    I don't see why you'd put it in update, corourtines are a good performance conscious technique. Why not just call the coroutine in start? I think you should go brush up on a what a coroutine is, as I don't think you realize what your code is actually doing.

    Brackey's has a nice intro video on it. I haven't used it much myself, but I'm sure they're other good tutorials. However, I'd recommend before you try that you'd continue learning the basics. No offense, but your code you've written is very amateur so I'd guess trying to learn multithreading is something that won't go down too well. If this mean reevaluation the scope of your game (1000's of units down to 100's), you might just have to do that.

    EDIT:

    I was looking more into the Nav Mesh system and it appears the without multithreading Unity can handle a lot more than I thought.

    This video shows thousands of Units using the Nav Mesh system without an issue. Just a though
     
    Last edited: Mar 25, 2019
  11. PhantomProgramming

    PhantomProgramming

    Joined:
    Jan 16, 2019
    Posts:
    61
    I misunderstood what you meant about the coroutine. I meant to move it to start, out of the update loop, not the code to update. :p

    I've seen that video on AI but he is just setting one target for all of those, which I know how to do smoothly, my problem is creating a script that locates the closest target and tells the agent where it is. AI draw a lot more power when constantly updating their targets as appose to tracking a static target.
     
    RavenOfCode likes this.
  12. wagon347

    wagon347

    Joined:
    Mar 28, 2019
    Posts:
    6
    WIP Top Down Shooter 2D Zombie. I'll do some levels with the same mechanics,but by now there only one. I'll be adding some explosions, weapons and reload system. Feedback welcome. Art assets made by myself.

    Edit:
    i've deleted this video from youtube for some reason and i added new one version for mobile. watch below.

     
    Last edited: Apr 12, 2019
    GarBenjamin likes this.
  13. SkyYurt

    SkyYurt

    Joined:
    Dec 12, 2010
    Posts:
    234
    Playing around with Custom Editor Window and trying to make an debugger for my AI Behavior Tree

    btv.PNG
     
  14. wagon347

    wagon347

    Joined:
    Mar 28, 2019
    Posts:
    6
    I have add some new features to my top-down shooter:
    -reload system
    -collect the key to exit
    -shadows
    -new levels

    Edit:
    i've deleted this video from youtube for some reason and i added new one version for mobile. watch below.

     
    Last edited: Apr 12, 2019
    GarBenjamin likes this.
  15. Ordnas006

    Ordnas006

    Joined:
    Jun 5, 2016
    Posts:
    53
    New prototype inspired by Dark Souls just released!

     
  16. ClaudiaTheDev

    ClaudiaTheDev

    Joined:
    Jan 28, 2018
    Posts:
    331
    Your prototypes looks better than many finished games :p
     
  17. jtok4j

    jtok4j

    Joined:
    Dec 6, 2013
    Posts:
    322
    Greetings @Tim-C ,
    What's the purpose of this thread? I've always made my own threads for posts with content that I see here.
    Is this thread to show some creative programming solution for yet-un-released projects? (Just don't wanna post incorrect content here.)
    Thanks and Keep On Creating!
    Justin of JustinTime Studio
     
  18. wagon347

    wagon347

    Joined:
    Mar 28, 2019
    Posts:
    6
    I decided to use a tileset i found the web for my prototype "Zombie Village".
    I had to redo the level-maps,but now it looks better. You can play the html5 version and send your feedback. It's still a WIP.
    zombievillage.png
    https://wagon347.itch.io/zombie-village
     
    Last edited: Apr 26, 2019
    GarBenjamin likes this.
  19. SkyYurt

    SkyYurt

    Joined:
    Dec 12, 2010
    Posts:
    234
    Part 2 of my Soldier AI implementation. In this video I demonstrate how to implement Pathfinding and simple Investigation mechanics.

     
  20. Ordnas006

    Ordnas006

    Joined:
    Jun 5, 2016
    Posts:
    53
    Just released a small prototype, it si lplayable on the browser, tell me what you think about it :)

     
    iamthwee and dyox like this.
  21. Dag-Tholander

    Dag-Tholander

    Joined:
    Jul 16, 2014
    Posts:
    90
    Working on a semi-constant step raymarching terrain on the GPU. Currently trying to optimize it. It's able to render about 1000m viewdistance without any major performance impact, however performance is extremely poor(20-30 fps).
     

    Attached Files:

  22. LilFire

    LilFire

    Joined:
    Jul 11, 2017
    Posts:
    74
    "Zeus Project" is my school project. Here is some space gameplay.

    And some images of the game.
     
    tobiass, stonstad, khos and 3 others like this.
  23. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,488
    Wow, cool! Would you give any clues on how you achieved this? Very well done.
     
  24. SkyYurt

    SkyYurt

    Joined:
    Dec 12, 2010
    Posts:
    234
    Thank You!.

    I use linerenderer for the rope and add a new position to this linerenderer every time the player passes a corner. Then when the player calls back the grappling hook, I have the hook backtrack through all these positions until it ends at the player.
     
    khos and Antypodish like this.
  25. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    Clever yet simple solution. Just wonder, using raycast, for corners detection?
     
  26. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,488
    Or maybe with collider?
     
  27. SkyYurt

    SkyYurt

    Joined:
    Dec 12, 2010
    Posts:
    234
    Here is an example:
    grappling_hook_explained.png

    I raycast from the last corner(the second last position of the linerenderer), towards the player, and as soon as the raycast can't hit the player anymore, i take the hit.point of the raycast and save it as a new position on the grappling hook linerenderer.

    Likewise I raycast from the second last corner(the third last position of the linerenderer), towards the player, and if this raycast can hit the player I remove the second last position of the linerenderer...if it makes sense?
     
    Antypodish and khos like this.
  28. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    Yep perfectly does. Many thanks.
    Only small different in my thinking was, that I thought, you are raycasting from the player, toward last detected position (obstacle) of linerenderer. Simply saying same red arrow vector, but opposite direction. I suppose, if raycast from linerenderer does not lies exactly on the obstacle mesh, but is a bit outside, then it work fine as well.

    Any reason, why you choose to cast ray from linerenderer toward player, rather than viceversa? Or does it makes no difference really?
     
  29. SkyYurt

    SkyYurt

    Joined:
    Dec 12, 2010
    Posts:
    234
    Yes, I do raycast with a small offset of the last position :)
    I had to test the raycast against a collider.
    The linerenderer position doesn't have a collider, so raycast cannot check if there is an obstacle in between, because the raycasthit doesn't hit the linerenderer., so to make sure that there was nothing between the position and the player I had to raycast towards the collider of the player.

    I suppose you could raycast from the player towards the last position with a set raycast length of the distance, and if no raycast hit, then consider the grappling hook free of the obstacle.

    For me it made more sense to do it from the linerenderers point of view, so I would know precisely where the linerenderer needed to 'bend'.
     
    Last edited: Jun 5, 2019
  30. IldarKasimov

    IldarKasimov

    Joined:
    Mar 7, 2015
    Posts:
    1
    Greetings everyone! I've been working on my ECS framework which is called TinyECS for about 3 months. Now the basic functionality is almost done.

    The core feature is a simplicity. Next goal is a performance and multithreading support. There is helpers that provide flexible way of communication between game logic and views.

    Sample code of a controller:
    Code (CSharp):
    1. using UnityEngine;
    2. using TinyECS.Impls;
    3. using TinyECS.Interfaces;
    4. using TinyECSUnityIntegration.Impls;
    5.  
    6.  
    7. public class Controller: MonoBehaviour
    8. {
    9.     protected IWorldContext  mWorldContext;
    10.  
    11.     protected ISystemManager mSystemManager;
    12.  
    13.     private void Awake()
    14.     {
    15.         mWorldContext = new WorldContextFactory().CreateNewWorldInstance();
    16.  
    17.         mSystemManager = new SystemManager(mWorldContext);
    18.  
    19.         WorldContextsManagerUtils.CreateWorldContextManager(mWorldContext, "WorldContextManager_System");
    20.         SystemManagerObserverUtils.CreateSystemManagerObserver(mSystemManager, "SystemManagerObserver_System");
    21.  
    22.         mSystemManager.Init();
    23.     }
    24.  
    25.     private void Update()
    26.     {
    27.         mSystemManager.Update(Time.deltaTime);
    28.     }
    29. }

    Sample code of a system:
    Code (CSharp):
    1. using TinyECS.Interfaces;
    2. using UnityEngine;
    3.  
    4. public class InputSystem: IUpdateSystem
    5. {
    6.     protected IWorldContext mWorldContext;
    7.  
    8.     protected IEntity       mClickInfoEntity;
    9.  
    10.     protected Camera        mMainCamera;
    11.  
    12.     public InputSystem(IWorldContext worldContext, Camera mainCamera)
    13.     {
    14.         mWorldContext = worldContext;
    15.  
    16.         mClickInfoEntity = mWorldContext.GetEntityById(mWorldContext.CreateEntity("ClickInfoEntity"));
    17.  
    18.         mClickInfoEntity.AddComponent<TClickComponent>(/* You can also set some initial values for the component here*/);
    19.  
    20.         mMainCamera = mainCamera;
    21.     }
    22.  
    23.     public void Update(float deltaTime)
    24.     {
    25.         if (Input.GetKeyDown(KeyCode.Mouse0))
    26.         {
    27.             Debug.Log(mMainCamera.ScreenToWorldPoint(Input.mousePosition));
    28.  
    29.             mClickInfoEntity.AddComponent(new TClickedComponent
    30.             {
    31.                 mWorldPosition = mMainCamera.ScreenToWorldPoint(Input.mousePosition)
    32.             });
    33.         }
    34.     }
    35. }

    Sample code of components:
    Code (CSharp):
    1. public struct TClickComponent: IComponent
    2. {
    3. }
    4.  
    5. public struct TClickedComponent: IComponent
    6. {
    7.     public Vector2 mWorldPosition;
    8. }

    Github page: https://github.com/bnoazx005/TinyECS

    Want to collect your feedback about the project. Any help or advices are appreciated!
     
  31. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    Unless you are doing it for fun, not for actual game dev, is the reason, why you spending time on it, instead using Unity performant multithreaded ECS/DOTS? Or just Jobs? Alternatively already fully functional Entitas asset?

    Is like developing own game engine, while having access to existing engines, before actual game dev.
     
  32. lucsout

    lucsout

    Joined:
    Dec 28, 2017
    Posts:
    1
    Hi Guys!
    First time posting here, i just wanted to share my very-partial-first test in unity.
    I'm trying to recreate some portal mechanics (actually, inspired by Shadowhunter TV show) focusing on new VFX and Shader graph and this is what achieve so far.



    Any feedback would be appreciated.
    Great place and great works!!
     
    Slaghton, iamthwee, Metron and 3 others like this.
  33. Deleted User

    Deleted User

    Guest

    Just an example of my updated flight AI..


    with my new Flight Physics script.
    "A Lot" of autonomous NPC's, looking for a fight.



    Random Enemy AI P.O.V ie.(what are they doing up there?)



    Getting closer,
    Patrick
     
    Last edited by a moderator: Jun 12, 2019
    Antypodish likes this.
  34. SkyYurt

    SkyYurt

    Joined:
    Dec 12, 2010
    Posts:
    234
    Part 3 of my Soldier AI implementation. In this video I show how to implement a simple Cover System:


    First time using a microphone, so please tell me if i'm understandable or not :)
     
  35. DavidNLN

    DavidNLN

    Joined:
    Sep 27, 2018
    Posts:
    90
    Hello guys, working on an open world 2d pixel art game.
    Wanted to show off the World loading I've been working on, the world is 64000000 (around 30km2) tiles big and I load it all from a file.

     
  36. Howard-Day

    Howard-Day

    Joined:
    Oct 25, 2013
    Posts:
    137
  37. Bastian-Blokland

    Bastian-Blokland

    Joined:
    May 14, 2018
    Posts:
    7
    Created a tool for generating c# enums based on json config. We use it because we have allot of configuration in json and sometimes you want to access it through code (or the Unity inspector) without having to hard-code values. Might be useful for someone.

    https://github.com/BastianBlokland/enum-generator-dotnet
     
    RavenOfCode likes this.
  38. Ordnas006

    Ordnas006

    Joined:
    Jun 5, 2016
    Posts:
    53
    iamthwee, khos and RavenOfCode like this.
  39. LilFire

    LilFire

    Joined:
    Jul 11, 2017
    Posts:
    74
    Zeus project progress - 3D Radar & Target Tracker
     
    DBarlok, Antypodish, khos and 2 others like this.
  40. tonymedd01

    tonymedd01

    Joined:
    Feb 7, 2018
    Posts:
    19
    I LOVE it :O , nice work
     
  41. the_Bad_Brad

    the_Bad_Brad

    Joined:
    Nov 2, 2014
    Posts:
    278
    I am looking for ways to break objects when a car hits them. I'm using a LWRP and looking to support low end Android devices.

    As you can see they are just being flung around

     
    DBarlok likes this.
  42. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,488
    Maybe try the exploder asset? Not sure if that supports mobile though.
     
  43. DBarlok

    DBarlok

    Joined:
    Apr 24, 2013
    Posts:
    268
    That made my day. I love all i saw of Zeus Project!

    This game will be amazing!!! Thanks for sharing!
     
    Last edited: Sep 25, 2019
  44. DominoM

    DominoM

    Joined:
    Nov 24, 2016
    Posts:
    460
    Did my first jam game (Ludum Dare 45) last weekend. Did more than a few silly things and ended up marking my game as unfinished. But I really liked the concept so kept working on it. I've fixed most of the issues, just the extra coyote time to work on and added a few things I ran out of time on during the jam.

    The jam's theme was "Start with nothing" and my game is called "Expect Nothing".

    Click here to play

    Start with nothing, looking for something, anything to end up with everything.
     
  45. creimschussel

    creimschussel

    Joined:
    Apr 11, 2017
    Posts:
    10
    Hey everyone! We have been working on a ARPG for mobile called Anzen: Echoes of War. Just recently we extended our item system to play sounds and visuals on on pickup. For the footsteps, we used animation events and a script that plays through a list of footstep audio clips.

    Do the sounds work okay together with the music, footsteps and sound effects play?

    Edit: I realized that the coins dont have pickup sounds in the video but I hope the fact that a sound plays when the red health globe is picked up shows that the system is working. :)

     
    Last edited: Oct 17, 2019
    RavenOfCode likes this.
  46. Gegenton

    Gegenton

    Joined:
    Nov 4, 2019
    Posts:
    9
    I feel like they sound too much like "walking" instead of "running". It reminds me of someone with quality leather shoes walking train station / airport / office hallways. I guess it needs to be more subtle.
     
  47. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    788
    Working on a 2d modular spaceship building game. It's pretty basic at the moment, but I plan on adding many more modules, enemy ships and planets/asteroids to destroy!

    Let me know what you think of the video. Open to ideas too.

    https://puu.sh/EEoxo/bbb5017e74.mp4
     
    RavenOfCode likes this.
  48. jaszunio15

    jaszunio15

    Joined:
    Jan 9, 2016
    Posts:
    4
    Hi Guys! It's my first post here :)
    I spend last weekend by developing procedural night skybox. I was trying to solve a problem with small flickering stars and I did it :)

    Fixed star size on different resolutions and camera FOVs. Custom material editor.
    Customizable star size, density, brightness. Moon positioned by directional light. Customizable galaxy fog.
    Tested only in unity standard pipeline.

    Example video:

    Gitlab repo, feel free to use it anywhere: https://gitlab.com/janmroz97/stars-skybox-shader
    Screen:
     
    Justice0Juic3 likes this.
  49. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    788
    @Jaszunio15 Looking good! Does it work in 2d? :D

    I've been working on my automated thrusters and AI Statemachine. The AI will prioritize different states Retreat > Combat > Mining > Patrol > Idle.
    This ship is moved using Unity's physics engine, each thruster adds force to move and rotate the ship, so the AI needs to determine which thrusters to activate in order to reach the goal.
    It's been a heck of a challenge but I've learned a lot and I'm very happy with it!

    The AI in my game are going to have their own motivations, they'll scour the galaxy for resources, upgrade their ship and wont hesitate to blow you out of the sky if you stand in their way (unless you've got bigger guns than them!).

    In this gif you can see the white circle is an "Enemy" and the ships AI will chase it down until it gets too far away.
    The brown circles are rocks that the ship can mine.
    You can see it changing states in the Console.

    Edit: Fixed Gif.


    gfycat cut it short, here's a link to the full thing if you're interested:
    https://puu.sh/EIpwF/8e52d1b686.gif
     
    Last edited: Nov 25, 2019
    Billy4184 and RavenOfCode like this.
  50. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770