Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: The E on August 12, 2012, 03:15:10 pm

Title: Codethulhu spotted in the wild
Post by: The E on August 12, 2012, 03:15:10 pm
So, I decided to give Visual Studio 2012's dependency analyzer a try. Gave it the simple task of analyzing all the things in FSO's code.lib.

I did not receive clarity. What I did receive, however, was a glimpse at the shape of Codethulhu (forever closed be his braces).

I wanted to lvlshot this, but decided against it. There's no reason to destroy the sanity of people who are just passing by. However, if you think you posess the mental fortitude necessary, here's a link:

http://blueplanet.fsmods.net/E/pics/depgraph.xps.1.png
Title: Re: Codethulhu spotted in the wild
Post by: sigtau on August 12, 2012, 03:25:20 pm
You guys weren't kidding when you use the adjective "spaghetti."

(http://sourcemaking.com/files/sm/images/spagett.jpg)
Title: Re: Codethulhu spotted in the wild
Post by: Rodo on August 12, 2012, 04:08:26 pm
That's so frikking messed up.
Title: Re: Codethulhu spotted in the wild
Post by: LHN91 on August 12, 2012, 04:09:50 pm
Viewing the image and resizing it several times actually managed to completely freeze my computer.

Apparently it is dangerous to even glimpse the shape of Codethulu.
Title: Re: Codethulhu spotted in the wild
Post by: z64555 on August 12, 2012, 04:27:39 pm
Well it doesn't look so bad from afar. Lets zoom in and... OH GOD!!!  :shaking:

The blob in the middle... you can't even distinguish which link goes where.
Title: Re: Codethulhu spotted in the wild
Post by: headdie on August 12, 2012, 04:31:31 pm
Apparently just processing Codethulu has traumatised my computer as chrome just loads a blank white image and Gimp locks up and even now it is running slower than it should  :eek2:
Title: Re: Codethulhu spotted in the wild
Post by: pecenipicek on August 12, 2012, 05:34:24 pm
Oh sweet jesus run away!
Title: Re: Codethulhu spotted in the wild
Post by: Oddgrim on August 12, 2012, 06:17:58 pm
hah! so this is what unfiltered madness looks like.
I do not envy what you coders got to work with!
Title: Re: Codethulhu spotted in the wild
Post by: Spoon on August 12, 2012, 07:30:27 pm
Ye gods... :eek2:
Title: Re: Codethulhu spotted in the wild
Post by: Droid803 on August 12, 2012, 07:52:00 pm
A wild codet̬͇̫̗̠̅ͯ̉̀̈́ẖ̘̞͕͎͋̕u̯͗̂̊͗͋͞l̼̼̯̟ͬ̏̉́̾ͦ͞h̖̒́ͮ̄̕u̠͘ ̡̻̖ą̲p̸̱̥̫̮̩͉̍ͭͬ̃̃ͩͅp̠̬͎̲̫ͥ́͌ͤ͒ͅe͗ͪͮ͛̊̈́҉͕͕̘aͧ͌̄҉͕ȓ̠̩̯̗ͣ͋è͒ͥ̌̽d̙͚̰͖͈̬̠̃̚!̳̅̇ͤͦ


FIGHT
BAG
PKMN
>RUN
Title: Re: Codethulhu spotted in the wild
Post by: TwentyPercentCooler on August 12, 2012, 08:02:05 pm
Dear lord, I'm not even a coder and that looks terrifying.  :shaking:
Title: Re: Codethulhu spotted in the wild
Post by: SypheDMar on August 12, 2012, 10:25:51 pm
Apparently just processing Codethulu has traumatised my computer as chrome just loads a blank white image
Same here. Can't see a thing. :sigh:
Title: Re: Codethulhu spotted in the wild
Post by: sigtau on August 12, 2012, 10:29:43 pm
Open it in Firefox or (God forbid) IE if you have it on-hand.
Title: Re: Codethulhu spotted in the wild
Post by: z64555 on August 12, 2012, 10:30:31 pm
Or just wait a minute or two :P
Title: Re: Codethulhu spotted in the wild
Post by: yuezhi on August 12, 2012, 11:58:34 pm
(http://25.media.tumblr.com/tumblr_m5x61mD1Bk1qzscldo1_500.gif)
Title: Re: Codethulhu spotted in the wild
Post by: NGTM-1R on August 13, 2012, 12:13:22 am
I see the truth now! IA! IA! TAYLOR FTHAGH!
Title: Re: Codethulhu spotted in the wild
Post by: z64555 on August 13, 2012, 12:27:18 am
Hmm. I must be immune to the effects of codethulhu...  :confused:
Title: Re: Codethulhu spotted in the wild
Post by: MatthTheGeek on August 13, 2012, 12:38:10 am
The pic is 14k * 9k pixels. Long load times are to be expected.
Title: Re: Codethulhu spotted in the wild
Post by: Quanto on August 13, 2012, 12:47:02 am
So, um... What does a professionally programmed piece of software (of similar size and breadth) look like? For comparison's sake.
Title: Re: Codethulhu spotted in the wild
Post by: niffiwan on August 13, 2012, 12:48:38 am
Perhaps StarShatter would be a good comparison, with source readily available?
Title: Re: Codethulhu spotted in the wild
Post by: MatthTheGeek on August 13, 2012, 12:51:11 am
I think it's less about "professionally programmed" and more about "object-oriented".
Title: Re: Codethulhu spotted in the wild
Post by: Crybertrance on August 13, 2012, 04:15:24 am
Dman...That blob in the middle?!? :jaw: OH THE HORROR! :shaking:
Title: Re: Codethulhu spotted in the wild
Post by: Dragon on August 13, 2012, 05:28:55 am
Talk about spaghetti logic. Or in this case, spaghetti lack of logic. :)
Title: Re: Codethulhu spotted in the wild
Post by: The E on August 13, 2012, 12:27:15 pm
I think it's less about "professionally programmed" and more about "object-oriented".

Indeed. That blob you see there is the result of 10 years of mostly sound software engineering decisions; this particular form of graph is just the worst possible way of trying to visualize it. If you were to analyze the various subsystems within FSO, the result would look much clearer. It's only when everything is combined into one giant block of stuff that Codethulhu (May his syntax always be valid) appears.

EDIT: For the record, this is Starshatter: http://blueplanet.fsmods.net/E/pics/ssdep.xps.1.png

It looks a lot cleaner to a first approximation, but that cleanness is only due to Starshatter being a one-man project for most of its life, and one that was C++ from the beginning.
Title: Re: Codethulhu spotted in the wild
Post by: Mastadon on August 13, 2012, 01:54:27 pm
Damn, that looks worse than a ball of yarn after my cat is finished playing with it!
Title: Re: Codethulhu spotted in the wild
Post by: assasing123 on August 13, 2012, 02:24:57 pm
Do homeworld 1!!!!!! :D source is available!
on another note... WTF is that!_ I swear to god I never saw such an atrocity! my eyes are bleeding u.u
Title: Re: Codethulhu spotted in the wild
Post by: z64555 on August 13, 2012, 02:52:45 pm
I think it's less about "professionally programmed" and more about "object-oriented".

Indeed. That blob you see there is the result of 10 years of mostly sound software engineering decisions; this particular form of graph is just the worst possible way of trying to visualize it. If you were to analyze the various subsystems within FSO, the result would look much clearer. It's only when everything is combined into one giant block of stuff that Codethulhu (May his syntax always be valid) appears.

EDIT: For the record, this is Starshatter: http://blueplanet.fsmods.net/E/pics/ssdep.xps.1.png

It looks a lot cleaner to a first approximation, but that cleanness is only due to Starshatter being a one-man project for most of its life, and one that was C++ from the beginning.

Um... There are nodes that are not named. Censorship or conspiracy by VS'12?  :nervous:
Title: Re: Codethulhu spotted in the wild
Post by: The E on August 13, 2012, 02:58:18 pm
My guess is derp.
Title: Re: Codethulhu spotted in the wild
Post by: Mongoose on August 13, 2012, 03:26:18 pm
Codethulhu just about managed to lock up Windows' image viewer.  Clearly his evil tentacles have great reach.
Title: Re: Codethulhu spotted in the wild
Post by: Droid803 on August 13, 2012, 06:37:12 pm
Um... There are nodes that are not named. Censorship or conspiracy by VS'12?  :nervous:

There are things written there which the mortal mind cannot comprehend.
Title: Re: Codethulhu spotted in the wild
Post by: z64555 on August 13, 2012, 06:43:54 pm
Yeah, well at least my laptop's face didn't melt when it opened the .png. :P
Title: Re: Codethulhu spotted in the wild
Post by: Cobra on August 14, 2012, 12:15:53 am
y'know, the FS2 code looks like something exploding.
Title: Re: Codethulhu spotted in the wild
Post by: yuezhi on August 14, 2012, 12:55:52 am
and i guess somewhere it says "Nuke was here".
Title: Re: Codethulhu spotted in the wild
Post by: asyikarea51 on August 14, 2012, 05:35:47 am
Aaaaaaaaaaaaaand my Firefox breaks 75% into the picture load.

Is that codethulhu or the Milky Way...~~~~??? :banghead: :lol:
Title: Re: Codethulhu spotted in the wild
Post by: FireSpawn on August 14, 2012, 07:19:21 am
Ph'nglui mglw'nafh Codethulhu R'lyeh wgah'nagl fhtagn
Title: Re: Codethulhu spotted in the wild
Post by: chief1983 on August 14, 2012, 04:13:39 pm
If you're looking for an example of 'good code', I'd look for volunteer, NFP projects, not built with a budgeted timeline in mind.  Deadlines are what lead to the corner cutting that gives you that kind of messy code.  Although, Doom 3's source might be a good example, as the engine itself is developed more to Carmack's personal will from what I understand.
Title: Re: Codethulhu spotted in the wild
Post by: jg18 on August 14, 2012, 10:32:42 pm
Just in case someone hasn't seen it...

(http://imgs.xkcd.com/comics/good_code.png) (http://xkcd.com/844/)



Indeed. That blob you see there is the result of 10 years of mostly sound software engineering decisions; this particular form of graph is just the worst possible way of trying to visualize it. If you were to analyze the various subsystems within FSO, the result would look much clearer. It's only when everything is combined into one giant block of stuff that Codethulhu (May his syntax always be valid) appears.
If you're looking for an example of 'good code', I'd look for volunteer, NFP projects, not built with a budgeted timeline in mind.  Deadlines are what lead to the corner cutting that gives you that kind of messy code.  Although, Doom 3's source might be a good example, as the engine itself is developed more to Carmack's personal will from what I understand.

Reading these gave me an idea: The E, could you try running the dependency analyzer on the original :v: code (or the closest we can get to that), maybe SVN r5 (http://svn.icculus.org/fs2open?view=rev&revision=5)? I wonder how it'll compare.
Title: Re: Codethulhu spotted in the wild
Post by: Nuke on August 17, 2012, 07:18:42 pm
and i guess somewhere it says "Nuke was here".

yea i leave my name all over my bits of code, just so people know who to blame when it eventually goes horribly, horribly wrong.
Title: Re: Codethulhu spotted in the wild
Post by: yuezhi on August 17, 2012, 11:11:50 pm
don't feel too bad about it. i believe this is the year we all should realize stuff like this was all for the greater good. otherwise i'd rather blame reds than give you credit. :P
Title: Re: Codethulhu spotted in the wild
Post by: redsniper on August 20, 2012, 09:48:51 am
... i'd rather blame reds than give you credit. :P

I don't know what you're talking about! :nervous:
Title: Re: Codethulhu spotted in the wild
Post by: Woolie Wool on September 03, 2012, 11:42:50 pm
Oh my god, it looks...it looks...LIKE A REAPER.

...

RUDIMENTARY CREATURES OF BLOOD AND FLESH. YOU TOUCH MY SOURCE HIERARCHY, FUMBLING IN IGNORANCE, INCAPABLE OF UNDERSTANDING. THERE IS A REALM OF EXISTENCE SO FAR BEYOND YOUR OWN YOU CANNOT EVEN IMAGINE IT. I AM BEYOND YOUR COMPREHENSION. I AM FREESPACE 2 OPEN.
Title: Re: Codethulhu spotted in the wild
Post by: Valathil on September 04, 2012, 04:03:40 am
ASSUMING DIRECT CONTROL
Title: Re: Codethulhu spotted in the wild
Post by: Cobra on September 04, 2012, 04:05:35 am
That was Harbinger, not a Reaper. :nervous:
Title: Re: Codethulhu spotted in the wild
Post by: MatthTheGeek on September 04, 2012, 04:10:31 am
....

All of my wat.

Harbinger IS a Reaper.
Title: Re: Codethulhu spotted in the wild
Post by: Cobra on September 04, 2012, 04:11:17 am
DERP. That's what I get for posting at 3AM.
Title: Re: Codethulhu spotted in the wild
Post by: Woolie Wool on September 04, 2012, 09:02:54 am
And you're both wrong, because I quoted Sovereign, not Harbinger.
Title: Re: Codethulhu spotted in the wild
Post by: MatthTheGeek on September 04, 2012, 09:06:44 am
And you are mistaken, because we were answering to Valathil, who quoted Harbinger.
Title: Re: Codethulhu spotted in the wild
Post by: Valathil on September 04, 2012, 09:08:19 am
WRONG Harbinger QUOTES ME HOW DARE YOU ASSUME OTHERWISE
Title: Re: Codethulhu spotted in the wild
Post by: Luis Dias on September 04, 2012, 11:20:16 am
In soviet russia... oh nevermind
Title: Re: Codethulhu spotted in the wild
Post by: yuezhi on September 04, 2012, 05:11:11 pm
... i'd rather blame reds than give you credit. :P

I don't know what you're talking about! :nervous:
you're innocent if you deny that you've holed up your slaves in a gulag so i don't mean you.
Title: Re: Codethulhu spotted in the wild
Post by: kev11106 on September 06, 2012, 11:53:56 pm
As a coding noob(never have), the question becomes does Codethulhu impede the engine itself of just the streamlined understanding of it?
Title: Re: Codethulhu spotted in the wild
Post by: z64555 on September 07, 2012, 12:23:57 am
As a coding noob(never have), the question becomes does Codethulhu impede the engine itself of just the streamlined understanding of it?

Both, really. the fact that nothing is particularly streamlined in FSO makes it difficult to maintain and upgrade. Additionally, there's no telling if the algorithms are the best they can be.
Title: Re: Codethulhu spotted in the wild
Post by: kev11106 on September 08, 2012, 02:50:32 am
Starbreeze studios, the makers of the Riddick games, have used their proprietary engine(which to me is one of the best dx9 engines out there) for roughly 12 years but after the release of "Syndicate", which was released a couple of months ago, they retired the engine and did not upgrade to dx11 citing "code bloat"(of course, the head of the company and lead programmer left as well). Is FSO in danger of this? 
Title: Re: Codethulhu spotted in the wild
Post by: The E on September 08, 2012, 03:20:43 am
I don't think so. We are not making an all-purpose engine a la Unreal here; staying focussed on what the engine does best and then adding new gameplay logic, bugfixes, and the occasional graphics features means that we're not in danger of succumbing to big feature creep.

That being said, when looking at Codethulhu (may his memory never leak), it is important to note that the tool used to generate the picture was basically running with wrong settings for FSO's structure; if you analyze any of the bigger subsystems the picture becomes much clearer, and the code much more maintainable.
Title: Re: Codethulhu spotted in the wild
Post by: Mongoose on September 15, 2012, 10:11:20 pm
I recently used Codethulhu, or at least his perhaps slightly-less terrifying former self in the guise of the original source code release, as an example of how retail game engines can be a total mess and make fixing certain bugs extremely difficult.  Actually the exact example I used was that memorable incident that cost Battman his blood. :D
Title: Re: Codethulhu spotted in the wild
Post by: haloboy100 on September 16, 2012, 01:03:19 am
Pssh, I loaded that ***** in like 5 seconds.



Didn't make it any less hideous, though.