Page 1 of 2

Rewrite the code!

Posted: Mon Jul 09, 2007 1:13 pm
by Tim
D2X-XL needs a massive code cleanup. The best way to do this?

SCRAP THE CODE AND START FROM SCRATCH!

Results:
Overall less code
Easier to understand code
Eliminate over 80% of bugs
Drastically speed up game
Easier to add new features
New features will cause less bugs

This would be PERFECT for D2X-XL 2.0.0!!
Of course this might take months to do, but I don't thing anyone will mind.

Lets make a petition!

Posted: Mon Jul 09, 2007 1:24 pm
by Krom
Uhmm no... Not only is the idea unrealistic, but it is unreasonable too. Do you have any idea how much work that would be?

Posted: Mon Jul 09, 2007 1:33 pm
by Testiculese
Haha! He said months... Well, wait, 60 months...yea that's about right. Do you have 60 months to spare, Diedel?

Posted: Mon Jul 09, 2007 1:57 pm
by Diedel
Not for D2X-XL. :lol:

Tim, you really have no clue what you are talking of.

Ok Tim, here's the deal: You give me 5 million Euros and 3 years, and I'll create a brand new Descent like game in the style of Descent 1/2.

Re:

Posted: Mon Jul 09, 2007 2:36 pm
by Krom
Diedel wrote:Not for D2X-XL. :lol:

Tim, you really have no clue what you are talking of.

Ok Tim, here's the deal: You give me 5 million Euros and 3 years, and I'll create a brand new Descent like game in the style of Descent 1/2.
XD word!

Posted: Mon Jul 09, 2007 2:52 pm
by Diedel
You know how I'd do it?

I'd just offer id Software the 5M Euros to build the game for me ... :roll:

Posted: Mon Jul 09, 2007 3:11 pm
by Kyouryuu
You don't just wake up one morning and decide \"Hey, I'm going to rewrite a game from scratch!\" :P

Posted: Mon Jul 09, 2007 4:25 pm
by Aus-RED-5
ROTFLMAO!

Nice try Tim, ummm no. :roll:

I like Diedel's idea better. ;)

Posted: Mon Jul 09, 2007 4:51 pm
by Diedel
Nice avatar, Aus-RED. :)

Posted: Mon Jul 09, 2007 6:12 pm
by Kilarin
Tim wrote:Of course this might take months to do, but I don't thing anyone will mind. Lets make a petition!
This is a GREAT idea! But you don't need a petition Tim, just go for it! Projects like this work better solo anyway. If it would take a team a few months to recode from scratch, surely you could do it in a year?

I look forward to seeing your new game around July of 2008!

Oh, and keep us updated on your progress! I'm certain you can work in running a web site and a nice little forum in there! :)

Re:

Posted: Mon Jul 09, 2007 8:34 pm
by Aus-RED-5
Kilarin wrote:
Tim wrote:Of course this might take months to do, but I don't thing anyone will mind. Lets make a petition!
This is a GREAT idea! But you don't need a petition Tim, just go for it! Projects like this work better solo anyway. If it would take a team a few months to recode from scratch, surely you could do it in a year?

I look forward to seeing your new game around July of 2008!

Oh, and keep us updated on your progress! I'm certain you can work in running a web site and a nice little forum in there! :)
x2!

Posted: Mon Jul 09, 2007 8:39 pm
by Krom
This thread rocks. :P

Posted: Mon Jul 09, 2007 8:48 pm
by Pumo
:D :) :lol: :) :D :o :lol: :D :) :( :) :? :D

ROFLMAO! LOL! ROFL! LMAO!

....

Now, it's time to be serious....

Tim, your idea might be good in the world of the dreams or if Diedel was not a single person, but a gaming developer company named 'Diedelsoft 3D industries' :lol:

And of course, that company would need employes, and money to pay them, and blah, blah, blah...

So, at this time, enjoy D2X-XL as is or wait for Core Decision! :wink:

Anyway, your intentions are good enough, but sadly, not possible in the real world... sorry :(

Re:

Posted: Mon Jul 09, 2007 9:34 pm
by Aus-RED-5
Krom wrote:This thread rocks. :P
It does and I should sticky it, but I won't. hehe :lol: :P :P :P

Posted: Tue Jul 10, 2007 9:54 am
by Tim
I would soooo do it if I knew C++ and the D2X-XL code as well as diedel does. I was planning on doing it to Spacewar GM until I found out that I was the only one playing it.
I am not saying to rewrite D2X-XL from memory, simply rewrite it how YOU would have written it with all the knowledge you have now.
Lest say someone gave you a circut board that does something cool. Then you add a wire to make it do something even cooler. Then you make another small circut and connect it using some wires. You keep updading it until there are so many wires that you can't see the board. If you keep this up, the D2X-XL code will become soo confusing, you will have tons of bugs and no way to find them. Make a new board containing everything you have done so far.

Posted: Tue Jul 10, 2007 10:02 am
by Kilarin
Tim wrote:I would soooo do it if I knew C++
It's a bigger project than you understand Tim.
Yes, in theory you are correct, sometimes starting over is a good idea. What you don't realize is the size and complexity involved in a project like this. It's a much, much, much bigger task than you think.

Posted: Tue Jul 10, 2007 10:06 am
by Testiculese
Try that with 40,000 wires.

Posted: Tue Jul 10, 2007 10:13 am
by Tim
40,000 wires? Whoever put that many in without staring over was a real idiot and is now screwed.

Posted: Tue Jul 10, 2007 11:12 am
by d3jake
You're asking somebody to do something that would take alot of their time and energy, and now you insult him? You better start learning C++ if you ever want to have this see the light of day.

Re:

Posted: Tue Jul 10, 2007 11:32 am
by Krom
Tim wrote:40,000 wires? Whoever put that many in without staring over was a real idiot and is now screwed.
No, you don't get it. The D1/D2 source probably started out at the equivilent of 100,000 wires, and Diedel put a lot of effort into adding/improving/fixing things in that huge jumble already. Don't automatically assume that finished game programming is going to be all flawless logic computer science perfection. The D1/D2 source was quite a fugly bug ridden hack job right from the start.

Posted: Tue Jul 10, 2007 12:03 pm
by Kilarin
Tim wrote:40,000 wires? Whoever put that many in without staring over was a real idiot and is now screwed.
You really need to learn some programming, and get a concept of the scale programming projects can reach before you can grasp what you are actually talking about.

I fix programming bugs for a living. And I'm telling you that the size and complexity of something as mindless as a billing system is simply unbelievable. A 3D game can be much worse. And that's assuming it's written on top of an already complex 3D rendering engine.

If you don't have any (or much) programming experience, trying to tell experienced programmers that they don't understand whether something is simple or complex is like someone who can only beat out chopsticks on the piano telling Mahler that his symphonies should have only taken a single afternoon to write.

I'm not trying to insult you here, just trying to explain that if you don't know anything about a field, you are probably better off not trying to estimate the difficulty of project. And certainly better off not contradicting experienced people on the topic. :)

Posted: Tue Jul 10, 2007 12:36 pm
by Tim
First of all, I was not attempting to insult any real person in that last post, I just highly doubt that diedel made 40,000 modifications to code. By Krom's post, I was insulting parallax.

I aced a class on python and am now learning C++.

My method of programming is to whip up a program that basically does what I want, then use all the knowlage that I gained to start over and create a less buggy and more adaptable program.

No one even downloaded Spacewar GM, big surprise...

Re:

Posted: Tue Jul 10, 2007 12:48 pm
by Lothar
Tim wrote:My method of programming is to whip up a program that basically does what I want, then use all the knowledge that I gained to start over and create a less buggy and more adaptable program.
This is called "code refactoring". It's pretty much the expected method for good programmers... not necessarily refactoring the whole program, but at least individual sections of it.

Doesn't mean it always happens, though. Especially not with a deadline, which is what D1 and D2 both had.

What Diedel is doing right now consists of refactoring and enhancing the code. He hasn't rewritten the whole thing from scratch, but he's rewritten a lot of it.

Posted: Tue Jul 10, 2007 12:52 pm
by Testiculese
That method won't last once you get into the workforce. I work on a project that has 239,469 lines of code...in one executable(I just looked). This project also has 693 DLL's at 3-5,000 lines of code each. Then there are the stored procedures. We have 2,869 stored procedures of various sizes, and 996 database tables. Then there is the entire web-based portion of the application that (thankfully) uses some of the same DLL's, but not really. I don't know how many lines of code there are in any of the web projects except the ones I've written, and they hit about 10,000 combined.

We tighten things up as we can, but with deadlines coming at you like a freight train, you have to make it work. Function over form, unlike everything else in America.

Re:

Posted: Tue Jul 10, 2007 12:55 pm
by MD-2389
Tim wrote:40,000 wires? Whoever put that many in without staring over was a real idiot and is now screwed.
You do realize what a mess the source code is don't you? The fact that Diedel can make heads or tails of it is nothing short of amazing. What your asking is for someone to redesign the game from scratch. I don't think you seriously understand how long that would take. It'd be like trying to rebuild the space shuttle from scratch. (Ok, maybe not THAT bad, but you get the idea.)

Posted: Tue Jul 10, 2007 1:23 pm
by Tim
Testiculese, what does that program do?

Posted: Tue Jul 10, 2007 2:37 pm
by Diedel
Tim,

as I said: You have no clue of what you're talking about.

Lothar is right, I did a lot of refactoring the code. I have cleaned it up, optimized it, and removed a lot of bugs. The program has not become more messy through my changes, but less messy.

To recreate D2X-XL, you'd need to code a completely different engine, making use of modern gfx technology as offered by OpenGL 3.

If you would do that, you'd also want to have new textures, new music and new sound, and then you don't have any levels, so you'd also need to create tools for that - and that's where the work really is. John Carmack wrote the DOOM3 engine in a few months, but the entire game took years to make.

It would probably even make more sense to mod an existing game, like the guys from Into Cerberon are doing (who didn't want me on their team - too bad,or it would probably be already finished, at least as far as the coding is concerned).

Actually there is a project where one guy started to write a Descent 2 clone from scratch using Direct X, and has come pretty far. It is called Deep World. But I suppose this project will never be finished, as the author has finished studying and has a job now. He also doesn't seem to be willing to disclose his source code, or make it GPL or OpenSource, so that other people may finish his work. What a waste of a good effort and a lot of time.

Posted: Tue Jul 10, 2007 4:06 pm
by Testiculese
Tim wrote:Testiculese, what does that program do?
It's an employee benefits enrollment application. It presents a visual guide to enrolling in employer benefits like life insurance, dental, vision, loss of work...It handles dozens of policies for ING, AIG, Kanawha, Protective and others. It replaces the paper insurance application you would fill out when you get hired by a company. Instead, an enroller brings a laptop and sits with each employee and outlines the coverages, the amounts and all the extras that are tied to policies using real-time adjustable quotes (so they can see what they can buy with $x a week for instance) and visuals like slideshows, video and audio. It tracks tons of data, and synchronizes each laptop to central servers every day.

Posted: Tue Jul 10, 2007 5:04 pm
by Pumo
... And all that stuff of the program of Testiculese, takes only a bit of the effort compared to make a game from scratch (and the effort of testiculese is a lot!)...

Re:

Posted: Tue Jul 10, 2007 8:42 pm
by Duper
MD-2389 wrote:
Tim wrote:40,000 wires? Whoever put that many in without staring over was a real idiot and is now screwed.
You do realize what a mess the source code is don't you? The fact that Diedel can make heads or tails of it is nothing short of amazing. What your asking is for someone to redesign the game from scratch. I don't think you seriously understand how long that would take. It'd be like trying to rebuild the space shuttle from scratch. (Ok, maybe not THAT bad, but you get the idea.)
wait.. did MD just compliment Diedel!!?! o_0

;)

Posted: Tue Jul 10, 2007 11:48 pm
by Ferno
he gave credit where credit is due.

Posted: Wed Jul 11, 2007 12:05 am
by d3jake
I knew that it would take something strange to bring them together. Isn't it cute?

Posted: Wed Jul 11, 2007 1:54 am
by Diedel
It took me quite a while to comprehend certain parts of the code (partially due to the lack of understanding of the underlying technicalities, like 3D math), but I think that I have a pretty thorough understanding of most of the program code by now.

Btw, some may not know that on top of doing D2X-XL I also rewrote DMB2, making DLE-XP out of it, which took several months by itself. I had rewritten the entire interface from scratch and recoded parts of the engine.

Then there were two big missions (Lunar Outpost Reloaded - took me weeks to build) and Boiling Point (took even more time), and my Descent site (I am really fond of the level spotlight :D).

Last big item was the redesign of all robot poly models to make them \"shadow proof\". That was blood, sweat, toil and tears ... :)

Just looking back a little at all I have done in the Descent 2 realm ... I have pretty much come to rest now, dreaming of having some money to start my own rewrite of Descent 2 or seeing whether I could fund Core Decision ... oh yeah ... :roll:

Gotta wake up. WAKE UP! :lol:

Posted: Wed Jul 11, 2007 6:20 am
by Sirius
To anyone still considering rewriting Descent 2, I recommend XNA - it will save you a lot of the work, even if it does tie you down to Microsoft. But you have to make sacrifices - Windows only (and at that recent Windows), or Linux/Mac support and much extra work?

Even that will take you a while... the game code is undoubtedly pretty huge by itself.

I looked at the Descent 1 code a while back, and tinkered with some stuff there (most of it consisting of \"hax\"); I can also understand how going on a programming course and doing fairly well can make you think \"hey this stuff is easy!\".

It isn't. That sort of programming course introduces you to the basic discipline of programming, but it doesn't prepare you for how to deal with mind-blowingly large systems on the scale of Descent. A 200-line (or even 1000-line) program is pretty easy to sort out, but if you go into several thousand lines you start to encounter new problems with managing the complexity of the system you have. Once you hit the scale of mid-90s games (tens of thousands up to maybe a hundred thousand lines of code), those problems become serious, and redesigning parts is a major undertaking. Diedel already mentioned how much time rewriting the DMB2 UI took, and that's only part of the picture.

Of course, today you have some games with tens of millions of lines of code. That's just stunning, and at that point it really is no surprise they take years to finish.

By the way, Diedel could quite possibly have made 40,000 modifications to the D2 code. He's issued hundreds of releases, and each of those would certainly have had quite a number of code changes; implementing new features and fixing bugs isn't generally a two-line affair in games.

P.S. I am not in principle against a total rewrite of the game - it could be much faster than it is - but there is the small matter of who exactly is going to do it. It's not a one-man job, at least not in a reasonable time frame.

Posted: Wed Jul 11, 2007 10:05 am
by Diedel
If I had a say in a rewrite of Descent 1/2, I'd definitely recommend using OpenGL 3. It contains all the fancy new stuff you can do with DX10, and it is free and not platform bound. Together with OpenAL, you can keep your game completely portable and quite platform and OS independent. For me, DirectX is an absolute and total no-go for the two simple reasons that it is platform and OS-bound and that it's simply M$ means for total domination in the world of computer games, and that is utterly unacceptable.

These guys sabotage every attempt at creating industry wide open standards for the sole benefit of their own revenue. I don't dislike (all) Microsoft products, but I sure as hell dislike their business attitude.

Re:

Posted: Wed Jul 11, 2007 11:18 am
by Tim
Diedel wrote:Btw, some may not know that on top of doing D2X-XL I also rewrote DMB2, making DLE-XP out of it, which took several months by itself. I had rewritten the entire interface from scratch and recoded parts of the engine.
And it works great! :lol: :wink:

Re:

Posted: Wed Jul 11, 2007 9:32 pm
by MD-2389
Duper wrote:wait.. did MD just compliment Diedel!!?! o_0

;)
Don't fall down too hard. ;) We may have our differences, but I don't have a problem giving credit where its due.

Posted: Thu Jul 12, 2007 12:03 am
by Tim
Suddenly, the word \"sticky\" seems a lot more justified. :wink:

Posted: Thu Jul 12, 2007 12:42 am
by Aus-RED-5
Not to me. :P

Re:

Posted: Thu Jul 12, 2007 9:02 am
by MD-2389
Tim wrote:Suddenly, the word "sticky" seems a lot more justified. :wink:
Yeah, and suddenly I'm leaning more towards having Lothar give you the "Rosey Palm" or "Palm of Cousin It" title. ;)