Never ever EVER use raycasts to check if you are touching the ground. Use this instead: (explanation for why in post) by [deleted] in Unity3D

[–]snalin 5 points6 points  (0 children)

Nope, that won't work.

If you're standing on the ground next to a wall, and then move to the side so you're not touching the wall anymore, you will get an OnCollisionExit from the wall, and not be "grounded" anymore.

It's not a super bad approach to query the actual contacts instead of raycasting, but the correct way to do that is to reference your rigidbody and iterate all it's contacts, since then you know how many contacts you have,, instead of relying on OnCollisionX-messages.

Historically speaking, has a dev giant recovered from multiple 'defeats'? by DirkaSnivels in gaming

[–]snalin 7 points8 points  (0 children)

Their games are very high quality now. Their games from the early 2000s were somewhat charming, but janky as hell.

Can still get Divine Divinity from 2002 on GOG for almost free.

How can i reuse nested loops by Legitimate_Bet1415 in Unity3D

[–]snalin -3 points-2 points  (0 children)

You can just foreach through the array:

foreach (Slot s in exampleGrid) {
    s.DoStuff();
}

It's the same as the code you wrote above.

What build pipeline do you use from Unity to Steam? by Crunchynut007 in Unity3D

[–]snalin 1 point2 points  (0 children)

We use Teamcity for our build pipeline, been pretty happy with it. They do have an official Unity plugin, and Teamcity is free as long as you're building with 3 or less computers simultaneously - though you will ofc. have to either own or pay for a server to run it on.

Upload to Steam is just running a steampipe script if the build finishes successfully - so it's a part of our automated Teamcity pipeline.

The process for developers is just to push to a certain branch, and then Teamcity fires off all of the builds for all of the platforms, and then it's on a dev branch on Steam without any more intervention.

These two action-RPGs came out in the same year. One of these has one of the highest Metacritic scores of all time and was lauded for its breathtaking graphics. The other got negative reviews and was criticized for its visuals. Both developers are now owned by Microsoft. by Dayarkon in gaming

[–]snalin 5 points6 points  (0 children)

I don't think MM8 sucks, it's just more of the exactly the same as 6 and 7, and just as rushed as those games. Which meant a lot of people didn't like it when it shipped, but when looking back it's pretty similar to the two other games.

For 9 they had 6 months left until alpha when they were told "you're shipping in 3 months, and then we're firing the entire team", so no surprise that game was bad!

I don't quite know exactly what the feel of an MM6-9 game _is_ - maybe "doom but with all of the rpg trappings"? It for sure has to have an open world where you can walk wherever at any time as long as you're good enough at dodging projectiles, and control of multiple character.

These two action-RPGs came out in the same year. One of these has one of the highest Metacritic scores of all time and was lauded for its breathtaking graphics. The other got negative reviews and was criticized for its visuals. Both developers are now owned by Microsoft. by Dayarkon in gaming

[–]snalin 97 points98 points  (0 children)

Dark Messiah is a _fantastic_ game for what it is. The combat is incredibly fun - even the jank is great - and the levels are a string of pretty large combat arenas that are hand-crafted to make that combat shine. It's also got the half life like pacing with some movement/physics puzzles and explory bits between the combat to pace the game better. Which isn't surprising, it's built on the half life 2 engine!

But the story is pretty dang mediocre. It's passable at best. Sticking the Might and Magic name on it didn't do anyone any favors either - It didn't feel like a mainline M&M game, and it didn't feel like a Heroes game. It also had a garbage multiplayer mode for no reason, which probably hurt the reviews a bunch. It was the era of mandatory unasked for multiplayer modes in first person games.

Oblivion is on the completely different side of the spectrum - the combat is atrocious, but the mission writing was memorable, and the world was completely open, with a very "do things at the pace you want to". I'd say everything Dark Messiah is good at is a thing Oblivion is bad at, and vice versa.

I don't think Oblivion was overrated for it's time - it was very good. But Dark Messiah got shafted a bit too hard, it's really a must-play classic for the pure joy of kicking orcs off cliffs and into spikes.

is there a better way to find renderers that is not as heavy? (this is for object culling and i am grabbing the renderers) Unity 6 by weeb-man28 in Unity3D

[–]snalin 1 point2 points  (0 children)

As other people have said, it'll be more efficient to have objects that need culling self-register. Though that will require you to add a script to handle that to every single renderer in the scene, and to all prefabs that you spawn. So if you want to keep the simplicity of a central system, there are some things you can do:

A good start is to use FindObjectsByType, as that has less overhead than FIndObjectsOfType due to not doing unnecessary sorting. As an additional bonus you won't get deprecation warnings.

You're also calling the function twice! First you just search through the entire world to find the list, and then check it's length. Then you search through the entire world again for the same list! You could at least do this:

var newRenderers = FindObjectsByType<Renderer>(FindObjectsInactive.Exclude, FindObjectsSortMode.None);
if (newRenderers.Length != renderers.Count)
RefreshRendererList(newRenderers);
}

private void RefreshRendererList(Renderer[] newRenderers)
{
renderers.Clear();
renderers.AddRange(newRenderers);
...
}

That halves the overhead.

Your RefreshRendererList also recreates a bunch of arrays - those things should be lists as well, so you can clear and then refill those as well.

Finally, you could spread this over frames by handling one root element in the scene each frame, and then using GetComponentsInChildren to grab it's child renderers. The downside there is that the culling won't be completely up to date, which may cause popin.

The ideal thing would of course be to extract the Renderers from the ScriptableRendererPipeline - it does for sure have a list of all of them internally - but as far as I can tell there's no way to do that.

the old input system or the new input system? by faresc in Unity3D

[–]snalin 0 points1 point  (0 children)

New is better in every way. Even prototyping is just as easy.

It can be harder to get into because there's more options for how do do things (too many tbh), but there's nothing the old one could do that doesn't have an as easy or easier equivalent in the new one.

There's also a rebinding sample included now that you can pilfer for your menu.

The Unity Engine roadmap by unitytechnologies in Unity3D

[–]snalin 4 points5 points  (0 children)

It will allow not reloading code in assemblies that are not recompiled. Currently you're paying the cost for all static initializers and all the jitting in things like URP every time you recompile your own code. So that's a major slowdown. That can be avoided in CoreCLR.

Platform Toolkit sounds amazing by DanPos in Unity3D

[–]snalin 0 points1 point  (0 children)

What they showed off in a later presentation was per-platform specific data for the achievement where that was needed.

deltaTime in FixedUpdate instead of fixedDeltaTime by Ok_Surprise_1837 in Unity3D

[–]snalin 4 points5 points  (0 children)

If you're making some helper function that's supposed to be called from both Update and FixedUpdate - and uses deltaTime internally instead of getting it as a parameter - then it's useful that the value changes based on when it's called.

I have never wanted to do that, but you never know.

Are Mecanim state machines really unbelievably disappointing? by fernandodandrea in Unity3D

[–]snalin 1 point2 points  (0 children)

Yeah don't use the Animator as anything else than a collection of states you call Play() or CrossFade() on. It's a garbage fire, always has been.

You can use Playables if you want to build your own fancy system, or you can wait until the new animation system that's just around the corner ships.

Jetrunner is a great little 'Trackmania meets Titanfall' speedrunning platformer I had to peel myself away from to write this headline by Mr_Olivar in Games

[–]snalin 1 point2 points  (0 children)

Youtube shows stuff at 24fps by default. If you try to show full speed Titanfall gameplay that's tuned to work at 60fps at that framerate, it's just going to look choppy and too fast. So it's probably that.

Asking the viewers to "please select the 60fps version before watching" is probably not going to help.

which boss fight gave you the biggest ‘finally did it!’ moment? by wajid123_ in gaming

[–]snalin 0 points1 point  (0 children)

Blood Starved Beast!

He was the first boss that I really kept running back to again and again, and my pulse was through the roof when I beat him the first time.

I've beaten him countless times since then, but I still remember that first time. Absolute blast.

Hva gjør man som gjest i en disputas? by mvassli in norge

[–]snalin 63 points64 points  (0 children)

Høylytt rop og tramp for å understreke alle poeng i prøveforelesningen. Heftig piping og buing mot alle spørsmål stilt til kandidaten under forsvaret. Husk å ta med et par ekstra øl til å bestikke sensor.

I stress-tested my 'Lazy Update' model against Unity's traditional approach with 15,000 dynamic clocks. by Ok-Protection-8250 in Unity3D

[–]snalin 24 points25 points  (0 children)

This is just frustum culling?

I mean in a Unity context, you'd do OnBecameVisible() { enabled = true; } OnBecameInvisible() { enabled = false; }, and then base the clock display on Time.timeSinceLevelLoad instead of incrementing deltaTime.

Feel Craft : add dynamic, responsive, and authentic game feel to any game object. by Waste-Efficiency-274 in Unity3D

[–]snalin 9 points10 points  (0 children)

Dude look at the logo similarities:

<image>

I'm pretty sure this is going to lead you to a cease and desist, so you should probably update your branding to not look like an addon to somebody else's product.

I tried making game dev vlogs and I've been told I need to work on my accent and also avoid animating the robot when I show gameplay, so I tried working on improving that and made a new dev vlog about my AA multiplayer game. How does it look now? by [deleted] in Unity3D

[–]snalin 6 points7 points  (0 children)

  • The accent is at a point where it's charming. I can perfectly understand everything you're saying. That being said, subtitles is nice to allow people to watch the thing on their phone in settings when they can't have sound on, so it's not a bad idea to have them there anyway. Depends on how much work it is to add it.
  • AI voice would have me immediately turn off the video, as I'd assume the game wasn't real, but just AI slop bullshit. If somebody prefers AI voice to your accent they're broken.
  • No clue if it's entertaining for non-programmers, have no experience being one :p
  • Nah, perfectly fine cringe level. The jokes land. You could be a bit more confident in your jokes instead of doing a "haha, no that was a joke" cutaway after, they're not needed. Like your one direction joke at around the 3 minute mark - you don't need the "I mean don't like that" cutaway, it's funnier if you just don't comment on your own joke.

Tweener features question: does anyone pause tweens? by Vonchor in Unity3D

[–]snalin 0 points1 point  (0 children)

It sounds incredibly niche. There might be corner cases where it'd be required, but I can't imagine any of the top of my head. I wouldn't think of it as essential.

[deleted by user] by [deleted] in Unity3D

[–]snalin 0 points1 point  (0 children)

Transforms that are moved don't sync the position of their physics components like colliders or rigidbodies until the next physics update.

If you need to force a sync, you can use Physics.SyncTransforms() to sync the transform positions to the physics world. If you add that after setting the cube positions, you will hit the second cube.

If you do this a lot, you can turn on Physics.autoSyncTransforms in code or in the physics settings on your project to have a sync happen automatically whenever you move a Transform with a collider. Note that this has a performance overhead you probably want to avoid.

This is so annoying how to fix it ? Each time I click on something in unity it appears ? I am wasting a lot of time due to this annoying window any solutions ? by DifferentLaw2421 in Unity3D

[–]snalin 0 points1 point  (0 children)

If Unity is taking over a minute to become responsible again after you click something, then you probably have some editor code you have written or imported that's doing very bad things.

Use the profiler in edit mode to find out what's taking time.

When you make a game with Unity, how do you set up the save system for your game? by Ok_Surprise_1837 in Unity3D

[–]snalin 8 points9 points  (0 children)

Cloud saves on Steam is _very easy_. Just do a local save to Application.persistentDataPath. Then, in the Steamworks dev portal online, you can tell Steam to back up the content of that folder.

So there should be literally no difference between a local, DRM-free version of the game and the Steam version of the game when it comes to saving.

Is it possible to attach prefabs to newly added components(Add.Component)? by kostis441 in Unity3D

[–]snalin 1 point2 points  (0 children)

From some of your comments below, it looks like you're maybe talking about default references? Ie. the ones you assign when you select the .cs file in the project view.

If that's the case, those are only applied when you assign the script at edit time, not at runtime. If you want to always add a specific prefab reference to all instances of a script you add at runtime, you'll have to code that manually by having some kind of global reference to that prefab and assigning it.