Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Is there a freely available project that uses best practices only?

Discussion in 'General Discussion' started by alexxUID, Jan 20, 2022.

  1. alexxUID

    alexxUID

    Joined:
    Jan 14, 2020
    Posts:
    48
    Hey,

    since I am working on my first project I notice quite often that informations I had from sources like youtube, blogs or learning platforms like udemy are working but are not really well advised to use in projects in the way they are shown. (Because the authors often don't know better as well).

    By that I mean for example of course you can get your references in the script by "FindObjectOfType", whereas it might be best practice to use a scriptable object that holds this information already.
    Or that components do a lot of things instead of one thing and one thing only.
    Or the way dependencies are handled.
    Or...

    While I am still learning a lot of that stuff, I find out how I should do it long after I did it.
    As I have never worked in the industry with others who know these best practices and would have taught me, I struggle to find out about them.

    I hope you get what I mean.

    So is there a project out there that was created by people who know what they are doing and mostly do the things how they are meant to be?

    Thanks a lot

    alex
     
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,886
    Just FYI, ScriptableObjects are assets (project bound not scene bound) meaning they cant hold references to instances of things in the scene unless you populate this info at runtime. So the use case you mention would be impossible / pointless

    Getting references using FindObjectOfType and similar methods is only a problem if you do it after the scene has started up. Doing this in awake or start is not a problem, as long as you have a decent loading screen or whatever to communicate to the user what is going on (if the delay is noticeable)
     
  3. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    Keep in mind that "best practices" are guidelines, and also that they can be heavily context dependent. What's a good practice in one scenario may get very different results in another scenario which superficially seems similar.

    That sounds pretty good, to me. You're getting stuff done and you're learning from it. It's normal to realise a better approach afterwards. I still do it after well over a decade. What's important is that I found a working approach, and I'm now better equipped next time I encounter a similar challenge.

    That said, a good teacher / mentor / discussion with others can help accelerate things. Don't assume that people know better just because they've been around longer, but do have those conversations and think about what's suggested and how it might apply (or not) in situations you've experienced.
     
  4. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    Sharp accent (look on youtube for it) does more advanced tutorials - meaning he makes tutorial games but does them in the same way as if they are actual games to be sold, not just tutorial examples.

    I cant say whether or not he follows "best practices", but he has made a lot of commercial games.
     
    Lurking-Ninja and alexxUID like this.
  5. alexxUID

    alexxUID

    Joined:
    Jan 14, 2020
    Posts:
    48
    Thanks for the answer @angrypenguin .

    Yes, I am aware that the learning is a never ending process.
    I hoped I could take at least a small shortcut for some basic things.

    My game is still working fine but it tends to get messier over time since I started off badly with some things. If I wanted to fix them it would come close to start new :)

    My question was about some small but very professionally built project example that would help a lot.
    Of course as you said it all is very dependent on the type of project but seeing general usage of the very broad overview like:
    - how many components and for what
    - usage and scope of managers/controllers
    - directory structures
    - usage of scriptable objects
    - coding standards / architecture
    - ...
     
  6. Akamis

    Akamis

    Joined:
    Nov 26, 2017
    Posts:
    7
    Hello @alexxUID

    I think you should check the official Unity project. This is what you are asking for. Project made by professional (Unity themselves) to teach you how to use properly the engine. They release a lot of project like this, some of them are for graphic rendering, and some others are about performance of coding standard.

    My preferrer project is the Spaceship demo project. It's showcase VFX graph, but there is a lot to learn about this project ! I learn a lot about how additive scene work with this project.
    Link : https://blog.unity.com/technology/n...ct-using-vfx-graph-and-high-definition-render

    The other one is FPSSample. This is a huge one because it showcases how to do a performant network FPS game, with high-fidelity graphic. But since there is a full game packed with this project, you can look how they develop and thinks about the architecture of the game.
    Link : https://unity.com/fps-sample

    I hope it will help you :)

    PS : I find this interesting open-source project from a professional team and Unity. I haven't check it, but is look very interesting too : https://github.com/UnityTechnologies/open-project-1
     
    Last edited: Jan 20, 2022
    alexxUID likes this.
  7. alexxUID

    alexxUID

    Joined:
    Jan 14, 2020
    Posts:
    48
    Thanks Akamis,

    thanks for those links. That is very much of the idea I was having about example projects from (I hope so) professionals.

    I will surely check out the open project as well but since anyone (no matter the experience) seems to be able to contribute I am just curious about it and not take it as one of the best examples. But maybe it surprises me :)
     
    Akamis likes this.
  8. alexxUID

    alexxUID

    Joined:
    Jan 14, 2020
    Posts:
    48
    Ok, after hours and hours of downloading and starting up I can say, that the FPS-Sample scene is about as good for me to understand as it would be to perform a heart transplant this evening.
    This stuff is way over my head and for sure does more harm to my confidence than help me. (Not that I did not expect that but this is a harsh reality check).

    I will look into the "easier" ones another time.
     
    Last edited: Jan 27, 2022
  9. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    10,003
    There is an FPS mini-game, maybe you should start with that first? It's a decent small FPS and you can practice and even build on it for some extent.

    You can find it in the Hub.
    screenshot.png
     
    Last edited: Jan 27, 2022
    alexxUID likes this.
  10. alexxUID

    alexxUID

    Joined:
    Jan 14, 2020
    Posts:
    48
    For sure :)
    It does not necessarily have to be a FPS game. On the contrary.
     
  11. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    10,003
    Check out the Hub, there are many small, educational mini games there (see my screenshot above). You can learn a lot from those if you can make them work. :)
     
    alexxUID likes this.
  12. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    I got to say, reverse engineering someone elses code is like, the most frustrating and confusing thing you could do.

    I think you might learn more faster building your own work from scratch, and then looking to others examples to solve specific problems as you face them.

    "Best practices" is mostly common sense that you'll arrive to on your own anyway. Most of the time the real geniuses are the ones who find simple ways to accomplish a task, not complicated.
     
    kittik, stain2319 and alexxUID like this.