Search Unity

Birds: The Game (alpha)

Discussion in 'Made With Unity' started by Antitheory, May 31, 2011.

  1. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    Hello everyone,

    Just thought I would share my first Unity project with the community here. I have mentioned my "bird sim" in a few threads here and I thought some of you might want to try it out.

    As you will notice it's not yet finished... right now basically you can just fly this bird around and land/walk in trees and stuff.

    It's a hefty download (30 megs?!) which is mainly due to the bird-model and animations I believe. There is information about how to play the game on the site.



    Play it at: www.antitheorystudio.com/birds-the-game

    I am aware of some issues already present (like for one you can walk/fly underwater). Also there are only environmental sounds right now, the bird currently doesn't make any noise (though I have scripts for this worked out, I just need to get some good sounds).

    As noted on the site the game makes use of the Nikko’s version of the Community Ocean Shader as well as the Skydome for Unity3d 3.X by Pixelstudio. The game was made with Unity indie so the underwater effect is lacking and obviously there are no real-time shadows or reflections.

    I have some features which are almost ready to go including a rigged snake with motion based on an improved version of a script I posted on the forums.

    Also to come is a large cargo-ship (which I have modeled just not textured yet) which floats/drives through the ocean using a buoyancy script similar to one found here.

    The terrain/splatmaps/vegetation/atmospheric-sound-mapping are all procedural, based off a single height-map file downloaded from a NASA digital-elevation-map. I use World Machine to create the vegetation/treemaps procedurally based on the input heightmap. The soundmaps are generated using a technique I discussed in this thread.

    In theory the entire terrain creation can happen in the game (all you need is the heightmap,splatmap,treemap etc.) but it seems impossible to do this with large terrains without a hiccup in the game. I managed to put everything I could into a background thread but what kills the performance is the call to SetHeights during gameplay. So in the demo I posted I just use a Terrain which I baked with this method.

    That's all for now. I will update this thread as I add some new features to the game. Enjoy the demo for now.

    Cheers,
    Jon
     
  2. Pedro Afonso

    Pedro Afonso

    Joined:
    Mar 13, 2011
    Posts:
    240
    awesome!!!
    I hope you finish this project and I hope it will have a great success

    Good Luck!
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi jon,

    i enjoyed flying around and liked it very much – but nevertheless i have some sugguestions. i hope these will help you to make your game look even better.

    skydome
    - there is no sky on mac… just a white/grey background

    ambient light
    - i would suggest to brighten the ambient lighting in order to avoid "black" areas and shadows like on the bird’s body on you picture posted above

    trees
    - the conifers are too dark i think, more or less black. add more baselight in the material setup or brighten the texture.
    - have you had a look at the pine trees that ship with the terrain asset? http://u3d.as/content/unity-technologies/terrain-assets/1qQ
    following the link below will give you even 3 different pine trees:
    http://www.unifycommunity.com/wiki/images/a/a4/ScotsPine3.zip
    using more different tree models will definitely increase the visual impact.
    - some of the trees are floating around. probably raising the tree’s pivot (in your 3d app) will fix this for the trunk will sink into the ground.

    details on the terrain
    - i am not a great fan of billboarding grass and details… have you tried just to uncheck "billboard" in the "add grass texture" dialogue?

    textures / models
    - have you tried some of the textures and models of the bootcamp demo? it offers a lot of different grass textures and some nice ground textures. i don’t know if it ships with unity but you can get it at the asset store: http://u3d.as/content/exit-games/photon-bootcamp-demo/1AA

    shadows on the bird
    - have you tried to use an orthographic projector in order to get shadows on top of the bird?
    http://www.unifycommunity.com/wiki/...Step_7:_Dropping_shadows_on_top_of_the_player

    lars
     
    Last edited: Jun 1, 2011
  4. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    Thanks for your input lars. I am glad people are taking an interest!

    I didn't realize the skydome would not be working on some computers, I'll have to look into what shader models it supports... Though it's strange that the it's the sky and not the ocean that is giving you the trouble, I am pretty sure the Ocean is set-up for SM3

    Trees:
    I'll have another look at the trees... I currently live in the boreal forest surrounded by conifers, and I wanted to be faithful to their appearance as best I could. Sometimes game artists go too far in the cartoony direction, I wanted it to be more subtle. Of course it could be related to what kind of monitor I/you are using. When I tested the game on another computer the lighting was not really to my liking anymore... I wonder if there is a way to have different colour profiles for different monitor setups like in Photoshop.

    In terms of the variety of trees, I have made a whole bunch more, but I didn't include them in this build because I was worrying about performance issues for this demo. I wanted to see how other people's machines handled the game. My computer is an old laptop and it runs ok here, but I know there are people out there running a lot worse.

    Terrain Details:
    Yes I really don't like them either. I just threw in the basic ones that come with the terrain kit, but eventually I want to use my own. I don't really like the billboarding either but I also don't like seeing a sprite from a sharp angle, I guess you have to pick which one is less annoying... either that or I could use detail meshes for everything.

    Terrain textures:
    Again I just used some of the basics that come with Unity for now. I will try to get something better.

    Shadows on the bird:
    I haven't tried that... but how would I know when to cover the bird in shadow? I suppose I could be checking to see if he is near the ground and on a spot that is shaded by the lightmap?
     
    Last edited: Jun 1, 2011
  5. iisjreg

    iisjreg

    Joined:
    Mar 25, 2011
    Posts:
    101
    I really, really like it. Well done!
    The cursor is odd (at the moment), but when I read and found out that's how you land, it worked really well. Landing at the top of a tree was brilliant!

    Good luck for the updates.
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    Shadows on the bird:
    I haven't tried that... but how would I know when to cover the bird in shadow? I suppose I could be checking to see if he is near the ground and on a spot that is shaded by the lightmap?


    yes, i guess so: in general it just should be enough to just take the bird’s y position into account. let’s say height < 20m (=average height of tree) always project shadow. additionally some pretty simple colliders around the high mountains which increase the average height on enter and set it back on leave.
    much more accuracy you would get by looking up the terrain’s height map at the bird’s position. so if( (terrain’s height + average height of tree) > position.y of bird ) ---> project shadow

    I didn't realize the skydome would not be working on some computers, I'll have to look into what shader models it supports... Though it's strange that the it's the sky and not the ocean that is giving you the trouble, I am pretty sure the Ocean is set-up for SM3
    sm3 should not be the problem – may be it doesn’t work correctly with opengl.

    what do you think?
     
  7. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    I was only able to test a few things on my girlfriend's mac before I went to work, but I wasn't able to get the sky working on it... Only now (when there isn't a mac in sight) do I think I have the solution to the problem.

    Apparently the line in the shader:

    Fog {Mode Off}

    is not working properly. That's why you are getting that greyish colour. Has anybody else been able to see the sky correctly on OSX? I wonder if it's an issue with specific cards or OpenGL versions.

    I am not 100% sure this is the problem because I cant just turn the fog down and test it until I get back from work.
     
  8. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    Sound interesting. I might try to put that in. I have been considering purchasing Unity Pro ao I wouldn't have to mess around with tricks like that! One of the big advantages to real-time shadows is that I could have the day-night cycle with accurate shadows. Right now the sun is frozen in position in order to keep the baked lightmap looking accurate.
     
  9. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    Thanks! Yeah the cursor is sort of a placeholder at the moment. I just threw in a transparent sphere when I was testing and I can't think of anything better at the moment. I thought maybe it could change depending on what the cursor is hovering over (like if you are hovering over a perchable location, it would show a bird foot or something... or when you are walking around looking for food/twigs, it could show a graphic of a beak).

    You guys are getting me pumped up again. I will definitely keep plugging away and post the updates to this thread. The snake is really cool and is almost done. I'll try and get it up here soon!
     
  10. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    Looks nice!
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i watched it on both my internal 15" macbookpro and external 24" eizo tft – both not the cheapest panels, both calibrated. and mac os now works with the same gamma as windows always had done. but this problem already appeared in a few threads.
    i guess profiles are not the solution as unity would have to support color profiles and adjust the colors on the fly…
    so the only solution i can think of is to provide your own gamma correction which pretty much any game offers – but which is impossible to implement with unity indie (no image effects…)

    adding more tree models (e.g. some tweaked versions of the conifer) all sharing the same textures should not influence the performance in any way. at least i have never noticed anything like this. in my opinion the number of different textures is important (texture memory / lookups) as well as the number of visible mesh trees, the complexity of the shader (you use the tree soft occlusion shader which is rather simple, don’t you?) and number of tris per tree.

    right, but this will be a massive performance hit. it easily doubles the number of draw calls and halves the number of fps… as in your game you are flying around you have a pretty far view distance and complex scenery (lot of trees). the number of draw calls raises with the increase of the shadow distance. i usually work with a shadow distance of 50 – 80m – nothing which is beyond this distance to the camera will drop any realtime shadow. so you would end up in a lively shadowed foreground and a flat background… not to mention that billboarded trees do not drop any real time shadow at all. usually you would fix this lack with lightmaps… so either nicely shadowed sceneries or day-night cycles i would say.
     
  12. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    Trees:
    Thanks kindly for all your responses. That's interesting what you said about trees. I used ngPlant to make the trees so I could generate many more with the same textures and some variety in size/shape. I would have liked to use the built-in tree editor but I find it too slow on my machine to work with, and there are some features that ngPlant has that Unity's tree editor just doesn't have. It's a pity because I want to be able to use the new tree shaders. Also there is a bug(?) with the new Unity trees, they are not affected by wind when place on the terrain.

    Shadows:
    Since I haven't tried out Unity Pro I didn't realize that there would be such a hit in performance with the real-time shadows (though I should have guessed). For the demo I think it makes sense to go with the nice shadows... but for a real simulator game I would definitely want day-night cycles as that will be a key element of the gameplay. I guess I will have to do away with the lovely tree shadows... (after I spent all that time getting them to appear on the ocean too!)

    It would be interesting if animated light-maps were possible...
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    the built in editor has got quite some limits, right. but in order to get the wind effect the trees you will have to add a wind zone. wind settings on just the terrain do not effect trees but only grass. that is no bug, you might call it a feature…

    yes, is guess so.
    just to give you an impression, this is how real time shadow might look like:

    $Bildschirmfoto 2011-06-02 um 04.24.47.png

    shadow distance of 70m and about 500 draw calls.

    notice: no shadows dropped by the billboarded trees. in order to have the trees in the background dropping shadows you would have to:
    a) increase the shadow distance ---> more draw calls
    b) increase the number of mesh trees and the tree distance ---> even more draw calls

    so i really would suggest to stick with baked shadows.


    lars
     
    Last edited: Jun 2, 2011
  14. iisjreg

    iisjreg

    Joined:
    Mar 25, 2011
    Posts:
    101
    DUCKS!

    landing on the water and swimming about.

    must have.
     
  15. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    I was aware of that... but last time I checked the wind zones did not work with trees which are placed on the terrain (and make use of the LOD system for the terrain). I wonder if this bug has been fixed since I last investigated, though I haven't seen it mentioned in the 3.3 release.

    Maybe Unity wants us to stop using terrain trees and just use their new trees (which I gather have some kind of LOD system, but not billboarding). I wonder how my game would run with 5000 of Unity's new trees?
     
  16. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    Yeah this is planned for sure. I have always thought of ducks as like master of the planet or something, they can operate on land, in air, and underwater (though admittedly they're obviously not top-of-the-class in any one of those areas).
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    you are right but this bug has been fixed. wind zone now work fine with trees placed using the terrain engine. you can use both: traditionally imported mesh trees using the soft occlusion shaders or trees created using the built in tree creator tool. the last ones have more advanced shaders which support translucency and bumpmapping and a different kind of bending like crysis, the first ones are cheaper to render. but all trees brought into unity like those coming with the terrain asset or those you have modeled in an external app have to use the traditional soft occlusion shades because the new shaders (tree creator bark / leaves / leaves fat) need some more params which are not provided in any imported .fbx or .obj file. you can assign the new shaders but activating the wind zone will totally break you imported model.

    unfortunately there is no LOD system for the trees just full mesh tree or billboard – nothing in between. doesn’t matter if you use traditional trees or "new" trees.
    each fully rendered mesh tree causes 6 draw calls (when real time shadows are enabled) so 5000 visible mesh trees would end up in 30.000 draw calls… which is ten times higher than any AAA game causes.
    usually i work with a number of 40 – 80 visible mesh trees. all other trees get billboarded and are drawn in just 1 – i guess – draw call. unfortunately billboarded trees do not look very nice: they do not get distorted to your camera perspective correctly (have a look at the image in my post above: the trees in the foreground are real mesh trees. they align perfectly with the camera perspective. trees in the background are just billboards which are always upright although they should align: look at the upper left corner e. g. – totally weird. next – in case you use one of the new leaves shaders – billboards don’t have any self shadowing but full translucency which makes them appear much brighter (using the "old" soft occlusion shaders you won’t get this problem). last thing: billboards to not react to any change of the lighting unless you "refresh tree and detail prototypes". unity creates a texture atlas containing all used tree prototypes viewed from different angles at your given lighting and then just shows one of the precalculated "pictures" according to the view angle.
    and billboarded trees do not cast any shadows...
    in case you really think of using any kind of day to night script you will have to update the billboarded trees from time to time in order to give them the correct lighting which might cause some hiccups i guess. i don’t know any way to spread this recalculation over several frames.
    next: you won’t get any shadows casted by billboarded trees even if you raise up the shadow distance (doing so will decrease the quality of your shadows dramaticly… ). what you could get is more or less what the picture in my post above shows.
    other engines might have some more advanced techniques supporting real time lighting on trees and billboards – unity doesn’t.

    so my suggestion: even if you buy unity pro and add real time shadows, just stick with prebaked lightmaps and drop the idea of dynamic day to night cycles as real time lighting provides nice results only if you view distance or better the distance of interest is about 50 – 100m.

    lars
     
    Last edited: Jun 3, 2011
  18. Antitheory

    Antitheory

    Joined:
    Nov 14, 2010
    Posts:
    549
    Thanks for all the info. I am particularly happy to hear I can get wind on the Unity trees as I really like what the wind looks like, not to mention the vast improvement in the shaders.

    I hadn't notice what you mentioned about the billboard lighting problem until now. It makes the switch from billboard to mesh a lot more noticeable. I guess I will leave the lighting static for now unless some other solution presents itself. Thanks again for your help.
     
  19. wingedfox123

    wingedfox123

    Joined:
    Apr 11, 2011
    Posts:
    229
    oohh for an unlockable special a GRYPHON!
     
  20. wingedfox123

    wingedfox123

    Joined:
    Apr 11, 2011
    Posts:
    229
  21. wingedfox123

    wingedfox123

    Joined:
    Apr 11, 2011
    Posts:
    229
    why cant i install the webplayer?