Page 1 of 1

I had an interesting conversation (Programmers step in)

Posted: Wed Oct 17, 2012 11:20 am
by Zach
Riders of Rohan for LOTRO just launched, but today the servers are coming down for some maintenance.

I asked why it takes 4 hours to bring the server down for 2 or 3 things, and someone pointed out the "memory leak" problem people were having. This memory leak, by the way was reported client-side. So I pointed out it seemed like a client side problem to me.

Eventually this went to private conversation, At first I thought I was going to get an interesting lesson on how things apparently worked, by someone who perhaps did know.

But what happened is I couldn't follow this guys logic, or any of his claims. Many of them just seemed stupid and contrary to common sense.

Have I got it all wrong??

(I have censored our game names for obvious reasons)
### Chat Capture: IMs_**CENSORED** 10/17 04:50 AM ###
[04:38] **CENSORED**: would you like a private explanation?
[04:39] **MYSELF**: couldn't hurt to listen
[04:40] **CENSORED**: lets say this game was coded and created for DX9 info being sent to your computer. If you're running DX10 or 11, you're missing stuff, for example.
[04:41] **CENSORED**: hence, why people are having to revert to DX9 in order to be stable and not freeze up, get slide-shows, or not be able to target stuff, or do quest turn-ins without relogging, etc etc.
[04:41] **CENSORED**: that isnt a client-side issue since there's a lack of junk being sent to your computer. it cant draw what it cant 'see'.
[04:41] **CENSORED**: make moar sense now?
[04:42] **CENSORED**: the same thing is the essential part to what lag is.
[04:42] **MYSELF**: but I don't understand why that kind of data would be sent as Direct X information, whatever that is supposed to be in this case
[04:43] **CENSORED**: it's sent as info. what you 'see' is being sent from the server. all your computer is doing is drawing what is being sent.. and sending replies based on what you do.
[04:43] **CENSORED**: in fractions of a fraction of a second.
[04:43] **CENSORED**: its the same shit with aircraft elecontrics
[04:44] **MYSELF**: my problem here is the assumption that what is being sent is somehow Direct X version specific. If that is truly how turbine coded this game, they should be out of the job
[04:45] **CENSORED**: it is, to a certain extent. if they aren't sending the right info for the version of your PC, then only the version they're sending is going to work flawlessly.
[04:45] **CENSORED**: its how EVERY game is coded. they have to make sure their shit is compatible with EVERYTHING. that is no small order.
[04:46] **MYSELF**: Where I am in the world, and where I am going to is not the purview of DirectX, what I look like and how it tells the GPU to render that representation is.
[04:48] **MYSELF**: I just can't make the connection here between legitimate game data, and DirectX, beyond a network communication protocol it might support or something, the server shouldn't even know what DirectX version I am running unless the client tells it for statistical purposes
[04:48] **MYSELF**: *nor should the server care
### Chat Log: IMs_**CENSORED** 10/17 04:50 AM ###
[04:56] **CENSORED**: sorry, i didnt get any info from the server so i lagged out for the second time during this conversation lol
[04:56] **CENSORED**: internet still worked client-side, could still surf the web, use google, look at even the lotro forums.. which side is at fault?
[04:57] **MYSELF**: Can't say withought more info. But more than likely a node hop between you aren Turbine dropping packets
[04:57] **CENSORED**: exactly.. but that aint *my* fault now is it?
[04:58] **MYSELF**: No, but I don't see how that relates to our discussion.
[04:58] **CENSORED**: info was not being sent to this computer. ergo it could not draw what it could not see.
[04:58] **MYSELF**: you're attempting to draw a parellel where none exists
[04:58] **CENSORED**: and it could not react or reply with what i was trying to do.
[04:59] **CENSORED**: one DOES exist coldy.. thats what im saying.
[04:59] **CENSORED**: the DX 10 and 11 data is data that is sent IN ADDITION TO Dx9..
[05:00] **MYSELF**: I don't see it. Your client could sit there lagged out all day, even without code telling it to exit its communication procedures. That act in itself would not cause a memory leak and has nothing to do with any specific version of DirectX
[05:00] **CENSORED**: if your computer doesnt get that info, it doesnt draw it.. and chaos ensues man.
[05:00] **MYSELF**: and further more, if what you were saying was true even remotely. 100% of DirectX 10/11 users would have crashes.
[05:01] **MYSELF**: this is not the case - because errant data in itself does not cause a memory leak in the way you are describing.
[05:01] **CENSORED**: no, it wouldnt. because not everyone has the same computer, same drivers, same video cards, etc etc.
[05:01] **CENSORED**: what the hell do you think a memory leak is?
[05:02] **MYSELF**: I think the question here is what -you- think it is
[05:02] **CENSORED**: it's a loss of data.
[05:02] **CENSORED**: whether that's inside the PC, outside the PC, is what we're arguing about.
[05:02] **MYSELF**: how can the client lose data it never received? You have created a paradox
[05:03] **MYSELF**: because the memory leak is with the client. This is a fact.
[05:03] **CENSORED**: ....there can still be loss of data based on what the server is sending you.
[05:03] **MYSELF**: No, that translates to dropped packets, which the game have interpolation code to deal with and fix that kind of issue already
[05:04] **CENSORED**: *sigh* i give up. im going back to the game and leveling for the 55 minutes of time we got left
[05:04] **MYSELF**: you can't have a memory leak on the client with data the client never received
[05:05] **CENSORED**: then WHY IN THE BLUE FING HELL DO YOU NOT HAVE THE MEMORY LEAK WHEN NOT PLAYING THE GAME?!?!?!?!?!?
[05:05] **CENSORED**: sorry for yelling.... :(
[05:05] **MYSELF**: For one thing, if you are not playing - your client is not Open.
[05:06] **MYSELF**: its impossible for the client to create a leak in that obvious scenario
[05:06] **CENSORED**: right.. sooo you arent receiving data from the server.
[05:06] **CENSORED**: ergo, there is nothing TO leak
[05:06] **MYSELF**: that's not how it works.. a memory leak can be any kind of data
[05:06] **CENSORED**: then why is it isolated to lotro?
[05:07] **MYSELF**: because there is an error in the source code for the game someone made.
[05:07] **CENSORED**: and why would they be hotfixing it to make both sides COMPATIBLE?
[05:07] **MYSELF**: correction - the game CLIENT
[05:07] **MYSELF**: that is what I asked originally, **CENSORED**. No one has been able to tell me
[05:08] **CENSORED**: EXACTLY!!!! the source code!! which is being sent FROM where? The SERVER....
[05:08] **MYSELF**: no, you're grasping at straws now
[05:08] **CENSORED**: ...... you just said what the problem was.
[05:09] **MYSELF**: Let me break it down into more clear steps for you
[05:09] **CENSORED**: no, you dont.
[05:09] **CENSORED**: BOTH sides of the connection need to communicate in a compatible manner. you're saying its client-side, im saying its server-side.
[05:09] **MYSELF**: the server does not send source code to us
[05:09] **CENSORED**: rofl.
[05:09] **MYSELF**: if the memory leak was server side do you know what would happen?
[05:10] **MYSELF**: we wouldn't be playing right now... or at any random point in the future
[05:10] **MYSELF**: because the SERVER would constantly crash after running out of memory - not the clients
[05:10] **MYSELF**: the problem people are reporting is a CLIENT side crash
[05:10] **CENSORED**: good god do you need to learn electronic theory. find out what ARINC is and let me know.
[05:11] **CENSORED**: until then, im going back to the game.
So basically I tried to remain respectful through this entire debate. I don't claim to know a lot about game development or DirectX or any of that stuff. I just argued my opinion on how I thought it worked, and everything he told me seemed like he was just repeating stuff he has heard or gotten his own mixed up ideas from.

I dunno. I thought it was poor form to insult me at the end, though. I am usually not this civil with my server-side compatriots.

Re: I had an interesting conversation (Programmers step in)

Posted: Wed Oct 17, 2012 2:08 pm
by kenmo
Well I know nothing about this game or how their client-server protocol works, but you're probably correct that...

1. They are obviously not sending "source code" to the client
2. They are surely not sending any executable code to the client
3. I hope they are not blindly sending DirectX-version-dependent data to the client
4. They should only be sending generic "game data" (you used the same term I would) to the client

Updating the server to fix client-side memory leaks seems illogical... the only scenario I can think of is if the server is sending malformed data that leaks memory when decoded... but I would expect the client to be updated to detect/fix that sort of problem.

Re: I had an interesting conversation (Programmers step in)

Posted: Wed Oct 17, 2012 2:18 pm
by Shield
Made (a part) of my day. :mrgreen:

Re: I had an interesting conversation (Programmers step in)

Posted: Wed Oct 17, 2012 2:18 pm
by Zach
There was a client patch (I downloaded it), but the servers are currently down..

I suspected maybe he was on to something like you mentioned, but he was just wording it poorly.. However some of the things he said just absolutely baffled me. It isn't how I would approach coding a multiplayer game, at least..

However, the whole "electronic theory" quip at the end leads me to believe he was just trying to show off and then realized he was actually dealing with someone intelligent and not the typical player. It's worth pointing out the average player in this game refers to poor FPS/rendering speed as "lag", as well. I actually got in to an argument once with somebody who tried to tell me that lag (legitimate communications/packet lag) affects my FPS..... That was after I rejected their "Clear your DNS cache" advice, and I had pointed out the game is more than likely pointing to an IP address anyway.

Re: I had an interesting conversation (Programmers step in)

Posted: Wed Oct 17, 2012 3:36 pm
by Demivec
It was clear from the conversation that CENSORED was talking over his own head.

A major portion of the conversation dealt with memory leaks. A memory leak is a loss of memory resources. If those resources still contain valuable information then it is also a data loss (not a leak).

I don't think that the cause of a memory leak would be found in missing or corrupt data that is sent but instead only in code that doesn't properly handle/store/track and free memory references.

Re: I had an interesting conversation (Programmers step in)

Posted: Thu Oct 18, 2012 10:42 am
by Bisonte
This is a very populated problem, the release of this game is too early.
No bugsearching or (in german : "Qualitätssicherung") was made, cause there was no time for it.

e.g. Runes of Magic (a "f2p" mmorpg)

The Client allocate memory and do not free it if the memory is no longer needed (mapchange for example) so in RoM the client
crashes after his memory usage goes over 1,6 GB RAM. (Its a 32Bit client) sometimes the client crashes so that a normal play
is not possible.

But the server never send other data to the client as "game informations".

Re: I had an interesting conversation (Programmers step in)

Posted: Fri Oct 19, 2012 1:18 am
by Zach
It actually was a big problem. The memory leak that was crashing the client was reported in every Beta version that they tested.
I actually had an invite to closed Beta, but I never used it, as I couldn't justify 14GB of space just for a Beta client, and I was more interested in my progress on the Live server I play on anyway.
but after hearing about the kinds of problems that were reported, and especially some of the known bugs, and the fact they had a memory leak for the entire Beta period. I'm glad I didn't download it.

And we still have minor issues on the Live servers now. I ran into a quest I couldn't complete because it wouldn't advance.


Demi, I pretty much agree with what you said regarding memory leaks. Although for some reason I was hesitant to say that in the conversation because I myself was not sure what or how many different things can cause a memory leak.. But I essentially wanted to say "Something in the client was coded poorly that caused it to not free memory properly / improperly destroying references to data without clearing that data from memory first".

I cannot even begin to fathom what kind of convoluted response he would come up with to that statement, though :lol:

Re: I had an interesting conversation (Programmers step in)

Posted: Sun Oct 21, 2012 3:49 pm
by Ramihyn_
I do not have the time to read all that chat and find out what exactly the misunderstandings where, nor do i know the game, but i see some misconceptions which easily happen due to how games are developed nowadays and how "traditional" programmers see software development.
kenmo wrote:1. They are obviously not sending "source code" to the client
2. They are surely not sending any executable code to the client
3. I hope they are not blindly sending DirectX-version-dependent data to the client
4. They should only be sending generic "game data" (you used the same term I would) to the client
There are reasons why developing computer games is called an "industry" nowadays. It also involves a more complex production pipeline and specialisation. Game engines usually include (their/an) own high-level language nowadays which is used to write all the high-level game logic. These languages can be either variants of generic languages ((stackless) Phyton, Mono C#) or any kind of specialised languages. C++ is way to complex for game designers and using C++ programmers to develop all the game logic, would be a huge waste of resources. The "trend" recently is live editing and changing of game code right in the game (see UE4, CryEngine3, Hero engine, BigWorld etc) and adaption of graph-based visual scripting methods for development of game logic (Kismet, uScript et. al.)

If you start doing (part of) the network protocol in these intermediate/scripting languages, you inevitable run into the situation that you need to keep the client and server versions "in sync" when you do protocol changes. If the core game chances due to updates in libraries or plug-in's for example, obviously also executable data is transfered from server to client. This update/integrity check is usually done by a seperate program which acts as a launcher of the game itself.

About DirectX and "generic" data ... if you look into the shader features of DX9 and DX11, you will end up with basically having to write two different shaders. We just have this problem with the upcoming unity3d 4 release which supports DX11 on windows, but you need seperate very different fallback shaders for smartphones, DX9 and Mac/Linux etc.

I hope this cleared some of the confusion up, its really best to look into the 3D engine SDKs yourself for example https://www.youtube.com/watch?v=lPIIiJFBOCI where part of the video shows the new IDE and it's use.

Re: I had an interesting conversation (Programmers step in)

Posted: Sun Oct 21, 2012 4:07 pm
by Zach
I'm sure a lot of that is very true and accurate.

But when I think of a Client / Server MMORPG setup... I don't see how or why they would for example, send directX (bet it shaders or w/e) data or code or w/e you want to call it, over the active connection. That code should already be part of the clients rendering engine, etc.

If they do it seems like a terribly inefficient waste of bandwidth. The only thing the client and server should be sending to each other, should be positional update data, interaction triggers, combat / other UI related commands and that kind of stuff. Basic text based data, not anything to do with graphics, or anything that depends on what rendering mode you are in (DX 9/10/11/etc). That data should already be present within the client program, which should be building the scene it renders based on its capabilities - not what the server tells it to.

But it seemed like at one point he was suggesting, everything you see on the screen, is being sent by the server - which is just ridiculous. The models, textures, etc already exist on the client (why the hell else is it 14GB in size?) the only thing the server is telling the client is if Entity X is within your rendering radius, if its moving/static, etc. At that point it is up to the client to render that data and control the level of detail / effects applied to the scene.

I think that falls outside the scope of sending scripting data and such, like you pointed out is probably involved. It would make sense for that kind of stuff to be in-sync with the server, but not graphics related stuff??

Re: I had an interesting conversation (Programmers step in)

Posted: Sun Oct 21, 2012 4:35 pm
by Ramihyn_
There usually is a "launcher" program which keeps the client up to date and starts the game executable. I was refering to that launcher, so it keeps the client up to date and then starts the game. During the gameplay, the shaders/scripts/models/movies/textures/sound etc are loaded from the clients storage media and not from the server obviously.

Streaming/cloud services like OnLive are a different story.

Re: I had an interesting conversation (Programmers step in)

Posted: Mon Oct 22, 2012 11:30 pm
by Zach
Ah, OK. Sorry for misunderstanding.