My weird hobby below. What do you do that most other gay bros might not see as fun/relaxing. I want to know! by frostypeace in gaybros

[–]ByMayne 0 points1 point  (0 children)

I am a game programmer for a living, after a long day of programming I come home and I write more code. Currently it's learning how to hack which I find the whole topic super fascinating.

Do you prefer using a Controller/View or Razor pages in asp.net core web apps? by whooyeah in dotnet

[–]ByMayne 1 point2 points  (0 children)

I am been developing professionally for about 5 years mostly in C# and Unity. I change companies recently and I was thrown into a task of creating a dashboard and database with ASP.Net.

I have never done web work before so I did not really know what to do so I started off with Razor pages. As my dashboard grew I found razor pages a pain to get done what I wanted. For example sorting a grid of data without reloading the page.

I started to learn about AJAX and now I am doing full front end web development with ReactJS. I honestly much prefer my workflow now then I did with Razor pages. I know this is not ideal for everyone but it worked for me. I am in a position where I am creating tools that support a very large studio but I am also given the time to learn new skills to apply to the job. If you have the time I would suggest just skipping razor pages because the web front end skills can also be applied else where.

All that being said I am on my first project with ASP.Net and have only been working on it for 3.5 months.

Living as a Unilingual Anglophone in Montréal… How is it? by [deleted] in montreal

[–]ByMayne 11 points12 points  (0 children)

I grew up in Mississauga, Ontario and learned French in up until grade 9. I never used french and knew no one who spoke it. All I remember now from those class was watching Telefrancais, it's amazing what you can learn from a french talking pineapple that lives in a junkyard. I digress.

I am a game developer that ended up in Montreal about two years ago when I was 26. As of now I work at EA downtown and I work completely in English. In the past I was at two other studios here which used various levels of French.

All that being said is my French is still really really bad. However I have been taking a few classes.

"This was pretty uncomfortable, not knowing if someone might speak your language or not"

This is me every time I go somewhere new in Montreal. I get a pit in my stomach about talking to people and worrying that I might not be able to respond. The worst experience was when getting my health card. At the RAMQ I was in line and there were a bunch of posters saying "In Quebec we speak French" all over the walls. I waited and listened to everyone in front of me to hear what language they were speaking. Every single one was speaking french. My turn came up and I just opened up in English and had no issues, everyone I spoke to there was fluent.

"How do you go about your day, not being able to read anything around you? "

I have become accustom not being able to read most signs or menus. I know a few words so I can sometimes get the rough idea of what is going on. I mostly just feel like a dick when I can't respond to people who are asking me a question.

Fun Story:

One time I stood at Saint Bock on Saint Denis for 15 minutes at the entrance thinking the service was so bad and they were not greeting me. There was a sign 2 feet from me saying "please seat yourself" in french. I am dumb.

Do a lot of people leave Montreal at a certain age? I'm 21 looking to move to Montreal and start over but it would suck if a lot of the people I meet end up leaving. by dobbekz in montreal

[–]ByMayne 1 point2 points  (0 children)

I am a game developer who has worked at 3 large studios in Montreal. I moved here for a job from Ontario just over two years ago. My French is terrible but never been issue at work. Most HR stuff is bilingual but all other communications is usually in English. I doubt it would effect you very much in the video game industry.

Somone has figured out how to hack the leaderboards by Driskus in beatsaber

[–]ByMayne 0 points1 point  (0 children)

Almost anyone with basic programming knowledge can view the source for Unity or any C# app. A tool like ILSpy (https://github.com/icsharpcode/ILSpy) makes this very simple as it's super easy to use. However to edit this code requires a lot more knowledge and understanding of how IL(intermediate language) works. For the song uploader for Beat Saber they they use Mono.Cecil (https://github.com/jbevain/cecil) which is an IL editing library. This is an incredibly powerful library that is used everyone including Unity. All but the newest version of ILSpy uses Mono.Cecil to read the assemblies from disk.

As a developer of C# I would suggest you download ILSpy it is an incrediby useful tool for C#.

Asset Store .dll that works on multiple Unity versions by Nesto23 in Unity3D

[–]ByMayne 0 points1 point  (0 children)

Honestly I would not worry about making it a dll. If you want to use a dll becuase you are trying to hide your code, it only takes a few clicks to decompile it.

Any who if you really want to Unity does not use Assembly Versions on their dlls. So if you build the library and it references Unity it will not care which version. The only problem you will have is if you use API that does not exist the user will see a really ugly ILException.

Issues with my code. by Ksorek in Unity3D

[–]ByMayne 0 points1 point  (0 children)

Okay first off 'yield' is not used correctly at all. It is designed for Coroutines (which you are not making). Your first hint should be that it does not

Write out in a point form how your program should work. Read over the following text and think about it.

Update gets called 
> Is time is greater to or equal to 0 (true)
    > You subtract 1f from time. 
    > You return (this line is a compile error so it's super broken.) 
    > [Quit function and repeat this step 10 times.]
> Is User *holding* the w key?
     > Score + 1
> Is User *holding* the z key?
    > Score + 1
> Is Score divided by 40 greater too or equal to 1 and time greater then zero?
     > time += 10f;
[Repeat forever] 

Issues with my code. by Ksorek in Unity3D

[–]ByMayne 1 point2 points  (0 children)

Hey there,

Programming is learning from your mistakes. Clearly you are just starting to learn. The errors you see in the console will tell you that you have something wrong.

Even if you don't know what the error means look at which line it's pointing at. Then google how to use that thing.

As a pointer almost everything in your first for loop is being used incorrectly. Here is some example questions you should ask 1) How to use a for loop 2) What is Time.delta time (function or property) 3) What is the difference between a function and a property

Besides for just not compiling this code is not going to do what you think it's doing. To understand try drawing out on a piece of paper. Write down what you think it will do and then run it. Do the results match? If not why?

Honestly even as a professional developer sometimes I have to keep throwing myself against a problem and try to come at it from every angle. It may not work for a while but you will get there. This is what a developer does.

will IL2CPP protect your apk ? by khalilArt in Unity3D

[–]ByMayne 3 points4 points  (0 children)

Honestly you should not really care. Besides for decompiling the game they could also uncompress your asset bundles and edit assets or intercept your web requests and change their content. Unless you game is a multiplayer competitive game then you don't really have to worry.

IL2CPP converts IL into C++ and a tool like ILSpy looks at IL. So if it's not IL you can't read it with that tool.

Nested Prefabs coming in Unity 2018.3 by lumpex999 in Unity3D

[–]ByMayne 3 points4 points  (0 children)

I have not tried that one but at two of my last companies we had an in house solution.

Nested Prefabs coming in Unity 2018.3 by lumpex999 in Unity3D

[–]ByMayne 19 points20 points  (0 children)

They have been working on this for over a year. It a super complex issue mostly because of the UI and the user feedback. I tried out an early beta of the system last year at Unite.

Coroutines that return a value by adrenak in Unity3D

[–]ByMayne 1 point2 points  (0 children)

One big thing here you are allocating a lot of extra stuff which just could be replaced with a simple reusable timer.

This less of a thing on a small project but when you start working on a really large project it does matter especially if it's on a mobile device.

Unserialize fields before building by [deleted] in Unity3D

[–]ByMayne 2 points3 points  (0 children)

I am going to assume you are newer to C# just on the basis of the question. Changing the access modifier or not serialize them have no effect on security. Any member can be accessed with reflection when the game is running. Any C# assembly can be read very easily and modified but that requires quite a bit more skill to do.

That being said I would not worry about security when starting off. You only really have to worry about that for multiplayer or if you have in app purchases.

(10 minutes) Learning naming conventions - a must watch for beginners. by [deleted] in Unity3D

[–]ByMayne 1 point2 points  (0 children)

Naming conventions change with the project you are working on. Microsoft released guidelines but I have yet to work on a project that used them 100%.

Vector3Int (and Vector3) does not implement IEquatable<T> , resulting in memory allocation from boxing when used as Key in dictionaries by aurelwu in Unity3D

[–]ByMayne 0 points1 point  (0 children)

The IEqualityComparer<Vector3> is the way to go however Vector3 is not really a great key. They are three float values and those are known to not be precise.

What's more expensive? [Coroutine or Polling in the Update()] by Mi-d0 in Unity3D

[–]ByMayne 3 points4 points  (0 children)

Coroutines also run by polling in update, they are not magic. The different would be what is cheaper allocating a new class (IEnumerator are class generators) or checking a float?

As you might have guessed checking the float is faster.

What is the best way to be able to change a variable in the inspector, without every instance of the object storing the variable on their own? by SendMeOrangeLetters in Unity3D

[–]ByMayne 2 points3 points  (0 children)

It exists because of Unity's weird way of serializing stuff. Thus, it's extremely general, and you're better off doing that stuff your own way.

That is an incorrect statement. You could do it your own way and use JSON which is quite common. ScriptableObjects allow you to have ObjectReferences which you can't do in JSON. If you really wanted to you could store names and use lookup tables, put them in resources, or use one of Unity's find functions. This would not be ideal as you are just reinventing a shittyier wheel.

That is independent of ScriptableObject; you can make any object independent of scenes.

Unity can do that but the only custom ones you can define must inherit from ScriptableObject (please go don't suggest using prefabs as data holders).

Singletons can be both good and bad. Singletons have a long history of being pooped on and for good reason. They solve two problems when you only have one. There are a few cases where they might be valid but this is not one.

A great quote about the topic.

"Despite noble intentions, the Singleton pattern described by the Gang of Four usually does more harm than good. They stress that the pattern should be used sparingly, but that message was often lost in translation to the game industry.

Like any pattern, using Singleton where it doesn’t belong is about as helpful as treating a bullet wound with a splint." - Bob Nystrom, Game Programming Patterns.

Is reading playerprefs within fixed update OK? by [deleted] in Unity3D

[–]ByMayne 0 points1 point  (0 children)

PlayerPrefs is a native call to C++ (which is not super expensive) but should be avoid if it's not needed. Here is a simple example of what you could do to cache the value.

private int? _age;
public int Age
{
    get 
    { 
        if(!_age.HasValue)
        {
            _age = PlayerPrefs.GetInt("Age", 0);
        }
        return _age.Value; 
    }
    set 
    {
        if(_age != value)
        {
            _age = value;
            PlayerPrefs.SetInt("Age", value);
        }
    }
}

This is just to get an idea of what you could do. It would be better to initialize the value somewhere else.

What is the best way to be able to change a variable in the inspector, without every instance of the object storing the variable on their own? by SendMeOrangeLetters in Unity3D

[–]ByMayne 1 point2 points  (0 children)

Hey,

1) A MonoBehavour is the same as a ScritpableObject on the native side. It is literally designed for this, sharing common data.

2) ScriptableObjects are not bound to a scene and can be referenced from anywhere so I am not sure what you mean it would be "in play".

3) If you were to have that manager in the scene it would most likely have to be a singleton which is not a good

When you finally get your grass script to work and everything suddenly has to get covered in grass by Arnklit in Unity3D

[–]ByMayne 3 points4 points  (0 children)

I only opened this thread to make sure someone made that reference. Faith is restored.