Thread: [DFBHD] Baldo's New M60 Sight
View Single Post
  #162  
Old 11-14-2023, 01:12 PM
Baldo_the_Don is offline Baldo_the_Don
Baldo_the_Don's Avatar
Registered User

Join Date: Jul 2012
Posts: 533

Honestly, the attachment is a secondary concern for me with this post, but...

cs_office_Punch_Reticles.jpg: The way reticle sprites work in Counter-Strike (version 1.6, CS for short) and Counter-Strike: Condition Zero (CS:CZ) is a bit different from how Counter-Strike: Condition Zero Deleted Scenes (CS:CZDS) uses them, so I couldn't just drag and drop my CS:CZDS stuff into CS and CS:CZ. For the sniper rifles, I had to deal with the irremovable thin lines and their wonkiness. On the SG-552 and the AUG, it's the irremovable crosshairs. They stay visible even when you zoom in CS and CS:CZ. You can still add reticle sprites, but they'll only cover that crosshair.

A short aside for clarity: The two little horizontal and two little vertical lines in the center of the screen that you use to aim unzoomed weapons in some Half-Life 1 (HL1) mods? I call those the crosshairs. Fairly certain that the Valve developers do too. The lines that appear when you zoom in a zoomable weapon that are provided by a targa or sprite graphic file? I call those reticles or sights.

Just so we're all on the same page, right?

I made some sprites for the SG-552 and the AUG.

The first thing you'll notice is the weird dot pattern. My adventures in modding HL1 sprites have presented me with transparency problems. There are four ways sprites handle transparency:

Additive: Is a white design on a black background in a palette of blendable grayscale starting with black and going to white. The game interprets darkness in pixels as transparency, brightness in pixels in the sprite is added to whatever is behind them on screen in-game, using the color of the HUD, so it looks glowy. Except the game doesn't allow this draw method for reticles or crosshairs, 'cause sighting elements that auto-adjust brightness for environmental lighting would be too cool and useful.

You'll have to choose one of the other three draw methods, although only two of them are practical for reticles and crosshairs.

Alphatest: I don't know what the name means, but what it does is allow you to choose a palette for the sprite of up to 255 colors, and the 256th color will be interpreted as transparent. This way, you can have a red chevron with black lines, but angles and curves will be aliased and pixelly, 'cause alpha (transparency) has one level and does not blend.

Indexalpha: This is a black design on a white background in blendable grayscale. The first 255 colors in the palette are levels of grey, from white to black this time, and will be interpreted as alpha. The 256th color will be the color of the reticle or crosshair.

Normal: This draw method is 256 colors in a sprite, no alpha. The game will not accept sprites if the dimensions of the sides are not in multiples of 8 pixels, so if you're not making an 8 px square to aim with, you can't really use this draw method for reticles and crosshairs.

What all that means is that, you can make multicolor reticles with pixelly angles and curves, or smooth alpha angles and curves in a reticle of one color.

I want my black lines with red bits, so I have to use alphatest, but then I can't really have a nice blur around the sight housing, can I?

Something I learned about the way the game basically smooths things in the reticle sprites by making the pixels really blurry in-game is that, sometimes, what you cannot do with blended alpha, you can fake with patterning. So if you want to imply a line less than a pixel thin, you draw a one pixel wide line with every other pixel alphaed. The dotted line then looks super thin in-game. If a solid one pixel line is too thin for what you want it to do, but a two pixel line is off-center, and a three pixel line is too thick, you stick with the solid one pixel line, but add rows of dots to the sides of it, implying a centered, two pixel line.

And if you want to fake a blurry scope body, you use a dot pattern that's dense toward the middle, and thins as it gets to the outer edges. Suboptimal, yes, but better than the alternatives.

All that may help you understand what you see in the attachment a bit better.

The left side has my interpretation of the Trijicon ACOG Crosshair. The inner edge of the 'scope body' is 124 milliradians in diameter, the crosshair reticle is 110 mrads tall, 48 mrads wide, and the thin line gap in the center of the horizon is 11 mrads wide. Zoom in and you'll see the red bit really is that classic ACOG crosshair shape, even though this level of magnification (1.91x) makes it a bit dottish.

The right side is my attempt at the classic AUG Swarovski 'Donut of Death,' with a bit of green illumination on the ring that, as far as I know, is my own invention. You can also see the hard-coded crosshair peeking into the center so annoyingly if it's sized to 'small' or 'medium' in the game settings, but if you like a 'large' crosshair, the bars and post completely hide it. The inside of the outer ring is 150 mrads wide, and the outside of the inner ring is supposed to be 12 mrads wide, ideally 14.7 px, but a 14 px unsmoothed circle is actually an octagon, so I made it a little wider (16 px) to make it look more round. The inside of the inner ring is 10 px wide so I could have a 1 px green illuminated ring bordered with a bit of black. That's 3 px wider than to scale, but I decided clarity is preferred to authenticity this time.

I like my crosshair set to 'small,' so I needed an alternative to the AUG original sight, and I went with a German #4 and a red dot, as displayed in the middle of the attachment. The center gap is about 10 mrads from center to bars and post, and the bars and post are about 5 mrads thick. The red dot is as small as I could make it and still get that super-bright red dot effect.

So that's the current state of my favorite CS mods. Now I can get to the main reason for this reply.

In this post:

https://novahq.net/forum/showpost.ph...49&postcount=3

I have a screenshot of my modification of the M16 sight targas I found in the DFBHD demo. I like them tons, and I was happy I found them, but if I had been a little bit more attentive to this post:

https://novahq.net/forum/showthread.php?t=46890

...that Luis made... nine years earlier (!!!)... I would not have had to wait so long to enjoy them.

Nine years. Nine whole-ass years.

Situations like this are a bit worrisome to the Gen-X metalhead with dementia in his family history.


Edit:

cs_office_alternate_AUG_reticle.jpg: Pure black, blended alpha, and designed to use the crosshair as illumination.
Attached Images
File Type: jpg cs_office_Punch_Reticles.jpg (630.6 KB, 14 views)
File Type: jpg cs_office_alternate_AUG_reticle.jpg (499.8 KB, 12 views)
__________________
////////////////////<- SIGNATURE STARTS ->\\\\\\\\\\\\\\\\\\\\\
The NSO Deadline Mod at NovaHQ.net:
/////////////////////<- SIGNATURE ENDS ->\\\\\\\\\\\\\\\\\\\\\\

Last edited by Baldo_the_Don; 11-14-2023 at 06:25 PM.
Reply With Quote