With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

Crosshair resurrection for 1.1

Postby Lucky Bro » Sun Aug 16, 2009 7:02 pm

Good day,

This update for crosshair.

New/fixed variables:
cg_drawCrosshair <0-CrosshairsCount>
Sets your crosshair.
In my current patch CrosshairsCount set to 9. You my suggest any other variable. But! You have to provide new crosshairs for them.
For now I can find only default one (but it is not free-to-use :() and two lethal ones (I'm not sure abut them too).
cg_drawCrosshairPickUpPulse <1/0>
Does pulsing when picking up an item.
cg_crosshairHealth <1/0>
Changes crosshair color depend on health and armor status.
You may suggest other colors or scheme how this thing should work. Please provide detailed expectations or give a link to them.
cg_drawCrosshairTransparency <0.0-1.0>
Sets crosshair transparency.
The crosshair will be solid when you look at your teammate or look at some item to activate. Please post a request here if you don't like such behavior (with explanation why not and expected behavior).
cg_drawCrosshairWidthMultiply <0.0-*.0>
Sets multiplier for crosshair width. If crosshair is too big or small for you - use it.
cg_drawCrosshairHeightMultiply <0.0-*.0>
The same as previous. With conjunction of previous you may form some unique crosshair forms.
Why we can't use the patch immediate:
We don't have crosshairs pictures. If someone can draw them - please do so.
Things to do:
To add UI support for crosshairs like it is done in vanilla Q3.
To add custom colors for crosshairs. It could be player's effect color (they aren't working now and should be resurrected too). Or just a new cg variable. Post your ideas if you have any.
To take a look at CG_DrawCrosshair3D() - the function for stereo rendering. It doesn't use now teammates markers and any color/transparent functions.
To make second crosshair like in many other games to allow to have complicated and two-colored crosshair. Again post your suggestions.
To add green (variable) and red (variable) colors when pointing at enemy or teammate.
To add pulsing when hit someone.
To add representation of player's velocity and position.
How do one can check the patch?
Wait until 1.1 will be released or check some other my thread here to find out how it could be done. Don't hesitate to use IRC.

The patch source code for discussion:
Index: code/cgame/cg_draw.c
===================================================================
--- code/cgame/cg_draw.c (revision 263)
+++ code/cgame/cg_draw.c (working copy)
@@ -2617,37 +2617,32 @@
qhandle_t hShader;
float f;
float x, y;
-#ifndef SMOKINGUNS
int ca;
-
-#else
- vec4_t colorActivate = {1.0f, 0.75f, 0.0f, 1.0f};
+#ifdef SMOKINGUNS
qboolean drawFriendWarning = qfalse;
+ vec4_t hcolor = {1.0f, 1.0f, 1.0f, 1.0f};
+#endif

+#ifdef SMOKINGUNS
if ( cg.snap->ps.persistant[PERS_TEAM] >= TEAM_SPECTATOR) {
return;
}
+#else
+ if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR) {
+ return;
+ }
+#endif

if ( cg.renderingThirdPerson ) {
return;
}
-
+
+#ifdef SMOKINGUNS
+ //Draw Sharps rifle crosshair
if( cg.snap->ps.stats[STAT_WP_MODE]==1 && cg.snap->ps.weapon == WP_SHARPS){
- float x, y, w, h;
- qhandle_t hShader = cgs.media.scopeShader;
+ hShader = cgs.media.scopeShader;
+ CG_DrawPic(0.0f, 0.0f, 640.0f, 480.0f, hShader);

- x = 0;
- y = 0;
- w = 640;
- h = 480;
-
- CG_DrawPic(x, y, w, h, hShader);
-
- y = 38;
- x = 118;
- h = 480-2*y;
- w = 640-2*x;
-
if( changeCrosshair){
if( isPlayer ) {
trap_R_SetColor( colorRed );
@@ -2656,97 +2651,83 @@
}
}

- CG_DrawPic(x, y, w, h, cgs.media.scopecrossShader);
+ CG_DrawPic(118.0f, 38.0f, 404.0f, 404.0f, cgs.media.scopecrossShader);

-// Zoom
+ // Zoom
CG_ZoomDown_f();
return;
}//modified by Spoon

CG_ZoomUp_f();
#endif
-
+
+ //To make/use the same for shraps?
if ( !cg_drawCrosshair.integer ) {
return;
}

-#ifndef SMOKINGUNS
- if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR) {
- return;
- }
-
- if ( cg.renderingThirdPerson ) {
- return;
- }
-
- // set color based on health
- if ( cg_crosshairHealth.integer ) {
- vec4_t hcolor;
-
- CG_ColorForHealth( hcolor );
- trap_R_SetColor( hcolor );
- } else {
- trap_R_SetColor( NULL );
- }
-
-#else
- //if a pickable item is in front of the player
+#ifdef SMOKINGUNS
+ //Duel fade out
if(cgs.gametype == GT_DUEL && cg.introend - DU_INTRO_DRAW <= cg.time
&& cg.introend + DU_CROSSHAIR_FADE >= cg.time){
- vec4_t colorFade = {1.0f, 1.0f, 1.0f, 0.0f};

if(cg.introend + DU_CROSSHAIR_START <= cg.time){
- colorFade[3] = (float)(cg.time - cg.introend - DU_CROSSHAIR_START)/DU_CROSSHAIR_FADE;
+ hcolor[3] = (float)(cg.time - cg.introend - DU_CROSSHAIR_START)/DU_CROSSHAIR_FADE;
}
-
- trap_R_SetColor( colorFade);
} else if( changeCrosshair ) {
if( isPlayer ) {
- // change crosshair to indicate that target is a teammate
+ // Change crosshair to indicate that target is a teammate
drawFriendWarning = qtrue;
- }
- else {
+ } else {
+ // Item to activate
trap_R_SetColor( colorActivate );
}
+ } else {
+ // set color based on health
+ if ( cg_crosshairHealth.integer ) {
+ CG_ColorForHealth( hcolor );
+ } else {
+ //Put here custom color set
+ }
+ hcolor[3] = (cg_drawCrosshairTransparency.value <= 1.0) ? cg_drawCrosshairTransparency.value : 1.0;
+ trap_R_SetColor( hcolor );
}
+#else
+ trap_R_SetColor( NULL );
#endif

w = h = cg_crosshairSize.value;

- // pulse the size of the crosshair when picking up items
- f = cg.time - cg.itemPickupBlendTime;
- if ( f > 0 && f < ITEM_BLOB_TIME ) {
- f /= ITEM_BLOB_TIME;
- w *= ( 1 + f );
- h *= ( 1 + f );
+ if (cg_drawCrosshairPickUpPulse.integer) {
+ // pulse the size of the crosshair when picking up items
+ f = cg.time - cg.itemPickupBlendTime;
+ if ( f > 0 && f < ITEM_BLOB_TIME ) {
+ f /= ITEM_BLOB_TIME;
+ w *= ( 1 + f );
+ h *= ( 1 + f );
+ }
}

x = cg_crosshairX.integer;
y = cg_crosshairY.integer;
#ifndef SMOKINGUNS
CG_AdjustFrom640( &x, &y, &w, &h );
-
- ca = cg_drawCrosshair.integer;
- if (ca < 0) {
- ca = 0;
- }
- hShader = cgs.media.crosshairShader[ ca % NUM_CROSSHAIRS ];
-
- trap_R_DrawStretchPic( x + cg.refdef.x + 0.5 * (cg.refdef.width - w),
- y + cg.refdef.y + 0.5 * (cg.refdef.height - h),
- w, h, 0, 0, 1, 1, hShader );
-#else
- hShader = cgs.media.crosshairShader;
- CG_DrawPic( x + 320 - w/2, y + 240 - h/2, w, h, hShader );
-
+#endif
if (drawFriendWarning) {
trap_R_SetColor(colorRed);
hShader = cgs.media.crosshairFriendShader;
- CG_DrawPic( x + 320 - w/2, y + 240 - h/2, w, h, hShader );
+ } else {
+ ca = cg_drawCrosshair.integer;
+ if (ca < 0) {
+ ca = 0;
+ }
+ hShader = cgs.media.crosshairShader[ ca % NUM_CROSSHAIRS ];
}
-
- trap_R_SetColor( NULL );
-#endif
+ h *= cg_drawCrosshairHeightMultiply.value;
+ w *= cg_drawCrosshairWidthMultiply.value;
+ trap_R_DrawStretchPic( x + cg.refdef.x + 0.5 * (cg.refdef.width - w),
+ y + cg.refdef.y + 0.5 * (cg.refdef.height - h),
+ w, h, 0, 0, 1, 1, hShader );
}

/*
@@ -2759,9 +2740,7 @@
float w, h;
qhandle_t hShader;
float f;
-#ifndef SMOKINGUNS
int ca;
-#endif

trace_t trace;
vec3_t endpos;
@@ -2795,15 +2774,12 @@
h *= ( 1 + f );
}

-#ifndef SMOKINGUNS
+
ca = cg_drawCrosshair.integer;
if (ca < 0) {
ca = 0;
}
hShader = cgs.media.crosshairShader[ ca % NUM_CROSSHAIRS ];
-#else
- hShader = cgs.media.crosshairShader;
-#endif

// Use a different method rendering the crosshair so players don't see two of them when
// focusing their eyes at distant objects with high stereo separation
Index: code/cgame/cg_drawtools.c
===================================================================
--- code/cgame/cg_drawtools.c (revision 263)
+++ code/cgame/cg_drawtools.c (working copy)
@@ -874,11 +874,11 @@
return 0.75;
#else
// Tequila comment: Adjusted the scale for small ui font
- return 0.45;
+ return 0.45f;
#endif
}

- return 1.00;
+ return 1.0f;
}


Index: code/cgame/cg_local.h
===================================================================
--- code/cgame/cg_local.h (revision 263)
+++ code/cgame/cg_local.h (working copy)
@@ -1122,10 +1122,9 @@
qhandle_t selectShader;
qhandle_t viewBloodShader;
qhandle_t tracerShader;
-#ifndef SMOKINGUNS
+
qhandle_t crosshairShader[NUM_CROSSHAIRS];
-#else
- qhandle_t crosshairShader;
+#ifdef SMOKINGUNS
qhandle_t crosshairFriendShader;
#endif
qhandle_t lagometerShader;
@@ -1652,6 +1651,10 @@
extern vmCvar_t cg_drawIcons;
extern vmCvar_t cg_drawAmmoWarning;
extern vmCvar_t cg_drawCrosshair;
+extern vmCvar_t cg_drawCrosshairPickUpPulse;
+extern vmCvar_t cg_drawCrosshairWidthMultiply;
+extern vmCvar_t cg_drawCrosshairHeightMultiply;
+extern vmCvar_t cg_drawCrosshairTransparency;
extern vmCvar_t cg_drawCrosshairNames;
extern vmCvar_t cg_drawRewards;
extern vmCvar_t cg_drawTeamOverlay;
Index: code/cgame/cg_main.c
===================================================================
--- code/cgame/cg_main.c (revision 263)
+++ code/cgame/cg_main.c (working copy)
@@ -116,6 +116,10 @@
vmCvar_t cg_drawIcons;
vmCvar_t cg_drawAmmoWarning;
vmCvar_t cg_drawCrosshair;
+vmCvar_t cg_drawCrosshairPickUpPulse;
+vmCvar_t cg_drawCrosshairWidthMultiply;
+vmCvar_t cg_drawCrosshairHeightMultiply;
+vmCvar_t cg_drawCrosshairTransparency;
vmCvar_t cg_drawCrosshairNames;
vmCvar_t cg_drawRewards;
vmCvar_t cg_crosshairSize;
@@ -341,6 +345,10 @@
{ &cg_drawAmmoWarning, "cg_drawAmmoWarning", "1", CVAR_ARCHIVE },
{ &cg_drawAttacker, "cg_drawAttacker", "1", CVAR_ARCHIVE },
{ &cg_drawCrosshair, "cg_drawCrosshair", "4", CVAR_ARCHIVE },
+ { &cg_drawCrosshairPickUpPulse, "cg_drawCrosshairPickUpPulse", "1", CVAR_ARCHIVE },
+ { &cg_drawCrosshairWidthMultiply, "cg_drawCrosshairWidthMultiply", "1", CVAR_ARCHIVE },
+ { &cg_drawCrosshairHeightMultiply, "cg_drawCrosshairHeightMultiply", "1", CVAR_ARCHIVE },
+ { &cg_drawCrosshairTransparency, "cg_drawCrosshairTransparency", "1.0", CVAR_ARCHIVE },
{ &cg_drawCrosshairNames, "cg_drawCrosshairNames", "1", CVAR_ARCHIVE },
{ &cg_drawRewards, "cg_drawRewards", "1", CVAR_ARCHIVE },
{ &cg_crosshairSize, "cg_crosshairSize", "24", CVAR_ARCHIVE },
@@ -1429,12 +1437,10 @@
cgs.media.tracerShader = trap_R_RegisterShader( "gfx/misc/tracer" );
cgs.media.selectShader = trap_R_RegisterShader( "gfx/2d/select" );

-#ifndef SMOKINGUNS
+#ifdef SMOKINGUNS
for ( i = 0 ; i < NUM_CROSSHAIRS ; i++ ) {
- cgs.media.crosshairShader[i] = trap_R_RegisterShader( va("gfx/2d/crosshair%c", 'a'+i) );
+ cgs.media.crosshairShader[i] = trap_R_RegisterShader(va("gfx/2d/crosshair%c", 'a'+i) );
}
-#else
- cgs.media.crosshairShader = trap_R_RegisterShader( "hud/crosshair");
cgs.media.crosshairFriendShader = trap_R_RegisterShader( "hud/crosshair_friend");

CG_LoadingStage(1);
Index: code/cgame/cg_weapons.c
===================================================================
--- code/cgame/cg_weapons.c (revision 263)
+++ code/cgame/cg_weapons.c (working copy)
@@ -4008,7 +4008,7 @@

spread_dist = ( current_spread_circle + Q_random( &seed ) ) / max_spread_circle * bg_weaponlist[es->weapon].spread * 16 ;
// spread adjustement to keep the same spread feeling:
- spread_dist *= 1.4 ;
+ spread_dist *= 1.4f;

spread_angle = current_angle_shift + ( (float)current_spread_cell + Q_random( &seed ) ) * M_PI * 2.0f / (float)current_pellet_per_circle ;

Index: code/qcommon/q_math.c
===================================================================
--- code/qcommon/q_math.c (revision 263)
+++ code/qcommon/q_math.c (working copy)
@@ -48,6 +48,7 @@
vec4_t colorLtGrey = {0.75, 0.75, 0.75, 1};
vec4_t colorMdGrey = {0.5, 0.5, 0.5, 1};
vec4_t colorDkGrey = {0.25, 0.25, 0.25, 1};
+vec4_t colorActivate = {1.0f, 0.75f, 0.0f, 1.0f};

vec4_t g_color_table[8] =
{
Index: code/qcommon/q_shared.h
===================================================================
--- code/qcommon/q_shared.h (revision 263)
+++ code/qcommon/q_shared.h (working copy)
@@ -415,6 +415,7 @@
extern vec4_t colorLtGrey;
extern vec4_t colorMdGrey;
extern vec4_t colorDkGrey;
+extern vec4_t colorActivate;

#define Q_COLOR_ESCAPE '^'
#define Q_IsColorString(p) ( p && *(p) == Q_COLOR_ESCAPE && *((p)+1) && isalnum(*((p)+1)) ) // ^[0-9a-zA-Z]
Index: code/ui/ui_main.c
===================================================================
--- code/ui/ui_main.c (revision 263)
+++ code/ui/ui_main.c (working copy)
@@ -415,9 +415,8 @@


void AssetCache( void ) {
-#ifndef SMOKINGUNS
int n;
-#endif
+
//if (Assets.textFont == NULL) {
//}
//Assets.background = trap_R_RegisterShaderNoMip( ASSET_BACKGROUND );
@@ -444,17 +443,14 @@
uiInfo.uiDC.Assets.scrollBarThumb = trap_R_RegisterShaderNoMip( ASSET_SCROLL_THUMB );
uiInfo.uiDC.Assets.sliderBar = trap_R_RegisterShaderNoMip( ASSET_SLIDER_BAR );
uiInfo.uiDC.Assets.sliderThumb = trap_R_RegisterShaderNoMip( ASSET_SLIDER_THUMB );
-
-#ifndef SMOKINGUNS
for( n = 0; n < NUM_CROSSHAIRS; n++ ) {
uiInfo.uiDC.Assets.crosshairShader[n] = trap_R_RegisterShaderNoMip( va("gfx/2d/crosshair%c", 'a' + n ) );
}
-
+#ifndef SMOKINGUNS
uiInfo.newHighScoreSound = trap_S_RegisterSound("sound/feedback/voc_newhighscore.wav", qfalse);
#else
uiInfo.uiDC.Assets.menu_width = trap_R_RegisterShaderNoMip( ASSET_MENU_WIDTH);
uiInfo.uiDC.Assets.menu_height = trap_R_RegisterShaderNoMip (ASSET_MENU_HEIGHT);
- uiInfo.uiDC.Assets.crosshairShader = trap_R_RegisterShaderNoMip( "hud/crosshair" );
#endif
}

@@ -2187,14 +2183,10 @@

static void UI_DrawCrosshair(rectDef_t *rect, float scale, vec4_t color) {
trap_R_SetColor( color );
-#ifndef SMOKINGUNS
if (uiInfo.currentCrosshair < 0 || uiInfo.currentCrosshair >= NUM_CROSSHAIRS) {
uiInfo.currentCrosshair = 0;
}
UI_DrawHandlePic( rect->x, rect->y - rect->h, rect->w, rect->h, uiInfo.uiDC.Assets.crosshairShader[uiInfo.currentCrosshair]);
-#else
- UI_DrawHandlePic( rect->x, rect->y - rect->h, rect->w, rect->h, uiInfo.uiDC.Assets.crosshairShader);
-#endif
trap_R_SetColor( NULL );
}

Index: code/ui/ui_shared.h
===================================================================
--- code/ui/ui_shared.h (revision 263)
+++ code/ui/ui_shared.h (working copy)
@@ -340,11 +340,7 @@
// player settings
qhandle_t fxBasePic;
qhandle_t fxPic[7];
-#ifndef SMOKINGUNS
- qhandle_t crosshairShader[NUM_CROSSHAIRS];
-#else
- qhandle_t crosshairShader;
-#endif
+ qhandle_t crosshairShader[NUM_CROSSHAIRS];

} cachedAssets_t;


The patch file: Crosshair.patch

Thank you for attention!
Have a good day!
Last edited by Lucky Bro on Mon Aug 17, 2009 8:32 am, edited 1 time in total.
"You should know that the lies won't hide your flaws/No sense in hiding all of yours/You gave up on your dreams along the way" (c) "Fake it" by Seether
P.S. English isn't my native language.
User avatar
Lucky Bro
Gunslinger
 
Posts: 143
Joined: Mon Mar 09, 2009 4:12 pm



Postby RailedRobin » Sun Aug 16, 2009 10:24 pm

Nicely done Lucky Bro! Good to see someone working on the crosshair, since I just the other night ran into a new player wanting to change his. Although I will have to wait for the 1.1 version to see this in action, but I look forward to it :wink:

Would it be possible to make the crosshair pulse or flash in another color when you hit someone? It could, for example, flash green when you hit an opponent and red when you hit a team mate, or something similar.

I could take a shot at drawing some crosshairs, but I won't be able to do it in another week or so, since I'm away from my computer with a decent drawing program.
What kind of crosshairs would be preferable? I know there was another thread about this somewhere, where just a small dot where mentioned. I'll just go look for that post, instead of changing the topic of this one.

Would the colors available be the same ones as those you're working on for the names?
A bullet may have your name on it, but dynamite is addressed "to whom it may concern."
User avatar
RailedRobin
Quick Draw
 
Posts: 54
Joined: Tue Jul 18, 2006 9:57 pm
Location: The frozen north



Postby Sucalakafufu » Mon Aug 17, 2009 4:23 am

RailedRobin wrote:Nicely done Lucky Bro! Good to see someone working on the crosshair, since I just the other night ran into a new player wanting to change his. Although I will have to wait for the 1.1 version to see this in action, but I look forward to it :wink:

Would it be possible to make the crosshair pulse or flash in another color when you hit someone? It could, for example, flash green when you hit an opponent and red when you hit a team mate, or something similar.

I could take a shot at drawing some crosshairs, but I won't be able to do it in another week or so, since I'm away from my computer with a decent drawing program.
What kind of crosshairs would be preferable? I know there was another thread about this somewhere, where just a small dot where mentioned. I'll just go look for that post, instead of changing the topic of this one.

Would the colors available be the same ones as those you're working on for the names?


maybe it should turn green when the crosshairs are pointed at an enemy and red when over an ally... this would emphasize not to shoot when red even if the red X doesn't appear..

during DM games the crosshairs could remain black at all times
SG Name: Sucalakafufu
Clan: [CWNN] - Clan With No Name
User avatar
Sucalakafufu
Gunslinger
 
Posts: 239
Joined: Thu Apr 16, 2009 8:59 am



Postby Lucky Bro » Mon Aug 17, 2009 8:29 am

RailedRobin,
Yes, the pulsing when you hit someone could be done. It will take some time but I think it could be done the same way as it now when you pick up something. I'll add this to "to do" list.
About pictures - if you have vanilla Q3 you may find inside baseq3/pak0.pk3 in gfx/2d directory 10 crosshairs from quake3. They are nice and everyone knows them well. So the job will be not to copy but to re-do them in Western-style or just to draw similar from scratch. Take them as basis.
But if you can do more complicated thing - then it will be better to do 2 types of crosshairs - one for inside and one for outside. Like circle and cross. Cross will be inside and circle outside.
I'll do color choosing for each one and then it'll be even more cool.
If you may do that - then the more crosshairs you'll draw the more we take into game. But don't just copy others authors crosshairs.. because we can't took someone else's job - we already have that problem :(
It will be great help if you do this! One week I can wait for sure. Even two :) (I'll do other patch instead and actually this week I'm suffering for lack of time too)
Don't hesitate to take inspiration from other's work. Just don't copy :)
About colors - there are lot of ways how to implement them.
The most flexible is like it done with Conq's patch with console - just to set them with RGB(A) pattern (or 4 variables for each). That will give you all-the-possible colors and transparency you may get. I think that will be the way (but maybe not).
Also there is a way to use player's effects color. But it will took a some time to resurrect it first.
Or yeah, to use the colors like in main text colors. But that will give you only 32 colors. If it fits everyone needs - than better to use them.

Sucalakafufu,
Not a problem too. But will require a few more variables to be able to configure the stuff. Since you have the possibility to choose your crosshair color and the possibility to choose which color is for enemy and which one for a friend. I'm already have this when I'm trying to decide how to choose health-relational colors.
I'll add this one to "to do" list.

Also I think the best thing to do is to make crosshair represent you current velocity and related spread. When you run it is big and when you sit it is small. But it will require a lot of work :)
"You should know that the lies won't hide your flaws/No sense in hiding all of yours/You gave up on your dreams along the way" (c) "Fake it" by Seether
P.S. English isn't my native language.
User avatar
Lucky Bro
Gunslinger
 
Posts: 143
Joined: Mon Mar 09, 2009 4:12 pm



Postby Sucalakafufu » Mon Aug 17, 2009 10:24 am

@LuckyBro: that sounds pretty good about the size for velocity thing :)
SG Name: Sucalakafufu
Clan: [CWNN] - Clan With No Name
User avatar
Sucalakafufu
Gunslinger
 
Posts: 239
Joined: Thu Apr 16, 2009 8:59 am



Postby mLy! » Mon Aug 17, 2009 12:49 pm

Crosshairhealth colour would be very cool, thats what i use in rtcw and ET.

Also no pulsing and a simple DOT is a HUGE improvement
My Latest fragmovies:
Winning BB cup
User avatar
mLy!
Gunslinger
 
Posts: 218
Joined: Wed Feb 11, 2009 8:46 pm



Postby Lucky Bro » Mon Aug 17, 2009 1:36 pm

mLy,
Nice to hear.
What is about armor? Should it be taken into account during health coloring?
And how exactly the scheme with health color should work?
Current realization means that health has two stages - red (almost dead -20hp) and orange (60hp). And it always adds armor (60hp) to health if you wear plate.
So, maybe we should do some color gradation and remove armor?
I haven't used colored health crosshair, so I hope you'll explain me the best scheme to implement.
Also should those health colors be modifiable?

Thanks in advance! :)
"You should know that the lies won't hide your flaws/No sense in hiding all of yours/You gave up on your dreams along the way" (c) "Fake it" by Seether
P.S. English isn't my native language.
User avatar
Lucky Bro
Gunslinger
 
Posts: 143
Joined: Mon Mar 09, 2009 4:12 pm



Postby mLy! » Mon Aug 17, 2009 2:03 pm

Keep it simple, making it modifiable doesnt seem necessary.

I would not include armor (boiler plate) because legshots and arms or not covered by it anyway.

For the colour scheme, I would suggest the following:
White: 100 - 80 HP
Yellow: 79 - 50 HP
Red: 49-0 HP

Changing these HP values a bit would not be too much differance. Important is that these 3 colours are the best to have your crosshair in. Maybe yellow not that much in SG, so thats why i would make the yellow range the 'shortest'


Lucky Bro wrote:mLy,
Nice to hear.
What is about armor? Should it be taken into account during health coloring?
And how exactly the scheme with health color should work?
Current realization means that health has two stages - red (almost dead -20hp) and orange (60hp). And it always adds armor (60hp) to health if you wear plate.
So, maybe we should do some color gradation and remove armor?
I haven't used colored health crosshair, so I hope you'll explain me the best scheme to implement.
Also should those health colors be modifiable?

Thanks in advance! :)
My Latest fragmovies:
Winning BB cup
User avatar
mLy!
Gunslinger
 
Posts: 218
Joined: Wed Feb 11, 2009 8:46 pm



Postby wwbiteme » Mon Aug 17, 2009 3:32 pm

I would like to see not a cross hair but a dot. This is what I use on the RTCW Wildwest game and I rather like it. Makes it easy to line up shots... Is this a possibility?
For another great WildWest game in addition to this visit us at:
http://forums.wildwest-game or http://forums.filefront.com/wildwest-250/
User avatar
wwbiteme
Drifter
 
Posts: 14
Joined: Mon Oct 08, 2007 5:17 am



Postby Lucky Bro » Mon Aug 17, 2009 3:49 pm

wwbiteme,
Yes, when crosshairs will be done (drawn).
Dot could be the circle or rectangle.
You'll just use multiply variables to reduce it if you need only 1 pixel.
"You should know that the lies won't hide your flaws/No sense in hiding all of yours/You gave up on your dreams along the way" (c) "Fake it" by Seether
P.S. English isn't my native language.
User avatar
Lucky Bro
Gunslinger
 
Posts: 143
Joined: Mon Mar 09, 2009 4:12 pm



Postby torhu » Thu Sep 17, 2009 12:44 am

If people want a bigger or smaller crosshair, they can use the cvar cg_crosshairSize, which works in SG 1.0. Just a reminder. :)

And here's a reply to your proposal:

Crosshair Health
I think the suggestion to display your health on the crosshair is good. The reason it's disabled in SG is probably that the crosshair turns yellow to indicated that you can 'activate' something in front of you, like a door or a gatling. So there would have to be a different way to do that. I've seen some games use a hand icon that pops up next to the crosshair.

Different Crosshairs
It would be nice to have more than one crosshair to choose between. But if someone can make one that's better than what we have got, and everyone is happy with, we don't necessarily need to have more than one. One easy fix would be to make it an option to use just the dot of the crosshair, without the stuff around. So you would have "default" and "dot only".

Or if someone wants to try to make better crosshairs, please do. :)
In game: =SG=monSter
Monster Browser
User avatar
torhu
SG Team
 
Posts: 1125
Joined: Thu Jan 06, 2005 8:12 pm
Location: Norway



Postby Lucky Bro » Thu Sep 17, 2009 8:07 am

Yeah,
The idea is to have two crosshairs. Two configurable crosshairs.
So one may react on activate/teammate/opponent (picking up an item) and second to the health, etc.
Depends on what player exactly wants.
Btw, there is no trouble if crosshair changes its color when player sees an activation entity. Looks like it is expected - the color is changed to the activation color. And when player doesn't look at the activation entity he/she sees health color. No doubt about that. Such logic works fine.

And concerning size, I already did so that player has ratio value to determine width/height ratio for each crosshair. Size is still present. Theses two values (ratio and size) are enough to make many transformed shapes of the crosshair.

After HUD resurrection/improvements there will be possibility just to set any picture you want to both of crosshairs. But before that - I'll wait until Robin will do crosshairs.

The patch is deprecated, btw. I have better version already. Which is not finished yet.

Have a good day.
"You should know that the lies won't hide your flaws/No sense in hiding all of yours/You gave up on your dreams along the way" (c) "Fake it" by Seether
P.S. English isn't my native language.
User avatar
Lucky Bro
Gunslinger
 
Posts: 143
Joined: Mon Mar 09, 2009 4:12 pm



Postby Joe Kari » Thu Sep 17, 2009 1:35 pm

My brother have made in the past a better default crosshair, just using the current crosshair with alpha transparencies.

I agree that a dot should be fine too, lot of top player want it ;)

Showing life of the target is not something I'm fond of... Especially because a wounded opponent have a lot of blood on his cloth, no need to redundant information... Just my opinion...
User avatar
Joe Kari
SG Team
 
Posts: 879
Joined: Sun Sep 16, 2007 8:44 pm
Location: France



Postby Lucky Bro » Thu Sep 17, 2009 3:51 pm

I haven't seen your brother's work Joe, so can't say anything about it.

Humm... Showing target's health is not competitive gaming. Current feature is going from Team Arena and already present in the code - crosshair color represents your player's health. You can't know other player's health. The only thing I miss is health-dependent hit sounds from CPMA. Will be done as well sometime I think.
And the only doubtable things about current feature are changing color when pointing to the opponent and pulsing on the hit.
"You should know that the lies won't hide your flaws/No sense in hiding all of yours/You gave up on your dreams along the way" (c) "Fake it" by Seether
P.S. English isn't my native language.
User avatar
Lucky Bro
Gunslinger
 
Posts: 143
Joined: Mon Mar 09, 2009 4:12 pm



Postby Allied » Thu Sep 17, 2009 6:14 pm

I would definitely most like a crosshair similar to the current one, but without the dot in the center. It makes aiming on distant targets, or small holes very difficult as it covers up what you're trying to see.

Can someone point out to me how to get a SG copy running off unpacked PK3's? I'd like to test some crosshairs I've made without repacking PK3's every time. Also, should the TGA be 8, 16, or 32 BPP?

Thanks.
User avatar
Allied
Quick Draw
 
Posts: 67
Joined: Tue Feb 24, 2009 8:27 pm



Next

Return to Code

Show Sidebar
Show Sidebar

User Control Panel

cron