For someone who writes software using C#, VB.NET, and Javascript (accounting/business software), how easy is Unity to pick up and learn?
Unity (the editor) is really easy to pick up and learn; you basically only need to know three things - what the hierachy is, what the project window is, and what the inspector is to get up and running.
Its the programming side of things people mostly struggle with, and as it natively supports C# you already have a head start on that (although might find some conceptual difficulties moving to a component based design, which fundamentally Unity uses).
Oh and I want to do a PnC Adventure Game and it falls into the same question of 2d rpgs and VNs of whether it makes any sense to do a 2d PnC Adventure game in Unity vs just using Adventure Game Studio?
Yeah, if you want to make a generic (without the implicit sneer of people who misuse the term) type of game, an engine specific for that genre will do literally exactly what you need.
Having said that, if that engine isn't new and / or fairly regularly maintained, or if you want to go 'outside the box' you're going to hit arbitrary limitations that will annoy you (eg AFAIK AGS is capped to some really shitty low res SD resolution for builds)
The advantages people seem to say about GameMaker Studio vs Unity is that you can do stuff quicker, and it has a better interface, so you can get it running and prototype your game fast and see what works and that it's easier to match things up consistently because it uses pixels instead of units. Disadvantages is that GML is less versatile for larger projects. Also GMS isn't good for projects with multiple people working on it, whereas Unity is.
You can do stuff 'quicker' in GMS, because it has some drag and drop logic shit for people who literally know nothing about programming; and yeah, you can 'learn' programming, but you're learning a language only used by gamemaker, so I'd honestly question if thats a good use of your time long term.
Also, NGL, Game Makers licencing is kinda expensive and shitty since their 2.0 upgrade, and its anti-piracy checks are kinda needlessly aggressive. I'm pretty sure Godot is eating its fucking lunch right now.
But ultimately, the 'best' engine is the one
you personally like the best, so try a bunch out and see what sticks; think about things like minor annoyances you're going to have to routinely deal with in every single project and how much of a ballache thats going to be longterm.
Instantiate(pickUpEffect, transform.position, Quaternion.identity, null);
Is basically the only line of real code in there, I'm trying to understand what they're doing. With pickUpEffect they're handing off the "what do I do with this" to a different prefab that it'll run at that current objects position and rotation, right? So this code is basically doing nothing other than say "on collision with pickup do whatever prefab you slot in"? Also why is there a null there?
Okay, so if they're not explaining this shit, they're not doing a great job at teaching you this shit tbh; what's going on here is called an OVERLOAD.
When you create a method, you can create different like...
flavours of the same Method, that all
basically do the same thing, but that you can send different inputs to, depending on what you need that method to do.
So if you look at the docs for Instantiate:
Declaration
public static Object Instantiate(Object original);
Declaration
public static Object Instantiate(Object original, Transform parent);
Declaration
public static Object Instantiate(Object original, Transform parent, bool instantiateInWorldSpace);
Declaration
public static Object Instantiate(Object original, Vector3 position, Quaternion rotation);
Declaration
public static Object Instantiate(Object original, Vector3 position, Quaternion rotation, Transform parent);
depending on what parameters you send the Instantiate command, it will do something slightly different; just spawn something, spawn something as a child, spawn something at a particular place and rotation, etc
Hopefully you can see what its doing with each of those different 'variants'.
They're using the
last variant, but they're also sending the 'parent' overload, but sending it as 'null' so it has no parent. If you remove the null completely, shits gonna work
just as well.Also looking at the code for how Doors work in this, why is it using a protected virtual void vs just void? Haven't seen protected and virtual before.
This also falls under the "They really should be explaining this shit" umbrella; what they're doing there is a
virtual method; if you try and drag and drop it onto a gameobject, it straight up wont let you (and will probably give you an error about not deriving from monobehaviour).
This is because they're using
Inheritance for their pickup scripts; that script there is the 'template' for how all 'pickups' will work, but theyre then going to add slight modifications to each one to be slightly different in code.
Like... I
assume they're doing this
specifically to fucking teach you about inheritance, because it's not a particularly intuitive way of doing things, and its not like its super efficient to justify doing it like that either.
Also I will try to comment on all code in this project.
I am terrible and did not write a single comment in all my code in my first game.
Sorry, I know that's extremely bad practice
real talk: I can't even count the number of times I've gone back to a piece of old code and been "what the actual fuck is THIS doing?" then found a comment by past me saying something like "this shit here is only so it compiles without complaining, because it wanted a quaternion rather than a rotation" (or whatever), or seen me add a comment like "If I wanna expand this, I'd add blahblahblah here" and been, like, "Damn, thanks past me, you're a bro". It's like the end of Bill & Ted.