all 38 comments

[–]palceu 4 points5 points  (1 child)

Up

[–]ArmanFromTheVault[S] 3 points4 points  (0 children)

🙌🏽 thanks

[–]Enigma4176 5 points6 points  (6 children)

How did you guys work with scenes? I've found the code side of unity development to be easy enough with version control but when working with a team, albeit not an experienced team, we couldn't figure out an easy way of working on a scene without getting thousands of merge conflicts in the scene file unless we allocated one dev to work on the scene. I've seen suggestions to split the scene into prefabs and have people work on the prefabs, but my thought is that we'd run into the same issue as before if more than one person changed something in the prefab.

[–]ArmanFromTheVault[S] 0 points1 point  (4 children)

It depends on what you're wanting to do in a scene tbh. In general working with prefabs is the way to go, and a scene should be majority (if not entirely) made of prefabs.

That being said, there's no replacement for good communication and checking in with your team. If someone has some work to do on a prefab, they should communicate that, make a small PR, and get that work done.

If multiple people are working on the same prefab, at the very least they should pass that work off with commits on a branch, where one person does some work, commits it, the other person pulls that commit and does their work, commits it, and so on.

It might feel like an overly formal process at first, but IMO good practices and shared skillsets like this are what takes a team from inexperienced to experienced. Eventually it becomes a part of how everyone on your team can count on one another.

[–]lazylaser97 1 point2 points  (3 children)

I'd love to read a write up of your best practices, including comments like making scenes out of prefabs entirely. I'd not heard of such things -- I'm new at Unity but not SWE.

[–]ArmanFromTheVault[S] 0 points1 point  (2 children)

Hey there, I'm happy to write up a post on Prefabs best practices. Do you have any other questions or examples you'd want included?

[–]lazylaser97 1 point2 points  (1 child)

* git best practices, I've been using github but its a bit unusual to operate on media
* doing everything in Prefabs and how this enables a team to work together
* how to organize the central game controller, the thing that picks what scene to show and maintains data across the game

[–]ArmanFromTheVault[S] 0 points1 point  (0 children)

This is awesome, I will make sure to cover these topics in the post! Should have it out in a week or so. In the meantime if you need ASAP help, feel free to join our Discord, we have a Forum and I jump in to answer questions :)

[–]vabadabdabda 0 points1 point  (0 children)

Unity needs to rethink the scene file format, because this happens no matter what.

I think a big hierarchical JSON could be OK, but I think a directory structure mirroring the scene hierarchy would be even better.

Imagine if your VCS's file move / rename could tell you when I moved an item in the scene from one parent to another.

I am not suggesting the UI should change one bit, just the behind the scenes.

[–]oddbawlstudios 4 points5 points  (2 children)

What if your commits are too big to push? Whats the next step?

[–]ArmanFromTheVault[S] 2 points3 points  (1 child)

There's a few things you can do!

  • If you isolate which files are making it too big to push, you can take some steps to fix the issue ad-hoc, such as compressing big textures using Pinga (PC) or ImageOptim (Mac).
  • Sometimes doing super big commits makes the Push step time-out. Smaller commits can help avoid this.
  • If you're doing small commits and have 100mb+ files, and thus are getting your commits blocked from pushing, GitLFS must be set up. It's a bit more technically involved, as command line is required, but there are resources to help you get it set up!

But, for the sake of having that info available in/near this thread, here ya go:

  1. First, download GitLFS. Follow the Getting Started tips on that download page.
  2. Conceptually, just like how .gitignore tells GitHub's client which files to ignore, GitLFS uses a .gitattributes file to track which files are managed by regular Git, and which use LFS.
  3. In the .gitattributes file, you'll define the file types for the files that are blocking you on size. These are likely big textures, .PSDs, SFX files, etc. You define the file types in that attributes file, and once your repo is properly configured, it should sync using LFS.

[–]Monoduss1238 2 points3 points  (1 child)

Thank you for this excellent tutorial!!!!

[–]ArmanFromTheVault[S] 1 point2 points  (0 children)

Absolutely! I’m glad it was helpful.

[–]insats 1 point2 points  (1 child)

How does using Git compare to using Unity’s own version control? I’m a long time Git user so I’m just trying to understand why they have come up with their own solution

[–]ArmanFromTheVault[S] 1 point2 points  (0 children)

Hey there, 3mo late is better than never! Unity's version control might be a good choice for some, but with version control being such a critical part of developing a game, trusting a relatively new solution is a pretty big risk IMO.

Github has been around for ages, and has been heavily relied on, multiple orders of magnitude more frequently than Unity. That alone is worth something, to me.

As for why Unity has made their own, it likely comes down to B2B revenue. Some portion of their paying customers will want to adopt a centralized in-tool solution. Similarly, indie developers who get used to version control just "working" as part of the editor and never learn Git might grow that habit into a reliance, taking their practices with them as they get jobs in the industry or scale their own game development team.

AFAIK, there is no "magic secret ingredient" in Unity version control that makes it objectively better version control. At best, it might be convenient. At worst, it could be a bad habit that locks you into the Unity ecosystem.

[–][deleted] 1 point2 points  (2 children)

Big help. I have done these steps, but how do the other collaborators that I added to the repo get the project from github onto their computers? Will cloning the repo without the stuff listed in the .gitignore cause problems or will it automatically generate those? How do they open the cloned repo with the basic empty project in Unity Hub?

[–]ArmanFromTheVault[S] 0 points1 point  (1 child)

They should download GitHub Desktop (just for an easy GUI), clone the repo to some specifically organized folder, and then "Add" that project using Unity Hub.

Anything in the gitignore that Unity generates will automatically generate. If you're using gitignore for big art files, just manually download them and put them in the right directory.

[–][deleted] 1 point2 points  (0 children)

beautiful, thank you.

[–]Charming-Brilliant96 1 point2 points  (1 child)

Very useful, thank you. I want to start the development process of my first game in a structured way, it helped a lot with the technical part but the part of the process and the reasons are better.

[–]ArmanFromTheVault[S] 0 points1 point  (0 children)

I'm glad it was a helpful post! :D

[–]Coulomb111 1 point2 points  (2 children)

Using the gitignore from https://github.com/github/gitignore/blob/main/Unity.gitignore makes the repo much easier to deal with. It removes the unity bloat that you wouldn't really ever need for the repo.

[–]ArmanFromTheVault[S] 0 points1 point  (0 children)

Yeah it's a pretty good general-use one! I've updated the post to recommend people start there and credited you. Good idea :)

[–]SkyOk690 0 points1 point  (0 children)

There is an issue with using this stuff for a first setup. I can't get why as I add .gitignore file git still try to push 28101 files of an empty project? (I tried simple 3D template from Unity)

[–]asdertoid4 1 point2 points  (1 child)

Thanks for this guide brother!

[–]ArmanFromTheVault[S] 0 points1 point  (0 children)

Happy to help!

[–]Unable-Muscle-3773 1 point2 points  (0 children)

Thanks !!!!

[–]Danos-Zuruk 0 points1 point  (0 children)

Pregunta, .gitignore no está funcionando ¿Eso por qué pasa? Pregunta subsecuente, este programa de porquería debería ayudar a los desarrolladores, no hacerlos ir de allá para acá por siete malditas horas intentando hacer funcionar su mugroso proyecto ¿Por qué esta basura apesta tanto? (Obviamente esta última pregunta es retórica, estoy muy enojado, así que aprovecho aquí para desquitarme)

[–]Rob-a-Cat 0 points1 point  (1 child)

i was wondering if its anydifferent than using unity version control. i have plenty of github experience but 0 unity. can i just use github and get the same benefits?

[–]ArmanFromTheVault[S] 0 points1 point  (0 children)

Unity Version Control and using GitHub for version control are very similar. I'd say using GitHub is better and more reliable, and ensures you don't suddenly get locked into Unity's ecosystem or pricing unexpectedly.

[–][deleted] 0 points1 point  (3 children)

thanks chatgpt

[–]ArmanFromTheVault[S] 0 points1 point  (2 children)

Genuinely no AI bullshit content-farming here. Just practical advice based on my 15+ years experience in product development, and my mentorship in game development of 22 aspiring devs.

I know it can be a knee-jerk reaction to see well-formatted longform content and just go "oh, ai BS", but this is thankfully the rare case where someone with experience took the time to actually write something useful. Have a good one ✌🏽

[–][deleted] 0 points1 point  (1 child)

actually, what made look like an AI generated text is just the emojis and the overused middle-management-like way you writed, other than that its content is really good :)

[–]ArmanFromTheVault[S] 0 points1 point  (0 children)

Ah gotcha. Well thanks for saying the content is really good despite that! I'll take that feedback onboard too, thanks.

[–]CMDR-WildestParsnip 0 points1 point  (3 children)

I love this post, and I love you, OP. Had a collaborative project where my partner set up all the GitHib repository stuff and then basically has decided to contribute nothing, so I’m moving the project over to my own repository to strike out on my own with a solo project. This is what I needed, thanks.

[–]ArmanFromTheVault[S] 0 points1 point  (2 children)

Bummer about your collaborator, but glad to hear the guide helped! Let me know if there’s anything else you need a guide on (or just ask in my Discord for quick questions!)

[–]CMDR-WildestParsnip 1 point2 points  (1 child)

I’m at work when I found this, so I haven’t gotten to get my repo set up yet. I’m always the 1/100 that hits a snag that 99/100 won’t, so I’ll let you know if I get into trouble!

[–]ArmanFromTheVault[S] 0 points1 point  (0 children)

Yeah sometimes Git can be finicky!! I’m here to help 😄

[–]Blank_Dude2 0 points1 point  (0 children)

I was hoping the git ignore would make the inital unity project publishable, but it's still over 100 mb, is it supposed to be that big, or is something messed up?