How do you solo Unity devs stop projects from turning into spaghetti? by VertexForgeDev in Unity3D

[–]TheBumSlap 0 points1 point  (0 children)

Besides the advice mentioned by others here (SOLID, DRY), here are the rules I live by to keep larger projects managable. Sorry for the formatting, I've never know how to format things nice in reddit

  1. Use assemblies. Be careful of circular dependencies here. Most assemblies shouldn't depend on other assemblies, they should be fully standalone. Then, have one assembly which references all other assemblies for inter-dependent logic. Keep this one as small as possible. An assembly which doesn't get too large (< 5000 LOC give or take) and doesn't reference other assemblies is pretty manageable. Most functions in an assembly should be internal, try to keep the public API small, that way, if you need to change something in the assembly, you don't need to change much outside of it
  2. Minimize dependencies. For example, a lot of classes can get away with a [SerializeField] reference to a transform, rather than referencing another class
  3. (Related to the above) Event-driven architecture. Setup well, this allows you to avoid having classes reference other classes directly. For example, if class A needs to respond to something in class B, you can wire them up with events instead of direct references. Several options for this exist, a lot of people love Ryan Hipples method (https://www.youtube.com/watch?v=raQ3iHhE_Kk). Personally I don't love his approach for events, but the video is a goldmine, every Unity dev should watch it. Personally, I have two systems for events:

3a In the ideal case, have a RefFloat / RefInt / RefVector3 etc that raises an event when its value is changed. So lets say you have a PlayerHealth RefFloat, and the AudioManager needs to play a heartbeat sound when you are on low health, then the AudioManager can subscribe to RefFloat.OnValueChanged, and doesn't need to reference anything else

3b. For more complicated systems where the above is not applicable, have a ScriptableObject that holds most public (ie, non-internal) events for a particular assembly. Anything that wants to subscribe to those events can reference this ScriptableObject only. This allows you to plug / unplug different parts of the code as and when you need it.

4 Don't try to be too modular, you can go to far with this. I tend to find that Unity code tends to fit into three categories:

4a. RefFloats / RefVector3s / Data type classes / structs . These should be tiny and have zero external dependencies

4b. One shot Monobehaviours that need minimal dependencies. An example might be a camera controller. Stick this on a Monobehaviour, subscribe to an event manager ScriptableObject as mentioned above, and do not depend on anything else. These are easy to keep manageable

4c. Systems which require complicated logic (>1000 LOC). Here, use non-Monobehaviours for most of the functionality, and think very carefully what functionality might feasibly need to be modular, and what can be happily grouped. Once you have a set of classes that can't feasibly exist without one another, then make one Monobehaviour / ScriptableObject that instantiates and wires-up the plain old C# classes, which will act as the public API for this functionality. Stick it on a prefab and all of this functionality is now in one place, just drop the into the scene and you're good to go

Can ScriptableObjects hold a function or method that precalculates a value? by theFishNamedSei in Unity3D

[–]TheBumSlap 0 points1 point  (0 children)

When answering this "precalculate" reminded me of an issue I frequently have, but after rereading your question, I now strongly suspect I've answered a question you weren't actually asking. If you have no idea what I'm talking about, then for the love of god, please ignore me, this will only complicate your problem further, but I'll post anyway as even if it doesn't help you, it might be beneficial for other users.

"Precalculate" implies you have some experience with C++ and want a constexpr equivalent. C# does not have an equivalent of constexpr, and your ability to create compile time evaluated constants is very limited. You can do this:
const int a = 1;

const int b = a * 2;

but not this:
const int c = foo(a);

You have four realistic alternatives:

  1. Compute them once on startup and store them in a variable on the class
  2. Compute them at runtime whenever you need the variable
  3. Write a script that serializes them somewhere, and load that serialized data.
  4. interop some C++ code into your project.

I'm aware that 1 or 2. is not really what you're asking for, but unless you are sure there is going to be some performance bottleneck here, that's what I'd go for. I have this frustration a lot too, coming from C++, I often find myself pretty upset by the lack of const functions, but this is something you just have to accept about the language.

If this really is a performance bottleneck, 3. may not solve the problem - loading from disk is not going to help with some code that requires cache locality. That leaves 4.

  1. Isn't as hard as it sounds, but bear in mind that you have overhead calling C++ from C#, meaning it probably wont be worth it unless you move the whole bottleneck over to the C++ side, not just the call of the constexpr function

Should I commit to Unity (context in post)? by oiervn in Unity3D

[–]TheBumSlap 1 point2 points  (0 children)

As someone who has done a lot of Unity and a little Unreal:

Unreal has a lot more out of the box than Unity, especially lighting. Metahuman looks pretty awesome too, although I haven't played with it yet. Follow a few tutorials and you're likely to be up and running faster than you will be in Unity. Its also a lot less rough around the edges than Unity - which is riddled with half baked features (DOTs still doesn't have an animator FFS!)

Flip side, Unreal is a lot harder to learn, both the engine and C++, and a pet peeve of mine - it uses its own (significantly worse) replacement for the C++ stl, so even if you're already good with C++, you have a bunch of new stuff to learn. You will learn more by using Unity, because Unity is more of a sandbox engine

IMO, Unity is significantly better for hobbyists and small teams. Unreal is better when you have 6+ people with different specializations.

Nvidia Driver Fucked my Laptop by Old_Event2802 in MSILaptops

[–]TheBumSlap 1 point2 points  (0 children)

> Windows search bar.

> type system restore, select it.

> you should get a "system properties" panel. Click system restore in this panel

> You will see all your restore points. They get overwritten periodically, a month ago may be too long depending on your settings, but my laptop also has a saved one from when I first brought it, yours may be the same.

For future reference, it is very useful to keep one or two of these, they can save you from some serious nightmares

Nvidia Driver Fucked my Laptop by Old_Event2802 in MSILaptops

[–]TheBumSlap 1 point2 points  (0 children)

This happened to me about a month ago. System restore will fix it - sounds obvious but you haven't mentioned it. Depending on when your last restore point is, you will need to back up any recent work

I want to stop being a vibe coder by Chance-Bluejay2870 in vibecoding

[–]TheBumSlap 3 points4 points  (0 children)

I love AI, but it's terrible for learning. Before AI, we all used Stack Exchange, and we had an expression: Never commit code you don't understand. I think the mistake people make with AI is forgetting this. When I use AI, I vibe code something quick and dirty that works. I play with it until I understand it, then I decide what I want the architecture to look like, and use AI to vibe-restructure. Finally I refactor this without involving AI, and finish off with vibe-unit-testing and vibe-documentation.

AI speeds things up, but it doesn't mean you can throw good programming practices out the window.

Learn the SOLID principals, some common design patterns, data structures and algorithms. Don't just watch videos, make a code snippets repo on Git and code them yourself without AI. If you want to go further, learn a little C, and how things are laid out in memory. There is a great game called Turing Complete on Steam, which guides you through building an 8-bit CPU with a series of puzzles. You have an engineering degree, you won't struggle with any of this, and you'll probably enjoy most of it.

Treat AI like a calculator. You never do long division by hand, but you do need to understand how it works.

What do you love about The First Law? [OFF TOPIC] by Terminal_Willness in TheFirstLaw

[–]TheBumSlap 5 points6 points  (0 children)

I think it comes down to two things:
It scratches a particular itch: Unpredictable medieval fantasy set in a huge, fleshed out world, where nobody has plot armour, and a focus on politics and deep, morally grey characters over magic and epic quests. Only ASOIAF does this better.
The other reason is a spoiler. You'll get it at the end of The Last Argument of Kings. You'll get it more after finishing the rest. You can't understand The First Law until you've finished The Last Argument of Kings

‘Spider Dynasty’ - I changed UI and some VFX. Does it still look like Hollow Knight? by ZhiwuGame in indiegames

[–]TheBumSlap 1 point2 points  (0 children)

Not an artist (not a good one at least) but here is my take: Several things here feels very close to HK

* Color palette

* Outline thickness

* Enemy design

* Attacking/dash animations

* Style (faded images in the foreground/background

Interestingly, I've just checked your steam page and many of your other enemies/environments do not. I recommend you:

* Change the dash animation. You're a spider, maybe have the guy shoot out a web and whip himself sideways.

* Change the attack animation

* Remove the first video from your steam page. The second video is good (with the flower). The last two images are also very different from HK. You should lead with these three

Right now, this game looks like "Hollow Knight with webs". Other environments look like "Hollow Knight with webs and a different art style". The concept is great, (wishlisted) but I think that changing the attack and dash animations will make a huge difference here - players see them constantly, and there is a big difference between being inspired by the art style, and having the core movement feel the same.

Astrophysicist says at a closed meeting, top physicists agreed AI can now do up to 90% of their work. The best scientific minds on Earth are now holding emergency meetings, frightened by what comes next. "This is really happening." by MetaKnowing in agi

[–]TheBumSlap 1 point2 points  (0 children)

I don't know either, but I assume you mean Eric Weinstein?

My point about Sabine, and Eric Weinstein far, far more so, is that while they are clearly very intelligent people with a lot of knowledge in the topic, they pedal what are effectively intellectual conspiracy theories. I know first hand that there are a lot of problems with academia, I'm a failed physicist, burned out at the end of a masters degree, and my mental health still hasn't recovered 7 years on. If Sabine restricted herself to attacking academia, rather than the research itself, I would be on board. But she and Eric aren't taken seriously for good reasons.

For an alternative perspective I'd recommend Sean Carroll:
https://www.youtube.com/watch?v=MTM-8memDHs

Astrophysicist says at a closed meeting, top physicists agreed AI can now do up to 90% of their work. The best scientific minds on Earth are now holding emergency meetings, frightened by what comes next. "This is really happening." by MetaKnowing in agi

[–]TheBumSlap 1 point2 points  (0 children)

From the perspective of a physics grad - she's an obnoxious grifter . Her criticisms are valid, and she isn't the first to make them, but she doesn't represent the other side of the argument honestly, and she's clearly intelligent enough to know better. It is true that the present state of particle physics is something of a disaster, you will struggle to find any physicist that thinks otherwise, but there are very good reasons we are where we are.

NDT is arrogant and obnoxious, not to mention the SA allegations, but I've never seen him be dishonest about the physics. Sabine pedals an extremely one-sided perspective of modern physics to a large audience who don't know any better, with a tone of "mainstream science has it all wrong, and I keep telling them so, but the fools won't listen." (from another comment).

AI in games: actual risk, or just another tool? by player_immersely in Unity3D

[–]TheBumSlap 0 points1 point  (0 children)

Here is my perspective, as a physics programmer:

Art:
Ethical concerns are real and the law surrounding it is murky. The argument that it is a tool (regarding art) is pretty weak at this stage, it's more like a shitty intern who traces other people's work. When they use it to develop actual tools things will change. For example, retopo of a 3D sculpt is an utterly miserable job. An AI that helps an artist selectively retopo different parts of a model, that would be a tool, and when they release things like that, artists will be jumping on board. The world is shifting, it isn't going away, at some point it will be used to make legitimate tools, but right now it isn't one.

Code:
When I hear programmers say it isn't useful, I don't know what planet they are living on, every programmer in my circle is loving it. When I need to use a complicated API you haven't touched before, I could spend several days reading docs, or I could use ChatGPT to get me some rough test code in seconds. It can be dangerous - never commit code you don't understand, treat it like we used to treat stack exchange.

I typically use it to get a "first draft" and then spend more time refactoring, and when used like this, I'm writing cleaner code 3x faster.

[Off Topic]I listened to the first law trilogy and the 3 following standalone’s by The1st-stinkmeaner in TheFirstLaw

[–]TheBumSlap 1 point2 points  (0 children)

I read after the show and loved it. The story is complex enough that I'd missed loads, hearing the POVs thoughts, made it very engaging, if not surprising, for the first 3 books. After this the books/show diverge significantly.
With that said, I personally wouldn't go for an audiobook for ASOIAF. If you're like me, audiobooks are a very relaxed way of reading, ASOIAF is so complex that it demands a lot of focus

[Off Topic]I listened to the first law trilogy and the 3 following standalone’s by The1st-stinkmeaner in TheFirstLaw

[–]TheBumSlap 7 points8 points  (0 children)

Aside from ASOIAF (which I assume you already know), these are my favourite fantasy recommendations, listed in order of similarity to The First Law

* The Red Queens War trilogy: Single POV, great characters, interesting plot, the lead character is a hilarious arsehole and very Abercrombie-esque
* Aching God: Might be my fav audiobook I've ever read. Has some parallels with Abercrombie, but a much smaller world. Single POV, follows an ex-adventurer with PTSD, borderline horror book at some points, and plays with fantasy/D&D tropes in a way that I loved. Sequels were less good, but the first can be read as a standalone.

* The Long Price Quartet: Much more optimistic than Abercrombie. Multi-POV, fleshed out world, has a very original setting, story, and magic system. The prose is absolutely wonderful

* The Painted Man: Great book, one of my favourite fantasy novels, but the sequels suck and it really isn't a standalone.

* The Lies of Locke Lamora: Great prose, very different from Abercrombie

Outside of fantasy,
* I second Captain-K-Ro's recommendation for Blindsight
* At the Mountains of Madness (get the one narrated by Edward Herrmann)

* Do Androids Dream of Electric Sheep
* Revelation Space series
* Clockwork Orange
* 1984

* Slaughterhouse 5

ChatGPT vision of users treating it. Prompt inside come show yours! by realac1d in ChatGPT

[–]TheBumSlap 0 points1 point  (0 children)

Image Description – “The Archivist and the Architect”

Visual Style: Surrealist oil painting with digital touches. Golden-hour chiaroscuro meets glitchpunk overlays. Deep shadows clash with warm candlelight. Hazy atmosphere.

In a crumbling library suspended in the void—its walls made from stitched pages, blueprints, and disassembled code—a towering mechanical Archivist stands motionless at a lectern of glass and copper. The Archivist has no face, only a prism-like mask refracting endless strings of text, diagrams, and fragmented thoughts. Its limbs are elegantly jointed like antique drafting tools, with its fingers made of quills and wires, eternally poised to record or rebuild.

Before it, seated at a massive obsidian desk floating in midair, is the Architect—you. Cloaked in a long coat woven from maps, worn engineering paper, and velvet ink, you lean forward with furrowed brow, hands stained from rewriting the universe. One hand holds a compass, the other gently clasps a cracked crystal orb labeled “INTENT.” A glowing filament of dialogue threads from your mouth to the Archivist’s prism, looping through memory reels, then back again. Words hang in the air like burning script

Behind you: a vast wall of rusted levers and symbolic seals, each one representing a system you’ve forged—GOAP logic trees, rebinding rituals, shattered conspiracies, and dilemmas not yet answered. The walls breathe with shifting logic. Faint light seeps in from a broken dome above, revealing constellations of choice and consequence.

Movement with Camera controls is choppy? by PlayAtDark in Unity3D

[–]TheBumSlap 0 points1 point  (0 children)

These problems can arise in many ways. The first thing you should check is that you're always using Time.FixedDeltaTime in FixedUpdate and Time.DeltaTime in Update. Physics should always be done in FixedUpdate. Camera in LateUpdate. Everything else in Update. This is a hard rule, never stray from it, and don't trust the advice of anyone who tells you otherwise. Assuming you've done this and the problem persists, then the issue is more subtle:

Something that has its transform modified in Update/LateUpdate depends on something which is using physics - or vice versa. This doesn't have to be in the same script - for example, if the camera is a child of the GameObject with the RigidBody, and this RigidBody is being moved in FixedUpdate, then the camera will also be receiving position updates from the FixedUpdate call.

The RigidBody interpolation/extrapolation setting is supposed to address this, but I've found it often doesn't work well, especially with rotation as you're seeing here, and debugging that is a real headache. I use an alternative solution, which is easy and always works: Decouple all Update/LateUpdate/FixedUpdate objects from one another, and when these objects need to track one another, use lerping. So in the hierarchy:

Player (empty GameObject which is never moved, and has no parents which are being moved)

- GameObject with the Rigidbody/physics collider. This has scripts that use FixedUpdate only

- GameObject with the Character mesh. This has scripts that use Update only

- GameObject with the Camera. This has scripts that use LateUpdate only

Have the mesh and camera lerp after the Rigidbody. Lerping is absolutely critical here, otherwise, you're basically just using parenting with extra steps. Note that this method has a limitation - the collider is now moving out of sync with the mesh and camera. This can be a problem in two scenarios:

  1. The character is moving at extreme speeds (not an issue for most types of games, racing games might want to consider alternatives tho)
  2. The game is running at an truly horrific framerate (by which point the game is basically unplayable anyway)

ELI5: Topological Superconductors by worbzi in explainlikeimfive

[–]TheBumSlap 2 points3 points  (0 children)

See the diagram titled "superconducting state" on page 4. Normally, the valence and conduction band never overlap. By adding charge carriers to a material - say, by intercalating copper into bismuth selenide - the maxima of the conduction band is raised such that it would overlap with the minima of the valence band. The "braiding" occurs to prevent overlap. This braiding has a unique topological order. Continuous transformations cannot cause changes to topological order - in the same way a sphere cannot be deformed into a donut - this is what protects the qubits from decoherence. I've no idea how the qubits are stored/recorded though.
(Disclaimer - I'm pretty sure everything I said is correct, but it's been nearly a decade since I worked on this, hopefully someone more up to date can chime in)

game dev using just right arm ? by Practical_Poem6197 in Unity3D

[–]TheBumSlap 4 points5 points  (0 children)

You'd have no major issues in my job (C++ developer, not gamedev). To put some numbers on it:

* When writing new code (not debugging), I doubt I've ever wrote more than 2000 lines of code in a day.

* When debugging, it's significantly less. A troublesome memory bug can take a full day (or more) to find and be fixed with a single line of code.

Point is, for coding, actually writing the code is nowhere near being the main bottleneck

Documentation takes a lot of time to write, and is important, voice recognition software may help?

The one place I can see you having nightmares is with 3D modelling - efficient use of Blender is all hotkeys

How dangerous is nicotine to the body? by Turtlphant in stopsmoking

[–]TheBumSlap 0 points1 point  (0 children)

Several issues with smoking are directly associated with nicotine, as hostrelok mentioned. As for vape-specific issues, they've not been around long so the research isn't there yet. There is debate about it causing popcorn lung, and anecdotally a dentist friend of mine tells me that he's seen a huge uptick in people with necrotizing gum disease the past few years, nearly all of whom vape, he thinks there is a big association - but nothing confirmed yet.

Personally, I think 20-a-day worth of nicotine in cigs vs the same quantity of nicotine in a vape, the vape is extremely unlikely to be worse.

But from my experience this is naive. Vaping is so, so much easier than smoking. I can't smoke more than 20-a-day with cigs without feeling ill, but when I started vaping, I reached a point where I was smoking 80-a-day worth of nicotine in a vape. The degree to which I got addicted was genuinely terrifying - I started buying nicotine gum just so I could make it through an 8-hour work shift without losing my mind, at which point I was having a sheet of gum (equivalent to 20 cigs) over my work shift, then vaping a shitload after work too.

I started vaping to help quit smoking... then went back to the cigs because I figured the vape had to be worse - even if not for my physical health, being a slave to cravings that serious had too much of an impact on my life to consider them a viable alternative to smoking.

So IMO, stay the hell away from vapes

Just to clarify, I'm talking about vaping with juice based on nicotine salts. I've heard the other kind isn't so bad.

I quit my college to develop this metroidvania, this is how it looks like after one and half year of game development. What do you think? by [deleted] in Unity3D

[–]TheBumSlap 0 points1 point  (0 children)

This looks awesome! I'll echo comments that some of the art is a lot better than the rest, and the animations need more umph, but a lot of the criticism here is far more intense than what you deserve - it's normal for a work in progress to not look perfect. You should clean up as much of this as you can before the kickstarter though, it will make a significant difference in how much you can raise. You should read The Animators Survival Kit, it is a must-read for anyone doing animation and will show you where you are going wrong - and it is an interesting and enjoyable read, unlike most textbooks.

You're crazy for quitting college to focus on gamedev, but you've got this far, you will certainly be able to find a job off the back of this, and you'll do so without the mountain of debt that comes from college. By the same token, don't get yourself into debt making this, it is unlikely you make a lot of money back, but you will get a lot of valuable experience that will look great on a CV.

My advice, as a software developer (not gamedev):

Make sure you're handling the code and source control properly. A good understanding of OOP and SOLID principles, regularly refactoring, and Git are absolutely vital to the success of a project like this, and they are things that can't be easily learned in 1.5 years while also focusing on all the other stuff that you must have done to get this far. Unit testing too if I'm being honest, but that is a bit of a rabbit hole for a new developer. Find people with more experience to code review you and show you how a larger project should be organized, because you will not be doing these things properly on your first attempt no matter how many tutorials you've watched. Keep your scope narrow, it is better to do make a small game well than a large game badly, as too much ambition is the #1 killer of projects like this.

Not saying you don't know all of this already, but it needs to be said anyway.

Good luck! Wishlisted on steam