D2X for MS-Windows

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

pATCheS
DBB Ace
DBB Ace
Posts: 187
Joined: Sat Apr 03, 2004 9:12 pm
Contact:

Post by pATCheS »

Diedel wrote:How can you expect me to understand that kind of humor of yours I'd need to know you face to face to understand it, if I do not know you face to face? This is something you just don't say easily to somebody you don't know.
myah, I'm used to chatting with people more my age in situations where "shut up" would nominally be seen in a friendly kind of way. I guess the DBB is not one of those places :P

Diedel wrote:So why the comment?
Because I felt I had to justity my methods by saying why I hadn't noticed and fixed it. I don't like looking bad without having and making known some real reason for it. Don't ask me why. Is it something I should avoid doing?

Diedel wrote:If you know that, and you know you changed (quite) some formatting, what do you believe a diff will produce in terms of quantity? :P
How was I supposed to know you were going to perform a diff? It's practically unheard of from my small corner in the world. I've never worked in a programming team before. Does MSVC even have the capability of doing a diff? I haven't looked, though I'm sure I could have made use of such a feature by now.

Diedel wrote:You boast pretty much with your screen shot.
That was after you had lit my fuse though :P But that doesn't make it any less wrong of me.


Diedel wrote:It's rather strange that you only get 66% of the original frame rate and not 100%.
No, not really. Depth testing is a fairly expensive operation that was not being performed before.

But regardless, the FPS should be sitting at the cap; I see no reason why it shouldn't. Not very much is getting drawn. The rendering pipeline, which is much more akin to a pipe dream, needs much attention. I'll start looking at that next. I'm going to try to thoroughly process the OpenGL routines, removing things that are no longer used or dead. Yes, I'll keep a log, but I'm not going to detail the things I remove (there's just way too much now-useless crap in there).

Diedel wrote:So why is it that a huge face does not cover all faces in front of it but inside the bounds of its 2D projection when it is "mis-rendered"?
Because not all of the cubes are drawn before they should be. I think it has something to do with the sorting routine using the number of cubes deep a particular cube is, and not how deep it actually is. Which would have been computationally expensive to implement way back in the day when they didn't much care for complex level geometry, so it's understandable at least. This does not easily explain the artifacts as seen in Dogfight, however (the faces would have to be sorted in some weird way...bleh, I dunno). But now that we have multi gigahertz machines, perhaps now is a good time to fix that? Because manually sorting and drawing cubes by their Z depth would be quicker than using the depth buffer. I dunno though, maybe it's not worth the effort to implement it. And if the rest of the rednering pipe dream can be optimized enough, it won't matter.


Diedel wrote:Coding style is not just how you write down your lines of code. It's how you organize everything, how diligently you check for bugs (see gr_do_palfx()), how diligently you check other coders' stuff (bool/int bLegacyZBuf), how well you mark and document your changes, how you communicate your changes, etc.
Interesting way of looking at it. I suppose there's really no other term for that than "coding style", because how effectively you code is so dependent upon how effectively you work with others, and so on.

I'm lazy, and sometimes do things without a clear perspective on them (especially when I'm depressed or otherwise not mentally functioning well). And again, I've never worked in a programming team before, where all of these things you mention here become key.

Diedel wrote:I have to say that I did not like at all the tone of your last post, and it looks very much to me like you were simply trying to get the better of me somehow, to show that in the end you are the better coder or whatever. I don't know what urges you to do so though. I have acknowledged your solutions where they worked so far, so no need to prove something.
I didn't like it either, hence my addition to the top. It was 4 am, and I didn't like how you were telling me I was wrong when, to me, it was so obvious that I was right. Those two combined with the effects of my sickness at the time resulted in that post. Again, my apologies.

Diedel wrote:My remark about 10 English and one German words for "schlampig" btw. was my kind of humor. Doh. :P
LOL, that's great.

Hmm, interesting. I didn't know the meanings of many of these fairly uncommon words.
Dictionary.com wrote:diligent, adj.

Marked by persevering, painstaking effort.
So, schlampig is basically sloppy and uncautious. It is not, then, any of these:
Dictionary.com wrote:blowzy, adj.

1. Having a coarsely ruddy and bloated appearance.
2. Disheveled and frowzy; unkempt: blowzy hair.

dowdy, adjective

1. Lacking stylishness or neatness; shabby: a dowdy gray outfit.
2. Old-fashioned; antiquated.
The others that I looked at are similar in their irrelevance (uh oh, I'm getting lazy again, I didn't look at them all :P). Some contain "uncautious" and "sloppy", but their connotation overall is much more severe. And try looking at the definitions of the words rooted "slut" :P


Diedel wrote:Turning off the depth test when drawing objects helps, but causes other problems.
Hmm, I'm curious as to what exactly... I'll have to give that a try.
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6458
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw »

ENOUGH!

Its probably high time that Diedel found his own resources to provide support for his project.

Sourceforge might be a nice place to start.
pATCheS
DBB Ace
DBB Ace
Posts: 187
Joined: Sat Apr 03, 2004 9:12 pm
Contact:

Post by pATCheS »

Hey, we're done quarrelling. As a plus, I've learned a little bit more about not being an idiot. :P


Now we return you to the originally scheduled programming:

MWAHAHAHA, I got another 10 FPS in KK by removing the color buffer clear :D I knew it would improve the FPS, but I didn't think it'd improve it that much. Woah. It would probably cost less to just draw a pair of black triangles on the background first thing. But that's not necessary anyway, as there aren't normally broken shells in D2 :) The -legacyzbuf code actually didn't use the color buffer clear, either. The Z clear, however, is still quite necessary (no, I didn't find that out via trial and error... although it would be kinda interesting to see, now I wanna give it a try hehe).

The change is in ogl.c[ogl_start_frame()]. Actually, I've re-organized the majority of that function's contents for optimal flow. I'll keep working on that file and send you the results, with appropriate newbie change documentation, via e-mail when I think I've got something.
pATCheS
DBB Ace
DBB Ace
Posts: 187
Joined: Sat Apr 03, 2004 9:12 pm
Contact:

Post by pATCheS »

Okay, I've fixed the robot eyes/guns by setting the zfar value to something a little more sane. At 16 bit, it gets set to 655.36; at anything else (ie, 24bit and 32bit) it gets set to 1000.0. 16 bits gives 65536 levels of Z, so 65536/655.36 gives 100 levels of Z for every 1 unit in the game. That ought to be enough Z precision, and 655.36 units should be enough render depth.

I'm also going to remove depth testing from vclips, they will look much better without it (laser impacts won't clip on walls, explosions won't clip on walls and robots, etc etc etc).

mmm, this is fun :)


Diedel, for my changelog, is this format okay?

ogl.c.log (in same directory as ogl.c)

Code: Select all

ogl.c changelog



=== 8/6/2004 ===

*** pATCheS ***

made M_PI much more accurate for no real reason; the preprocessor will truncate it where necessary for any given situation

revamped code in ogl_start_frame()
	fixes:
	-	zfar value sent to gluPerspective() reduced to sane levels; Z artifacts seen on very close faces (robot eyes, for example) are now fixed
	-	re-ordered some logic for correct flow

	speedups:
	-	no longer performs color clears when Z buffering is enabled
	-	made scissor testing work when not using Z buffering (might improve FPS with -legacyzbuf and reduced screen size, probably insignificant)

	other:
	-	removed old commented code
	-	miscellaneous formatting changes

	todo:
	-	fix vclip problem (see comments in function for details)
	-	don't break :)
[edit]Oh dear, double returns. This didn't occur in the preview. *sigh*[/edit]
User avatar
Ferno
DBB Commie Anarchist Thug
DBB Commie Anarchist Thug
Posts: 15012
Joined: Fri Nov 20, 1998 3:01 am

Post by Ferno »

Flip.. would you rather people that have no knowledge of D2 tell diedel how it should be?
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6458
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw »

I'd rather support issues regarding diedel's d2x find themselves a more apt home rather than crowbar all of it into a single thread.
User avatar
Ferno
DBB Commie Anarchist Thug
DBB Commie Anarchist Thug
Posts: 15012
Joined: Fri Nov 20, 1998 3:01 am

Post by Ferno »

all that needs to be done is whatever code revisions need to be shared go in a PM.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

pATCheS wrote:myah, I'm used to chatting with people more my age in situations where "shut up" would nominally be seen in a friendly kind of way. I guess the DBB is not one of those places :P
Had you ever chatted with me? :roll: "Shut up" is considered very impolite by me (even more as you are less than half my age :wink: ).
pATCheS wrote:How was I supposed to know you were going to perform a diff? It's practically unheard of from my small corner in the world. I've never worked in a programming team before. Does MSVC even have the capability of doing a diff? I haven't looked, though I'm sure I could have made use of such a feature by now.
Which way do you expect me to detect your changes to the code? By comparing it line by line myself? That would be even harder with a lot of changes.
patches wrote:It's rather strange that you only get 66% of the original frame rate and not 100%.
No, not really. Depth testing is a fairly expensive operation that was not being performed before.
That's what I thought, but I wanted to hear your idea ... :wink:
patches wrote:
Diedel wrote:Coding style is not just how you write down your lines of code. It's how you organize everything, how diligently you check for bugs (see gr_do_palfx()), how diligently you check other coders' stuff (bool/int bLegacyZBuf), how well you mark and document your changes, how you communicate your changes, etc.
Interesting way of looking at it. I suppose there's really no other term for that than "coding style", because how effectively you code is so dependent upon how effectively you work with others, and so on.
Call it "work style" if you like. :)
patches wrote:I'm lazy, and sometimes do things without a clear perspective on them (especially when I'm depressed or otherwise not mentally functioning well). And again, I've never worked in a programming team before, where all of these things you mention here become key.
Diedel wrote:My remark about 10 English and one German words for "schlampig" btw. was my kind of humor. Doh. :P
LOL, that's great.

Hmm, interesting. I didn't know the meanings of many of these fairly uncommon words.
I did not know a single of the English words before consulting that dictionary which obviously list every word with a meaning even slightly akin to the German word's meaning.
patches wrote:
Dictionary.com wrote:diligent, adj.

Marked by persevering, painstaking effort.
So, schlampig is basically sloppy and uncautious. It is not, then, any of these:
Dictionary.com wrote:blowzy, adj.

1. Having a coarsely ruddy and bloated appearance.
2. Disheveled and frowzy; unkempt: blowzy hair.

dowdy, adjective

1. Lacking stylishness or neatness; shabby: a dowdy gray outfit.
2. Old-fashioned; antiquated.
"Schlampig" in German kann also describe the appearance of something, or somebody's clothing. There it will mean exactly what you quoted here. "Schlampig" is either the process or the result of being "sloppy and uncautious" with something.
patches wrote:
Diedel wrote:Turning off the depth test when drawing objects helps, but causes other problems.
Hmm, I'm curious as to what exactly... I'll have to give that a try.
You will e.g. see the Gauss behind the cave entrance on Koolkave from its front.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

pATCheS wrote:Okay, I've fixed the robot eyes/guns by setting the zfar value to something a little more sane. At 16 bit, it gets set to 655.36; at anything else (ie, 24bit and 32bit) it gets set to 1000.0. 16 bits gives 65536 levels of Z, so 65536/655.36 gives 100 levels of Z for every 1 unit in the game. That ought to be enough Z precision, and 655.36 units should be enough render depth.

I'm also going to remove depth testing from vclips, they will look much better without it (laser impacts won't clip on walls, explosions won't clip on walls and robots, etc etc etc).

mmm, this is fun :)
Nice changes. Where did you learn about OpenGL? I started to read a little about it 8 weeks ago.
pATCheS wrote:Diedel, for my changelog, is this format okay?
It's a start. You either need to clearly mark all changes in source code with a comment (single line comment for single or few lines, or a comment each at the start and the end of a changed block, like "// 060904 patches" - or whatever signature you'd like to use).

Or you specify every function and its file together with the change, e.g.

ogl.c::ogl_start_frame()
- removed color buffer clearing from call to glClear()

That would help greatly in quickly finding any changes you made.

Take a look at d2x-changelist.txt from my d2x source zip file.

Btw, I'd like to have the source files you have changed. :wink:
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

I've been sitting on this thread for a while... keep it down or else either Flip or I will close it.

This thread is getting awfully large anyway... seems like it would be better served if it were split into multiple threads.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

My last post simply deals with organisation and communications regarding patches' and my working together, and the one before was mostly some clarification on that German word.

Patches and I had a little dispute, and we have settled it! We don't need you for it, and it's over already, so wtf?!

:evil:
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

fliptw wrote:ENOUGH!

Its probably high time that Diedel found his own resources to provide support for his project.

Sourceforge might be a nice place to start.
OMG. I am doing this for free and to the benefit of the Descent community, and this is the Descent message board, so why not use it for exchanging info about this project?

You're not needed for us to sort our differences out.

What is this anyway? Two DBB members are having a dispute, it's already all settled, and some mods have to stomp in like a gorilla, drumming their chest, and demonstrating who has the power here?

When people (esp. if they don't know each other), get together, there is unrest sometimes. That's life. If you want graveyard peace here - well, ban me or whatever, if you believe that furthers the reputation of the DBB and the cause of the Descent community.

At least I have brought some fresh air into a community and a message board stagnating for a long time now.
User avatar
Ferno
DBB Commie Anarchist Thug
DBB Commie Anarchist Thug
Posts: 15012
Joined: Fri Nov 20, 1998 3:01 am

Post by Ferno »

"At least I have brought some fresh air into a community and a message board stagnating for a long time now."

Exactly
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6458
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw »

Exchange info yes, not bickering about how to haggle with patches, not using the Coder's Corner as a support forum for D2X.

Trust me, having all of this inside just one thread is more inconvient in the long run for everyone.

there are free resources out there that you can use to manage this project, use them.

If you want to, you can ask Xciter or Topher to create a forum for this.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

flip,

that is crap. It is one single thread with maybe 3 or 4 regular contributors. I wonder what is riding you now that you are trying to harrass me here for this. I really wonder what the problem with posting Descent related stuff in a Descent related message board. And it's even the "coder's corner", and this is about coding Descent stuff.

What do you want to prove? That you can kick me out if you like? That you are still alive and important? Is this an immature power game of yours?
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

I appreciate your work on D2X, but I agree that one thread in the little-trafficked Coders' Corner is not the best place to conduct business for multiple reasons. If you want to use the Coders' Corner to ask questions/get feedback on coding changes, then be my guest. But otherwise, Descent Multiplayer might be the better forum for general gameplay questions. That said, I'm not gonna move or lock this thread (yet). You'd be better off starting new threads in Multiplayer, one for each issue that comes up. It's hard enough trying to follow the multiple conversations (wall transparency, laser lighting, input polling rates, etc.) that are all taking place simultaneously in this one thread, and it is definitely not worth my time to attempt to split this topic.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

The stuff that is discussed here is not multiplayer stuff. It's mainly rendering stuff and some gameplay issue, and directly related to coding.

I really wonder what all the fuss about this thread is about. You guys must be pretty bored.
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

[added stuff to above post]
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6458
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw »

No, Coder's corner is to help people with programing, it's not as a surrugate support forum for random projects.

What irked me was the diatribe between you and patches that is better served in a PM rather than a public thread.

When it got to that point, it became apparent that this thread wasn't enough support for your project.

At the very least, this needs its own forum. a bug tracker and a source repository would make things easier too.

So, go ask Xciter or Topher, they'd probably be willing to create a forum for this, but this thread will get unruley as time goes on.
User avatar
Kyouryuu
DBB Alumni
DBB Alumni
Posts: 5775
Joined: Fri Apr 30, 1999 2:01 am
Location: Isla Nublar
Contact:

Post by Kyouryuu »

Move it to frelling Descent Development and I'll let you guys do what you want.

Buncha crybaby mods.
User avatar
Ferno
DBB Commie Anarchist Thug
DBB Commie Anarchist Thug
Posts: 15012
Joined: Fri Nov 20, 1998 3:01 am

Post by Ferno »

Sol: it's just the power itch. i guess it comes along when there is an active thread in a forum that has next to no activity. I saw a couple different programming styles being explained, not an argument.

So if they want a dead forum, by all means; let them have it.

heh. ;)
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

Never did I say I wanted a dead forum, but for God's sake, if you're gonna talk about D2X, talk about D2X, don't argue back and forth about semantics and non-existent insults!
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Kyouryuu wrote:Move it to frelling Descent Development and I'll let you guys do what you want.

Buncha crybaby mods.
ROFL!

k. :D
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

DCrazy wrote:Never did I say I wanted a dead forum, but for God's sake, if you're gonna talk about D2X, talk about D2X, don't argue back and forth about semantics and non-existent insults!
A discussion is all about exchanging arguments about a matter or isn't it?

Take it as a proof of patches' and mine's minds flexibility that we took an excursion into semantics, differences of English and German, and obscure English words. :P

Hehe. :wink:
Post Reply