Development Blah: Comments

All other topics around Descent and D2X-XL

Moderators: Frustikus, simX, Aus-RED-5

User avatar
Hawkins
Posts: 256
Joined: Wed Jan 11, 2012 1:18 pm
Location: /Universe/Milky-way/Sol/Earth/Europe/Greece/Athens/~

Re: Development Blah: Comments

Postby Hawkins » Wed May 30, 2012 10:10 am

I used to code like that, so I might be able to understand the guy.
:roll:
Gigabyte® GA-X48-DQ6
Intel® Core 2™ Quad Q6600 @2.4GHz
ATi(AMD®) Radeon™ HD4870
________________________________________________________________________
Descent Rangers
Captain of Black Lions squadron
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Wed May 30, 2012 11:25 am

I can understand it, but it takes an unnecessary big amount of time.
Sirius
Posts: 1990
Joined: Tue Sep 25, 2007 10:29 pm
Location: Bellevue, WA
Contact:

Re: Development Blah: Comments

Postby Sirius » Wed May 30, 2012 3:24 pm

If that's readable, I shudder to think...

Some parts aren't so bad, it's just that the combination of terse variable names and few-to-no explanatory comments makes this resemble what I imagine a D&D wizard's scroll to look like.
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Wed May 30, 2012 3:58 pm

Sirius,

are you referring to my reformatted version of the code? If so, you don't want to see the original code. It's not just one or two character identifiers all over the place, it's several statements in a single line, line breaks at column 80 (or so), structures nested in structures nested in structures w/o any reasonable access functions (well, how should there be those - it's vanilla C ... not that C++ had been around quite a while in 1995 when DEVIL was written), no white spaces in expressions (making them very hard to read), as few curly braces as possible (making code blocks hard to track), and uncommon names (like SCALAR (product) instead of DOT (product), VECTOR instead of CROSS (product) ...)

Achim Stremplat committed about every code formatting crime here I can think of. Apart from that he seemed to know what he was doing though. It's simply coded like DEVIL looks: Quite well under the hood, but with a gruesome surface.

As far as wizard scrolls go: If I stare at the code long enough, the deeper meaning of it will sooner or later start to emerge out of this letter soup. :lolol:
User avatar
Alter-Fox
Posts: 1132
Joined: Mon Mar 31, 2008 7:29 pm
Location: some other reality

Re: Development Blah: Comments

Postby Alter-Fox » Wed May 30, 2012 7:58 pm

And then you can bend reality to your will and conquer the universe.
We live in a universe... It's distracting
=========================================================
beware of ounce
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Wed May 30, 2012 9:14 pm

Alter, that you have nothing really to say doesn't keep you from posting, right? :P
User avatar
Hawkins
Posts: 256
Joined: Wed Jan 11, 2012 1:18 pm
Location: /Universe/Milky-way/Sol/Earth/Europe/Greece/Athens/~

Re: Development Blah: Comments

Postby Hawkins » Wed May 30, 2012 9:26 pm

About the names of function, they are not unusual. They are just more generic, but mathematically more proper to recognize then the dot, cross names. :P
Gigabyte® GA-X48-DQ6
Intel® Core 2™ Quad Q6600 @2.4GHz
ATi(AMD®) Radeon™ HD4870
________________________________________________________________________
Descent Rangers
Captain of Black Lions squadron
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Wed May 30, 2012 9:39 pm

Hawkins,

where ever you look at (English) 3D code, you will find the names dot and cross product used, but not scalar product (and certainly not "VECTOR" for a cross product, which produces a perpendicular vector to two reference vectors). You could call it "PERPENDICULAR", but not "VECTOR". "VECTOR" looks like a type cast merging separate coordinate values to a variable of a compound data type.
User avatar
Hawkins
Posts: 256
Joined: Wed Jan 11, 2012 1:18 pm
Location: /Universe/Milky-way/Sol/Earth/Europe/Greece/Athens/~

Re: Development Blah: Comments

Postby Hawkins » Thu May 31, 2012 12:49 am

OK OK, I concur. I just said they are mathematical references, that actually refer to tensor calculus for example. No matter. I'll do my thingie, and let you know of any progress.
Gigabyte® GA-X48-DQ6
Intel® Core 2™ Quad Q6600 @2.4GHz
ATi(AMD®) Radeon™ HD4870
________________________________________________________________________
Descent Rangers
Captain of Black Lions squadron
Sirius
Posts: 1990
Joined: Tue Sep 25, 2007 10:29 pm
Location: Bellevue, WA
Contact:

Re: Development Blah: Comments

Postby Sirius » Thu May 31, 2012 7:49 am

Code: Select all

struct point {
    float x[3];
};

I think that was my favourite snippet. Does the index even serve a purpose? We trying to stay extensible in case DEVIL needs to support hypergeometry in future or something?

(Edit: I guess there is initialization. Seems to me a union would have been a better approach if {0} or {0,0,0} wasn't an acceptable alternative though.)
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Thu May 31, 2012 9:28 am

This rather looks like a "matter of principle" (deep booming authoritative voice here) to me. Everything is put in a struct, so a vector will be, too! The index allows to do various operations in for loops (like adding vectors). Nothing you couldn't do better with a half way decently designed vector class though.
Woodpecker
Posts: 129
Joined: Wed Oct 07, 2009 11:07 pm

Re: Development Blah: Comments

Postby Woodpecker » Thu May 31, 2012 1:05 pm

Is it still plagiarism if you totally re-write his code so it's a) easier to read and b) better? :P
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Thu May 31, 2012 1:50 pm

It is FOSS under the GPL, so I can take any of the code I want as long as I keep my version of it under the GPL (or a lesser license), too.

The DEVIL solution is very good, and I will not reinvent the wheel here.
User avatar
blarget#
Posts: 673
Joined: Fri Aug 14, 2009 1:50 am

Re: Development Blah: Comments

Postby blarget# » Fri Jun 01, 2012 1:05 am

What are you talking about? I use DLE alot when i can understand it. Mostly for lighting.
Pumo uses it for custom stuff.
Hawkins uses it for everything.
Gengi uses it when he can.... ish (he is complicated).
Descent freak still uses it.
I think wolfy uses it (DFW).
and many more i cant think of off the top of my head.
NaphthaTurisas
Posts: 2
Joined: Wed May 23, 2012 8:10 pm

Re: Development Blah: Comments

Postby NaphthaTurisas » Fri Jun 01, 2012 1:35 am

It's the only level editor I use, if that says anything. :P I usually keep two separate versions to work off of, in case each has some things that don't work in the other version, but my computer had to be restored a couple weeks ago and I lost most of the programs that were on it, including earlier versions of DLE. I can wait for the curve generator to be fixed, since there are levels I can work on in the meantime that don't require as much use of it.

Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest