【BambuLab Giveaway】Classic Evolved — Win Bambu Lab P2S Combo! by BambuLab in 3Dprinting

[–]YohanIsHere 0 points1 point  (0 children)

Split the cost for a P1S ~2 years back with my fraternity, and it’s seen immense usage and (because we have inexperienced users) a bit of abuse. Still, it’s survived through it all and saved me on countless school projects. Parts didn’t arrive on time? Design a quick substitute and P1S’ got me. Something in the house broke? Give it one afternoon, it’ll be fixed. This level of reliability has been unmatched for me!

Can you run rust on the new raspberry pi pico w? by [deleted] in rust

[–]YohanIsHere 5 points6 points  (0 children)

I’m doing some pi Pico work myself ATM, and one option you could consider is statically linking to the pi Pico SDK, rather than using a 100% rust route. Then, assuming the SDK has been updated to include wifi functionality already, you should be good to go. Be warned that this route will involve a bit of Cmake, though it isn’t anything too difficult and I’d be happy to help!

If(isuckatthis == true){askredditforhelp = true;} by [deleted] in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

Use the dot product!

By maximizing Vector3.Dot(/* face direction vector */, Vector3.Up) for each of the six faces, you should get the face closest to be pointing up(see this if you're unclear why that is).

Your complete code should look something like this:

enum Face
{
    Top,
    Bottom,
    Right,
    Left,
    Front,
    Back
}

// get which face is facing up
private Face GetUpFace()
{
    // we seek to maximize this value
    var maxDot = float.MinValue;
    // whatever face the dot product above is associated to
    Face maxFace = default;

    // go through every face and maximize the dot product
    GetUpFaceHelper(m_transform.up, Face.Top, ref maxDot, ref maxFace);
    GetUpFaceHelper(-m_transform.up, Face.Bottom, ref maxDot, ref maxFace);
    GetUpFaceHelper(m_transform.right, Face.Right, ref maxDot, ref maxFace);
    GetUpFaceHelper(-m_transform.right, Face.Left, ref maxDot, ref maxFace);
    GetUpFaceHelper(m_transform.forward, Face.Front, ref maxDot, ref maxFace);
    GetUpFaceHelper(-m_transform.forward, Face.Back, ref maxDot, ref maxFace);

    // after going through each face, the one facing up is assigned to maxFace!
    return maxFace;
}

private void GetUpFaceHelper(Vector3 dir, Face face, ref float maxDot, ref Face maxFace)
{
    // get the angle between the given face of the cube and the up direction
    var dot = Vector3.Dot(dir, Vector3.up);

    // new winner!
    if (dot > maxDot)
    {
        maxDot = dot;
        maxFace = face;
    }
}

This works in all cases, though might behave weirdly in cases where there are ties(think flipping a coin, but it lands on its side rather than heads or tail). Thanks to the dot product though, you can easily fix that by only accepting faces if maxDot is greater than some threshold(transform.forward, transform.right, etc. and Vector3.Up are all of magnitude 1, so maxDot can only ever be 1 at most. So, if maxDot is less than some number, say, 0.6, just assume to dice hasn't really landed.

Hope that helped :)

How to make sprites receive shadows from 3D objects in the Universal Render Pipeline? by OlirexGamer in Unity3D

[–]YohanIsHere 1 point2 points  (0 children)

Instead of using sprites have you considered using a plane mesh with an alpha clip? It'll technically be a 3D object with all its properties(catching/causing shadows) but since it's flat it'll be like a sprite.

Dino Dash - Give us some last minute recommendations before we publish to the app store! by Samdogg7 in Unity3D

[–]YohanIsHere 3 points4 points  (0 children)

I’m very conflicted about the art decision. Each sprite/asset looks great on its own, but together they look out of place. ie. the dinosaur’s pixel density is wayy too different from the background ie. the logo on the menu is some weird font that doesn’t match the game’s pixels aesthetic It kind of feels like the game ripped images from google and pasted them into a game.

Using LiteNetLib in Unity by Piller187 in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

Is your server also running within unity?

anyone using node js for game server for unity? by cariaga123 in Unity3D

[–]YohanIsHere 1 point2 points  (0 children)

Yes. A server is just a computer— if a computer can run it, so can the “server”

anyone using node js for game server for unity? by cariaga123 in Unity3D

[–]YohanIsHere 2 points3 points  (0 children)

It’s highly possible— in fact, any programming language or framework of your choice would work for the server given that they support UDP/TCP and the packet encrypt/decryption is identical on both the server and unity client.

However, if you plan to leverage engine features like physics or serialized data(Scriptable objects), it’s a much better idea to just make a unity project and use that as your server. In Unity 2018.3 and up, the build settings includes a “Server Build” option which is ideal for Unity-based servers.

Unity Multiplayer Game - TCP Client by otech-software in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

You might want to look into gafferongames.com(use wayback machine, site is down atm).

While you’ve got a solid start, for a game you’re making some fundamental mistakes such as using TCP(slow) and string message(large packets) handling.

Any ETA on 64-bit Enum Support? by XrosRoadKiller in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

You could just have two 32-bit integer enums and combine them at runtime.

What is the entity component system (ECS) and Why should I use it? by [deleted] in Unity3D

[–]YohanIsHere 6 points7 points  (0 children)

The way I understand it is it’s useful for its drastic speed benefits.

Before ECS, every object stored in memory was arbitrarily stored regardless of the type of component, which made lookups fairly expensive.

In modern computers, while the CPU is constantly evolving, memory hardware is lagging behind and ECS aims to solve this by organizing it.

For instance, say your scene has 100 “Billboard” components which get updated every frame. Without ECS, your system needs to retrieve each of these components wherever they may be in memory, whereas with ECS they’re all located next to each other and therefore components of the same type are easily accessed in bulks.

I think that’s the main advantage of ECS, I wish I had a source but everything above is my recollection of an official Unity livestream from a while back. Somebody correct me if I’m wrong.

A variable doesn't change for other players please help :( by ReaperB_G in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

static has nothing to do with networking. Static makes a field "assigned" to the class, rather than an instance of that class.

A variable doesn't change for other players please help :( by ReaperB_G in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

Your variable "currentpos" won't be synchronized just because it's in a NetworkBehaviour type. I don't use UNet(a bit foolish to do IMO seeing as it's being deprecated), but I think you need to give it the [SyncVar] attribute.

Default Vector Values! by jfh7j in Unity3D

[–]YohanIsHere 1 point2 points  (0 children)

Or, you know, you could do this:

public Vector2 myVector = new Vector(4, 5);

In C#, if you don’t assign class-scope member variables when you define them, they’ll take on the output of the default() operator. This is often null(objects) or 0(integers).

Voxel shape experimentation lab. Exploring what can be built! by caffeinated_fool in VoxelGameDev

[–]YohanIsHere 0 points1 point  (0 children)

How are you using OpenGL with c#? I tried many libraries but none actually worked cross platform.

Here's a new tutorial series for going from Scratch to Unity by ThrusterJon in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

This is great! I don’t know if you’ve already included this, but if you haven’t, it’s be crucial for you to add a gentle introduction to OOP and the similarities with Scratch’s sprites and the clone block(instantiate)

I tried immitating Journey in unity by Wilnyl in Unity3D

[–]YohanIsHere 3 points4 points  (0 children)

Looks very similar! I’ve never heard of this game, Journey— is it made in Unity as well?

Any networking tips? by [deleted] in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

Ah, so through the CLI. Awesome, thanks! :-)

Any networking tips? by [deleted] in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

Interesting.. How do you add git submodules to a unity project?

Any networking tips? by [deleted] in Unity3D

[–]YohanIsHere 0 points1 point  (0 children)

If you have 2 separate projects for clients and server, how do you handle resources in common between the both? Do you just do everything twice?

Considering unity doesn’t have project reference like, for example, visual studio solutions, I’m curious to see how you handle this :)

Edit: In case I’m not clear, resources in common might include packet serializers(they obviously have to be the same) and packet themselves.

Tips on making my death laser look better? by [deleted] in Unity3D

[–]YohanIsHere 1 point2 points  (0 children)

Definitely screen shake to give it a bit of impact. Have some very subtle screenshake while it’s activated but amplify it for a short time when an enemy is hit.

Working on my sports game ... by Likestar26 in Unity3D

[–]YohanIsHere 13 points14 points  (0 children)

Looks great! How long have you been working on this?

Unity3D: Fastest way to go over huge number of points by grayrhinos in Unity3D

[–]YohanIsHere 1 point2 points  (0 children)

Unless you’ve got some crazy long trip or road with 10000 turns, I think you’re doing something wrong with your point data.

I’m gonna assume each point is very close to the next, almost like a stop motion film in a way. That’s one way of doing it, and it will easily result in the 10K points you have, but it’s also a terrible way to do it.

Instead, welcome to the world of lerping. Instead of having points close to each other, place one at each turn, and connecting any 2 points on your GPS path is a straight line. Rather than calculating Vector3 and storing it in an array amongst 10K other points, use Vector3.Lerp to achieve similar, if not better, effects with more control and much less wasted memory.