Page Index Toggle Pages: [1] 2  Send TopicPrint
Normal Topic Behind the spaghetti code (Read 6152 times)
SweetKitten
Waterworks Kobold
**
Offline


Meeow

Posts: 125
Joined: May 23rd, 2013
Behind the spaghetti code
Apr 7th, 2023 at 1:43am
Print Post  
An old dev is back and gives some insights :

Quote:
Without giving too much detail, know that Turbine developed two proprietary script languages to help abstract the multiplayer aspects of the game and solve synchronization and messaging requirements for massively multiplayer games. Having done so, a lot of modern approaches to performance profiling fall a little flat because they come down to an inconvenient fact that the game code is written almost entirely in these two proprietary languages and the last call on the stack ends up being the call into the VM. Over the last two years, we've developed profiling and analysis tools to aid us in diagnosis and fixing problems.

That being said, knowing about a problem and coming up with workable solutions can be challenging. The era under which these games were developed is VERY different from a hardware topology standpoint. These were developed during the times of single processor servers prior to broadband and when servers were not virtualized.Turbine invented its own form of compute cloud, storage solutions, and game engine. Some architectural decisions were made to minimize memory requirements because memory was rather limited and expensive which tends toward more CPU intensive solutions. Another thing to keep in mind is that post launch the game took directions that original team could never have foreseen and therefore wrote algorithms and made architectural decisions that can be a challenge given where we are now.

An example of this is can be illustrated with feats in the game. When I asked for a specification on feats for the game during early development, the design lead at the time handed me a copy of the 3.5 edition players handbook and said "This is your specification!" Cool! That's less than 100 feats and most of those are specializations and masteries. At the time, network speeds were not as fast as they are now and serializing a player across a server boundary was considered very expensive, so we jumped through hoops to compress information on the player. We were operating under the impression that like other MMOs we would have cross server boundary combat akin to WoW and LOTRO. (This was prior to deciding upon the instanced model of content that DDO later adopted.) Some algorithms literally walk through every possible feat in the game with a certain category and check if you have that bit set which at launch was a quite small number. We did not envision a design team solving the problem of advancement at a less macro level by using feats as the workhorse they have become. Initially, those small iterative pathways were not a performance issue and no one batted an eye at that n squared algorithm. We had some coding standards to keep certain pathways from crossing to keep it from becoming a performance issue like "feats don't modify effect properties" and "effects don't modify feat properties". So that feats could cache their bonuses and not have to be re-calculated except on logon and advancement. At some point, one of the developers fixed a bug where feats and effects weren't stacking per the player's handbook crossing that stream because nobody was left from the original combat team to stop them. So then every time an effect touched one of these properties, it had to rebuild this value iterating over all the possible feats that could touch it. An n squared algorithm became n cubed. At the time, it wasn't that big of a performance hit because we didn't have 485 refreshed bonus properties and 7000+ potential feats. LOL... just gave too much detail.

So this fix is very much a fix fighting against the very architecture under which the feat system was designed. This is just one example... performance on projects this massive isn't just one big issue. I always say performance on these projects is death by a million paper cuts and only through steady applied pressure and paying our technical debts by carefully changing what is prudent and testable, we can improve performance. This change has been a long time coming with a lot of different rounds of testing and finding a lot of peculiar and stumping problems along the way. This change has been silently tried on Lamannia a few times running the new code in tandem with the old code and cross checking the results to find errors. This time, we felt like we are getting close enough to release with it and decided to turn off the old code pathways and see what issues popped up.

I'm super grateful for the fans that have kept this franchise going and we aspire to be worthy of your patience and loyalty to this product. I hope this change is successful and brings greater joy to gameplay. We are painfully aware that there is a long way to go when it comes to performance fixes on the client and server and we have to balance that against new feature development and tech rot associated with tools and technologies written 15 years ago. I hope this explanation is somewhat illuminating and I would kindly ask that those in the community not assign incompetence or malfeasance to the developers at SSG. There are many of us who were there in the early years who have come back and a lot of new faces. Everyone here really cares about the products and we really care about our players and the longevity of the franchise. We are human and make mistakes. Games like this have a burden of legacy systems and data that sometimes make it hard to anticipate the halo of changes when they are made.

I don't tend to surface often because I'm hella busy and when I worked for the games previously I spent a little too much time on the forums and got myself in trouble with work/life balance. It is nice that somebody remembered me from my "Doghouse" thread days. We still have the castle bed and four more children have enjoyed it since that time. I have really good memories of having such a collaborative working relationship with the fans of the game. I'll try to surface more often so long as we can keep the vibe constructive. However, I must say that you, my boss, and coworkers would rather me spend my time working on the game than chatting on the forums.
  
Back to top
 
IP Logged
 
eighnuss
Epic Poster
*****
Offline


ด้้้้้ ͩͩͩͩͩͩͩͩͩͩ
ͩͩͩͩͩͩ

Posts: 3468
Location: ด้้้้้็็็็็้้้้้็็็็็  ͩͩͩͩͩͩͩ
Joined: Jan 30th, 2013
Re: Behind the spaghetti code
Reply #1 - Apr 7th, 2023 at 4:17am
Print Post  
BRO WHAT YOU GUYS DONT UNDERSTAND IS THAT WHEN WE FIRST ATTACHED 2 HORSES TO OUR WAGON WE DID NOT EXPECT 70% OF AMERICANS TO BECOME OBESE AND THEN A NEW DEV MR FORD PUT AN ENGINE INTO IT BUT WE DIDNT EXPECT THE WOODEN WHEELS TO BECOME AN ISSUE FROM THE ADDED TORQUE AND EVEN THO ITS 2023 AND EVERY OTHER COMPANY HAS MADE PROGRESS SUCH AS RIMS AND TIRES AND SUSPENSION OUR WAGON WAS NOT DESIGNED WITH THIS TECHNOLOGICAL TOPOLGY IN MIND WHICH IS WHY YOU NEED TO UNDERSTAND THAT THE HORSE AND BUGGY IS STILL PRETTY GOOD DESPITE ALTERNATIVE OPTIONS.
  

ͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩDISCLAIMER: This post is provided �as is� for informational purposes only. The Department of Vault
Security (DVS) does not provide any warranties of any kind regarding any information contained within. DVS
does not endorse any commercial product or service referenced in this post or otherwise.
Back to top
 
IP Logged
 
Flav
Vault Frog
*
Online


One Frog to Rule them
All!

Posts: 9961
Location: Land of the Frogs
Joined: Aug 29th, 2010
Gender: Male
Re: Behind the spaghetti code
Reply #2 - Apr 7th, 2023 at 3:10pm
Print Post  
I can understand the hardware side, even if at that time servers were already multi processors and it wasn't uncommon to have 4 procs in a server. ( hell, you could find dual procs mainboards for high end home PCs at semi-decent prices )

Windows 2000 could handle up to two processors in it's normal incarnation ( the one people had at that time ) and the Advanced Server version could handle more processors. ( i can't tell for the other versions, I didn't get to play with them )

But theres a point that irks me :

SweetKitten wrote on Apr 7th, 2023 at 1:43am:
Some algorithms literally walk through every possible feat in the game with a certain category and check if you have that bit set which at launch was a quite small number


Routers and Firewalls have been going ( respectively ) through routing tables and firewall rules sequentially for ages and nobody notices it... so going through feats sequentially is not a good reason.
( and trust me, routing tables and firewall rules are more numerous and usually harder to parse than a check if a flag is set. )
« Last Edit: Apr 7th, 2023 at 3:14pm by Flav »  

Yes my avatar is an Hermine eating a Greenland Lemming for brunch.
Back to top
 
IP Logged
 
noamineo
Completionist (i.t.p.)
******
Offline


All men fear time, but
time fears the pyramids

Posts: 8874
Location: Titan
Joined: Jul 2nd, 2014
Re: Behind the spaghetti code
Reply #3 - Apr 7th, 2023 at 11:02pm
Print Post  
Flav wrote on Apr 7th, 2023 at 3:10pm:
I can understand the hardware side, even if at that time servers were already multi processors and it wasn't uncommon to have 4 procs in a server. ( hell, you could find dual procs mainboards for high end home PCs at semi-decent prices )

Windows 2000 could handle up to two processors in it's normal incarnation ( the one people had at that time ) and the Advanced Server version could handle more processors. ( i can't tell for the other versions, I didn't get to play with them )


You're not thinking far enough back. Remember DDO's code is based on Asheron's Call, so we are talking server architecture from the mid-to-late 90s, not the early 2000s. Multi-processor servers did exist; but at the time it made more sense to use 1 cpu to run the OS/network, and the other to run the actual server application. Hence DDO was written to be single-threaded.
  

I'll never understand the propensity of people to brag about being good at a video game. Its a toy you play with for fun. The only person who should be proud of you is your mother. If you're 3.
Back to top
 
IP Logged
 
Flav
Vault Frog
*
Online


One Frog to Rule them
All!

Posts: 9961
Location: Land of the Frogs
Joined: Aug 29th, 2010
Gender: Male
Re: Behind the spaghetti code
Reply #4 - Apr 8th, 2023 at 2:57pm
Print Post  
noamineo wrote on Apr 7th, 2023 at 11:02pm:
You're not thinking far enough back. Remember DDO's code is based on Asheron's Call, so we are talking server architecture from the mid-to-late 90s, not the early 2000s. Multi-processor servers did exist; but at the time it made more sense to use 1 cpu to run the OS/network, and the other to run the actual server application. Hence DDO was written to be single-threaded.


Everything was written single threaded at that time except hte OSes... and they also were single threaded since a single processor had a single thread. In Multiprocessors systems it meant that more than one process/program could run at the same time... not more than one bit of a given process could run in parallel.  Even in the mid-late 90s multiprocessor was something in server rooms.

Now you are right that DDO ( and LoTRO ) is using the same code as AC. ( the main proof is the DAT file format ).

And we know that the architecture is separated in a frontend that runs the actual game server and a backend that runs the database and probably several other things... and that for each game world there's a front end and a back end... nothing is shared. ( well was by virtualiing and putting them all on the same virtualization infrastructure they allowed for some interraction, like the automated server transfer. Before that they had to do it manually, by extracting all the character data from one server database and then injecting the extracted data into the destination server database.  )

Oh and side note : the database is MSSQL.
  

Yes my avatar is an Hermine eating a Greenland Lemming for brunch.
Back to top
 
IP Logged
 
noamineo
Completionist (i.t.p.)
******
Offline


All men fear time, but
time fears the pyramids

Posts: 8874
Location: Titan
Joined: Jul 2nd, 2014
Re: Behind the spaghetti code
Reply #5 - Apr 8th, 2023 at 6:22pm
Print Post  
Flav wrote on Apr 8th, 2023 at 2:57pm:
Oh and side note : the database is MSSQL.


MSSQL, as in MicroSoft SQL? Ugh. Is that even still under support?
  

I'll never understand the propensity of people to brag about being good at a video game. Its a toy you play with for fun. The only person who should be proud of you is your mother. If you're 3.
Back to top
 
IP Logged
 
Standing Stone Games
Abbot Raider
**
Online


I Love DDO & LotRO!

Posts: 960
Location: Needham, MA
Joined: Jan 12th, 2017
Re: Behind the spaghetti code
Reply #6 - Apr 8th, 2023 at 7:09pm
Print Post  
noamineo wrote on Apr 8th, 2023 at 6:22pm:
MSSQL, as in MicroSoft SQL? Ugh. Is that even still under support?

SQL Server 2022 is the most recent version.
  

We invite you to explore our games, which hold the promise of depth, scope, and unlimited imagination!

Our phone # is (858) 239-0663. We enjoy hearing from our fans!
Back to top
IP Logged
 
Oracler
Titan Demolisher
****
Offline


Sploits! omnomnom..

Posts: 387
Joined: Mar 17th, 2014
Re: Behind the spaghetti code
Reply #7 - Apr 12th, 2023 at 9:44am
Print Post  
SSG are fucking Amishes of IT
  

Here's a drama, There's a drama, and another little drama
Fuzzy drama, Funny drama, drama drama duck

drama drama, cheesecake drama, tablet, brick, potato, drama
drama drama mushroom drama, drama drama duck
Back to top
 
IP Logged
 
Shunned
Stormreaver Piker
*
Offline


Hi! You have multiple
personality disorder.

Posts: 501
Location: Behind the edit button
Joined: Nov 21st, 2020
Re: Behind the spaghetti code
Reply #8 - Apr 12th, 2023 at 12:29pm
Print Post  
the dev edited this post.  i wonder what he took out.
  
Back to top
 
IP Logged
 
Asheras
Completionist (i.t.p.)
******
Offline


This is why we can't have
nice things.

Posts: 10230
Location: Ohio
Joined: Jun 9th, 2010
Gender: Male
Re: Behind the spaghetti code
Reply #9 - Apr 12th, 2023 at 4:29pm
Print Post  
noamineo wrote on Apr 8th, 2023 at 6:22pm:
MSSQL, as in MicroSoft SQL? Ugh. Is that even still under support?


Apparently it is still pretty common.

https://www.statista.com/statistics/809750/worldwide-popularity-ranking-database...
  
Back to top
 
IP Logged
 
higgildypiggildy
Stormreaver Piker
*
Offline


I just mock the world

Posts: 658
Joined: Dec 8th, 2011
Re: Behind the spaghetti code
Reply #10 - Apr 13th, 2023 at 4:29am
Print Post  
I write to/from MSSQL, it's under constant development and is improving in version after version.  New major version released every 2-3 years.
  

I ain't got no mothafukkinsignature
Back to top
 
IP Logged
 
Bobbicus
Dragon Raider
***
Offline


I Love Drama!

Posts: 299
Joined: Feb 14th, 2014
Re: Behind the spaghetti code
Reply #11 - Apr 13th, 2023 at 11:44pm
Print Post  
T-SQL is bad? I hope not. I just learned it.
  
Back to top
 
IP Logged
 
noamineo
Completionist (i.t.p.)
******
Offline


All men fear time, but
time fears the pyramids

Posts: 8874
Location: Titan
Joined: Jul 2nd, 2014
Re: Behind the spaghetti code
Reply #12 - Apr 14th, 2023 at 8:32pm
Print Post  
Bobbicus wrote on Apr 13th, 2023 at 11:44pm:
T-SQL is bad? I hope not. I just learned it.


Any form of SQL is great.

There's actually nothing inherently wrong with MSSQL, it was probably best-in-slot when the foundations for DDO's code were lain down. There's just so many betters SQL servers out there I had totally forgotten about it. And I was too lazy to go look it up.
  

I'll never understand the propensity of people to brag about being good at a video game. Its a toy you play with for fun. The only person who should be proud of you is your mother. If you're 3.
Back to top
 
IP Logged
 
Flav
Vault Frog
*
Online


One Frog to Rule them
All!

Posts: 9961
Location: Land of the Frogs
Joined: Aug 29th, 2010
Gender: Male
Re: Behind the spaghetti code
Reply #13 - Apr 15th, 2023 at 2:00pm
Print Post  
noamineo wrote on Apr 14th, 2023 at 8:32pm:
Any form of SQL is great.

There's actually nothing inherently wrong with MSSQL, it was probably best-in-slot when the foundations for DDO's code were lain down.


Not really at DDO Time, at AC time, now the choices were limited : MS SQL, Sybase or Oracle. 

Sybase and MS SQL are cousins, Sybase is more for Unix servers wityh Risc hardware, and MS SQL is more for Windows stuff with x86.

Oracle license have always cost an arm, a leg, an eye, a kidney, a lung and your firstborn...

The choice was simple and probably dictated by the hardware architecture used server side.
  

Yes my avatar is an Hermine eating a Greenland Lemming for brunch.
Back to top
 
IP Logged
 
noamineo
Completionist (i.t.p.)
******
Offline


All men fear time, but
time fears the pyramids

Posts: 8874
Location: Titan
Joined: Jul 2nd, 2014
Re: Behind the spaghetti code
Reply #14 - Apr 15th, 2023 at 10:04pm
Print Post  
Flav wrote on Apr 15th, 2023 at 2:00pm:
Not really at DDO Time, at AC time


Thats what i meant by "the foundations for DDO's code" = Asheron's Call.


Flav wrote on Apr 15th, 2023 at 2:00pm:
Oracle license have always cost an arm, a leg, an eye, a kidney, a lung and your firstborn...

The choice was simple and probably dictated by the hardware architecture used server side.


Also remember that Asheron's Call was produced by Microsoft. So probably the choice had more to do with that.
  

I'll never understand the propensity of people to brag about being good at a video game. Its a toy you play with for fun. The only person who should be proud of you is your mother. If you're 3.
Back to top
 
IP Logged
 
Shunned
Stormreaver Piker
*
Offline


Hi! You have multiple
personality disorder.

Posts: 501
Location: Behind the edit button
Joined: Nov 21st, 2020
Re: Behind the spaghetti code
Reply #15 - Apr 16th, 2023 at 9:02am
Print Post  
noamineo wrote on Apr 15th, 2023 at 10:04pm:
Also remember that Asheron's Call was produced by Microsoft. So probably the choice had more to do with that.
                   

shit i forgot about that.  I wonder if they have to pay any annual costs or they get grandfathered in.  idk if ms sql has a cost to be honest
  
Back to top
 
IP Logged
 
Standing Stone Games
Abbot Raider
**
Online


I Love DDO & LotRO!

Posts: 960
Location: Needham, MA
Joined: Jan 12th, 2017
Re: Behind the spaghetti code
Reply #16 - Apr 16th, 2023 at 11:01am
Print Post  
Shunned wrote on Apr 16th, 2023 at 9:02am:
idk if ms sql has a cost to be honest

It requires licensing like any other serious Microsoft piece of software.

MS SQL licensing (on the server at least) was based on the # of CPUs the server had. IIRC, there is also licensing required for the # of users.
« Last Edit: Apr 16th, 2023 at 11:01am by Standing Stone Games »  

We invite you to explore our games, which hold the promise of depth, scope, and unlimited imagination!

Our phone # is (858) 239-0663. We enjoy hearing from our fans!
Back to top
IP Logged
 
Flav
Vault Frog
*
Online


One Frog to Rule them
All!

Posts: 9961
Location: Land of the Frogs
Joined: Aug 29th, 2010
Gender: Male
Re: Behind the spaghetti code
Reply #17 - Apr 16th, 2023 at 3:39pm
Print Post  
noamineo wrote on Apr 15th, 2023 at 10:04pm:
Thats what i meant by "the foundations for DDO's code" = Asheron's Call.



Also remember that Asheron's Call was produced by Microsoft. So probably the choice had more to do with that.


That's something I didn't know...And that's definitely a good reason to go MS SQL.

I was still playing full time Pen & Paper at that time... Online activities was mainly emails with friends and downloading anime pictures. And the eventual Neverwinter Night Play world. ( first NWN, the one with the Aurora and Linux support )

  

Yes my avatar is an Hermine eating a Greenland Lemming for brunch.
Back to top
 
IP Logged
 
Flav
Vault Frog
*
Online


One Frog to Rule them
All!

Posts: 9961
Location: Land of the Frogs
Joined: Aug 29th, 2010
Gender: Male
Re: Behind the spaghetti code
Reply #18 - Apr 16th, 2023 at 3:41pm
Print Post  
Standing Stone Games wrote on Apr 16th, 2023 at 11:01am:
It requires licensing like any other serious Microsoft piece of software.

MS SQL licensing (on the server at least) was based on the # of CPUs the server had. IIRC, there is also licensing required for the # of users.


Licensing in many products is almost always broken down into the CPU (  usually hardware, not thread ) and concurent users. That's especially true for serious MS products
  

Yes my avatar is an Hermine eating a Greenland Lemming for brunch.
Back to top
 
IP Logged
 
noamineo
Completionist (i.t.p.)
******
Offline


All men fear time, but
time fears the pyramids

Posts: 8874
Location: Titan
Joined: Jul 2nd, 2014
Re: Behind the spaghetti code
Reply #19 - Apr 16th, 2023 at 6:20pm
Print Post  
Shunned wrote on Apr 16th, 2023 at 9:02am:
shit i forgot about that.  I wonder if they have to pay any annual costs or they get grandfathered in.  idk if ms sql has a cost to be honest


They definitely have to pay yearly if not monthly and you can bet M$ jacks up the price on them every year.

Flav wrote on Apr 16th, 2023 at 3:39pm:
That's something I didn't know...And that's definitely a good reason to go MS SQL.

I was still playing full time Pen & Paper at that time... Online activities was mainly emails with friends and downloading anime pictures. And the eventual Neverwinter Night Play world. ( first NWN, the one with the Aurora and Linux support )



Funny story, I just found my original NWN disks yesterday whilst going through some old boxes. I managed to lose nearly all my old games I actually played... but not NWN.
  

I'll never understand the propensity of people to brag about being good at a video game. Its a toy you play with for fun. The only person who should be proud of you is your mother. If you're 3.
Back to top
 
IP Logged
 
Shunned
Stormreaver Piker
*
Offline


Hi! You have multiple
personality disorder.

Posts: 501
Location: Behind the edit button
Joined: Nov 21st, 2020
Re: Behind the spaghetti code
Reply #20 - Apr 16th, 2023 at 7:43pm
Print Post  
noamineo wrote on Apr 16th, 2023 at 6:20pm:
Funny story, I just found my original NWN disks yesterday whilst going through some old boxes. I managed to lose nearly all my old games I actually played... but not NWN.


I dont even have a working drive to put discs into.  I probably  can';t play any old games that require a disc be present anyway
  
Back to top
 
IP Logged
 
Soul
Shroud Slacker
***
Offline


I Love Drama!

Posts: 1121
Joined: Nov 10th, 2010
Re: Behind the spaghetti code
Reply #21 - Apr 17th, 2023 at 12:12pm
Print Post  
The Dunning–Kruger effect is strong in this thread.
  
Back to top
 
IP Logged
 
noamineo
Completionist (i.t.p.)
******
Offline


All men fear time, but
time fears the pyramids

Posts: 8874
Location: Titan
Joined: Jul 2nd, 2014
Re: Behind the spaghetti code
Reply #22 - Apr 17th, 2023 at 12:44pm
Print Post  
Shunned wrote on Apr 16th, 2023 at 7:43pm:
I dont even have a working drive to put discs into.  I probably  can';t play any old games that require a disc be present anyway


I build retro PCs for fun and have a whole box full of working optical drives both SATA and PATA. Now if I could only find all my vintage games I'd be in great shape...
  

I'll never understand the propensity of people to brag about being good at a video game. Its a toy you play with for fun. The only person who should be proud of you is your mother. If you're 3.
Back to top
 
IP Logged
 
Standing Stone Games
Abbot Raider
**
Online


I Love DDO & LotRO!

Posts: 960
Location: Needham, MA
Joined: Jan 12th, 2017
Re: Behind the spaghetti code
Reply #23 - Apr 17th, 2023 at 4:55pm
Print Post  
Soul wrote on Apr 17th, 2023 at 12:12pm:
The Dunning–Kruger effect is strong in this thread.

It is now.
  

We invite you to explore our games, which hold the promise of depth, scope, and unlimited imagination!

Our phone # is (858) 239-0663. We enjoy hearing from our fans!
Back to top
IP Logged
 
Standing Stone Games
Abbot Raider
**
Online


I Love DDO & LotRO!

Posts: 960
Location: Needham, MA
Joined: Jan 12th, 2017
Re: Behind the spaghetti code
Reply #24 - Apr 17th, 2023 at 4:58pm
Print Post  
noamineo wrote on Apr 17th, 2023 at 12:44pm:
I build retro PCs for fun and have a whole box full of working optical drives both SATA and PATA. Now if I could only find all my vintage games I'd be in great shape...

I still have a DOS/Windows 3.11 PC with a Pentium 66 MHz CPU and 16 MB of RAM. Can't remember the size of the HD but it's enough to run all my old DOS games. Really, I used it to play all those old SSI goldbox D&D games like Eye of the Beholder, Pool of Radiance, etc.

I should really dig it out of storage and set it up again.

Brings back great memories.
« Last Edit: Apr 17th, 2023 at 4:58pm by Standing Stone Games »  

We invite you to explore our games, which hold the promise of depth, scope, and unlimited imagination!

Our phone # is (858) 239-0663. We enjoy hearing from our fans!
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint