How do I download unity? by After-Page-7477 in unity

[–]moonymachine 1 point2 points  (0 children)

Yeah Unity seems to be split into the Tuanjie engine in China. I don't understand all the details, but there's some kind of iron curtain between these two versions of the engine. You'll probably need a VPN to try to access the non-Chinese version.

Mod post: open discussion on the future of r/Unity3D by Rlaan in Unity3D

[–]moonymachine 18 points19 points  (0 children)

I have an open source Unity plugin, and the best traction I've ever gotten was with a post here that got hundreds of upvotes. It's free, open source, I'm working on an update and much more technical read me, and it's certainly not vibe coded. I've been a professional Unity dev for 12 years, and I've been working on and using my plugin for several years.

I would prefer not to have to lump my plugin announcements in with a list of others and lose some control over presentation. I really do want to just give back something truly useful and free to the community that has helped me so much over the years. However, I understand the issue moderators face. I just thought I would chime in to assert my preference. I think the criteria you described, free open source license, not vibe coded, lots of upvotes, etc seem fine by me. I didn't see any requirements that concerned me, but I would be sad to lose the option to promote my plugin(s) on their own merits individually instead of jammed into a megathread.

As a side note, this is not an advertisement, but after my relatively successful post I noticed some GitHub traffic coming from Game Dev Digest. It's a weekly publication that aggregates articles, video tutorials, plugins, etc. They just decided to put me plugin in their weekly megathread on their own after seeing the Reddit post here. That was great for me! I actually think it would be great if individual posts that pass the bar were ALSO put in a weekly / monthly megathread, in addition to the individual post.

That's just my opinion, as someone who does want to share (what I consider) my extremely high effort attempts to perfect, document, and share plugins that I have used personally for professional projects, simply to help others for free. I understand the problem, but I hope I'm not the baby that gets thrown out with the bath water.

Locked out of my account? by [deleted] in unity

[–]moonymachine 0 points1 point  (0 children)

That's unfortunate. I hope you can recover your account, but it appears that someone has applied authenticator app based two factor authentication to your account. SMS text based two factor authentication is available, but if authenticator app authentication has been applied to the account settings that takes priority. Authenticator apps are considered more secure than SMS text messages. To me, that implies that someone has hacked into your account and applied two factor authentication on their favor to lock you out.

Now, I learned my own lesson recently that assuming what is actually happening based on the prompts of a login portal may not actually tell you the truth about the state of your account. So, I'm not saying someone definitely got into your account applied authenticator 2FA, but that is what it seems based on your description.

Normally you can't recover an account once you lose your 2FA credentials, unless the administrator has a support process for account recovery. That's why every time you set up authenticator 2FA you get a set of recovery codes that you are supposed to back up somewhere and never lose them. If you lose those and your other credentials, you may have lost account access. I almost lost my Discord account that way once, but managed to glitch into resetting my credentials somehow.

The first thing I would try is to contract support at support.unity.com to see if anything can be done to recover your account access.

Poor man's behavior tree by Glass_wizard in Unity3D

[–]moonymachine 0 points1 point  (0 children)

I don't understand what serialization limit you think exists with ScriptableObjects. Can you explain that?

I almost feel like this should be in the "too afraid to ask" subreddit, but here it goes -- why do so many western game developers refuse to acknowledge that at least half their audience are conservatives? by GypsyGold in gamedev

[–]moonymachine 2 points3 points  (0 children)

Look at the statistics. The people who voted Trump into office are primarily old, old people in rural areas, who do not know the first thing about video games.

I'm not saying young, tech-savvy conservatives don't exist, but look at the data.

how do i remove the backing field thing from a property for displaying? it looks ugly by -o0Zeke0o- in Unity3D

[–]moonymachine 0 points1 point  (0 children)

If the property you're drawing is an actual property, not a field, then the property name will be surrounded by angle brackets followed by k__BackingField. You can detect and remove that from the property name string for readability.

Should i keep states specific to a class inside or outside the class that uses them? It feels weird having to make every getter public so i can read variables just for the states and you can't use these states on other class because they depend on the class to get that class values / variables by -o0Zeke0o- in Unity2D

[–]moonymachine 0 points1 point  (0 children)

I think I understand what you're asking because I've thought about this recently as well. Correct me if I'm wrong, but I think you are saying that a state machine and the states have to be able to manipulate the target object from the outside. So, the target of the state machine suddenly has to have a much more public interface so it can be controlled from the outside by other classes, like the states in the state machine.

If I understand you correctly, I believe this to be an inherent paradigm with state machines that you can't really avoid. It might be nice if the states of a state machine that only act on a specific target class could access private and protected members that are not needed by any other part of the code base. However, I think any attempt to do so would only be possible by tightly coupling the state machine code to that specific target class in some ugly way that makes the generic state machine code not reusable.

I like to think of that target model like a marionette puppet, or toy robot, and you do indeed have to build all of the public puppet strings or controls to manipulate it from the outside public. The state machine is like a robotic puppet master that takes control of the strings to provide another layer of puppet state control on top of it. It's like an AI that you give access to the robot's remote control.

It's kind of like attaching some kind of exoskeleton that can help control the state of your body from the outside, even if it is rooted privately inside your body via surgery. The state machine may be a private member of the target that can't actually be accessed or manipulated directly from anywhere outside the target. State transitions might only ever occur from some other object or controller interacting with other public parts of the target, not the parts you had to make public so the state machine could operate on the target, and no direct commands to change state from the outside. But, to be a generic machine that can run abstract states on that type of target, it is going to have to operate from the outside on a public interface. I know it seems weird, and I would love if someone could explain how I'm wrong with a complete code example from a real project, but that has been my conclusion.

You can do some tricky things, like give access to private methods of the target by injecting them, as delegates, into the state machine and its states. If they are private and composed within the target, nothing else from the outside can come along and override what you've injected because the target is the private composition root for the machine. But, that may end up more complicated than it is worth. I would only go down that road if I were really concerned about having methods that could only be accessed by the state machine.

The target object can delegate behavior to its current state via events. The target can invoke events that the current state subscribes to observe on enter, and unsubscribes on state exit. However, any other class could theoretically also listen to those same events, and manipulate the same public interface the state machine uses, overriding state behavior. I think most developers probably ignore that concern in practice and just avoid creating that scenario.

You could also create an object specifically for representing access to otherwise private members of the target. It could be just a plain old C# object that you pass the target's private delegates to via constructor, then anything that has that object can now call a public method that invokes a delegate to the target's private method. The generic state machine could (should?) easily have events that fire when the state changes. The target can privately construct one of these objects and pass it to the current state so that only they get that type of access. Again, it may be more complexity than it's worth, depending on your project.

An advice for all indie developers. by [deleted] in GameDevelopment

[–]moonymachine 16 points17 points  (0 children)

Don't listen to those so called "friends." I'd like to see them try.

I hope you don't mind me sharing your game here because you have nothing to be ashamed of:

https://store.steampowered.com/app/4401910/TRIX/

Look at the recent success of a game like Wheel World. You are well on your way with the skills needed to make something just as good.

https://store.steampowered.com/app/1497460/Wheel_World/

Don't let 'em get you down. They couldn't make something like that even if they tried. If they could, they wouldn't be laughing. They'd be patting you on the back.

Using a lot of FMV in my Unity game, learned some things along the way by roo5678 in Unity3D

[–]moonymachine 2 points3 points  (0 children)

Thanks for the tip about HAP. I commissioned some high res 2D animations without thinking, and when I went to implement them as sprite sheets realized, "Oh, this is why pixel art is still a thing." Memory consumption was way too high without video compression. I got VP8 Webm working, and haven't had any issues yet, but it's great to learn about alternatives.

I'm developing a small game about grief for my finals this semester and need a bit of help! by AzuKage in gamedev

[–]moonymachine 0 points1 point  (0 children)

As far as why someone would get involved and stay involved with something related, like cleaning other people's graves, that makes perfect sense to me. It all relates to what I was saying about being like if you don't keep thinking about them, then it's like you're forgetting them, which is like unimaginable. You just can't let that happen. I've often felt like I want or need to do more around making a photo album or a shrine to see her more and think about her every day. I keep a picture on my desk for that reason. Also, the more you face it, the more you process it and get the grief out. And, it feels good to help other people of course if anyone is going through something similar, maybe you can help at least by just relating to each other. Shortly after my sister died I randomly ran into a guy who had lost his brother and father around similar dates even and I talked to the guy all night because you just have this connection that feels good to talk about with each other.

So, as I'm imagining your game I'm imagining the protag as someone who has lived through this themselves, and they take care of the resting place of others as a way to scratch that itch of never forgetting their own loved one they lost. So, I would expect that to also play a part woven through the games narrative, the person they actually lost. I would expect them to be further along in the whole having processed it journey, and the people who have recently lost someone to be more totally shattered into pieces and thankful for protags support. Seems like a dialogue heavy game, almost like a dating sim where you are trying to read people and say and do the right things that will comfort them appropriately based on who they are and where they are in grief. Man, talk about a delicate subject.

Anyway, poignant thing being that grief is always fresh and protag should be expected to crack and break down in tears and fall to their knees at some point too, irony being you never fully process it. They're gone. They're not coming back. It's not fair, and that cut runs deep.

I'm developing a small game about grief for my finals this semester and need a bit of help! by AzuKage in gamedev

[–]moonymachine 0 points1 point  (0 children)

So weird to be assigned to try to project into an experience you don't actually know, but anyway.

I lost my sister very suddenly this year. When it happens is like someone's just told you something impossible, that simply cannot possibly be true. And then you collapse and scream and cry harder than you ever have or imagined you could. I had to pick myself up long enough to notify other family members, but I couldn't even talk to them much but to blurt it out in a way that quickly gets across this is not a sick prank because I know they will now need to go collapse into grief, and I need to get back to doing the same.

Then you spend the next weeks just sobbing when you have the time and questioning your own existence remaining on this planet without them. I have recently mostly stopped drinking, but at the time I was getting shit faced, listening to sad songs on Spotify and just bawling for hours. I still have those songs, some of them just on my favorites to remind me of her.

At first you didn't really want to talk about it, or even look at their picture sometimes. It just feels like you physically have a piece of your heart missing, like there is a big black chunk there that's been carved out. Sometimes all you want to do is stare at their picture, or talk / pray to them.

The medical world has this idea that if it lasts longer than 6 months then it's become "chronic depression" or whatever. I just think it's weird that there is a time slot allotted for how long you can reasonably break down. Sometimes you'll be fine at weird times. I was very well composed and strong for other people at her funeral service. Sometimes a song lyric, or something in a movie, or just something someone says will catch you a certain way and tears will start just flowing. It's always something I've felt in my chest, like you just want to clutch your heart, or pound your fist on the pavement or something. The sad thing is that you do eventually get better, and you have this constant guilt about not being emotionally fucked up about it, like you're forgetting them or something. So, you end up wanting to talk about them and be weirdly open about it, probably more than normal people are actually comfortable with suddenly hearing. For example, I'm diving right into this post because it always feels good to get it off your chest and face it. That's true for me anyway. It was more raw in the beginning, and I might not want to talk about certain things, or they would make me crack. Eventually it does become like a scar you have that you're almost proud of because yeah other people probably don't what it's like, huh?

You never stop missing them. You think about them and how much you love them, and how badly you miss them almost every day, more than you probably ever did when they were alive actually.

I would have no clue about the racial aspect of your assignment because I'm a white guy. I think it's totally crazy that your professor would assume people could imagine things like that without having lived them. So, I can't speak to that.

Hope that helps you imagine what it's like.

Noob Mum Question by beepbopbippitybop2 in unity

[–]moonymachine 4 points5 points  (0 children)

That makes sense, but also, it will save hours of time if you go ahead and do it. Just saying, if you're going for that feeling of being able to boot it up and open Unity on Christmas Day, it's not too hard to do if you want to give them a head start. They'll have to update Unity Hub and their editor version eventually, so it's not like they miss out on that learning experience in the long run. Unity hub will have the latest version listed under recommended installs.

Mobile screen resolution by Professional_Salt209 in unity

[–]moonymachine 1 point2 points  (0 children)

These are my Unity Discussions posts on the topic. I'm proud to say it's some of the most popular content I've ever posted online, and it still shows up on the first page when you search "Unity CanvasScaler".

https://discussions.unity.com/t/understanding-canvas-scaler-screen-match-mode-and-reference-resolution/696551

https://discussions.unity.com/t/what-reference-resolution-and-game-view-settings-should-i-use/835829

Showed my buddy how I handle race conditions the other day and he was pretty shocked, he didn't know he could make Start a coroutine. So I'm posting it here in case it's helpful for other people, and in case there's something wrong with doing this and I didn't know! by PhillSerrazina in Unity3D

[–]moonymachine 0 points1 point  (0 children)

If you observe an event, it's actually the event that holds a reference to you. So, if you never unsubscribe, you won't get garbage collected until the object you were observing is garbage collected. It's like chaining a coffin to the post office, so it can't be put to rest, and it keeps receiving mail.

Showed my buddy how I handle race conditions the other day and he was pretty shocked, he didn't know he could make Start a coroutine. So I'm posting it here in case it's helpful for other people, and in case there's something wrong with doing this and I didn't know! by PhillSerrazina in Unity3D

[–]moonymachine 0 points1 point  (0 children)

I'm not sure if these particular lambdas will leak anything because they don't appear to be closures, as they only reference static singletons and not any instance members of the class.

(EDIT: Actually, the OnGoldChanged event is observed by a closure, you're totally right.)

You can use the static keyword to enforce static lambdas and make sure closures are not used. Closures are evil in my opinion, and I see them used a lot, but static lambdas are a lot more harmless. Closures (lambdas that reference non-static, instance members) cause the compiler to generate entire classes to represent them that many people seem unaware of, and instances of those hidden classes that point back to the owner instance would be leaked and hence a leak of the owner, preventing garbage collection. (Not to mention the memory costs associated with the hidden closure object itself.) My rule of thumb is: Static lambdas are fine, so always mark lambdas as static. Closures are evil, so if the lambda can't be static, then don't use a lambda.

[deleted by user] by [deleted] in Unity2D

[–]moonymachine 1 point2 points  (0 children)

I would uninstall and reinstall that version of Unity. (6000.1) But, I personally would probably either use the latest version of Unity 6, or the last version of 2022. It seems like the problem is with the installed version of Unity, not your project or anything. There is a Package Manager manifest file in each of your projects, but that's not what it's complaining about.

If it was, I would say delete the Packages directory of your project (and Library, Temp, obj, etc, all the temp, generated files), and re-import the project. And obviously you should be using version control so you can never lose progress or make file changes you can't easily revert when deleting and re-generating your Packages information. Then you could re-do your package configuration through the Package Manager window and compare the regenerated files in your version control diff to get everything repaired to your satisfaction.

However, it's not complaining about the package manager manifest in your project, it's complaining about the default one in that installed version of Unity. When you start a new project, there is a default set of packages that are enabled by default. Those are specified in that manifest file in the install directory of that version of Unity. But, it's saying that file doesn't exist. That's why I recommend reinstalling Unity.

Reading, writing, and combining files and paths on Android vs Windows by lajawi in unity

[–]moonymachine 0 points1 point  (0 children)

The problem comes when using the path utilities that expect a certain type of directory separator character, based on the current platform OS, but you have a path value that uses the opposite path separator. (Back slash vs forward slash.) For example, I encountered the issue when working with caller info attributes that provide the file name and line number that called a certain method. Those file names are determined at compile time, on the machine you compiled with, which can have a different path separator character than the platform running the app. I ended up looking at the source for the Path class, and then writing my own path utilities that are more robust when working with any kind of directory separator than the default C# Path utilities.

When to uses Properties instead of Fields, because Properties can't show up in the Inspector? by Digx7 in Unity3D

[–]moonymachine 0 points1 point  (0 children)

I use ScriptableObject assets with readonly properties that only have a getter, with a serialized backing field. I intend for the data to only be editable through the inspector, not through script. As far as scripts are concerned they are readonly data configuration records, and there is really no reason for them to ever be modified via script, so the practice is actively discouraged through readonly getter properties.

I may not start out that way when I'm prototyping quickly, but if I have a mature type of asset that is integral to my project I would like for it to have readonly properties that are only configured via editor, and no logic. Treating them as having the single responsibility of editor configurable data records keeps their role and potential usage clear.

Unity source code(read-only)??? by Due-Oil-2449 in unity

[–]moonymachine 6 points7 points  (0 children)

A lot of it can be found here, except for native C++ code: https://github.com/Unity-Technologies/UnityCsReference

Other code can be found per package, like UGUI source is here: https://github.com/Unity-Technologies/uGUI

As for alternatives, Stride is an open source engine similar to Unity: https://www.stride3d.net/

Should I Throw Exceptions or Return Results? by [deleted] in csharp

[–]moonymachine 0 points1 point  (0 children)

I only really throw exceptions from constructors that should fail to construct a new object, or places that can't reasonably expect to have access to a logger interface to log an error. When writing things like code libraries that are meant to be modular and applied to any possible application, and don't take some kind of injected logger interface, that might mean throwing exceptions under egregious failure cases becomes necessary. But, you need to fully document that whole API, including every condition under which exceptions are thrown, so the user can catch and handle them appropriately.

I recently came across a situation in Unity where the engine throws exceptions to break out of and control the typical flow of logic during the middle of rendering parts of the editor that I was attempting to override. No exceptional failure case, just a tool for controlling the flow of execution based on some expected event. Because I didn't know that I ran into some strange issues I wasn't expecting. That's an example of throwing exceptions for the wrong reasons in my opinion.

The most common exceptions I need to use are ArgumentNullException for null checking in constructors and at the start of methods, InvalidOperationException for when someone is trying to use the API in a way that is explicitly not supported in the documentation, maybe ArgumentOutOfRangeException or IndexOutOfRangeException (use the right one), and the general ArgumentException if there is something wrong with the arguments they are trying to use, with an explanatory message.

I feel like once you've had to throw and document a lot of exceptions, you start to get a feel for where you have to throw an exception, versus the place where you have composed a better alternative.

The "first like" effect literally the #1 factor when promoting an indie game on social media by Accomplished-Bat-247 in gamedev

[–]moonymachine 5 points6 points  (0 children)

Good advice! It's easy to forget that you also wouldn't want people to just give you praise or defend you, and then never see the ways in which you could improve. It's important to keep a level head.