Mark V - Cut/Copy/Paste | ASM

Discuss programming topics for the various GPL'd game engine sources.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Mark V - Cut/Copy/Paste | ASM

Post by Baker »

Mark V Binaries: OpenGL | DX8 | WinQuake (there is a Mac build even for the WinQuake, I need to update it).
Mark V Source: VS 2008, VS 6, CodeBlocks --- all using gas2masm for WinQuake's ASM |

[The WinQuake build does Nehahra + BSP2 + stipple r_wateralpha. Unlike qbism, doesn't do alpha entities. Unlike makaqu, doesn't do masked textures. Unlike both of those, it loads TGA 24-bit skyboxes. The WinQuake build of Mark V isn't particularly separate from the GL build, but isn't quite as "the same" as say, FTE's combo renderer of days gone by nor Quake 2.]

cut/copy/paste

I made a new version of Mark V that has cut/copy/paste and ability to select text in the console (you know, hold shift down, press CTRL+X or CTRL+V or whatever).

As it is, it is just 1 extra field: selection length

It can be positive or negative. If you hold down shift and press the forward arrow, selection length increases. If you press back arrow, it decreases.

The details can bog down a bit in minutia with using memove to remove text or insert text (and you have to do a strlen on the line), and there is some extra baggage with HOME and END and the fact Quake's console does not have decent entry and exit pathways (i.e. con_forcedup or entering the menu in stock Quake doesn't trigger anything to exit the console).

ASM

After looking at Qbisms engine (CodeBlocks) and ezQuake, added native WinQuake asm builds for:
1) CodeBlocks (had to capitalize all the .s files to .S)
2) Visual Studio C++ Express 2008 (the last no-cost Visual Studio that does not require registration after 30 days)

Both use the gas2masm to build from the .s source files. I almost at one used .asm files like MH did with an MH-ized aguirRe Quake. In fact, I went that route and then discovered ezQuake actually built the .s files in VS2003 or such and seeing QBism's engine use the .s files for CodeBlocks, I thought a project with both .s and .asm files would be a bit redundant so I painfully dissected ezQuake's method and acquired it.

net_wins.c and net_win.c --- they are gone!

I merged away net_wins.c and net_win.c. net_bsd.c and net_udp.c are the sole survivors. No more maintaining 2 "basically the same" network files. net_bsd is BSD sockets and WinSock is Microsoft's "mostly" a clone of BSD sockets. There isn't much of a good reason for Windows to have its own network code that is basically identical to the net_bsd.c and net_udp.c equivalents except a few lines and like 2 extra functions.

WinQuake on-the-fly palette conversion

First time I did this, it took 6 seconds for a map to load when it had to convert 6 1024x1024 skyboxes to the Quake palette.
Then I thought, "I'll have it write cache files and load those if it finds them". Which obviously was slow the first time and instant on subsequent occasions.

But that leaves junk laying around. And what if you are tweaking a skybox? How will it know the cache file is out-of-date and writing something to keep track of that is just adding more layers of "wrong" on top of "bad".

3rd and final method was this: open up a big buffer.
buffer = calloc(256*256*256*256)
if color = black, skip it and use Quake's black color (stored away).
if buffer[color] = 0 then convert color. buffer[color]=converted color
else color = buffer[color]
After map/level loading is done, free buffer.
Load time for that is milliseconds (basically instant), no garbage caches files lying around. I was pleasantly surprised by the speed, I expected faster but I didn't expect essentially instant.

Engine resistant config

Mark V doesn't load a config written by another engine. The mechanism is simple. Write config.cfg with a stamp "// Mark V" as the top line. Write a 2nd copy to the caches folder (on Windows %APPDATA%/Mark V/gamedir/config.cfg, a Mac has a similar location for the user/application combination).

When loading config.cfg look for the stamp. If not found, load the cache file version.

Best of both worlds: a user can modify their config.cfg and everything is ok if they don't delete the comment line. If some other engine wrote the config, that engine could have cvars with the same name but different or invalid values and it is even possible that some of the cvars might be interpreted as commands and do things undesirable.

Better to just not load a config written by another engine and use a cache file backup.

Future: possibly read the key binds offered and maybe lowest common denominator Quake cvars that are available even in DOSQuake like sensitivity.
Last edited by Baker on Sat Apr 11, 2015 6:59 pm, edited 1 time in total.
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 ..
Spirit
Posts: 1065
Joined: Sat Nov 20, 2004 9:00 pm
Contact:

Re: Mark V - Cut/Copy/Paste | ASM

Post by Spirit »

Great stuff as usual, thank you! Binary link points to source (better than the other way around ;) ).
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by Baker »

Ah, corrected that thanks!
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 ..
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Mark V - Cut/Copy/Paste | ASM

Post by Dr. Shadowborg »

Obsolete hardware test: Tried all three in a real quick test on my oldest laptop (ATI Mobility M3, P3 800mhz), OpenGL version crashes (unsuprisingly), dx8 version works, but is a bit slow fps-wise, software works quick due to ASM, but seems to have a wierd bug with walltorches disappearing / reappearing at certain viewangles. (try start.bsp)

I'll try them again on my Radeon X300 laptop later.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by Baker »

Dr. Shadowborg wrote:Obsolete hardware test: Tried all three in a real quick test on my oldest laptop (ATI Mobility M3, P3 800mhz), OpenGL version crashes (unsuprisingly), dx8 version works, but is a bit slow fps-wise, software works quick due to ASM, but seems to have a wierd bug with walltorches disappearing / reappearing at certain viewangles. (try start.bsp)

I'll try them again on my Radeon X300 laptop later.
Thanks for info.
1) Torches issues. I'll fix that. Is "non-interpolation" bug (torches get excluded from interpolation) that I fixed months ago but apparently code didn't make it to this version.
2) GL crashing? What operating system? Is Windows XP or later? How much RAM do you have?
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 ..
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by mankrip »

Thanks Baker, I'll take a good look at it.
Baker wrote:Unlike both of those, it loads TGA 24-bit skyboxes.
The latest version of Makaqu does. It loads the 24-bit TGA skyboxes and converts it to the default 8-bit palette, with floyd-steinberg dithering.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Mark V - Cut/Copy/Paste | ASM

Post by Dr. Shadowborg »

Baker wrote: 2) GL crashing? What operating system? Is Windows XP or later? How much RAM do you have?
The old laptop:
P3 - 800mhz
512mb RAM
ATI Mobility M3 (rage 128) - 8mb (OpenGL 1.2.1731)
Windows 2000 Professional

Tested all three exes on WinXP, ATI Mobility Radeon X300, all three worked nice and fast (as expected). (With the exception of the Software version's Walltorch issue)
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by Baker »

Dr. Shadowborg wrote:
Baker wrote: 2) GL crashing? What operating system? Is Windows XP or later? How much RAM do you have?
The old laptop:
P3 - 800mhz
512mb RAM
ATI Mobility M3 (rage 128) - 8mb (OpenGL 1.2.1731)
Windows 2000 Professional

Tested all three exes on WinXP, ATI Mobility Radeon X300, all three worked nice and fast (as expected). (With the exception of the Software version's Walltorch issue)
Thanks again for the extra usability information. I'm surprised the DX8 version ran on Windows 2000, there are some Windows API calls and possibly some libraries that Mark V uses that are not compatible with version of Windows prior to XP. It's not many, but I don't know what happens when the API isn't actually available.

The torches thing isn't related to operating system, I have it fixed but need to run some tests on it.
mankrip wrote:Thanks Baker, I'll take a good look at it.
Baker wrote:Unlike both of those, it loads TGA 24-bit skyboxes.
The latest version of Makaqu does. It loads the 24-bit TGA skyboxes and converts it to the default 8-bit palette, with floyd-steinberg dithering.
Didn't notice that!
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 ..
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by Baker »

Dr. Shadowborg wrote: (With the exception of the Software version's Walltorch issue)
Resolved: http://quakeone.com/proquake/interims/m ... 150410.zip

And thanks for bringing it to my attention.
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 ..
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by mankrip »

Feedback on the software rendered version:

There are corrupted texels in a corner of each skybox texture. And the stippled water is rendered as alternate columns, rather than a checkerboard pattern.

Single brushes of water in the middle of the air weren't rendered as translucent, even though there's visibility data obviously available in this case.

The mapmenu's cursor goes 3 or 4 items beyond the last one, and almost none of the vanilla maps were found when I tried to load them. Using the "new game" option started the game in E2M1.

Despite the above, the stability and the support for custom maps is very good. There's some really good features in the GUI, and many little niceties everywhere.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by Baker »

mankrip wrote:Feedback on the software rendered version:

There are corrupted texels in a corner of each skybox texture. And the stippled water is rendered as alternate columns, rather than a checkerboard pattern.

Single brushes of water in the middle of the air weren't rendered as translucent, even though there's visibility data obviously available in this case.

The mapmenu's cursor goes 3 or 4 items beyond the last one, and almost none of the vanilla maps were found when I tried to load them. Using the "new game" option started the game in E2M1.

Despite the above, the stability and the support for custom maps is very good. There's some really good features in the GUI, and many little niceties everywhere.
1) Fixed the extra slots in the levels menu, thanks!
2) I'll have to investigate the corrupted texels deal, I haven't seen that and most of the skyboxes I have are very noisy so picking so I'll probably have to make an single color one to see this.
3) Water brushes in air? Hmmm. Interesting. That is likely to be a bizarre exception to automatic underwater transparency as there are no underwater surfaces at all. The method I use to detect water transparency depends on an instance of underwater brushes and not underwater brushes in the same frame. And I think that unusual scenario there is no way using that method to determine if that water is transparent capable or not.

Stipple water as columns is on purpose as it doesn't need to know what row it is on to apply the stipple.
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 ..
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by mankrip »

Baker wrote:2) I'll have to investigate the corrupted texels deal, I haven't seen that and most of the skyboxes I have are very noisy so picking so I'll probably have to make an single color one to see this.
I tested two skyboxes, and it only happened in one called "eaglesdare". I can e-mail it to you if you want:
Image

The only online source I found for that skybox is this one, but all links are dead. Spirit probably has it too.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by Baker »

Yeah, if you could email that I'm real curious what could be going on with that skybox.

I've private messaged you my email address.
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 ..
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by mankrip »

:D Sent. Good luck.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Mark V - Cut/Copy/Paste | ASM

Post by mh »

That's almost certainly an in-memory header struct overwriting the first few texels. You can see the same pattern in a GL engine if you set up the glpic_t data before loading the texture from the source qpic_t.
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
Post Reply