« first day (3388 days earlier)      last day (1617 days later) » 

10:21 AM
hey @Vaillancourt @Pikalek sorry to leave so suddenly yesterday, turns out I was still kinda ill and got sent home
 
hello
 
hey @trollingchar, how's it going
 
same as usual, refactoring a game, refactoring a project at work
I finally started to refactor that buggy "thread-safe" queue
 
Messing with threads, ooof
tough work :P
is it thread-safe now?
 
it's not completed yet
components are tangled and I have to refactor services
it will support parallel services loading (now they are loading sequentially and work in parallel)
 
10:27 AM
ooooh
What language is your game written in again?
 
client - unity+c#, server - java+netty
 
I remember java was quite good at handling threads
Haven't done anything thread-wise with C#
 
at work, we use C++
and the issue is with work
 
I wanna say C++ is quite good at handling threads, but you need to study more to be able to use them properly :P
assuming they are the same threads as in C
 
what I'm currently doing
 
nwp
10:35 AM
Threading is ridiculously difficult. Even when aware you still write data races and miss them for months.
And in C and C++ it's simply UB, so detection is also lacking. I have not had much success with thread sanitizer.
 
@nwp that's true, it depends what the threads are for
What do you mean by "UB" ?
 
undefined behavior
 
ah
 
nwp
If you use a thread-safe message queue it gets a little bit easier, but you still need to pay attention to when you use messages over accessing data directly.
 
I remember doing some experiments in the past with threads in C and it was fun, I didn't use it on an actual project yet, but plan to
@nwp isn't that exactly when someone should use the mutex?
If I remember its name correctly
 
10:39 AM
this task is almost producer-consumer problem, but there are some additional operations that not fit the common solution
 
nwp
@TomTsagk If you remember to use it then sure, that's one way. And you're gonna do it correctly 99% of the time and that 1% bug ruins everything.
And then you refactor a bit and suddenly got a data race and you don't even notice because it appears to work. With fun effects like it only failing with a release build on that one laptop.
 
@nwp And that bug jumps out in production, right when you present your product to investors
 
@nwp I do agree that anyone deciding to use threads must be really careful of what they do
Some people, when confronted with a problem, think, 'I know, I'll use threads' - and then two they hav erpoblesms.
 
nwp
It's cool how you can teach people that data races are UB and show them a trivial example of 2 threads incrementing an int and ask them to spot the bug and they are clueless. It really takes a while to get it, and even then it's difficult.
 
(Stolen from the internet)
 
10:47 AM
The problem here was not data races, but the situation when a consumer is awaiting data but producer has already stopped. Current version circumvents this by using null pointer to "poke" the consumer but I don't like it.
 
nwp
Are you not using a condition variable? Are you going full atomics?
 
there is a condition variable, but it's used wrongly
 
nwp
Oh. Normally you can just notify the condition variable to force it to check the exit condition again.
It still feels weird that notifying doesn't require holding the mutex. I don't know why.
 
 
4 hours later…
2:45 PM
@TomTsagk No worries, people just come and go here and that's fine :)
 
2:56 PM
I have just realized that trollingchar-from-the-past made a mistake: he did not use tags in git, and that's why I have trouble finding previous stable versions.
 
Tags in git are SO amazing
 
Oh, good advice for your trolligchar-of-the-present!
 
It's so awesome being able to do something like git checkout v1.2 and suddenly your project is on that version!
The only thing its missing is being able to do git checkout v3.0, when your project is still on version v1.0, but still have git make features for you.
2
 
3:22 PM
"Computer, produce version 3.0."
 
Pretty much
We can finally blame the computer for bugs, and be right :P
 
Yep!
 
Random question: Do you have a "it's not a bug, it's a feature!" story?
 
nwp
No funny ones.
 
@nwp only horror ones ?
 
3:27 PM
Not one that does not involve a rant about our current project, so I will not talk about it :P
 
Programmers and rants, name a more iconic duo
:P
 
nwp
No, boring "business as usual" ones. I got to work with people who made a PDF with screen states that show which button transitions from where to where. And they just keep forgetting arrows, so some screens are inescapable. It's especially annoying when I point it out and a few versions later the arrow disappears again.
They made trials with the device and must surely have gotten annoyed by it, but they haven't felt like correcting the issues or double-checking the specification.
 
@TomTsagk I have one, but it's more of a internal dev thing than it is about a external product feature.
 
nwp
Doing what they meant instead of what they said is dangerous because it's easy to get that wrong.
 
@Pikalek If you want to share, i'm interested
@nwp sounds horrory enough :P
 
nwp
3:33 PM
I can make it sound like one. It's a medical device after all which may save your life some day. Unless the doctor is stuck in a menu and doesn't know how to get out.
 
oh wow
Didn't that became an issue with windows 10 updates? That some life-critical devices had a force-restart while they were needed in a hospital or something?
 
nwp
Unlikely. Hospital systems have no internet access, so they just wouldn't get the update.
 
It might be something else, I can't remember, but I've heard of issues like that before
 
Time was, there was a member of the research / dev group wrote some code. In said code, was mostly the expected sort of thing. The conspicuous exception were some variables with people names. I.E. instead of something like PatrollingAgent01 it was Alice. When asked about it, he said something like "I couldn't come up with a good name that conveyed meaning, so I tried to pick an obviously bad one to avoid leading others to bad assumptions about its behavior."
4
 
woah :P
I can't even decide how I think about this
 
3:39 PM
Yup.
I've had a decade to chew on it & I'm still digesting that one.
 
nwp
foo = bar; //TODO: naming
 
No deal is better than a bad deal?
 
nwp
Sounds like something BoJo would say.
 
The underlying axioms are: Coming up with good identifiers is both important and difficult.
 
Like, I can understand having trouble making a variable, but at least if there is an attempt to name it one would see a train of thought to follow
Isn't it one of the best ways to obfuscate code to randomise variable names?
 
3:43 PM
@TomTsagk Yes. I don't dive too much into the physics engine that we use, because of letters :P
 
nwp
Gotta go fast
 
iSn'T iT oBvIoUs If 'v' StAnDs FoR vErTeX oR vEcToR bAsEd On CoNtExT?
 
Velocity?
 
Or that :P
 
Or just v, because the previous one was u.
 
3:47 PM
Or start from the beginning of the alphabet, because there are no more letters
 
If memory serves, we were trying to jam out a proof of concept for some deadline.
 
Yeah, go excel style and use AA when you get to Z
 
I don't know, if a physics engine starts using 3-4 digits with what appears to be random letters, it's just asking to be left alone
 
Yeah.
 
if a physics engine has variables that *
I messed it up
 
3:50 PM
When I first started coding, my 1st looping var was x, followed by y when needed. Then I had a project that needed me to go 4 loops deep. I now start with a as a matter of course.
3
 
It's open source. "You're free to contribute, but you're not welcome to do so". Or I don't know, maybe that's just like how physics people think.
 
^ My friends used to say "Open source hates you, patches welcome".
^ Might have ended with an expletive.
 
wish people understood that just having your code online is not open-source
 
Yeah, sometimes it's one-way: you can use it, but I don't want you to modify it.
 
Which is exactly the same as distributing binaries
 
3:55 PM
Not really, you can modify the code and adapt it to your needs.
And fix bugs.
But if you want the feeling of "community" well..
 
I mean, assuming that its readable, that's the biggest consern
 
There's also disagreement about if changes to open source must also be open source.
 
that's why i love open-source projects with plenty of comments
@Pikalek That's why GPL exists, no?
 
@TomTsagk Yeah, as long as these are relevant!
@TomTsagk That has at least the sign that the one who writes the code wants you to use it.
 
I prefer not to speculate on why GPL does or does not exist.
I'd also prefer not to speculate on what is legal meant by 'derivative works'.
Once the latter is figured out, maybe I'll bother with the former.
 
4:02 PM
Yes
 
Until then, I expect to have little time for it.
 
ah okay :)
 
@AbhasKumarSinha Welcome. Please excuse my GPL rant.
 
@Pikalek ah never mind :)
I personally prefer MIT or EULA (if for commercial purpose)
 
Yes, I like MIT and some others because I have a clear sense of where I stand. GPL, not so much.
 
4:06 PM
agree
 
@Pikalek So you don't like GPL ? :P
 
who likes it seriously?
 
I do
It has its ups and downs :P
 
License is like your girlfriend, at the end you don't understand anything and say "I agree!" and continue installation...
 
Which can lead to undesired situations
I've seen people going to social media and put on their profile "I don't agree with this service using my pictures for commercial reasons"
That's not how the law works at all
 
4:12 PM
@TomTsagk So you never had undesired situations with relationships? :P
 
I don't think I ever had a desired one
 
@TomTsagk same with Licenses..
 
@TomTsagk I've looked through the code for 2xSaI. Does that mean I can write my own 2XSaI implementation now that isn't GPL? How close can it be to the original? If the math is the same, is the code? As far as I know, none of this has a legally tested answer.
 
@Pikalek I see where you're coming from, I guess that comes down to if the original developer can prove your project is a "copy" and you didn't write it yourself.
If you write the entire project by scratch (even if inspired by another project) you should be able to license it however you like, but I do get your point that there is no definite line of how similar two projects need to be
@AbhasKumarSinha At least with licenses you choose the one you like most
 
@TomTsagk hahaha.... This cracked me!!
 
4:18 PM
@TomTsagk Yes, that's fine. Also it's fine if I knowingly use GPL code with the intent of making a GPL project. But between those two end points is a wide spectrum of use that's not clearly explained.
 
If you work for employer A to write some code that does X. Then you get hired by employer B to write code to do X, the code will be pretty much the same: you will not have changed the way you think about it. Can employer A sue employer B for code theft?
 
Which is some of why companies want to use non-competes.
 
I think the general idea is if you've actually written the code, or copy-pasted it. If it looks the same or not it doesn't matter.
 
@Vaillancourt no, because they are different people, most of the chances are that they have written themselves and not copied
 
Kinda like piracy, the illegal part is not that you own a video game, but if you downloaded it through piracy or not.
 
4:21 PM
@Pikalek Which is not legal, at least here. "My speciality is to write code that does X, you can't prevent me from working."
 
@TomTsagk Maybe. Then again maybe not. Again, it's not been legally tested & no one has attempted to provide a officially sanctioned framework for making those decisions in the absence of a legal ruling.
 
by "non-competes" do you mean companies not allowing you to work for a competitor?
 
Yes
Also not legal in some places in the US.
 
I've heard of that, but it always sounded wrong
It's like telling you "if you leave us, your career is over"
 
@AbhasKumarSinha Who is different people?
 
4:23 PM
@Vaillancourt Use version control system to prevent it.
@Vaillancourt A and B
 
Ars recently had some good (but brief) coverage on it here.
 
@AbhasKumarSinha You mean that employee should use version control to prove that they haven't copied the code but built it up piece by piece?
 
Seems to be that could prove guilt by presence, but the absence doesn't prove innocence.
Of course it's generally difficult to prove a negative.
 
Yeah.
 
Trying to show my work was original was the most nerve wracking part of my literature review.
 
4:37 PM
That's a tricky situation.
 
In my case it came down to my effort of good faith + the expertise of my committee. Life outside academia isn't always as clear cut.
 
Yeah.
 
@Vaillancourt most of the VCS have features for that to see who wrote the code first and how it was merged, that'd help them to decide what happend...
 
@AbhasKumarSinha Prove how? These can be tampered with.
 
@Vaillancourt depends on which one you use. For example - TortoiseSVN can only be tampered by admin, not employees,
 
4:44 PM
@AbhasKumarSinha Companies would never share their version controlled project with another company though (assuming its not open-source)
 
@AbhasKumarSinha Yeah, but it's the employer who sues. If they want to sue for code theft, they'll make sure to delete the proofs.
I guess that the only way that an employer can do anything about it is to patent the code.
?
 
I'm not a lawyer... My advice is meant to be taken as a grain of salt.
 
It's just not as simple, not to mention how much more difficult it becomes if you are an indie
 
We have exactly 47k questions on the site :P
 
Where can we see that?
Oh I found it
 
5:00 PM
^_^
 
Shall we just delete any new question to keep the number intact? :P
 
If we do that, it will be exactly inexact, so I don't know if it'll serve anything.
We can wait and see if "the system" feels like removing a trash question or two :P
 
Does the system ever completely delete questions?
 
There is no such thing as "completely deleting a question".
So, no. It will just hide it from most users.
 
So it will always exist somewhere
 
5:03 PM
Yep. Mods can always see them.
And I think 10k rep users can also see them.
Helps us find badly behaving users, sometimes.
Also, deleting your question and/or answer can be considered vandalism.
 
That's interesting, never heard of that
 
5:53 PM
https://developer.valvesoftware.com/wiki/Latency_Compensating_Methods_in_Client/Server_In-game_Protocol_Design_and_Optimization

"It will be some time before broadband truly becomes adopted in the United States, and much longer before it can be assumed to exist for your clients in the rest of the world."
 
Written ~19 years ago :P
@Pikalek At the same time, I think in some situations, some committees just close there eyes. Someone with whom I had master degree classes was very bad. I didn't have a clue of what we were doing. I know some professors need students to help them with their work so they kind of also do all the work for them.
Some professors on those committees know some students are bad, but close their eyes during those reviews.
I suspect a couple of reasons, one being "scratch my back, I'll scratch yours".
 
True; but I like how "US-minded" it is. Though even after ~19 years lagg is still a real thing.

"While broadband has been held out as a panacea for all of the current woes of on-line gaming, broadband is not a simple solution allowing developers to ignore the implications of latency and other network factors in game designs."

Though even with fiber theoretically; minimal round trip time from US/Paris is 40ms (In practice; US east from my connection is 100ms)

I'm uncertain how much lagg I should be able to "smooth" or compensate; but worst case (or always if possible) one should put a ser
 
@Paul Yeah; depends what you aim, though; EVE Online has one shard only.
(Except for China)
This is now also dependent on the end-user infrastructure: my WiFi connection is bad. Much more reliable when I plug the wire in.
@Paul Having multiple servers might cause other headaches "hey we would like to change our region, can we do that?"
 
6:09 PM
I've read the https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

But it's quite shocking.
The server remembers client positions up to 1 sec ago; to be able to do lagg compensation and calculate hits "in history" (which is also why you can get hit by an enemy even if you duck behind cover already, which I personally hate).

There is also "lerp" (default 100ms) delay in the render time for the clients; which I understand; but think it just makes the whole delay bigger?

I actually always game on WiFi (laptop) but I have a proper WiFi setup and nearly no interference (:
@Vaillancourt What would be the headache on that? You could allow them if their ping doesn't exceed a limit, as long as your database can server both regions (and there is some protection in being online in both regions), but I'm far from implementing that lol.
 
@Paul Yeah, well you want to transfer ownership and such. I guess.
 
EVE Online would have very constant "player" movement then; to be able to accurately predict client locations?
And you're probably right that you would have a database for each region as well
 
@Paul It's a bit more complicated, but yes. The tick rate is 1 second (I think). You move in space, so quite slowly, to move and shoot, you "activate" stuff, so the effect is not as immediate as shooting with your rail gun.
 
"But instead of sending a new packet to the server for each user command, the client sends command packets at a certain rate of packets per second (usually 30)."

I think that's odd.
Worst case it:
- Adds 33ms delay.
- Sends 30 packets each second; though it's unlikely someone will press 30 keys each second?

Just sending a packet whenever a key is pressed/released makes more sense?
 
@Paul If the server will not process them any way, what's the point? What's the maximum noticeable input rate?
If the user keeps their hands on the the W, will you send an infinite amount of key presses?
 
6:26 PM
(In javascript you have "key_down" event and "key_up", so it will not send infinite presses)

But it indeed matters if your server does "check all inputs -> calculate world -> update clients" or if your server handles all input "by event". My game was set up in the second way; but it's completely different from how Valve does it; not yet sure if that makes it wrong :p
 
I don't think so. The server will internally need to track that anyway.
 
Actually; I just remember that the client does.
It has a player object with an "update" function that checks if the keys are held down. Though this "is_down" state is only changed by the keyevents.
It does have the problem that if your window loses focus if a key is being pressed; your client will keep moving as the "unpress" event is not caught in that browser window.
 
I guess that's one of the reason they do it like that. If the client stops transmitting, the server will not be notified that the player should stop.
 
6:43 PM
The fun part here is that even the client doesn't know (in browser/javascript)
You only get "events" for keypress/release, you can't get the actual state of the keyboard for some reason.
 
That's interesting!
I guess you can know when the window loses the focus, though?
 
I've just checked; depends on the browsers' implementation but most modern browsers do.
Or well there is a difference between focus, unfocussed and 'hidden' I believe.
But I could use that to reset all keys if the client loses focus and let the server know as well.
Change the player's name to "{AFK, pls no shoot me}" lol.
Though if you:
- hold a key
- window goes out of focus; game resets key holding
- window comes back into focus
- (you're still holding the key) but not moving; since it was reset; you'll have to release and press again.
I was testing this, you can see the difference in "surviv.io" and "starve.io" one stops movement when window loses focus and has the above problem.
The other doesn't stop; and makes it look as if the key is sticky.
 
6:59 PM
Yeah; you need to decide what you think is the best.
 
For now; it doesn't matter, it's also something that I should be able to add quite easily.

But given how Javascript's input is working; it has no use to send which keys are held on a fixed interval. Though I do think of making a "ping" message to see if the connection is still alive (and potentially what latency it has).
 
I think sending the "on release" event is better, though ;)
Yeah, that's a good idea.
 
I've actually re-started this project after a few months and I see I have to "alive check" built in already; I just don't see how it works, but it works xD
But now I have no clue on how to get the latency out of it; instead of adding timestamps to them (surely there should be something built-in for that though).
const interval = setInterval(function ping() {
wss.clients.forEach(function each(ws) {
if (ws.isAlive === false) return ws.terminate();
ws.isAlive = false;
ws.ping(noop);
});
}, 10000);
function noop() {}
(I just see I copied everything exactly from the websocket library examples; so it's just me being confused about someone elses code, which makes sense)

But most likely I'll have to reimplement it with my own functions to allow a timestamp to be sent along. I'll be searching for a cleaner solution
 
I'm sure I read somewhere what would be a good way to actually check a ping, but I don't remember where.
 
7:19 PM
@Vaillancourt It's not a perfect system. Some days I'm not sure if it's even a good one. At the same time, a cannot provide superior alternative.
 
Ah; per spec; if the server sents "Ping" the clients send a "Pong".
So:
1. set a timer
2. send ping to everyone
3. when ping is received; current time on the timer is the 'round-trip-time' for that connection.

This way I avoid sending a timestamp along to all clients (extra bandwith) and having to calculate the differences between the timestamps etc.

Only problems:
- only sent once every 10sec for now. (but can easily increase that)
- if you have 10 clients; the last one may have a slight offset as the timer was already running while sending to 9 other clients
What system though?

Some system is often better than no system at all.
As long as the system is open for improvement; it may become even a good system.
 
@Pikalek Yeah, I agree.
@Paul Academia. I was talking about a guy who could get a masters degree without really deserving it.
@Paul You can refine that later :)
 
We had a similar discussion. One of our interns had a very rough time (sickness and what not), then they were discussing an option to "relieve some requirements".

But I was thinking; if they let someone pass; who didn't pass all requirements, what is your diploma worth? (And by doing so; what is the value of all other diplomas of that same school?)
 
7:47 PM
I see it as an indirect measure of prior accomplishments & an indirect estimator of future ability. It's not the only or best measure. And in some places, it's a key to move through gated processes.
But it doesn't necessarily guarantee anything.
When my spouse was in med school, they had this joke:
"What do they call someone who graduates at the bottom of the class?"
Doctor.
There's more than one truth to that.
From the outside, people just see them as doctor without knowing if they were best or not.
And if the system is working, it shouldn't matter - even the bottom of the class graduate is qualified to be a doctor.
To a lesser extent, the same is true of academia, but the ivory tower has fewer checks and balances.
 
The danger comes from placing incompetent persons in key places because they have a diploma.
 
8:05 PM
Absolutely. Mistakes of that matter can happens despite good intentions; blindly assuming any diploma equates to skill or competence makes it happen faster.
But it's also easier from a recruiting standpoint.
 
Yep.
 
Genuinely evaluating people is hard & takes some time, $ and effort.
 
Yeah. It's not uncommon to have a "probation period" of three to six months.
 
Where?
 
Yeah. It's not uncommon to have a "probation period" of three to six months.
 
8:10 PM
... weird... the system was doubling my posts & then appeared to correct for it, so I thought it was just me...
 
8:25 PM
Looks like it's a glitch in the Matrix.
Where I work, the "probation" was 6 months.
 
8:38 PM
A diploma is different from work experience anyways.
But here; you get a temporary contract for the first (half) year.

And if you're fresh out of school; usually you'll work on a department before becoming the lead of a department (could be me, but I think it's an essential part in being able to lead the department; knowing what daily activities is like).

I work in a small company; it'll be quite obvious after half a year if someone isn't getting along well. But I find it hard to estimate it from one or two interviews alone.
 
Heh fortunately, I haven't gone through that process for a while now :P
 
@Vaillancourt not sure if bad
 
If bad?
 
Not sure if it's a bad thing*
 
You mean not changing job often?
 
8:45 PM
It depends, also on what "often" would mean.
Getting kicked out after half a year from each job? = bad :P
 
I've been here for 7 years.
 
My aim is at 5 years.
It somewhat differs per country; but here it's getting much more common to swap.
Even though most companies won't give you a fixed hour contract the first 1 to 2 years.
 
So you explicitly plan on switching after 5 years?
 
My colleague mentioned something like that, I think it fits my situation as well:
- You don't want to be the guy that works at each job only for 2 years; looks bad on your resume and people will question that.
- Depending on the company; you can learn a lot in 5 years; but after that (if the company does not allow it) you may not be able to learn much more.
- Swapping jobs every now and then can boost your 'orientation'.

Long story short; it kind-of sounds reasonable
I plan on not switching before 5 years, unless if 'needed'.
And if after 5 years not needed; I may not switch at all.

I'm starting to doubt myself lol
 
9:09 PM
Yeah, well if you like it there and enjoy the challenges and the pay is decent, you might want to stay a bit longer :P (@Paul)
 
Yeah; I think it really depends and my "5 year thing" isn't that strong, but I think it's a reasonable aim. Not too much; not too less for my current situation.

It'd at least be interesting to work closer to home as the highways are getting full here.
 
Yeah. Commute can be a pain. It helps if you can work remotely once or twice a week.
 
That's actually a good one, could try to see if that's an option. Once a week may actually be a good idea; just to be able to focus a full day on programming and not people running around the office.

Though it's more the everyday delay. Getting to work in 30-45min and 30-45min back isn't that bad for the standards here.
But I could save an hour of my day easily, which especially would be nice every day ;)
Or if I'd be able to get to work by bike, it'd be healthy and not wasted time and resources (car, though I do get (some) compensation for mileage/expenses).
It's also not particularly on-topic here, nor useful to put too much 'private' details in the open (:
In the Arduino.SE we need to send a "." in the chat every now and then; just to keep the chat from being closed automatically :]
I just stumbled on this: https://www.youtube.com/watch?v=S2eXK025uC4
But; if I make a game using any of these engines; it somehow still ends up looking like pre-alpha minecraft ¯\_(ツ)_/¯
 
9:44 PM
@Paul gamedev stuff has a higher priority, but if noone talks about gamedev any topic can go ;)
And the room will freeze after a week of inactivity.
Cant youtube a.t.m.
 
How are you still alive?

Though; sometimes I fall into the trap of YouTube, at some point you realise you've been watching the most random stuff for last few hours; when all you wanted is to watch a tutorial or smh.
 

« first day (3388 days earlier)      last day (1617 days later) »