. /../[DEV] Noctis IV (CE/Plus).../ 1
doing pushups
written by Megagun on Sep 23, 2009 16:50
Allright, I've grabbed the latest Noctis IV Plus release (http://mooses.nl/nice/relatedprojects/nivplus/latest/release/) and began diving through the code to see if I could speed things up..

Completely cleared the following function:
void digit_at (char digit, float x, float y, float size, unsigned char color, char shader)
Then, I changed the speedup thingy from:
if (!ontheroof || !roofspeed){
to:
if (!roofspeed){
And killed some SYNC_START()s here and there, and did some other minor changes...

Apply the following patch to NIVPLUS r2.1:
http://mooses.nl/nice/relatedprojects/nivplus/temp/NOCTIS_NIVPLUSR2dot1_NOCHARACTERS.zip

Then boot it up. There's no text, but 's' will switch between the 'speedup function' (which now also works inside the stardrifter)...

See how much better it runs under something slow-ass, like DosBOX.

The probable reason why this function is so goddamn slow: Pre-Noctis IV (also Noctis III? I forgot; someone tell me!) used alphabet.ncc (a polyvert 3d model; polygons for text) whereas it seems that this function does not....

EDIT:
Major speed bump of that function found:
for (n = 0; n < 36; n++) {
			i = 256 * n - 5;
			txtr[i-1] = 0; // evita aliasing a fine scanline.
			for (m = 0; m < 32; m++) {
				if (digimap2[n+d] & pp[m])
					txtr[i] = pixel_color;
				else
					txtr[i] = 0;
				i++;
			}
			if (shader) pixel_color--;
		}
r'lyeh sweet r'lyeh
written by Neuzd on Sep 23, 2009 17:03
Are you sure this is a good idea?
If I recall correctly all "animations", intended as refreshing the position of a particular object (space or animal), keep into account that 18 fps is a fixed limit and their "next position" is calculated accordingly.

Doesn't everything risk to look weird? I mean, I personally didn't like also the "old" speedup because it was so fast that you couldn't enjoy one single bit of in-system traveling.
I'm afraid the same thing will happen to hoppers. Their motion may look totally awkward.
If you manged to keep everything just "smooth", instead of "fast", well, kudos to you : )
doing pushups
written by Megagun on Sep 23, 2009 17:07
I just kicked the frame limiter out to see how well my performance increase worked under DosBOX; to make sure that I could actually SEE any difference. The frame limiter kicking isn't what makes this test run from 2FPS (normal NIVPlus) to ~15fps (this test); it's the commenting of that particular function...
r'lyeh sweet r'lyeh
written by Neuzd on Sep 23, 2009 17:27
Alright, now I see what you've done. I mean, in-game...I still have to understand the polygon fonts topic and what that function does.

I'll be trying it later on OSX and see how it runs.
While we're at it, the antialiasing option is another thing I'd liked to have "again" on the SD. Some planets are really much more beautiful without that effect applied (oh, and rings are amazing, too).
doing pushups
written by Megagun on Sep 23, 2009 20:29

"Quick Stardrifter" patch for the latest release of NIVPlus (2.1):
http://mooses.nl/nice/relatedprojects/nivplus/temp/NOCTIS_NIVPLUSR2dot1_quickSD.zip

Now, it's still damn slow on the surface in DosBOX for me (and possibly anyone else) but at least it's a lot quicker now on the stardrifter..

EDIT: it's still a bit buggy with rendering some text; I know that.
written by Cryoburner on Sep 24, 2009 09:13
Nice! That seems to eliminate the massive performance hit when stepping inside the drifter. I figured it might be the text, since hitting 'disable display' gave a small framerate boost before. This brings the framerate to around full speed in space for me.

Megagun said:
Pre-Noctis IV (also Noctis III? I forgot; someone tell me!) used alphabet.ncc (a polyvert 3d model; polygons for text) whereas it seems that this function does not....
I believe only Noctis I used polygonal text. Noctis II and III both use a bitmapped font, much like Noctis IV. You seem to be using the same font, but it looks a bit misaligned, as lines often appear along the right and bottom edges of the characters. Also, they look pretty jagged with the screen antialiasing disabled, and even the older versions of Noctis applied a translucent gradient effect similar to that in Noctis IV. I took a few screenshots showing the differences. : )

Noctis I:


Noctis II:


Noctis III:


Noctis IV:


Noctis IV mod:


Now we need to figure out what's making the surface framerates so low. I'm guessing there's a similar routine lurking there as well.
hello! :) felysian
written by Hello! :) on Sep 25, 2009 03:21
Mega, how many times per frame is that bit of code executed? It loops 1,152 times and doesn't seem too bad (looks to be about 50 instructions), so worst case about 57,600 instructions total are executed.

But you're right, anti-aliasing is really sloooooow. Even worse on an emulator.

Megagun said:
for (n = 0; n < 36; n++) {
	i = 256 * n - 5;
	txtr[i-1] = 0; // evita aliasing a fine scanline.
	for (m = 0; m < 32; m++) {
		if (digimap2[n+d] & pp[m])
			txtr[i] = pixel_color;
		else
			txtr[i] = 0;
		i++;
	}
	if (shader) pixel_color--;
}
doing pushups
written by Megagun on Sep 25, 2009 07:42
It's executed once for every character (the 'fancy 3d ones', not the ones that say "EPOC 6011, LOCATION PARSIS" etc) that needs to be rendered.
reading this thread
no members are reading this thread
. /../[DEV] Noctis IV (CE/Plus).../ 1
29862, 11 queries, 0.064 s.this frame is part of the AnyNowhere network