« first day (2679 days earlier)      last day (2331 days later) » 

12:01 AM
^^^
 
I'm finally below 1KB with fog
 
 
7 hours later…
6:51 AM
 
 
2 hours later…
8:26 AM
Yeah, but I have assigned renderer to every gameObject, and I even checked it twice, so I commented out my destroyObject script : https://hastebin.com/irobutesih.cs
Then it doesn't give me the error : The variable renderer of DestroyObject has not been assigned.
You probably need to assign the renderer variable of the DestroyObject script in the inspector.
DestroyObject.Update () (at Assets/Scripts/DestroyObject.cs:20)
And it does says on line 20, so can you please help me what I am doing wrong? Bc I think it's giving me an error bc of my script.
 
8:37 AM
Nvm. I think I still have empty gameObjects. My bad.
 
user92578
yeah...
 
haha
 
@GabrieleVierti go for it
 
NullReferenceException: Object reference not set to an instance of an object
DestroyObject.Update () (at Assets/Scripts/DestroyObject.cs:20)
It says that even though I have assigned the renderer.
 
user92578
And you're sure that all instances of Destroy Object have it set?
 
8:52 AM
It says in a lot of gameObject, not just one
what have it set?
 
user92578
Have the renderer.
 
I didn't understand
In my script?
 
user92578
Do all instances of the "Destroy Object" script have the renderer variable set to the correct renderer of the game object?
 
Here is the script code hastebin.com/hupenawejo.cs
I have not set the renderer variable to anything
 
user92578
I don't care about the code
 
8:55 AM
Um yeah
 
user92578
What I care about is whether or not you've set the reference from the inspector
 
yes, its why it says on the renderer : Torus_003...
In the image
If I haven't set it to anything, it would be empty.
 
user92578
On this one particular object, yes
 
user92578
Is this the only object that has the Destroy Object-script?
 
Yeah and it says that for so many other object as well even though they all have set renderer gameObject
No, there are so many object which has destroy object script
And it says that on like 30 or more objects, but doesn't say on the rest even though they all have assigned the renderer
I will assign it all again. Maybe it will help
 
 
2 hours later…
11:00 AM
@dot_Sp0T I wish i could man, i'm still too young for it.. :)
 
 
1 hour later…
12:25 PM
@GabrieleVierti well if my french was better I'd apply I guess
 
12:43 PM
@dot_Sp0T You don't need to speak French to work in Montreal.
 
I don't have any error and it does work, but again it remove the gameObjects which are far away idk why.
I will have to do everything again I think
 
@AlexandreVaillancourt isn't Ubisoft a french studio?
I mean I guess one of the dream jobs in my mind would be to work with Michel Ancel - which is to my knowledge working for Ubisoft
but yeah
 
@dot_Sp0T Yeah, but expecting everyone who works for them to speak french is well.. not a good business plan :P A lot of studios from France closed a while back because it cost too much to develop games there. If you want to work with a specific guy, who still works in France (I think it's Ubi Montpelier), then you'll be better off learning french :P But if you want to work in Montreal, french is not needed.
 
1:04 PM
@AlexandreVaillancourt also Montreal is Canada isn't it? So I'd need a visa and working permits anyways
 
@dot_Sp0T I don't even speak french :)
The problem is that i still need to college
 
@dot_Sp0T Yep, Montreal is in Canada :) Sometimes, companies will take care of this, but you have to check with them first.
I guess it is what "Visa sponsor" means in that job description :)
@GabrieleVierti As said earlier, you don't need to speak french to work in Montreal :)
 
But you'll have to learn to speak moose
 
... And you'll have to know how to build igloos and debug snowmobiles.
 
1:24 PM
for now i only got these: "Good analytical and synthesis skills and attention to details.
Ability to work as part of a team and good interpersonal and communication skills.
Autonomy, curiosity and resourcefulness, that push you to go talk to people.
Flexibility in the organization of your work, allowing you to adapt to changes."
 
@GabrieleVierti Make more games :)
 
user92578
fuck do I need to make multiple
 
nwp
At once? That might hurt.
 
no longer sure what we're talking about
 
@Tyyppi_77 Hehe no, I don't think so :P
 
user92578
1:27 PM
oh good
 
user92578
continues to slack off doing nothing
 
Haha going to school is and getting good grades is good enough for now too ;)
 
I'm currently lacking the bachelor's degree and the Cpp skillz
 
I guess some people survive making indie games too, so all these requirements are not needed. You only need to ship games for that.. :P
 
1:33 PM
that also takes skillz, you just don't need to prove them to an interviewer
 
@Jimmy You're right! And the skillset is different.
You don't need as much interpersonal skills as an indie, but you need a lot more discipline.
 
I woulda thought interpersonal skills are the core of being indie, I mean somehow you need to get your games out into the world
No matter how awesome your game is, if noone will play it because you're a butt
 
I see "interpersonal" as "in person". But I guess that could be another way to see that.
 
nwp
@dot_Sp0T I don't know any developers of any games I have played and wouldn't know if they are butts or not. Not sure if that is just me being ignorant though.
 
 
1 hour later…
2:51 PM
I am making an effort to get to know the local dev scene, it's worth it. Very interesting discussions
 
3:34 PM
Can someone please help me? I wanna destroy objects when they go off screen. I have tried by using a destroyObject script ( hastebin.com/hupenawejo.cs), but nothing works. Do anyone know any other way to destroy objects?
 
nwp
As a general note: Don't try all the ways to destroy objects until one of them "works". Figure out why the obvious destroyObject doesn't do what you want. Otherwise you just bypassed a bug in your program that will break more stuff later.
 
Yeah, but that script was working, but it was also destroying objects which are far away.
But I have no idea what I am doing wrong.
But I am sure I am doing something wrong in the script
Any help is appreciated
 
+1 to nwp
 
nwp
Well, figure it out. Add a breakpoint or some print("destroying object ", object); to the destroy object code and see when it triggers and why. And then you can start figuring out which part of the code is not doing what you want, so you know where to change something.
 
user92578
^ +1
 
3:48 PM
Um ok
 
user92578
lol who starred that
 
4:10 PM
Who knows :P
 
@Tyyppi_77 who starred what
 
user92578
36 mins ago, by Hemlata
But I have no idea what I am doing wrong.
 
oh that one
 
4:27 PM
Might've been me
 
@Hemlata That is the kind of thing to which nwp is referring. Debug why that's happening, and take steps to improve your code to make sure it's only destroying things that actually leave the viewport, rather than merely go far away.
 
4:49 PM
Is it common that you folks just delete comments?
 
user4704
Comments are transient.
 
user4704
So yes.
 
user4704
Unless you're talking about in code.
 
user4704
In which case I try not to write them at all. :P
 
nwp
That is very good. I'm glad someone agrees on that.
I'm considering adding a code metric. Comments per line. If it goes above 0.05 it is a sign that the code is bad.
 
4:54 PM
I don't really think comments are bad
as long as they describe "why" and not "how"
 
user92578
I used to think that too, but now I try to add as little comments as possible
 
user92578
I was a really obsessive commenter, one of those return 5; // Returns five. guys
 
@nwp what? You're kidding aren't you?
 
nwp
@dot_Sp0T No, I'm serious.
 
@Tyyppi_77 that's stupid
 
user92578
4:55 PM
Yeah that actually doesn't sound too bad.
 
user4704
// Returns the first integer after four that is before six.
 
Comments are there to document why something is done that way instead of another way, etc.
Stuff that is not deductible from code
 
nwp
Exactly. But there shouldn't be stuff that is not deductible from the code.
 
user92578
I had similar stuff basically all over the code base for all members and methods, and I recently removed all those comments, but there's still a ton left inside the actual implementations, which I'm cleaning slowly as I work with the code.
 
nwp
And if you have lots of code that you need external knowledge to understand it's a bad sign.
 
4:57 PM
@nwp have you ever written any complex logic?
 
user4704
Anybody happen to have both Hue and LIFX bulbs?
 
user92578
Complex logic isn't complex if structured properly.
 
@Tyyppi_77 my ass
 
nwp
@dot_Sp0T Yes. I implemented an ECS for example. I used quite a few comments there. I wasn't happy about that at all.
 
user92578
@dot_Sp0T That's a sorta out of line response
 
user4704
4:57 PM
@dot_Sp0T Be civil, please.
 
I actually carefully chose to use that word in that case.
 
user4704
Well choose more carefully next time, it wasn't appropriate at all.
 
There's plenty of code you can write without comments, and there's plenty of code you can't
 
The comments I would leave are method/function documentation comments. On Python, those are docstrings (not quite comments); in C# those are XML documentation comments. Just "Here is this function's purpose, here are the parameters it expects, here is what it will return."
 
@doppelgreener that's doc tho
 
5:00 PM
Yeah, but, it's also comments.
 
nwp
The parameters should be obvious from the declaration, so should the return type and the purpose should be clear from the name.
 
Method documentation is another level. There's still normal comments that are sometimes necessary
 
In the short term I'll leave // TODO add handling for xyz comments, but if I don't have an immediate plan for handling them shortly, they'll go into my backlog as tasks instead and not be comments.
 
//TODOs are even another kind of comment
 
nwp
The thing is I realized that I comment every time I have to cover for deficiencies in code. I can't get rid of all deficiencies, so there are some comments left, but if you have lots of them it's a bad sign.
 
5:01 PM
Ideally TODOs don't have a long life expectancy.
 
There's a lot of context you can forget without comments
 
@nwp define deficiencies
 
@nwp These are the times I leave ongoing, long-term comments in the code base: it is deficient, something is bad, but I don't have the time or resources to resolve it, so in a comment goes explaining what's going on.
 
like suppose you wrote the Carmack invsqrt function - even with perfect variable names, I'd put something like // first-order Newton-Raphson by the iteration line
 
Like "one browser has a bug/anomaly, here's a reference link. That means we need to do something different (explanation in English)." I'll leave that above a passage of code that would otherwise appear dumb/unnecessary.
 
5:04 PM
Say you design an algorithm to do XYZ. You will want to have comments there, to understand why you did it that way instead of another way. When you, or someone else comes back to that code they might want to optimize, then they spend 3 days finding out that the bad-looking code was already optimized.
just to give one of the more obvious examples
 
user92578
float FirstOrderNewtonRaphsonApproximation(float v); float sqrt(v) { return FirstOrderNewtonRaphsonApproximation(v); }
 
that makes it less readable
 
@nwp So overall... this could be an OK metric, but it depends on what your organisation's doing and the time/resources you have. Some organisations I've worked with in the past just do not have the resources to pass that metric. They should, but they don't. (Make sure you exclude documentation comments. Make sure you also track TODO comments separately, as they shouldn't stay long term and are worth paying independent attention to.)
 
@Tyyppi_77 yeah, and then you read up on what the FirstOrderNetwonRaphsonApproximation is. Which means there is some point where this was defined, explained > COMMENTED
 
user92578
I'm not copy pasting wikipedia into documentation, and I don't think you should either
 
5:06 PM
becuase first of all, your function is actually wrongly named
 
nwp
@dot_Sp0T This for example. It would be much better if I could express "object is inside a system vector" in the type system, but C++ cannot do that. There are other more problematic comments in that project, but that one is a good example of covering up deficiencies in code.
 
@dot_Sp0T I would summarise the methods/algorithms being employed, if they require special knowledge or awareness, in the class or module documentation.
 
it isn't generic first-order newton raphson, it's an interation against the local derivative of sqrt at the value of the temporary value you're currently approximating from
 
user92578
float FirstOrderNewtonRaphsonApproximationForInvSqrt();
 
@Tyyppi_77 I never said you should do that. I was trying to point out that the example is something that has somewhen been well-defined and there's plenty of explanations to understand why it is done the way it is. IF you write your own algorithm then you invented it, you will explain what it does and why. Because otherwise it ain't even worth the time you spent developing it
Also Metrics like max lines of code in a method or max number of methods on a class or max number of comments per line of code are just wrong in the very idea. It's just as wrong as all these women-quota discussions for upper managements or bringing a certain amount of people that match the description xyz into field vwy....
@nwp what is 'UB' ?
 
5:09 PM
float IntSqrt(x) {
   float xhalf = getHalfOfXForSqrt(x);
   int i = BitCastFloatToIntPointer(x);
   i = MagicNumberInitialGuessForSqrt(0x5f375a86, i);
   x = BitCastIntToFloat(i);
   x = FirstOrderNewtonRaphsonApproximationForSqrt(x);
   return x;
}
 
nwp
@dot_Sp0T Undefined behavior.
 
user92578
@Jimmy lovin' the polarisation
 
user92578
nothing makes for a more reasonable discussion than that
 
nwp
Usually I'm against abbreviations, but UB is one of the ones a C++ programmer should be intimately familiar with.
 
@Jimmy Some of that would be implemented in a conversion utility or as a class extension, depending on the language. Conversion.ToFloat(int), for example
 
5:11 PM
@nwp thanks for explaining. Also your example is Framework/Library code. Code that helps other code be more concise. Most comments are found in end-user code. E.g. the code that defines all the fields in a GUI, you will want plenty of commenting there explaining which numbers were chosen why, etc.
 
user92578
numbers like what? widget positions?
 
Like whatever you put in there. E.g. I've got code that decides if trackpad scrolling should scroll text up or down. There's a parameter for a deadzone, there's a comment in the code providing that parameter explaining why it is that very number
 
user92578
meh
 
user92578
int volume = 50; // Sounds nice on my computer.
 
nwp
The numbers should have descriptive names, because magic numbers are not cool and you want to centralize their setting and explanation.
 
user92578
5:15 PM
Also that number should probably be in a data file
 
on a related note, I like data file formats with comments
 
nwp
And if you are really modern you use a type library that doesn't use int for every number and has seconds and meters instead so that volume + deadzone is a compilation error.
Unfortunately that takes quite a bit of work. At least in C++.
 
user92578
yeah typesafe typedefs would be cool
 
@Tyyppi_77 and then the data file gets a comment explaining the same thing
 
user92578
so what's your current comment for the trackpad value?
 
nwp
5:18 PM
@Tyyppi_77 std::chrono is a start. There are some type libraries on github.
 
@Tyyppi_77 //cutoff at 0.05 as trackpad scrolling produces fractions that are around 0.016_ on slightest touch
although i've no idea what you gain from it
 
user92578
that seems very trackpad dependent
 
I've got my development/test-machines I got to tweak these values based on the data I have
don't I?
 
nwp
Arguably you want to tweak the values to customer machines. Not sure how close yours is to theirs. Maybe worth checking.
 
@nwp even if, that's something that needs to be done, it takes time and resources. So if I have these resources I can revisit this. As long as there's more important things to do this works fine and reminds me of why that value is that value
 
user92578
5:25 PM
So in reality this is more like a //TODO: Calculate based on the users trackpad: Currently derived magically from the number 0.016 comment
 
nwp
I have written headers that just list magic numbers too, and every single line has a comment with an explanation what that number is for and why it was chosen. But that is arguably not even code, just a list of business logic values.
 
@Tyyppi_77 no. in reality it is: //cutoff at 0.05 as trackpad scrolling produces fractions that are around 0.016_ on slightest touch
 
user92578
again a very constructive way to move the conversation forwards
 
user92578
being super pedantic about my choice of words
 
user92578
IM REALLY FUCKING SORRY
 
5:27 PM
It seems we've discovered there are multiple ways to write code.
3
 
It's alright, you don't have to apologize. But we're likely both second-language-speakers. So being pedantic about what words mean, voluntarily or unvoluntarily, is something that just happens
 
game devs, help me fix the economy - recommend a good dev related book, pref something crunchy like GameAI Pro or juicy like Pragmatic Programmer
 
@nwp yeah, got plenty of these as well :D
 
user92578
@dot_Sp0T It totally didn't need to.
 
@Tyyppi_77 sadly we have little control over how others perceive our communication other than learning and improving
 
5:29 PM
@dot_Sp0T is the book form superior to the web form?
 
also I'm off for dinner
 
user92578
@Pikalek same content afaik
 
user92578
@dot_Sp0T *to dinner
 
@Pikalek no. It's, as described on the website I believe, exactly the same. But it's a good way to support the economy and the author that did a really well job
@Tyyppi_77 for having dinner
 
@dot_Sp0T fair point
 
user92578
5:30 PM
@dot_Sp0T that doesn't sound correct at all
 
feels right to me
 
'off to' is kind of a tightly-binding idiom here
 
user92578
^
 
I don't think "off for dinner" is wrong, but it parses differently than "off to dinner"
"I'm off (explanation: for dinner)" vs "I'm (off to) dinner"
parsing English requires backtracking
 
5:44 PM
for requires looping (conditional jump) whereas to is a conditionless jump. There may also be address restrictions, in which case for dinner might imply local whereas to dinner could be anywhere
 
5:56 PM
I just realized there were two problems per day on the advent of code :/
 
An addition to the comment discussion: Most often you strive to write code once and reuse it. So even if something makes sense you will often have to dig into other code no matter how long and intricated the method names, even if it's just to understand why the code dividesNumberAByNumberBAndThenAddsARandomNumberBetweenAAndB(A, B)
 
6:11 PM
Forgot how great refactoring felt
 
6:57 PM
@dot_Sp0T I would never write that function, that's insane. I'd write a function with a specific purpose. What it does internally to meet that purpose doesn't go in the function name. The purpose does. :P
"GetIncome(A,B)"
Happens to divide A by B then add a random number because that's how I calculate income in this module for some reason
Naturally A and B have better descriptions, like TotalLoot and NumberOfCuts
I'm aware this is theoretical but that theory was channelling Nyarlathotep, who doth send men mad with visions of that which is not quite right
(and women, should that so happen)
 
@doppelgreener I've seen it done...
 
@dot_Sp0T Whoever wrote it is or temporarily was insane.
 
7:48 PM
once had a colleague who believed if you couldn't come up with a good, meaningful name for a method/class/struct/whatever, then you should deliberately give it a bad name that communicated a lack of usefulness. So we'd occasionally find variables named Bob, NotBob, Alice, etc\
so there was a logic at work, but also induced some sort term insanity.
 
nwp
int ijustneedsomethingtoiteratewithgivemeabreak = 0;
 
8:01 PM
I'll plead guilty to having resorted to doesStuff( )
 
if it's the single function in the class, also known as execute(), invoke(), run(), start() etc
 
in my case it's usually one of may functions in one or more classes that are begging for some refactoring
which I'm totally going to do
just as soon as I finish this one thing first
it just has to, you know, doesSomeStuff() & things will be fine
 
I'm super-picky about my names
 
good
I should be as well
find a way to infect us
in the mean time, I need to track down an errant student - later all
 
:D
 
8:39 PM
I'm not picky with names but I can't think of any function I've written that couldn't be described other than stuff like my examples
 
nwp
@Pikalek Code review probably helps. If it gets spotted reliably and you must fix it that might force you to do it. And if you are lucky you will even get suggestions.
 
8:57 PM
i hate debugging..
 
nwp
9:13 PM
Sometimes debugging is fun because the sanitizers catch all the errors and the debugger does the rest. But the other times ... yeah.
 
i mean the behaviour is reproducible, so it's fine
but still
 
nwp
Today I managed to reproducible crash Qt Creator because of some CDB issue.
 
I start thinking you're just making these words up
 
nwp
9:29 PM
Which ones?
 
CDB
 
nwp
Its the visual studio debugger. Basically the windows version of gdb.
Might be part of the debugging tools and not actually VS.
 
I still think you make these up
 
nwp
That one mentions it and that one asks about it.
 
grrrrrr
 
nwp
9:35 PM
I'm not that insane yet :P
 
well, i've got a routine to split text into... shorter text
and it goes haywire and makes me really sad
 
nwp
That sounds like something you can write useful tests for.
 
And I'm starting to get to the point where I just dump stuff on stackoverflow and go all bollywood...
 
nwp
Never go all bollywood. Value your sanity. Take a coffee break or something.
 
I guess I should write some unit tests indeed. I haven't had much chance to write any so far because most of the logic does graphics, and validating graphics with unit tests is, well, not really the most intuitive thing.
 
nwp
9:44 PM
In my experience unit tests work well when you know the correct answer. "Does this triangle overlap with that triangle" works great with unit tests. "Does the fireball hit the monster" doesn't work well at all, not even if you actually make a test case where you hit the monster with a fireball.
 
@nwp actually 'does this fireball hit the monster' should be testable relatively easily by spawning the fireball and then testing if the monster's hitbox produces a collision-event
What I mostly did so far is things like: Does this really open 4 different windows; Can move the windows between my monitors; Is this locking behaviour sufficient to swap context ownership between the rendering thread and these callbacks; ....
 
nwp
@dot_Sp0T I guess. I just never managed to make useful tests of that type.
 
@nwp they tend to go into the direction of integration tests; e.g. spawn an enemy, check; spawn fireball, check; hits enemy, check; deducts correct amount of hp, check; triggers kill-event, check; spawns loot, check;
 

« first day (2679 days earlier)      last day (2331 days later) »