Xonotic Forums
[SUGGESTION] SVG crosshairs - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Suggestion Box (https://forums.xonotic.org/forumdisplay.php?fid=20)
+--- Thread: [SUGGESTION] SVG crosshairs (/showthread.php?tid=837)



SVG crosshairs - unfa - 08-17-2010

Just got an idea, when I was looking at my crosshair, scaled up and ugly pixelized.

Would it be possible to make the game use SVG graphics for crosshairs, and other stuff? That would decrease game package size, and make it easier to change things. And mostly important: that would improve visual quality.

Sharp HUD, crosshairs, and other icons.

What do you think?
Is this worth work? Woudn't it slow down DP too much? Or is this a totally idiotic idea? Wink


RE: SVG crosshairs and other graphics - rainerzufalldererste - 08-17-2010

GOOD IDEA UNFA!!!
WE NEED THAT!!!
(are SVGs possible in darkplaces [yet]?)

Could there be SVG-Textures , too? xD


RE: SVG crosshairs and other graphics - Roanoke - 08-17-2010

SVGs are slow to render, they are not practical. Best thing to do would be to design in SVG and render at, say, 256^2 so crosshairs can be scaled down.


RE: SVG crosshairs and other graphics - Odin - 08-17-2010

Or you could render the SVGs into textures at load time, at a resolution that scales with the screen resolution.


RE: SVG crosshairs and other graphics - Visiiri - 08-17-2010

I'm not by any means an expert, but unless the crosshair was going to be more than a couple of lines that widen for spread representation, there's not really a reason for any sort of image at all. TMK, images are static. I don't think you can have one interact with things like spread.

(But what do I know? I'm just assuming that this game will have factors like spread.)


RE: SVG crosshairs and other graphics - divVerent - 08-17-2010

Especially for crosshairs, with pixel graphics you can work way more exact and provide way better quality (if done right).


RE: SVG crosshairs and other graphics - unfa - 08-18-2010

(08-17-2010, 07:12 PM)Odin Wrote: Or you could render the SVGs into textures at load time, at a resolution that scales with the screen resolution.

That's it! Rendering engine would have just textures as big and detailed as needed.

(08-17-2010, 11:01 PM)divVerent Wrote: Especially for crosshairs, with pixel graphics you can work way more exact and provide way better quality (if done right).

Well, I think that in theese days, when you can play the game in 640x480 or 1600x1200, not scalable crosshairs are in danger beacuse they easily get pixelized or they has to be unscalable.

Those would be great if we had a hard-coded screen resolution. Then they could be designed with pixels in mind.

Personally, I'd prefer those things to be sharp and simple. Thinking of that, SVG would give us another advantage: as it is all written in XML file, finding some marker and hiding/unhiding stuff that is needed would be easy. Then, engine could render several layers of crosshair, and show proper layers to indicate things.

When you get hurt, your crosshair could spawn a red ring of death around it (or show you approximate direction from where the shot came from), or turn red completely when your health is below 10, when you pick up something, it could flash gently in yellow or blue, when you aim at enemy, a dot in the center could get red instead of black etc (and flash green/blue if your shot was aimed good Smile, your crosshair could tell you if you're going to be out of ammo soon, or if you're empty already.

Possibilites are endless Smile Fun is endless Smile

I've never seen things like theese in any game, that would be something innovative Smile

Cerianly, it would require to re-make all crosshair, or simply create one universal design for the beginning, to test (and develop) this feature.

One design could contain weapon-specific parts like different base shape for every weapon. That would make one SVG file a whole crosshair set! In a very consistent style. That would be very development-friendly IMHO Smile


SVG got layers, naming them properly will make them recognisable by the engine, then it can generate proper textures and react for events with the crosshair!

Proposed SVG layer definition:
  • base - always visible layer of stuff that is not changing
  • pickup - ges visible when player pickup something (different colour could indicate what pickup e.g: green=armor, white=health, yellow=ammo/gun)
  • empty - gets visible when player has no ammunition left for the gun he handles
  • enemy - gets visible when hitscan detects an enemy in sight (useful for Nex)
  • friend - gets visible when you aim at a teammate (should indicate to hold fire)
  • hit - gets visible when player give damage to somebody (could be a friend), works same as the 'plink' sound of hit indicator
  • wall - gets visible when player would hurt himself (just like blurring the crosshair with TrueAim)
  • left - gots visible when player recieve damage from left
  • right
  • front - in your face!
  • back
  • hurt - fades from 0 to 100% opacity for health in range of 50-0. So it is 50% transparent for health 25 and 100% opaque (fully visible) for health 0 (meaning player dead Smile
  • armor - fades from 0 to 100% for 0 to maximum armor.

Layers priority should be the same is in SVG file to make it configurable by artists.


RE: SVG crosshairs and other graphics - unfa - 08-18-2010

   

.zip   SVG crosshair.zip (Size: 163.62 KB / Downloads: 15)


RE: SVG crosshairs - rainerzufalldererste - 08-18-2010

I think the current crosshairs are better!
but I like the back left-right-front-thing! Wink
and the hit thing!

there should be some things added to the current crosshairs ( and the current crosshairs should be made as svg )
PS: there are already some new crosshairs made: http://forums.xonotic.org/showthread.php?tid=542&pid=7155#pid7155
[Image: CrossConcept.jpg]


RE: SVG crosshairs - unfa - 08-20-2010

Would you be able to make theese in SVG?