Rewrite the code!

D2X-XL - Descent II update for modern systems with many new features and enhanced graphics. Home Page

Moderators: Grendel, Aus-RED-5

Should he do it?

YES!
4
24%
NO!
10
59%
Later, not now
1
6%
Don't care
2
12%
 
Total votes: 17
User avatar
Tim
DBB Ace
DBB Ace
Posts: 39
Joined: Wed Nov 16, 2005 11:15 pm

Rewrite the code!

Post 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!
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16137
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Post 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?
User avatar
Testiculese
DBB Material Defender
DBB Material Defender
Posts: 4689
Joined: Sun Nov 11, 2001 3:01 am

Post by Testiculese »

Haha! He said months... Well, wait, 60 months...yea that's about right. Do you have 60 months to spare, Diedel?
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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.
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16137
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Re:

Post 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!
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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:
User avatar
Kyouryuu
DBB Alumni
DBB Alumni
Posts: 5775
Joined: Fri Apr 30, 1999 2:01 am
Location: Isla Nublar
Contact:

Post by Kyouryuu »

You don't just wake up one morning and decide \"Hey, I'm going to rewrite a game from scratch!\" :P
User avatar
Aus-RED-5
DBB Friend
DBB Friend
Posts: 1604
Joined: Fri Apr 23, 2004 7:27 am
Location: Adelaide, South Australia
Contact:

Post by Aus-RED-5 »

ROTFLMAO!

Nice try Tim, ummm no. :roll:

I like Diedel's idea better. ;)
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Nice avatar, Aus-RED. :)
User avatar
Kilarin
DBB Fleet Admiral
DBB Fleet Admiral
Posts: 2403
Joined: Wed Aug 07, 2002 2:01 am
Location: South of Ft. Worth Texas

Post 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! :)
User avatar
Aus-RED-5
DBB Friend
DBB Friend
Posts: 1604
Joined: Fri Apr 23, 2004 7:27 am
Location: Adelaide, South Australia
Contact:

Re:

Post 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!
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16137
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Post by Krom »

This thread rocks. :P
User avatar
Pumo
DBB Captain
DBB Captain
Posts: 779
Joined: Tue Jan 18, 2005 11:48 pm
Location: Mexico
Contact:

Post 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 :(
User avatar
Aus-RED-5
DBB Friend
DBB Friend
Posts: 1604
Joined: Fri Apr 23, 2004 7:27 am
Location: Adelaide, South Australia
Contact:

Re:

Post 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
User avatar
Tim
DBB Ace
DBB Ace
Posts: 39
Joined: Wed Nov 16, 2005 11:15 pm

Post 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.
(__/)Save Pokemon, Destroy Yu-Gi-Oh<br>(O.o )<br>(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
User avatar
Kilarin
DBB Fleet Admiral
DBB Fleet Admiral
Posts: 2403
Joined: Wed Aug 07, 2002 2:01 am
Location: South of Ft. Worth Texas

Post 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.
User avatar
Testiculese
DBB Material Defender
DBB Material Defender
Posts: 4689
Joined: Sun Nov 11, 2001 3:01 am

Post by Testiculese »

Try that with 40,000 wires.
User avatar
Tim
DBB Ace
DBB Ace
Posts: 39
Joined: Wed Nov 16, 2005 11:15 pm

Post by Tim »

40,000 wires? Whoever put that many in without staring over was a real idiot and is now screwed.
(__/)Save Pokemon, Destroy Yu-Gi-Oh<br>(O.o )<br>(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
User avatar
d3jake
DBB Admiral
DBB Admiral
Posts: 1075
Joined: Tue Dec 21, 2004 10:08 am
Location: Minnesota, USA

Post 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.
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16137
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Re:

Post 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.
User avatar
Kilarin
DBB Fleet Admiral
DBB Fleet Admiral
Posts: 2403
Joined: Wed Aug 07, 2002 2:01 am
Location: South of Ft. Worth Texas

Post 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. :)
User avatar
Tim
DBB Ace
DBB Ace
Posts: 39
Joined: Wed Nov 16, 2005 11:15 pm

Post 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...
User avatar
Lothar
DBB Ghost Admin
DBB Ghost Admin
Posts: 12133
Joined: Thu Nov 05, 1998 12:01 pm
Location: I'm so glad to be home
Contact:

Re:

Post 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.
User avatar
Testiculese
DBB Material Defender
DBB Material Defender
Posts: 4689
Joined: Sun Nov 11, 2001 3:01 am

Post 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.
MD-2389
Defender of the Night
Defender of the Night
Posts: 13477
Joined: Thu Nov 05, 1998 12:01 pm
Location: Olathe, KS
Contact:

Re:

Post 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.)
User avatar
Tim
DBB Ace
DBB Ace
Posts: 39
Joined: Wed Nov 16, 2005 11:15 pm

Post by Tim »

Testiculese, what does that program do?
(__/)Save Pokemon, Destroy Yu-Gi-Oh<br>(O.o )<br>(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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.
User avatar
Testiculese
DBB Material Defender
DBB Material Defender
Posts: 4689
Joined: Sun Nov 11, 2001 3:01 am

Post 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.
User avatar
Pumo
DBB Captain
DBB Captain
Posts: 779
Joined: Tue Jan 18, 2005 11:48 pm
Location: Mexico
Contact:

Post 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!)...
User avatar
Duper
DBB Master
DBB Master
Posts: 9214
Joined: Thu Nov 22, 2001 3:01 am
Location: Beaverton, Oregon USA

Re:

Post 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

;)
User avatar
Ferno
DBB Commie Anarchist Thug
DBB Commie Anarchist Thug
Posts: 15163
Joined: Fri Nov 20, 1998 3:01 am

Post by Ferno »

he gave credit where credit is due.
User avatar
d3jake
DBB Admiral
DBB Admiral
Posts: 1075
Joined: Tue Dec 21, 2004 10:08 am
Location: Minnesota, USA

Post by d3jake »

I knew that it would take something strange to bring them together. Isn't it cute?
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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:
User avatar
Sirius
DBB Master
DBB Master
Posts: 5616
Joined: Fri May 28, 1999 2:01 am
Location: Bellevue, WA
Contact:

Post 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.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post 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.
User avatar
Tim
DBB Ace
DBB Ace
Posts: 39
Joined: Wed Nov 16, 2005 11:15 pm

Re:

Post 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:
MD-2389
Defender of the Night
Defender of the Night
Posts: 13477
Joined: Thu Nov 05, 1998 12:01 pm
Location: Olathe, KS
Contact:

Re:

Post 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.
User avatar
Tim
DBB Ace
DBB Ace
Posts: 39
Joined: Wed Nov 16, 2005 11:15 pm

Post by Tim »

Suddenly, the word \"sticky\" seems a lot more justified. :wink:
User avatar
Aus-RED-5
DBB Friend
DBB Friend
Posts: 1604
Joined: Fri Apr 23, 2004 7:27 am
Location: Adelaide, South Australia
Contact:

Post by Aus-RED-5 »

Not to me. :P
MD-2389
Defender of the Night
Defender of the Night
Posts: 13477
Joined: Thu Nov 05, 1998 12:01 pm
Location: Olathe, KS
Contact:

Re:

Post 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. ;)
Post Reply