Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Escape From Tarkov, a Unity5 game.

Discussion in 'General Discussion' started by MurDocINC, Dec 27, 2015.

  1. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    Yeah that might be not really noticable especially from video of people playing.
    from what i see when the door opened there's an indirect light coming from outdoor environment into the interior, and when the door closed that indirect light are gone.
    after doing some experiment it actually is possible to do that with Spot/Point light with cookies, just you need to tweak it carefully so it looks integrated with the surrounding lighting. Also it only works if your game doesn't have time of day like in this game.
    Oh the only problem with this is the specular, which i don't find in Tarkov
     
    Last edited: Aug 8, 2017
    theANMATOR2b likes this.
  2. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,578
    [snark]When something looks correct in terms of light, in Unity that is remarkable.[/snark]
    Seriously though, the thing is that the dark interiors have quite smooth ambient shadows and that look normally is achieved through some form of light baking, either fully baked or precomputed realtime GI. I wouldn't rule out though, that they just made clever use of large amounts of SSAO and many dim point lights. Inside you see areas around windows being lit up with a round falloff, likely from pointlights I'd say. The limitations of both light baking approaches mean that dynamic objects (like a moving door) don't affect their surrounding - they can cast shadows from realtime lights but do not affect the indirect baked light. For such objects to be themselves affected by the baked light, one needs to place light probes that capture the light situation at different points in space and interpolate between them as you move through the space. That way e.g. the weapon you carry could be affected by baked light as you move through the world.
    The curious thing for me is that the light around the opened door is not round, like a point light would make it look, but follows the rectangular shape of the door. I wonder if that is some trickery with spotlight cookies (which sounds rather impractical to me), or if they just manually placed a light probe with a box-shaped area of influence and override the light information in it (I'm not actually sure that is even possible).
     
    theANMATOR2b likes this.
  3. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    3,609
    I went and had a look, didn't seem spectacular to me. The whole room lit up all at once the moment the door opened a fraction, so that was kind of strange but still very good attention to detail that a lot of games don't have.
     
  4. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    That's what i'm wondering too, using cookies are difficult to make them looks right and properly integrated.

    yeah it's just a small detail, which maybe not very important but it add an additional bonus visual.

    The best example that i've notice on another game is in the latest hitman, they have the same effect when opening and closing the door, and actually in hitman the effect are even more proper not just a square/boxed shaped light. Possibly they used a realtime squared area light
     
    Last edited: Aug 9, 2017
    Billy4184 likes this.
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    2,249
    I would just be glad if shadows didnt look like this :p

     
  6. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    2,358
    Have you tried tweaking shadow resolution, cascades and draw-distance yet? These are often some options to improve shadow quality significantly.
     
    angrypenguin likes this.
  7. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    2,249
    yepp, thats highres shadows, its a point light, real time point lights is pretty much useless, but I think they have on their roadmap to improve them.
     
  8. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    10,683
    So you've tried playing with this stuff, then?
    upload_2017-8-9_20-41-2.png
     
  9. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    2,249
    Yes, shadow distance 1500? Whats your framerate? :D They do some difference but not enough, for point lights atleast
     
  10. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    10,683
    My framerate is 60hz, and that's my mid quality setting. High is further again. My game's requirements are very different to yours, though.
     
  11. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    2,249
    We struggle to keep 11ms frametime with one directional mixed mode light and shadow distance of 150 meters :p
    Though our game uses baked lighting and Shadowmask light mode so only dynamic objects are using the setting
     
  12. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,578
    Don't those just apply to directional lights?

    Shadow distance itself has no direct effect on framerate I think. The difference comes indirectly from the distance values affecting the number of shadow casters rendered for a frame. I'm only splitting hairs here, because it is possible to have scenarios where changing that value matters a lot, and also possible to have scenarios where a change in that value makes no difference whatsoever.
    Someone please correct me if I'm wrong, I'm only 95% certain on this one.
     
    Ryiah and angrypenguin like this.
  13. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    2,249
    @Martin_H
    if more objects cast shadows set pass calls will increase for sure.
     
  14. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    Yeah Quality Setting only affect the shadow from directional light, it's doesn't affect spot/point
    @AndersMalmgren
    For point/spot light shadow it might be better to go for custom shadow filter
    Custom
    CustomShadow.jpg

    BuiltIn
    BuiltIn.jpg
     
  15. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    2,249
    Something you write yourself? Or asset store? How is performance? :D
     
  16. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    i'm just using some shadow filter i found gamedev.net long time ago (and kinda forgot what was the thread name :/ ), and it runs great. Well for me it runs great, no significant performance loss.
    The only problem i found is it unity 5.5 and above there's some artifact when using soft shadow. not sure why. it was fine in before.
     
  17. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    10,683
    I believe there's a "Shadow Softener" asset on the store, and I also remember a forum post from quite some time ago where someone showed how to modify the built-in shadow stuff yourself. I haven't done it so can't give details.
     
  18. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    10,683
    I haven't tested, but I'd have thought that they'd effect the maximum distance from the camera that any light casts shadows. As in, if there's a point or spot light out past X units then it also won't cast shadows.
     
    Martin_H likes this.
  19. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    Oh that's right, i've seen that thread long time ago. i think that thread also helped me implement custom shadow for point/spot
     
  20. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,578
    I was mainly thinking of the cascades, because they were highlighted in the screenshot, and they would help with low-res directional light shadows at close distances. Afaik other light types don't support cascades. For shadow distance you are right, it seems to cull point lights past that distance. I tried it out in 5.5.2. Point light shadows going away from you seem to fade out, while those going towards you just vanish abruptly when the whole light is culled. At least that's what it looks like to me at a glance.
     
    angrypenguin likes this.
  21. lunaticCoder

    lunaticCoder

    Joined:
    Nov 11, 2016
    Posts:
    43
    Its quite impressive, but the animations looked kinda robotic, I think they did a pretty good job for an indie studio.
     
  22. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    Btw there's something that i've notice with this game (i've been watching people playing this lately), and this is make me curious. There's always a bad lag/stutter when an enemy or an ai spawning. Is this because their system/codes are unoptimized or this is from unity side? and how do people avoid this stutter/lag when spawning a character/object, let's assuming the assets are for high end game with highres textures, medium res tris, lot of animation, scripts initialize, etc.
    Really this is an honest question because i honestly don't have much knowledge on that aspect, so i'm not trying to blame unity or the devs.
     
  23. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    10,683
    I'm looking into something similar at the moment. The general answer is that it depends on what's causing the spike.

    There's a few possibilities here. If they're loading large, fresh textures then as far as I can tell these currently get pushed to the GPU by the main render thread and that can cause a hitch if the textures are large enough. The Awake() and Start() need to get called on anything new you load, so if there's anything expensive there then you've got to pay for that, too. And if you're creating new stuff that has scripts attached then that means there's going to be some allocation at load time, which could cause a GC run, which could cause a hitch of its own. There's probably also a bunch of stuff I haven't found or looked into yet. On the bright side, the spikes I've been measuring to investigate this stuff got noticeably smaller just by updating from 5.5 to 2017.1.

    In many cases, but not all cases, some of that can be mitigated by pre-loading or pooling stuff. Also, for anything you know you'll be loading at runtime you want to keep your initialisation (Awake and Start) as cheap as possible, which is counter to the "do all the expensive stuff up front" advice that usually holds true in other cases.
     
  24. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    now preloading/pooling are make sense, but it is doable for characters/npc assets? since they technically heavy weight part in term of memory usage (textures,mesh,scripts,ai,animation). Poolling a lot of them wouldn't that make the memory usage bloated?
     
  25. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    10,683
    It will be exactly as "bloated" as if you were actually using them. You don't pool more than the maximum that you will need, and you need to be able to support that number anyway.
     
    Martin_H likes this.
  26. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    2,358
    Thread is derailing in 3..2..1 :eek: ;)
     
  27. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    2,249
    We use Phonon 3D for spatial sound, it has a bug so when creating a prefab that uses it you will see a massive spike. We hope to move to Steam Audio soon which does not have this problem, but other problems instead. Maybe they use Phonon 3d :D
     
  28. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    2,358
    youtube just made me aware of a new Escape From Tarkov video. I know nothing about network programming, but the video title sounds incredibly catchy.

     
    Last edited: Feb 14, 2018
    Martin_H and JamesArndt like this.
  29. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    6,323

    >800 ms lag in a 60 FPS game!

    Although the devs have a Unity update in the works so time will tell... fingers crossed!
     
    Martin_H and JamesArndt like this.
  30. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,073
    Its pretty unlikely that those problems are related to Unity. That s pretty terrible performance, clearly other multiplayer games in unity aren't experiencing that issue.
     
  31. nhold

    nhold

    Joined:
    May 2, 2017
    Posts:
    32
    Are any of the other games on the graph Unity games? Would be interesting to see other Unity multiplayer fps results and whether or not they went custom, llapi or hlapi.

    Just want to make it clear, it's 100% nothing related to Unity that these are all so high (Very high!) and I feel like it might not even be related to the network communication code but server processing\setup\throughput.
     
    Last edited: Feb 15, 2018
    JamesArndt likes this.
  32. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    hmm rust seems doesn't have problem with netcode tho
     
  33. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    600
    Does Escape from Tarkov use uNET? Unless it does, then that sort of graphing has no correlation with the Unity game engine and how responsive it can be. Different network libraries and networking designs can cause that well before an engine will. I know my game certainly doesn't have 800ms lag, it uses Bolt which can be perfectly snappy.
     
  34. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    6,323
    Apparently according to Garry's Blag Rust uses Raknet -> https://garry.tv/2016/02/18/rusts-networking/

    So fingers crossed Tarkov and maybe UT does good work and shows what can be done with native Unity netcode...
     
  35. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    Interesting. . .
     
  36. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,117
    I agree Tarkov is looking better than many multiplayer games, but it lacks better environment artists.
    If you compare it to Cryteck last game, Tarkov look a bit amateur with it's flat rounded terrain and some rocks with simple texturing (it looks like they used some rocks asset pack); and trees needs diversity.






    Grass in Tarkov looks simplistic, not enough variety and coloration diversity





    Anyway Tarkov texturing and assets look like triple A, but it lacks that details and additional work to get a level above.
     
    Last edited: Mar 3, 2018
    Peter77 likes this.
  37. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    2,358
    WTF, is this really CryEngine or actually a photograph? It's a difference like day and night if you compare those two next to each other.

    What game is this btw?
     
  38. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,083
    well the hunt using photoscan though, for most environment assets.
     
  39. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,578
    Peter77 likes this.