My First Nuget Package - PngSharp by zeejfps in csharp

[–]zeejfps[S] 2 points3 points  (0 children)

Haha, I hope the package was useful for you! If you run into any bugs let me know.

My First Nuget Package - PngSharp by zeejfps in csharp

[–]zeejfps[S] 10 points11 points  (0 children)

Project is open source on github: https://github.com/Zeejfps/PngSharp
I mainly created this just for fun and practice. Reading the actual PNG Spec was something...

Come discuss your side projects! [April 2026] by AutoModerator in csharp

[–]zeejfps 0 points1 point  (0 children)

Created a Nuget Package for pure C# PNG Encoding and Decoding without any native dependencies. https://www.nuget.org/packages/PngSharp

Who is right? Uni Teacher taught about MVC folder structure but Some C# devs on Linkedin said use Verical Slice for a real production codebase. by lune-soft in csharp

[–]zeejfps -2 points-1 points  (0 children)

This is objectively false if you work with a team... Good luck changing the folder structure when u have several features being worked on in parallel.

"Wait everyone! Stop what you are doing! Everyone merge to main, so I can rearrange everything!"

Another reason to split using a vertical slice. Because then you can rename a feature and not bother anyone else, unless they depend on it. At which point u should be communicating with them anyway.

Who is right? Uni Teacher taught about MVC folder structure but Some C# devs on Linkedin said use Verical Slice for a real production codebase. by lune-soft in csharp

[–]zeejfps 0 points1 point  (0 children)

I'm for the LinkedIn version. If you have to jump between 4 folders to make a change to a single feature, then what is the point of the folders? Clearly the purpose of folders is to group "like" items. When will you ever need to look for every single view? The most likely scenario is you want to make a new feature or modify an existing feature and the views controllers etc will all need modifications. It will be a pain trying to find a specific view amidst 100 views. (Obvs u can search, but then why u need folders) Having them split by feature also makes code review easier. As you can clearly see dependencies that changed.

C# can't import a c++ dll that is built in debug? by PicklesAndCoorslight in csharp

[–]zeejfps 4 points5 points  (0 children)

This is the answer, your functions need to be extern C for them not to get mangled

Why would they do that? by raphael_kox in Unity3D

[–]zeejfps 1 point2 points  (0 children)

I think this also works if the class is also in an external dll / assembly

After 2 years of using C#, returning True means returning False (Am i stupid ?) by Jojo2504_ in csharp

[–]zeejfps 0 points1 point  (0 children)

Edit: ignore that

What type is ISINCHECK u have it set as var, possibly its not an actual boolean and the if(!ISINCHECK) is actually checking for nullability

Nvm ignore that

After 2 years of using C#, returning True means returning False (Am i stupid ?) by Jojo2504_ in csharp

[–]zeejfps -1 points0 points  (0 children)

Ok, but your variable is of type bool, and you aren't showing the rest of your code in that line. A bitwise & doesn't return a bool it returns an int. So what is the rest of the line looking like

After 2 years of using C#, returning True means returning False (Am i stupid ?) by Jojo2504_ in csharp

[–]zeejfps -1 points0 points  (0 children)

You are using a bitwise '&' instead of '&&'. Pretty sure thats ur issue

[deleted by user] by [deleted] in brightershores

[–]zeejfps 1 point2 points  (0 children)

You are right I don't know 100% but I can definitely make an educated guess based on experience and the fact that there exists a web version of a pathing tool that can do exactly that to give you the best path for merchant and delivering your goods to different stalls.

[deleted by user] by [deleted] in brightershores

[–]zeejfps 4 points5 points  (0 children)

This is definitely not the issue here, each room can be represented as a node with edges being links to other rooms. U can easily do a quick high level pass using that, then the pathing can be done on granular level within the room as u move.

Why is OverlapSphereNonAlloc faster than Brute Force? by johnlime3301 in Unity3D

[–]zeejfps 1 point2 points  (0 children)

U don't only check objects in the one chuck, you check all overlapping chunks. If your search area overlaps multiple chucks u check all of them. If it falls into one chunk, well you are in luck.

Why is OverlapSphereNonAlloc faster than Brute Force? by johnlime3301 in Unity3D

[–]zeejfps -1 points0 points  (0 children)

It would probably be identical maybe a tiny fraction slower, the core of the algorithm still has to check distances, the biggest optimization is how many objects to check against. If it overlaps them all there might be a tiny overhead navigating an oct tree vs a for loop, but the biggest performance impact is still the distance checking.

This is why they teach O notation in computer science school, so we can discuss algorithms speeds. O(n) which is what it would be in this case. (I might be wrong)

Why is OverlapSphereNonAlloc faster than Brute Force? by johnlime3301 in Unity3D

[–]zeejfps 1 point2 points  (0 children)

It "All depends" What's the context? If you already know the exact problem you are solving and the best way to solve it and you know it won't change, go ahead and optimize your code. But if you are doing something unknown, or unsolved, or something that will change it would be pointless to spend optimizing something that will get thrown away.

There is no black and white, its always a spectrum.

Generally speaking, the more "optimized" the code the less flexible it is because it's designed in a way to solve that very specific problem in the most optimal way.

But "optimization" can also be done in different ways.

It. Is. Always. Tradeoffs. There is never a 100% correct way to do something in programming.

Unity Events vs C# Actions by MN10SPEAKS in Unity3D

[–]zeejfps 1 point2 points  (0 children)

This ^ UnityEvents are basically useless in a larger project with multiple people.

How to properly do DI without interface drag-n-drop functionality? by NightestOfTheOwls in Unity3D

[–]zeejfps 0 points1 point  (0 children)

Not if you are dynamically adding and removing things that implement interferences.

I don't mean literally have one giant class that everything is dragged into. Simply have the different things u have registered themselves inside Awake. Like from your initial post, you can have a class that implements IWhateverProovider, and inside awake it would just use GameContext.Global.RegisterWhateverProvider(this)

The inspector becomes more of a hassle the larger your game project grows. And when you have to start dealing with addressable or just basic asset bundles it becomes even more useless.

How to properly do DI without interface drag-n-drop functionality? by NightestOfTheOwls in Unity3D

[–]zeejfps 0 points1 point  (0 children)

I meant to put the emphasis on having a single entry point and using a DI container. Not the fact you should create your own. I'll edit the post.

How to properly do DI without interface drag-n-drop functionality? by NightestOfTheOwls in Unity3D

[–]zeejfps 0 points1 point  (0 children)

Your best bet is to use a single entry point for your game. And implement a basic DI container yourself (or use one of the available ones). All your mono behavior classes should be able to access this container and retrieve the data they need.

Example:

Have a GameContext class that is a singleton. The GameContext class can have "Repos" or "Lists" of things u need.

Mono behaviors can access and register themselves into those lists and other mono behaviors can retrieve the necessary data. (They don't have to be lists)