Forum

Quake Video Code Rant

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Quake Video Code Rant

Postby Baker » Mon Feb 28, 2011 6:17 pm

I was in the process of writing split screen rendering and reworking the 2D graphics handling in Engine X.

Then working through some of that stuff, it occurred to me that the video code in Quake with 15 variables doing nearly (width, DIBWidth, window_rect, and on and on and on) the same thing is just terribly disgusting.

You can't get "control" over the engine with confusing variables maybe used by a single function redundantly scattered all over the place.

I think I understand why Spike scrapped software renderer stuff for FTEQW going forward. Having to work through the code just to find the 85 software-renderer relics (not that FTEQW would have those) that don't do anything or don't matter to OpenGL and having to maintain that overhead ... yuck.

/End Rant
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby mh » Mon Feb 28, 2011 7:07 pm

Been there, done that, made the same rant. Many times over. :lol:

Wait till you move on to how it interacts with the input and sound code. More globals storing the same info, dibwindow, mainwindow, yadda yadda yadda.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Baker » Mon Feb 28, 2011 7:25 pm

I'm hoping I can unwind all that spaghetti, by tomorrow morning.

What I would like to do is have some flexibility to define viewports at will and get a true framework going with the 2D graphics. [And the menu and the sbar].

With ProQuake I had to stick with expectations, maintain builds, ensure backwards compatibility. With Engine X, I can do whatever makes sense.

I noticed from day 1 things relating to both the "canvas management" and the menu.

[Off-topic, but speaking of nasty stuff I read the whole Nehahra thing. Many things I didn't know ... that skybox/savegame thing. Well, those were the early days.]

If I can truly get a handle on the disgusting redundancy of the window definition cvars, I'll should have some major speed gains in accelerating some of the things I want to wrap up.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby mh » Mon Feb 28, 2011 9:32 pm

I tend to view Nehahra as being a crushingly disappointing missed opportunity. Here was a chance to get a good baseline set of standards to move forward from, but instead it turned out to be a collection of some of the grossest hacks imaginable. But like you said: early days.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Baker » Tue Mar 01, 2011 2:20 am

mh wrote:I tend to view Nehahra as being a crushingly disappointing missed opportunity. Here was a chance to get a good baseline set of standards to move forward from, but instead it turned out to be a collection of some of the grossest hacks imaginable. But like you said: early days.


I didn't really know how gross until I read your blog item. I'm glad LordHavoc and Spike have been guarding the fort with the "decent standards" thing over the years.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Spike » Tue Mar 01, 2011 2:34 am

'decent standards' is anything you don't mind maintaining for ages, including future extensions. :)

Baker, all those variables in the video code would not be so bad if they were correctly scoped. Quake's main fault is that it uses so many different globals, and globals are bad. They're easier for asm though.

FTE no longer has a software renderer because noone cared enough to maintain it. When the code around it is changing, it gets in the way. Plus, the removal of the software code permits merging the gl/d3d code paths into closer alignment with each other, instead of somehow trying to fit software rendering in there.
If FTE does ever regain a software renderer (and it would be nice) then it'll have to fit the same basic framework as GL/D3D - vertex lists.
But in all honesty, its easier to use gles for embedded systems, and retain intel driver support for pcs.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby TimeServ » Tue Mar 01, 2011 5:53 am

Well really FTE doesn't have a software renderer because I woke up one day and decided to remove the entire software renderer code because I was sick of looking at that and then committed that change in. So really I'm the one to blame for that. Spike just didn't feel like getting into a commit war and reverting the changes I guess.
TimeServ
 
Posts: 38
Joined: Wed Jun 08, 2005 4:02 pm

Postby Baker » Tue Mar 01, 2011 3:54 pm

Software renderers are fun, but I think to some extent they really are a novelty for the most part. It is fun to learn how they work, the pixel buffers and all that.

But maintaining a novelty build of FTEQW with so much capability that software just isn't going to have is a hell of a lot of maintenance overhead.

[And it's not like the SW build source isn't out there for prior builds.]
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby mh » Tue Mar 01, 2011 4:13 pm

I'm semi-fascinated by the possibility of implementing software Quake's surface caching using a set of dynamic textures in either OpenGL or D3D. I believe that's the architecture vQuake used back in the day, and I know it won't perform well, but it's still intriguing.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Spike » Tue Mar 01, 2011 9:00 pm

One of my failings is the inability to completely remove something I worked on. Not really a problem, as it will live on at least in the svn history, but hey, I'm too lazy to fix up that stuff each time I break it.
Besides, I couldn't ever figure out what the heck any of the code was doing anyway. Too many statements that just copy one global to another global, and far far too many spans.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Irritant » Tue Mar 01, 2011 9:41 pm

Baker wrote:Software renderers are fun, but I think to some extent they really are a novelty for the most part.


Exactly, what is the point of maintaining a software renderer?
http://red.planetarena.org - Alien Arena and the CRX engine
Irritant
 
Posts: 250
Joined: Mon May 19, 2008 2:54 pm
Location: Maryland

Postby mh » Tue Mar 01, 2011 9:48 pm

In fairness Quake's software renderer has always been far superior to the original GLQuake, so a valid argument could be made for using it in preference. Modified engines have caught up, and fixed a lot of the things that are wrong with GLQuake, so that argument seems less valid these days, unless one has something against the concept of using a modified engine, or unless one has a really old machine that doesn't have even semi-reliable 3D acceleration.

Maintaining a software renderer in the same codebase as a hardware renderer seems more trouble than it's worth to me.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Baker » Tue Mar 01, 2011 11:11 pm

Irritant wrote:Exactly, what is the point of maintaining a software renderer?


About the same as keeping the CD player support in an engine :D
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Chip » Wed Mar 02, 2011 7:35 am

Baker wrote:
Irritant wrote:Exactly, what is the point of maintaining a software renderer?


About the same as keeping the CD player support in an engine :D


CD player support was the first to be stripped from my modified DP engine.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays

Fear not the dark, but what the dark hides.
User avatar
Chip
 
Posts: 575
Joined: Wed Jan 21, 2009 9:12 am
Location: Dublin, Ireland

Postby leileilol » Wed Mar 02, 2011 8:11 am

mh wrote:In fairness Quake's software renderer has always been far superior to the original GLQuake, so a valid argument could be made for using it in preference.


In 2011 it's still not about preference. *cough*poor bsd on intel gma folk*cough*. This almost makes me want to have software rendering for OpenArena somehow i mean jesus christ...... don't underestimate that obscure-of-obscure gamer portion. entitlement issues are through the roof. It's one of the many reason Darkplaces has a software renderer now even.

As for CD support... i had that replaced with MIDI for a while, then reverted it back since you can't midi quake music and vorbis decoding on pentiums suck.
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Next

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest