Search Unity

Games WIP Small Works Game / Programming Thread

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

  1. K-E-I

    K-E-I

    Joined:
    Oct 6, 2012
    Posts:
    17
    Well, I thought shader works should be in programming thread. I'm sorry if I'm wrong.
     
  2. TehWut

    TehWut

    Joined:
    Jun 18, 2011
    Posts:
    1,577
    gameplay suggestion - only decrease fuel when you are thrusting the ship
     
  3. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    853
    Fixed for now - that happened because I decreased fuel based on Input.GetAxis which introduced some kind of "afterglow" when releasing the cursor keys which probably works well with an analogue stick but acts strange with a binary input (pressed/not pressed). Changed it to decrease fuel based on the GetAxisRaw value.
     
  4. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664


    My feeling would be, unless you are posting and discussing the code behind the shader, then it's an "art thing". Some might even argue even a discussion of the code behind a shader would be an art thing! You may get better and stronger feedback from that forum as well.
     
  5. Brotherhood

    Brotherhood

    Joined:
    Dec 8, 2012
    Posts:
    73
    I love the look, extremely sci-fi.

    On another note, not sure if you know or not, but if you're using NavMesh agents you'll want to use NavMeshAgent.Raycast since it has lower overhead than Physics.Raycast. Also, mind me asking why you opted for Raycast over Linecast? (just curious)
     
  6. suctioncup

    suctioncup

    Joined:
    May 19, 2012
    Posts:
    273
    I'm not using any NavMesh agents, so its okay. I used multiple rays just because its more accurate than a single linecast.
     
  7. Brotherhood

    Brotherhood

    Joined:
    Dec 8, 2012
    Posts:
    73
    Ah. I was wondering since I use a mixed system; If the linecast doesn't hit, only then do I try rays. :)
     
  8. bobbert234

    bobbert234

    Joined:
    Nov 13, 2011
    Posts:
    32
    I made an object pooling system to reuse enemies/level chunks and save on memory. The best part is I made it based on builtin arrays so it is very fast and good for mobiles. Since they cannot be resized, it can make more arrays or fallback on Instantiate or Destroy. It takes a moment to set up in the inspector and organized itself based on the objects name but I might make it completely automatic if I use it enough.

    So now this: Destroy(gameObject);
    is now this: Pooling.give(gameObject);

    $Screen Shot 2013-06-12 at 11.15.05 AM.png
     
  9. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Looks amazing! You could sell those! :)
     
  10. Thunderent

    Thunderent

    Pocket Artist

    Joined:
    Oct 8, 2010
    Posts:
    435
    Took a brake from doing art in order to polish/remember my c# skills.The art from the game is not mine(Make your Level Pack on the Asset Store along with the Maze Demon).I focused only on my programming and let the art apart for a while.

    The mechanics of the game are very simple as I tried to experiment with everything(raycasting,array,transforms,animations...etc).Use W,S,A,D to move and Spacebar to launch a projectile + you can also use your "spells"(the first adds x amount of speed for 30 seconds and the second gives you +40 life).Dodge the enemy bullets and collect 27 cubes to progress through the levels.
    Press ESC to return to Main Menu or Restart Level.

    There are 3 levels in total,the final one being a "buggy" boss fight.

    CURRENT KNOWN BUGS:
    -Sometimes Restarting the level doesn't work
    -In the beginning of every scene a huge amount of projectiles are spawned by the enemies(I couldn't find a way to solve it)
    -In the beginning of the boss fight,start moving immediately or you're gonna get crushed by 10000 "magic bolts",just like above.
    -The boss dies at -400 life.I forgot to update the boss's stats.

    $txoq.jpg
    $umm9.jpg



    And the link:
    Click me to Play!


    P.S : The boss fight is really buggy,it was a huge accomplishment even for me to kill it :) .If you manage to kill the final boss,post a screenshot :D(the boss dissapears at the end,but the proof that he isn't there is enough) :D
     
  11. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    $ShadowTest.png

    Early work on a new 2d shadow system... using a completely new technique - it works very fast and supports unlimited dynamic objects and multiple lights. I also have a new method for soft shadows that I am working on. Planning to make this into a full 2d lighting solution and then make it available on the asset store. Might take a couple of weeks though.

    [edit] ... got some soft shadows working.. but I'm not liking the quality yet.[/edit]

    $Screen Shot 2013-06-14 at 8.26.29 PM.png

    [edit2] Ok... looking better :) [/edit]
     

    Attached Files:

    Last edited: Jun 15, 2013
  12. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    2.5D Platformer toolkit I'm working on for the Asset store, featuring powerups, AI. and 4 different environments!


     
    Last edited: Jun 17, 2013
  13. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    613
    The last picture shows a gap. This seems like you are drawing a shadow object for each of the 4 edges of the cube.
    -Does that mean we can expect a lot of draw calls from your solution? Iwould rather guess it is a shader based solution since you wrote unlimited objects

    i have seen a lot of 2D-shadow implementations the last months (shader, raycasts geometric), i even try to get one working myself but i suck at converting c++ code to c#. I received the source to this geometric approach from serumas:
    http://serumas.gamedev.lt/index.php?id=visibility


    After ~3000 Lines of conversions and supplementations, realtime polygon extractions, segment face identifications, occlusion diagrams, i am stuck at the second stage of dropping sub-segments. At the end i will have a single starlike polygon (visibility polygon) or the inverted of it (circle with a cutout of it). So it is a single object in terms of drawcalls and i can make a prism out of it for use in 2.5D environments e.g. if i want to tilt the camera a bit.
    I hope i can finish it sometime soon, but this year i am always occupied in my free time, i can share it if anyone is interested but the code is a bloody mess right now

    I am still a noob at basic coding practices somehow,
    E.g. was it a good choice to use a List of classes(since passed by reference i guessed) to convert from c++ std::vector that deal with pointers to structs?
     
    Last edited: Jun 19, 2013
  14. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Hey. Yes there is a gap in the last pic near the bottom - but actually that bottom object is not supposed to really be in the screenshot because it is rendering using an older experimental shader which doesn't work, hence the white line. I should've left it out of the screenshot.

    In terms of draw calls, it depends on whether individual occlusion objects need to move individually or not. If the objects are fixed in position there can be effectively an unlimited number of them (performance and memory permitting of course), allowing a light source to move and for the shadows to update dynamically - just so long as the occluders are stationary. In this case the shadow `data` can be combined to produce minimal draw calls, as few as 1 even, but most likely a larger environment would want to break this up into localized draw calls so that there can be some occlusion culling by Unity. It is possible though to cover the whole screen with shadows from a single light in one draw call. Static background elements are therefore extremely fast to render. There are some polygons involved, so the triangle count is more than without shadows, but then it's mostly down to triangle processing and fill-rate after that. Each light source will require a separate render pass, which seems typical for most shadow solutions and really comes down to the fact that any pixel could be receiving/hidden from light from a variety of locations which is difficult/inefficient to try handling all in one pass. There is also another aspect of my technique that I haven't talked about which imposes a limitation of each light source needing to have a separate pass. I'm also looking though at how to have short-range shadows that fade out over a distance, which possible allows for more combining.

    As far as dynamically moving individual objects are concerned, they need to have their own shadow data, which doesn't necessarily have to be modified each frame, just that it has to be separate from the static objects, so mostly have to have their own draw call at the moment, but I do plan to dynamically batch them to allow far more objects with fewer draw calls. I don't imagine needing more than 5-10 draw calls per frame for most situations, but it also depends on how many light sources you want.

    There's been a few implementations of 2d shadows already, with various plusses and minuses. Generally there is a mesh-based softshadow solution which looks quite good but I imagine the meshes have to be dynamically generated and updated every frame, which involves a fair amount of work to allow the light sources to move. I've also seen a kind of fake soft-shadow one where they uniformly blur all shadows the same amount which makes even the crisp parts blurry (and I think that's also mesh based), and isn't as realistic. And there is also a texture-based multi-pass method to do with distorting and streaking and warping the occluder textures from circular space into linear space and back again, requiring rendertextures (Pro only) and several passes per light. I think mine is mostly better than any of these with the current exception of the mesh-based soft shadows which although slower, looks better. I do have two or three approaches to making the shadows soft but I need to work it it more to perfect it. One interesting side-effect of one method (shown above) though is that the soft-shadow edges make the shadows very smoothly antialiased.
     
    Last edited: Jun 20, 2013
  15. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    613
    Thanks for the insights.

    As i started programming Unity (~1.5 years ago) i was eager to find any solution to this problem. This is my linklist, you may have stumbled upon all of them recently:

    Shader based:
    http://www.gamedev.net/page/resourc...ming-and-theory/dynamic-2d-soft-shadows-r2032 --> has a nice take on umbras penumbras
    http://www.catalinzima.com/2010/07/my-technique-for-the-shader-based-dynamic-2d-shadows/ (in action http://www.youtube.com/watch?v=MBjt-WT2tIs&list=SP541A5EA29174CFA2)

    Raycasting:
    http://unitycoder.com/blog/2012/02/15/raycast-realtime-visibility-2-0/ --> this is the one i currently use (modified)
    http://u3d.as/content/reverie-interactive/2d-volumetric-lights/36x --> i bought this one to check it out, it uses raycasts (sweeptest) that only update occasionally to improve performance

    Mesh Generating:
    http://forum.unity3d.com/threads/25138-light-and-dynamic-shadows-with-meshes-for-2d-game?
    http://serumas.gamedev.lt/index.php?id=visibility -->serumas was so kind to send me his source
     
    Last edited: Jun 20, 2013
  16. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Any reason not to use Generic Lists? They are fast, show up in the inspector and are resizable...
     
  17. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    My new gradient shader pack went live on the asset store this past week... Realtime-rendered adjustable/animatable gradients, only $25 here: https://www.assetstore.unity3d.com/#/content/9403
    Meanwhile, this week I jumped ship across what's turning out to be two slightly longer-term projects (one being my realtime 2d shadows) and landed on a new short-term one... just now putting the finishing touches to it, hopefully up onto the asset store next week... 2d mesh deformation...

    $Screen Shot 2013-06-21 at 7.00.47 PM.png
     
  18. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    Wow, looks great :D
     
  19. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    Webplayer

    Working on my new enemies, the dreaded Steelguard, and figuring out why when they attack, they get stuck in their 'thrusting' pose...
    That's what she said.
     
  20. XGundam05

    XGundam05

    Joined:
    Mar 29, 2012
    Posts:
    473
    I wrote an In-Editor importer for Tiled maps in JSON format. It uses the map layers to create a 3-dimensional tile map. The tile set is defined by an array of objects containing game object definitions for the top/left/right/back/front faces. In this case, the tiles are pre-made quads with a pre-made atlas material (so I can see what it looks like in the editor more easily).

    Tiled Editor input:
    $tiled_editor.png

    Unity Editor output:
    $map_in_editor.PNG
     
  21. MaxieQ

    MaxieQ

    Joined:
    Nov 1, 2012
    Posts:
    295
    $trajectory.gif

    I am at the moment trying to get my simple avatar to do three things for my new game with the working title "Ballistic".

    Applying thrust in a direction should propel the avatar in a ballistic arc in the direction the avatar is facing.

    Applying thrust during the trajectory should... change trajectory.

    Then there should be a mechanism to interrupt the trajectory progress. Ie stop in mid-air.

    So, the avatar could propel itself in an arc, change direction, and then stop in mid-air and fall down in a desired location. For instance, a trickily placed ledge in a platform puzzle game.

    Simple stuff, I suppose,
     
  22. 0n35

    0n35

    Joined:
    Aug 23, 2012
    Posts:
    51
    Very similar to
    http://unitycoder.com/blog/2013/04/06/roguelike-shadowcasting/
     
  23. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Mmm... similar in appearance perhaps, but horribly slow. Having to rely to SetPixels/Apply() every frame is bad, since Unity's implementation of uploads from cpu to gpu is terribly slow compared to other systems (at least let us upload and modify only PART of a texture Unity, not the whole dam thing! ;-) glTexSubImage2D() has been standard in OpenGL since version *1*, many many years ago - it would help many algorithms HUGELY in speed to not have to dump stupid float-format 4-component data in its entirety when a tiny change is made. What would help even more is to do away with having to transfer an array from main memory into some internal unity storage space and then on to the graphics card - a totally unnecessary go-between step. But anyway...

    My method doesn't require any tracing of rays or casting lines or whatever... It's crazy fast and complexity is no issue. But it does look much the same in terms of visibility from the light source.
     
    Last edited: Jun 24, 2013
  24. SilentDeveloper

    SilentDeveloper

    Joined:
    Jun 5, 2013
    Posts:
    29
    Outstanding, hands down the best car shader I've seen. You should put up a webplayer of it once your done with it, and put it up on the asset store.
     
  25. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Feedback? I can't imagine that this is lost on the Dev's but I can imagine that without some pressure, it might be overlooked for other issues...
     
  26. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Yah I dont know that many people realize its an issue or want it resolved.
     
  27. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    But, when it comes to optimisation, it seems to be a very important thing... Maybe it's just an edge case. If you submit a bug report or make a feedback post, can you PM me the bug number or url? I'd consider it, but I don't know the detail to include.
     
  28. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    I posted a feedback request for improving the texture uploads.

    I seem to be having some major issues with feedback.unity3d.com on Safari on Windows at the moment.. it doesn't show ANY feedback requests.
     
  29. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Hey guys, don't know if anyone wants to see this or not, but I wanted to test out making a rigid body based movement system in a creepy setting. As of right now, I like how it moves, and when you turn on the flashlight, I like the lag behind it. Possibly thinking of selling the movement system, but I'm not sure. Let me know what you think.
    http://calibermengsk.com/games/unity/nightLevel/

    $creepyMovement.jpg

    I'm probably not going to do much development on this, unless people really want this kind of thing in the asset store. I would still like to know what people think of it though. It's a shame to work on something and not show it off.
     
  30. CVgames

    CVgames

    Joined:
    Jun 30, 2013
    Posts:
    25
    the atmosphere and lighting are pretty creepy, not sure which direction you going with it, but it looks nice
     
  31. TehWut

    TehWut

    Joined:
    Jun 18, 2011
    Posts:
    1,577
    Well, I've been working on this for the past two days.

    So I have this "monster" rigged with rigidbodies and some box colliders. If you get hit by one, you're supposed to fly off in the direction of the attack. This proved more troublesome than I first imagined, a simple rigidbody.velocity reading didn't seem to do the trick. I have the general idea now though. Upon collision, I attached a "hipoint" gameObject to the point of collision and parented it to the bone. Then, on the next frame, after the hitpoint had moved with the bone, this was taken as the "actual hit". from here after performing some vector subtraction and Dot products and other witchcraft to get direction I've come up with a rudimentary solution, and it appears to work.

    Below, you can see the hitboxes and the player capsule. The red lines are the "sweeps" where the collision occured, and is the direction and force in which the player flew.

    $mYiESCj.jpg
     
  32. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  33. TehWut

    TehWut

    Joined:
    Jun 18, 2011
    Posts:
    1,577
    I'm actually using a CharacterController rather than a rigidbody for the player character. I'm looking for pretty specific "unrealistic" motion. (Think Monster Hunter type collisions)
     
  34. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  35. TehWut

    TehWut

    Joined:
    Jun 18, 2011
    Posts:
    1,577
    Thanks so much Little Angel! That's a fantastic script!
     
  36. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    Are you qualified to provide such a link ;)?
     
  37. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    TBH - I never passed my GCSEs.

    They didn't have them in country when I was in school.

    You can however use the GCSE in my .sig free of charge.

    You can even mention this in your CV* if you think it will improve your standing.

    *Resumé
     
  38. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    I'm probably going to add oculus rift support when mine finally comes in. I've also been debating getting a razer hydra to mess with. I'd be kind of cool to actually move your hand around to control the flashlight.
     
  39. CVgames

    CVgames

    Joined:
    Jun 30, 2013
    Posts:
    25
    Don't give up on it I think you have a great start.
     
  40. Benproductions1

    Benproductions1

    Joined:
    May 11, 2011
    Posts:
    63
    Yo!

    I'm currently working on a little side project because I got bored and had an idea XD

    I don't have anything to show of it yet (It's still WIP)
    But what do people think of an animation system specifically for Scripts?

    It would work basically the same as the Legacy Animation system, but instead of editing transform properties of a heiarchy,
    you animate members of `MonoBehaviour` scripts.

    I've gotten the basic classes already finished.
    I now have lots of work to do on the Editor GUI part :)
     
  41. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Would love to see it in action...

    As long as it works and it's efficient, there's always room for a new way of doing things.
     
  42. AlexZimich

    AlexZimich

    Joined:
    Aug 8, 2009
    Posts:
    358
  43. Rafael-Barbosa

    Rafael-Barbosa

    Joined:
    Apr 14, 2013
    Posts:
    288
    I got curious regarding First Person Shooter controls with unity, so I made a quick test, and got some pretty nice results!

    Here is a webplayer : https://dl.dropboxusercontent.com/u/44674918/Zimb/Zimb.html

    Controls :

    WASD - Move
    Left Mouse - Shoot
    Right Mouse - Aim
    R - Reload
    F - Punch

    The health is working 100%! I had some "zombies" set up , they come close, stop walking and hit you every 1 second, but the problem was that I have no idea how to create a pathfinding system :/ , guess AI won't be used yet..

    By the way, keep on shooting the cubes, they will crash into 6 smaller pieces ;)
     
  44. dot_entity

    dot_entity

    Joined:
    Nov 2, 2012
    Posts:
    86
    My greetings to the community!

    I was wondering if this the right place to post my recently developed application. It is my first comprehensive work, made for a university project, I put a big effort on it and since I am pretty much fresh in all of the fields of 3D modeling, animation, programming etc., I only managed to get ideas from the forums and try to implement them in my project. Therefore, I have many reasons to doubt about the efficiency of my development and I desire any feedback, critique and wisdom from experienced users or everyone who wants to share his/her thoughts. Can anyone tell me, if it would make sense to upload the whole project here, in order to get back some valuable comments?

    Thank you in advance!
     
  45. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    613
    I believe a link to a webplayer would be sufficient. Dropbox links should work afaik but i never used that feature. At least more people will take a look at it if they don't have to download stuff to their hdd, especially if they don't know what it is.
    So supply some pics + short description so people know what to expect.
    If there are certain obvious aspects that may be inefficient, people will notice through gameplay, if they don't notice, why bother anyway, i doubt that anyone would review your whole source code except your game gets a lot of attention.
     
  46. dot_entity

    dot_entity

    Joined:
    Nov 2, 2012
    Posts:
    86
    Thank you Marrt! It seems you're right. I'm currently looking to these options in Build Settings for a Web Player (like what this 'Development Build' is) and I will upload a Built afterwards, I guess. However, what you describe as 'reviewing the whole code' is maybe what I would like, in order to get some deeper insight of what could have been done differently, what method would be more efficient. But it is not even about a funny game, just a simulation application and since I see 'Location: Austria' at your profile, it is a project done for Vienna's TU.:) Anyway, I will probably lay some stress on the parts about which I am concerned and only if there is someone interested, I could provide some code or whatever further information.
     
  47. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    Just tested something 2 Days ago, a motorway simulator. I didn't include many rules. Cars try to overtake but use the right lane if possible. SOme accidents occur and somethimes they don't switch Lane properly. But it was a funny quick test.

    You can adjust game speed with the slider and zoom camera with the mousewheel.

    Webplayer: TrafficSystem
     
  48. create3dgames

    create3dgames

    Joined:
    Aug 20, 2012
    Posts:
    275
    What do you guys think?

    $unityscripting.JPG

    It's a game (sort of) where you can write scripts and run them during runtime. Very good for learning Unity. So far I only have five lessons, but after all I just started working on it today. When I've got more lessons I will release it (for free!)
     
  49. Thunderent

    Thunderent

    Pocket Artist

    Joined:
    Oct 8, 2010
    Posts:
    435
    Working on a 2.5D Platformer System right now.So far i've implemented:
    -walk,jump
    -climb ladders
    -downslope bouncyness fix
    -swiming/underwater
    -push rigidbodies
    -crouch

    I had to speed-up the video,because the original turned out very laggy.




    Things to add/fix:
    -Climb/Jump ropes
    -Stay on moving platform
    -Grappling hook
    -Slide
     
    Last edited: Jul 13, 2013
  50. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    How do you execute your code? just eval()?