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

What I find wrong with Unity Developers

Discussion in 'General Discussion' started by RobAnthem, Jul 8, 2017.

  1. RobAnthem

    RobAnthem

    Joined:
    Dec 3, 2016
    Posts:
    90
    So, this is a bit of a rant, but it's been a long time coming.
    I've done a lot of freelancing and tutoring as well as developing my own games.
    In that time I have experienced a lot of ridiculousness either driven by Unity itself, or by "developers" who's projects I have worked on.

    First thing is first... Find Object calls... Seriously? These are the bane of efficiency. I can't count how many times I've seen
    Code (CSharp):
    1. GameObject.FInd("name")
    in a project, tutorial, or even a Unity answer. This is basically the single worst function in Unitys API. People will argue how useful it is, but those people have likely never developed their own software. It is complete garbage.

    Second... Coroutines...These things are one of the stupidest implementations I have ever seen. Not only do they take more resources then an intelligent recursion, but they are propagated so much in Unity that people believe they are actually useful. Even if all they actually do is just complicate your code and make it less readable.

    The Asset Con. So many assets trick people into believing that they either need said asset, or that said asset is going to make it so they don't need to know how to program. Or that the asset will save them a ton of time. In reality, coding is quick and easy, it's art that is time consuming. Code assets are almost exclusively crap, filled with tons of extra code to account for a ton of different ways of doing things, when all you actually needed was one thing.

    So many developers cobble together a project with a ton of craptastic code assets, and then wonder why their game runs slow, or try to hire people to implement new features and wonder why it costs so much when we have to integrate them into multiple APIs. Developers/programmers are normally well paid, but in the Unity community, people expect to pay almost nothing for a developer. As if our knowledge and skill isn't worth much.

    Unity is an amazing engine, but it suffers from poor developers and an uneducated community who thinks making games is easy.

    Rant over. I apologize if I offended anyone.
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,066
    Citation needed.
     
  3. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    What was the point of this? It certainly wasn't to inform people about why they might be wrong, because you don't actually explain anything, you just make accusations without anything to justify it.

    Didn't we just have a thread about whining? And didn't we recently have that one where coders were saying coding was trivial, and the artistically inclined were saying art was trivial?

    Stay classy there.
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Isn't that most thread? :p
     
  5. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,522
    I think it would be a better idea to post this on your blog and something.

    Tutorials are beginner material and display easiest technique to understand. Non-beginner is "supposed" to use whatever they need at the moment. "Beginner" includes people with zero programming experience.

    Stating your opinion does not make a good argument. The primary problem with coroutines is that they don't serialize. That's the main issue (there are few other things that will make your life more complicated). However, you can't really stop "intelligent recursion" in the middle of the call and have it wait one frame without freezing your game or utilizing heavier OS threads.

    For all practical purposes, CoRoutines are green threads. While they have certain drawbacks, they're a decent way to create a a function that is executed across multiple frames without too much headache.

    Welcome to the planet earth. Convincing client that your product is going to grant them enlightement and make them live forever in eternal bliss is the usual business practice that applies pretty much to anything, including toilet paper.
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Mostly should not be used, but in very specific cases it's OK.

    Eh, no, that just means you did it wrong. Used correctly, coroutines simplify your code and make it more readable. Yes, they can be abused, but so can everything else.

    Nah, they both take time to do right. So many people have sent emails telling me specifically how much time my assets saved them.

    I'm not offended, but I'm going to have to say you're massively overstating things, which is sadly all too common. I'd like to see fewer rants, and more measured and rational criticism.

    --Eric
     
  7. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    You know, if all you educated folk who know so much actually participated in the community you might make a difference. Stay around and work to fix the ignorance you describe. When you actually are a part of the community, you will have a right to comment on it.

    Otherwise I'm going to write you off as another useless looser with a chip on your shoulder.
     
  8. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    It looks like your new, wait until you start hitting garbage collection performance hiccups and find a lot of those asset store scripts and even Unity's API calls can allocate/de-allocate memory.

    Old thread but it's still an issue -- https://forum.unity3d.com/threads/g...third-party-assets-in-the-asset-store.140673/
     
  9. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,006
    I've also done freelancing and worked on people's stuff, and I've seen some horrific things. But I was a bit surprised to see you latch onto GameObject.Find and coroutines? Doesn't make any sense. Used correctly, both of these are very useful.

    All in all, the worst thing imo is just really bad code practices. Miles of undocumented, messy and GetComponent ridden code, hacked into arbitrary pieces with each part tacked onto the end of a different and unrelated script, making public calls round and round the block, with a few infinite while loops with dubious looking escape points added just for fun.

    Funnily enough, the worst I've seen has been code assets off the store with at least four stars ratings.
     
    Noisecrime, Kiwasi and Ryiah like this.
  10. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    If you use GameObject.Find. this means you have a game architecture failure.
     
  11. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,006
    That's true, I was thinking of FindGameObjectWithTag. Searching by name seems like a bad idea when unity allows duplicate names.
     
  12. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Coroutines always make code messier and hard to use? Yeah no, they really don't if you're using them right.
     
    xVergilx, larku and Ironmax like this.
  13. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    nothing wrong with Coroutines
     
    Rodolfo-Rubens likes this.
  14. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    In the defence of Unity developers they are just about to get an upgrade from C# .net 3.5 to C# 6.
     
  15. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    Garbage
     
    pcg and theANMATOR2b like this.
  16. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    Unity is for all developers, the experienced advanced ones, the in the middle "hobby" folks or solo developers, and most of all, for those new, young, uneducated in code developers who want to try something new.

    Democratization means available to all. Yes, some folks are better than others. Some have computer science degrees or art degrees. Some have worked on other games on other engines, many are brand new.

    I do not know what engine you use but using your logic, maybe it breeds arrogance. ;) As a community, Unity beats all others. We are not afraid to reach down and help someone, giving them advice to be successful in whatever goals they may have.

    Also...education is not only about making games. I have met so many very well educated people here, both in terms of engineering degrees, science degrees, psychology degrees, etc, as well as many with technology or computer related degrees.

    Personally, my degrees are in science but the help and advice offered in these forums has helped me to learn and do things I never thought I could do. THAT is what makes a great community. And Unity's commitment to all of us is what makes a great engine.
     
  17. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    LOL but it does make making games easy!

    Lava Cave a quick game I made in a few hours...



    Then improved a bit over a few more...



    So you can make simple games quite quickly in Unity.

    Although making great games has always been hard.

    PS Also made in a few hours...



    Although the code for these games might not be amazing they do actually work.
     
  18. RobAnthem

    RobAnthem

    Joined:
    Dec 3, 2016
    Posts:
    90
    I regretted posting this immediately, but there is no delete thread option, so I figured I deserved whatever flame came my way.

    Anyway my biggest peeve is really just that every time I am hired to work on a project it is a clustered nightmare of poorly designed code and ideas, with a bunch of cobbled together assets, and it makes me feel like an incredibly large portion of the developer community is subpar, even ones who've been doing it for a while. Not to say all Unity developers don't know what they are doing, obviously a decent amount do. Like @Eric5h5 has contributed a lot of meaningful assets and wiki scripts, and plenty of others like him.

    One thing that I think is just absurd is how people can teach bad coding practices and say "Well it's for beginners" As if you would tell a beginning carpenter to replace a door with a chainsaw. People remember the things they learned early, and if no one tells them they are imporper, they will keep doing it.

    UnityAnswers is full of great questions and helpful people, and I try to do what I can do answer as many questions as possible when I have time, but most of these questions are idiotic because a 5 second google search ALWAYS provides an answer. People are lazy.

    Honestly, I just wish that the Unity community was more professional about how they handle their business, and likely UE isn't much better. Of course, my unprofessional biased rant doesn't contribute anything meaningful, so I'm not helping in that department.
     
    hippocoder and Peter77 like this.
  19. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Get used to this kind of response even when you try and point out how Unity could be improved!

    Good Luck.

    PS. If you keep hitting the same or similar problems why not document them and think up ways you could automate finding them and fixing them, then sell it on the asset store!
     
  20. Farelle

    Farelle

    Joined:
    Feb 20, 2015
    Posts:
    504
    especially, if you are hired to help someone, you might consider that they NEEDED the help and should not look down on those that asked and paid for professional help.....
     
  21. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    There is a large number of people who make games as a hobby. And there are many new folks here. Professionalism is something that comes from experience as well as from the need/desire to make money from your development.

    Honestly, are you judging how people handle their business from a support forum? I think maybe most of the professionals on this forum handle their business outside of the forums.

    And is it truly professional to come onto a support forum, where people get help, rant, and wave the white flag, and then judge others as non-professional?

    As for quality of code, again, that comes with experience. You really need to stop depending on stereotypes for the basis of your discussion. :)
     
    EternalAmbiguity likes this.
  22. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    You have to remember you have been working with unity for 8 years
     
    Teila likes this.
  23. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    The OP did not discuss improving Unity. He is discussing how Unity users are unprofessional and uneducated.

    There are lots of posts on improving Unity. Most of yours are not about that...and in fact, I am not sure what most of yours are about. LOL They do entertain though.
     
  24. FrankenCreations

    FrankenCreations

    Joined:
    Jun 14, 2017
    Posts:
    326

    That surely cant be everything wrong with me, likely not even the worst things.;)
     
    kB11, Schneider21, Kiwasi and 4 others like this.
  25. Deleted User

    Deleted User

    Guest

    Huh.! I actually thought it was one of the pro's of Unity, you can be fast and sloppy (that doesn't sound right :D).. One thing to consider there's nothing wrong with co-routines if used right and findobject's types are used quite a bit in Unity's official training material, plus I've never had issues with them (if used right again).

    If you're developing for limited spec mobiles I can understand you need to squeeze every bit you can out of it, if developing for PC / Console and you have plenty of spare cycles (for your min specs) then it doesn't really matter does it? I'm not going to "pre-optimise" if it's a complete waste of time, usually performance issues (for me at least) stem from rendering / shadow casters / phsyx, I often work on large games and the game logic piece is rarely the issue and even if it is you'll do an optimisation pass later.

    I agree to some extent with the asset store stuff, I've had more warnings / performance issues from random amalgamations of code than I ever have writing game logic. I just ask them politely to sort it out, or roll my own..

    I will say though, as a freelancer you need to be more professional about how you handle your business. As others mentioned slagging off customers is never a good thing, you are paid to help them no matter how deep the mess is.
     
  26. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,964
    The find transform thing is not efficient to call every frame, but it's useful as a way to get stuff on first frame, if getting by component type or by tag isn't specific enough for your needs.
     
    Schneider21 and Deleted User like this.
  27. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Even gameObject.<sub element> can be a hog if you use it too often e.g. in physics or Update()
     
    dogzerx2 and Deleted User like this.
  28. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    What I really have to say about bad coding practices though
    Is what says that's localised to Unity Devs? I'm sure there's plenty of devs for everything you'd hate to work with
     
    Farelle and Teila like this.
  29. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Totally understandable...if you wanted to let off some steam, I think a topic where you just said that would have gone over pretty well. ("Hey, does anyone else feel that every time you're hired to work on a project it is a clustered nightmare of poorly designed code and ideas?"...although I suspect that's common across the board, not really specific to Unity. I used to read a site called thedailywtf a while ago.)

    Er, no, there have been a number of useful discussions about improving Unity. Topics like "Unity suxx0rz!" or "Here's a half-baked idea based on poorly-understood concepts that Unity should totally do and I refuse to listen to logic or reason!" aren't received so well.

    Well, sure, but not when making an asset that you expect to sell to others where they can reasonably import it into their projects and not have it bork everything. ;)

    --Eric
     
  30. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Simply not true. If it wasn't for the asset store some of my projects wouldn't be able to meet the tight deadlines set by the clients.

    There was a few interns (CS majors) in my place a few years back that have more than 10 duplicate scripts with just different parameter values, each for different levels. They were just inexperienced, not exactly Unity's fault.
     
    Teila likes this.
  31. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Actually I agree with everything you've said. Although:

    - Find Object is fine - in Awake or Start only. You could say it's a bad design pattern but there's probably a case for proto and working faster with setup. Never ever call at runtime.

    - Coroutines might well get replaced by unity's jobs system thingy. The idea behind them is great but they suck arse for perf.

    - Asset store. There are some really great assets but needle in a haystack and 90% of that place is useless hobbyist-quality stuff. No bad thing for hobbyists though.
     
  32. Deleted User

    Deleted User

    Guest

    Agree but I was kinda pointing at your own stuff where time is a bigger factor than polish.. Also agree, sometimes it's not what you say but how you say it (or type it in this instance).

    @hippocoder

    Strings can be heavy no matter the engine and it's coding 101, especially constantly searching in a cycle.. This isn't specifically a "Unity issue" and even the best developers do silly things.. The elemental demo has a TCHAR string function which converts wide char from upper to lower case, there was an article on optimising the amount of calls and reducing the impact of the function..

    After it was properly indexed with a single branch there was a 41% improvement in performance. Again it's something you learn (sooner or later)..
     
    Last edited by a moderator: Jul 8, 2017
  33. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Or there is the overhead of using any Update() functions, Unity even did a blog about how you should limit the number of Update functions where possible.

    https://blogs.unity3d.com/2015/12/23/1k-update-calls/

    Note this blog even says you should where possible write a manager for large number of object updates and avoid a individual component based approach (the default Unity way to code).
     
  34. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    There is no overhead of using Update() its how you use it that causes overhead.
     
  35. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The overhead of update is quite small, it's unlikely to be a problem for most people (you'd need to be doing serious amounts of content). It's also the easiest possible thing to fix at the end of development with a simple manager pattern. It's a non-issue.

    There is overhead. Empty updates will cost performance. Still not an issue though given my above comment.
     
    Ryiah likes this.
  36. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    I never seen it in any of my profiles, update GC aloc = 0B (and i have lots of stuff going on in update.. ) Def not overhead..
     
  37. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    No overhead by Update Unity 5.6.1
     

    Attached Files:

  38. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    I agree with findobject, even in awake or start, there is always a better way. FindObject is basically laziness, although sometimes being lazy is alright.

    Replacing update with a managed update is not as much of a performance benefit as stated (even in unity blog). At some point you would probably want to start wrapping update calls in try/catch to prevent exceptions from potentially completely wrecking frame dependent logic. At this point, it's unlikely that you will have any performance benefit at all (although I've never benchmarked, ymmv, etc).

    Asset store is absolutely invaluable. There's tons of trash and you will need to rework or customize most things to get really good results, but if you pay attention and work smart - the asset store is immensely valuable.

    A lot of the asset store is a huge con, and a lot of the customers are hobbyist so you can't trust reviews. But if you are smart about it - there's so much value there in useful tools, functional examples and lessons in what not to do.

    Coroutines are fine as they are. Useful, powerful, easy.
     
    Last edited: Jul 8, 2017
  39. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,522
    Well, that's why they hired you, no? They have little experience, tried to make their dream game, failed and now need help. So they choose you to help them.

    The reason why you don't see clean code in the projects is because people with clean code don't need any assistance.
     
  40. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,522
  41. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    I haven't tried with 100000 Updates to know, sounds pretty crazy if you ask me not a typical scenario. Running 10-50 makes no overhead 100% sure.. Its good to disable behaviors on objects that are not running, there are reasons to why we use pooling.
     
    Last edited: Jul 8, 2017
  42. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,454
    You're describing bad practice not bad tools. A lot of that stems from bad developers writing bad tutorials and beginner users just assuming that's how you do things in unity.

    In reality none of your complaints can be blamed on unity. Basically you're just calling most of the people here dumbasses, I guess.

    Kind of a dick move.
     
  43. cyangamer

    cyangamer

    Joined:
    Feb 17, 2010
    Posts:
    234
    Hardly. Coding is only quick and easy for those who can master that skill and have been doing it for years. I could say the same thing about art and music. Many of the code-based assets have saved weeks of time, like the Dialogue System or PlayMaker
     
  44. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Coding never takes up my time, only R&D.
     
    neoshaman likes this.
  45. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    I have limited experience but I have observed this:
    There is two kind of competent peoples:
    - those who make things right
    - those who get things done
    I have seen a tendency of the former working for the latter.
     
  46. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    ya no reason to write an itween libary or rewired when its already done, it would take months to write a good input plugin that did the same thing. if you notice its a top grossing asset its probably pretty good.
     
    theANMATOR2b likes this.
  47. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    410
    It sounds like if you want to work with professional code you should work with professionals.

    If you are trying to make an argument about showing bad code practices to beginners and then they go and copy them. That's a different argument. And that happens in all programming fields not just unity.

    It happens more in games because how many people when learning programming say I want to write employee tracking software or school names management software.
    And unity for a long time was one of the only engines easily and cheaply to get started with.

    What is intelligent recursion? Because I searched and didn't find anything that seemed related to the problem of what coroutines are trying solve.

    I would not describe coroutines functionality recursive.
     
  48. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    @RobAnthem

    Nothing of what you quote is absolutely necessary to make a game under Unity. So, you can do with, or move on.
     
  49. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    In my experience, optimization is rarely a matter of using this API over that API and such, because it's pretty pointless to discuss performance without a specific context and actual profile data.

    Let's say, A() method runs 10 times faster than B(), then some people might immediately jump to the conclusion, while exclaiming, "Whoa, that's 90% performance gain! What idiots ever use B()?"

    But what if both A() and B() provide some method to query a database, so when a user hit the submit button on a web page where the average response time is 1 second?

    Typically, most of the overhead comes from network round trip in such a case, so let's assume about 1% of that response time is consumed while performing the said process about querying the database.

    So, what becomes of that '90% performance gain' really? It just means users will get their response 0.009 second faster if we replace B() with A(). What if B() provides more intuitive API that A(), do we really need to abandon that advantage for that amount of performance gain?

    Of course, it's not exactly the same with games, because not many of them have bottlenecks that are IO bound but the principle applies the same.

    The only time you can really claim not to use A() in any case, because it's slow is when there's an equivalent B() which is better than the former in every other (including non performance related) aspects. Of course, it's pretty rare to see such a case in real life, because few widely used platforms or frameworks would tolerate such duplicated features without deprecating the less performant of the two.

    More likely, it's usually a matter of trade off, like one provides easier or more intuitive way to do some task while the other less so but with more efficiency, and so on.

    There's little reason why you shouldn't use Find() in Awake(), for example - who cares if a monster appears on screen, say 0.01 second later? It will only become a real problem if you call it in every frames, and even then you might get away if, for example, it'll gain you about 5 more fps and your game already runs with 60 fps on lower end hardware.

    If you somehow believe that one should always choose the faster path when it comes to develop games, just don't use Unity at all. No matter what you do - even if you carefully avoid using such 'evil' methods like Find(), you cannot change the fact that the whole platform forces you to run your code on top of C#/Mono layer, which undoubtedly incur quite an overhead compared to a pure native approach.

    P.S.: I'm not a big fan of coroutines either, possibly because the languages I'm familiar with don't have such a feature, and now I'm using UniRx, which eliminates the use for coroutines altogether.

    However, I'm curious how an 'intelligent recursion' can replace coroutines. Is there any common practice in C#/Unity, to make a recursion to perform an asynchronous task like a coroutine?
     
    Last edited: Jul 9, 2017
    Kiwasi, Ryiah and EternalAmbiguity like this.
  50. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Also less efficient code can be more legible and devoid of magic number, which can be a huge boost when debugging and you are not filling up the process or memory budget.
     
    EternalAmbiguity likes this.