Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411497 Posts in 69373 Topics- by 58428 Members - Latest Member: shelton786

April 25, 2024, 07:39:17 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsShepherd Dog
Pages: 1 2 [3] 4 5
Print
Author Topic: Shepherd Dog  (Read 14341 times)
deyama
TIGBaby
*


View Profile
« Reply #40 on: July 03, 2016, 01:28:58 PM »

Hi, boogie!
The game looks great so far, keep up the good work!
Can I ask if there is some static obstacle avoidance for the sheep involved?
Logged
boogie
Level 0
***



View Profile
« Reply #41 on: July 04, 2016, 10:27:42 AM »

Thank you deyama Smiley Do you have something specific in mind with static obstacles? Something like traps on the ground?


Also, i've been working on a house model. It will be your objective, to take sheep to the farm.



Shamelessly stolen from https://www.behance.net/gallery/Low-Poly-Big-House/14146799

I'm not good enough to make something like that by my own Smiley I took idea for sheaves of wheat from https://twitter.com/WilliamMesilane
He's making a cool game, worth following.
Logged

boogie
Level 0
***



View Profile
« Reply #42 on: July 14, 2016, 01:46:17 PM »

I've been playing around with tree models and animations



I want a really simple and cheap animation. I want to be able to put a lot of trees and still have good overall performance. My previous tree animations were bone animations. A tree had only two bones, but still I felt that's too expensive. Not that i made any tests, just felt that it has to be expensive. So i've made a simple vertex offset animation.  The red channel on the vertex colour means how much vertex moves:



But I'm doing just simple translation on one axis, so animation has to be subtle. It doesn't look good if i overdo the translation:



Maybe i will want to make a stormy weather with strong wind. I will have to come up with something better for that. But for now subtle movement is ok.

So I've spent couple days fighting dynamic batching in Unity. First of all my vertex offset was applied in shader before multiplying by MVP matrix. It causes problems with batching. When batched, vertices are sent to the gpu in world coordinates. So you are applying your translation in a different space. For example, local model space Z axis is up in Blender. In Unity Y axis is up. So applying translation in local and world coordinates means moving in different axis. I fixed it by dividing MVP matrix in two multiplications. The first multiplication is the model matrix or objecttoworld matrix. Then I apply the translation and after that multiply by VP matrix. It means that the translation is in global coordinates. Here's shader's fragment to show what i mean:

                o.posWorld = mul(_Object2World, v.vertex);
                o.posWorld.xyz += (o.vertexColor.r * ( (-1 + sin(_Seed + node_4324.g)) / 2)*float3(0,0,_Amplitude));
                o.pos = mul(UNITY_MATRIX_VP, o.posWorld );

 It sucks, because now all trees bend in the same direction. Without batching i can just randomly rotate trees and they will bend in different directions.

So i've been curious how much did the batching improve performance. I made a scene with ~1100 trees:



1100 trees in 26 batches sounds quite good. Half of it is shadow generation. I was curious how unity's dynamic batching work. Does it sord meshes by materials? Or does it just go in some random order? I checked the frame buffer. There are 3 materials for trees with 3 different colors. You can see (maybe not so clearly, because colors are similar), that it renders all medium-green trees, then all light-green trees and at the end all brownish trees. Pretty neat. So far so good.



First weird thing i noticed is that stats in unity shows 480k vertices rendered. Well that's bullshit. My tree has 50 vertices:



 1100 x 50 is 55k vertices. Then i checked model in unity:



244 vertices. Why? Because of flat shading. If you have flat shading it means that vertex has different normal for every face it belongs to. The way Unity handles it is to duplicate vertices with different normals. You can actually make a simple test - create a cube with flat and smooth shading. The one with smooth shading will have 8 vertices, and the one with flat shading 24 vertices. I've searched for a different approach but with no luck.

Ok, so how good is batching? On my laptop i had 50 frames on average with batching. Without batching it's actually better, 60 fps. I thought - ok, with batching cpu has to do some extra work and multiply vertices into world coordinates. There's actually 5 times more vertices than i expected and draw calls aren't so expensive on pc as they are on mobile. So I've checked it on my mobile devices. On my tablet and on my phone version without batching was slightly better (by 1-2 fps). That was unexpected. Here are stats from batched and non-batched version:





If you have any thoughts about this, let me know, i'm little bit shocked that batching doesn't improve performance in my case.
Logged

io3 creations
Level 10
*****



View Profile WWW
« Reply #43 on: July 21, 2016, 11:02:57 AM »

I'm still in the early stages of my Unity "adventures" and haven't had time to explore a similar topic: optimizing a low-poly game.  So, I'll let you do the "exploring" based on an article that has great tips that work well for mobile as well:  http://www.paladinstudios.com/2012/07/30/4-ways-to-increase-performance-of-your-unity-game/
Reducing the number of different materials (e.g. by combining texture images) is a common approach but if you are fine with having "simple colors" for the poly triangles, then using vertex colors can be an even better option.  As you mentioned above with flat shading, that might triple the number of vertices to allow each poly triangle to have different color but the overall performance gain should be significant.  I'm guessing that this approach should also allow gradient colors for those poly triangles (if needed).  How to actually create such models will probably depend on the 3d software used but seems possible.

Let me know what you find. Smiley
Logged

Pixel Noise
Level 10
*****



View Profile WWW
« Reply #44 on: July 21, 2016, 02:28:14 PM »

I think the "simple" approach to the graphics - regardless of why you're doing it - is really charming in this project anyway. I really like the overall look of the game right now.
Logged

Pixel Noise - professional composition/sound design studio.
 https://soundcloud.com/pixel-noise
 https://twitter.com/PixelNoiseMusic
 https://pixelnoisemusic.bandcamp.com/

Recently completed the ReallyGoodBattle OST!  https://www.youtube.com/watch?time_continue=2&v=vgf-4DjU5q
boogie
Level 0
***



View Profile
« Reply #45 on: July 22, 2016, 11:44:58 AM »

Thanks Pixel Noise!

io3 creations, there's something wrong with static batching, at least in my version of unity (which is 5.3.5). I think there's a bug, because i got twice as good results using CombineMeshes and in fact they should be comparable with static batching. Using CombineMeshes method framerate is 2 times better, 15 fps in stress test without batching and 30 fps using CombineMeshes. The profiler and frame debugger show that static batching is actually happening, but i don't see the results in performance. I didn't want to use CombineMeshes, because it happens in runtime and it's more work, because you cannot merge everything on a scene in one mesh,  you have to make a grid and combine everything in one cell or look at your game and combine things that are close. I've tried StaticBatchingUtility (a different method, that you can explicitly tell Unity, what do you want to merge), but with no luck. Same results as in static/dynamic batching. StaticBatchingUtility seemed to be cool, because Unity takes care of culling for you, so you don't have to split meshes into grid or something. The batching isn't even so necessary for me right now, i'm doing it more from curiosity. It can help with grass though.
Logged

io3 creations
Level 10
*****



View Profile WWW
« Reply #46 on: July 22, 2016, 12:31:35 PM »

That's interesting.  Given the number of things Unity have changed over the last year, the possibility of a bug is likely.  Have you checked if others had the similar issue?  Or perhaps file a bug report?
Logged

boogie
Level 0
***



View Profile
« Reply #47 on: July 22, 2016, 12:52:43 PM »

There's that:

http://answers.unity3d.com/questions/1020280/static-batching-in-unity-5-doesnt-work-on-android.html

it sounds really nasty.
Logged

io3 creations
Level 10
*****



View Profile WWW
« Reply #48 on: July 22, 2016, 02:26:10 PM »

Yeah, that sounds bad. 
Logged

boogie
Level 0
***



View Profile
« Reply #49 on: July 24, 2016, 11:09:10 AM »

Made a simple silhouette shader



The idea is to render the dog last. You do this by setting queue tag to something like Geometry+100, any number is good but has to be after all other opaque geometry. Then you do a silhouette pass before you do normal dog rendering. Silhouette pass is just one colour. Silhouette pass has to always win in depth test and must not write to depth buffer. And that's it.
Logged

boogie
Level 0
***



View Profile
« Reply #50 on: July 27, 2016, 02:44:30 PM »

Hey! I've been working today and yesterday on bear run animation. I'm still inexperienced in this, but it's not as hard as it was at the beginning. I actually had some fun while doing this. Any tips from experienced animators are welcomed!

Logged

darthlupi
Level 0
***



View Profile WWW
« Reply #51 on: July 27, 2016, 05:57:07 PM »

Man this is low poly heaven!  That bear run looks amazing.
I think after I finish my current game I will play with some low poly stuff.
You are inspiring.  Even though I don't understand all your talk of shader magic, it is rad you are sharing with us!
Logged

boogie
Level 0
***



View Profile
« Reply #52 on: July 29, 2016, 04:20:11 AM »

Man this is low poly heaven!  That bear run looks amazing.
I think after I finish my current game I will play with some low poly stuff.
You are inspiring.  Even though I don't understand all your talk of shader magic, it is rad you are sharing with us!

Thanks! I'm so happy to hear this. Literally it gives me motivation to work on this project. I appreciate this, i know this sounds like a cliche, but i really do.

ps. Are you from Poland?
Logged

somin
Level 0
***



View Profile WWW
« Reply #53 on: July 29, 2016, 07:13:07 AM »

certainly NOT and experienced animator, but I think the anims lack weight. Maybe add some up down movement in the hips and shoulders.
The leg movement looks good I think!
Logged

@sominklein      WIP Story Exploration Game      WIP Weltenformer      Done CLIMB
boogie
Level 0
***



View Profile
« Reply #54 on: July 29, 2016, 09:10:52 AM »

certainly NOT and experienced animator, but I think the anims lack weight. Maybe add some up down movement in the hips and shoulders.
The leg movement looks good I think!

Thanks for the tip, that's a good observation!
Logged

io3 creations
Level 10
*****



View Profile WWW
« Reply #55 on: July 29, 2016, 09:44:08 AM »

Hey! I've been working today and yesterday on bear run animation. I'm still inexperienced in this, but it's not as hard as it was at the beginning. I actually had some fun while doing this. Any tips from experienced animators are welcomed!


The front leg's movement seems good but the rear legs' movement seems off for some reason. I can't quite put my finger on it though.  It might be related to the speed of the bear.  It seems to be traveling at a moderate pace and perhaps the rear legs should move back more (similar to the dog's animation above)?
Logged

jctwood
Level 10
*****



View Profile WWW
« Reply #56 on: July 29, 2016, 10:45:21 AM »

Woah this low poly art style is looking really great! adore the concept too reminds me of an old game i can't quite pinpoint...
Logged

Sitatop
Guest
« Reply #57 on: July 29, 2016, 10:58:05 AM »

Hey! I've been working today and yesterday on bear run animation. I'm still inexperienced in this, but it's not as hard as it was at the beginning. I actually had some fun while doing this. Any tips from experienced animators are welcomed!



As said earlier the animation lacks up and down movement. The legs are also not syncronized very well, which makes it look like the bear has injured rear legs - so try improving that. Just thought I'd give my two cents on the bear department Smiley

Otherwise I just came here to say that I'm really digging the look of the game!
« Last Edit: July 29, 2016, 01:01:11 PM by Sitatop » Logged
darthlupi
Level 0
***



View Profile WWW
« Reply #58 on: July 29, 2016, 06:40:25 PM »

Man this is low poly heaven!  That bear run looks amazing.
I think after I finish my current game I will play with some low poly stuff.
You are inspiring.  Even though I don't understand all your talk of shader magic, it is rad you are sharing with us!

Thanks! I'm so happy to hear this. Literally it gives me motivation to work on this project. I appreciate this, i know this sounds like a cliche, but i really do.

ps. Are you from Poland?

I am actually a 3rd generation immigrant from Poland, so I only know some swear words and have a genetic high tolerance for vodka. Smiley

I completely understand the motivation for the project.  It is not a cliche.  It is sooooo easy to get wrapped in the moment of coding your brains out that it is good to hear your vision is something worth your time and life's energy.  I really find your project to be inspiring, so keep making kick ass stuff that reflects hidden beauty that only your mind can see!

Fun note:

I work for an an engineering firm as a DevOps guy, and this game and your art style started a fun talk between me, our CAD specialist, and our graphics designer on tools to use to create low poly graphics. 

Logged

Babar
Level 0
***



View Profile
« Reply #59 on: July 30, 2016, 04:36:25 PM »

The sheep gameplay makes me think of Riot Simulator. I also love the visuals, reminds me of Shelter !
Games with real-life animals are always more emotional  Screamy

Good luck with the dev
Logged

Pages: 1 2 [3] 4 5
Print
Jump to:  

Theme orange-lt created by panic