Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Dead Awake - Pixel Art, Rouge, Hardcore

Discussion in 'Works In Progress - Archive' started by Zilk, May 10, 2014.

  1. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    Thanks for the feedback! The movement controls are inspired by Hotline Miami, I will probably stick with that setup but I will add a keybinding feature for all controls.
     
  2. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    Now the generator is completed with a last floor and a short end sequence. I also experimented with a script that animates lightsources and has the ability to spawn particles.. Therefor I added some broken cables to try it out ;)



    See if you can reach the ending in this Webplayer Demo

    EDIT: OH! I tweaked the controls to remove the sluggish feel some have felt.
     
    Last edited: Aug 26, 2014
  3. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    I made another update tonight, fixing some bugs like auto-opening the elevator on arrival and a collision issue with the elevators.

    I also made a fun little bubble effect on the toxic leaks :)

     
  4. Gorlog

    Gorlog

    Joined:
    Jan 20, 2011
    Posts:
    201
    looks very promising!
     
  5. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    Main character design is done. It is split into a few sections so I can start animating it tomorrow. It will be running two animations, one for the upper body and one for the feet.

     
  6. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    Ahhh, love these updates. The sparks and bubbles add so much to the scene.
     
  7. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    Thanks! If anyone has any questions or want to know how I did something I post in an update I'm happy to share short "tutorials" or even scripts.
     
  8. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    I would love any kind of short tutorials you can provide :D

    Since I'm also making a top-down zombie shooter.
     
  9. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    Anything specific you are thinking of?
     
  10. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    What about the particles when you hit a zombie?
     
  11. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    The particles that spawns when a bullet hits or the blood pools on the floor?

    The particles that spawn when a bullet hits (the blood spray) is a simple script added to the projectiles that I fire.
    Code (csharp):
    1.  
    2. //Enemy has triggers in them for head and shoulder hits
    3.     void OnTriggerEnter2D (Collider2D col)
    4.     {
    5.                 //All enemies have the tag Enemy
    6.         if(col.gameObject.tag == "Enemy")
    7.         {
    8.                         //Here I simply get the enemy ai and hitbox scripts if it is an enemy
    9.             enemyAI = col.transform.parent.parent.GetComponent<EnemyAI>();
    10.             enemyHitbox = col.gameObject.GetComponent<EnemyHitbox>();
    11.  
    12.                         //simple check to see if the scripts aren't nulled
    13.             if(enemyAI && enemyHitbox)
    14.             {
    15.                 //Deal damage
    16.                 if(enemyHitbox.head)
    17.                     enemyAI.DealDamage(damage * criticalMultiplier);
    18.                 else
    19.                     enemyAI.DealDamage(damage);
    20.  
    21.                 //Create blood particle on hit position
    22.                 pos = col.transform.position;
    23.                                 //I have made a pool manager that handles particle creation, this way I can reuse old particles
    24.                 particleInstance = poolManager.ActivateFromPool(ItemType.Particles, bloodParticle, null, pos);
    25.                 particleInstance.transform.rotation = myTransform.rotation;
    26.                 particleInstance.particleSystem.Play();
    27.                                
    28.                                 //This is a bool to tell the bullet to deactivate next frame to avoid hitting multiple triggers with the same bullets
    29.                 deactivate = true;
    30.             }
    31.         }
    32.     }
    33.  
    34.  
     
  12. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    Got the feet animations working this weekend. Still looks a little rough when the upper body rotates and it transitions between animations and also the strafe animations look a little weird but I'll leave it like this for later.



    Try the web version HERE
     
  13. _Carl

    _Carl

    Joined:
    Jan 12, 2014
    Posts:
    5
    How did you do the level generation? I'm creating a 2D top down rogue like but having issues with random generation =/
     
  14. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    I could put together a simple design idea post on the steps I use in my generator. I'm going to bed now but hopefully I can get some time to put it together tomorrow.
     
  15. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    Once you finish this game, you should put it up on gamejolt.com and maybe work in some achievement systems. :)
     
  16. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    Depending on the quality of the game I might try putting it up on some PC marketstores like Steam/GOG or whatever. If it ends up sucking I might just throw it up for free somewhere though.. :p
     
  17. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    So, as promised I will make a post on how my procedural floor generator works.

    The idea I had was to create rooms with enemy spawns, props, floors etc create points in each room that defines where exits from the room are and in what direction they are pointing. With these exits I could place new rooms, wait one update and see if the placed room collided with anything and if not place another until the floor was as big as I wanted. Then I would simply plug up the remaining exits with rooms without exits or simple walls to block out the exit.


    Used Extensions
    Custom Poly Mesh to create room colliders
    http://unitypatterns.com/new-tool-polymesh/

    My generator has some two different scripts:
    • Generation Manager; keeps pools of all rooms so they can be reused and placed, also keeps track of how big each floor is supposed to be, the root objects for each floor and is the script that actually places the rooms and handles generation.
    • Room; the room has a custom mesh collider and rigidbody (the collider needs to be a trigger and convex) that reports to the generation manager if it collides with anything
    • Room Exit; is placed on the exit transform and contains an enum to define in what direction the exit points (left, right, up, down)

    Generator flow (this is where it gets tricky)
    • Set a start exit and direction to begin generation from.
    • Say the exit direction is left, randomize a room with at least one exit with the entrance direction left.
    • Place the randomized room onto the exit position with the collider actived
    • Wait one frame for the physics to run and see if the room hit anything (the room script will report to the generator if it collided)
    • Let's say that the room collided. Then we simply remove the last placed room and randomize another exit, a new room and place it on the new exit.
    • Wait one frame again.
    • Now let's say nothing collided with the placed room. Then we remove the exit we just placed the room on from our list of exits, count down the minimum room size counter and lastly find and add all the exits available in the room we just placed and add those into the list.
    • Continue this flow until the minimum room size counter reaches zero (meaning we have made the floor as big as we want).
    • Now that the floor size is reached there is going to be a few exits left that we need to plug up so randomize a new exit and a new room that doesn't have any exits.
    • Wait one frame and if it didn't collide we just plugged up one hole so let's randomize yet another exit, place a room without an exit on it and wait one frame.
    • If this room without exit collided let's remove it and plug the exit with a wall instead.
    • Continue this until there are no exits left in the list of exits and when it reaches zero the generation is completed.
    I would love to fill this in with some pictures but I'm a little out of time for tonight so this will have to do for now. If anyone has any questions feel free to ask them and I'll try to answer them.
     
    IAmCraigSnedeker likes this.
  18. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    I started putting in animations for the upper body last night. A lot of polish and a few animations missing but it might end up looking quite good.

     
    IAmCraigSnedeker likes this.
  19. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    Seeing some great improvements!
     
    Zilk likes this.
  20. Yanneyanen

    Yanneyanen

    Joined:
    Jan 18, 2012
    Posts:
    55
    This is starting to look really good! I played the demo and I liked it, I think the movement and aiming work really well and the art and the lighting look great so far. This would certainly benefit from some sound effects, but I understand that might not be a priority yet. Keep it up!
     
  21. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    So I added animations for two handed ranged weapons tonight, just have the reload animation left. After this I'll either do death animations or continue with some other task since I'm quite bored with animations at the moment :D



    Try it HERE
     
  22. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    I finished up handgun and rifle animations this evening.

    After that I got around to fixing some bugs that I have been bothered by for a long time. I also started working on a hit effect script to put special hit effects on objects when they are hit with bullets. But it seems like there might have been a beer or two too many so it doesn't really work as intended yet ;)

    Try the latest version HERE
     
  23. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    Looks great! Though my icons on the bottom right are cut off.
     
  24. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    I gotta take a look at that, what screen resolution and web browser are you running on? Could be something wrong with the UI anchor.
     
  25. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    So a lot of people have asked for a minimap and I have been thinking it would be a b**ch to implement but tonight I figured it out and had one up and running in 30 minutes. Now 2 hours later it is "polished" with animations and everything.


    It is mapped to TAB and I also remapped weapon switching to the scroll wheel.

    Try it HERE
     
  26. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    It's fixed now. And the weapon remapping is amazing, thanks
     
  27. Zilk

    Zilk

    Joined:
    May 10, 2014
    Posts:
    329
    I have been fixing some issues that people have addressed such as better highlight on loot.


    I also finished my hit effect script and added it to the green barrels as a test.


    And tonight I made the art for the basic type of zombie and put some quick animations on it, so now the zombies at least walk :D


    Although when I added the zombies my draw call issue with the sprites became a real issue, I have to figure out why batching on sprites doesn't work...

    Play the latest version HERE but expect some performance issues
     
  28. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    Any more updates? :)
     
  29. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    Just checking in to see if you're still working on it?