FPS dynamic crosshair

I would ask if anybody can give me suggestions about how to create a dynamic crosshair for fps. For dynamic crosshair I mean replacing the fixed “+” char used for instance in test TestBrickWall, with a new one which can enlarge/resize itself using player movements. [It is the way used by fps games to display the inaccuracy consequent after fast movements of the gun].

  • Shall I to use the camera rotation? Or the camera direction?
  • Or I can use some mouseListener?
  • Is it better [even if is it possibile] “drawing it” using nifty in place of attaching it directly onto the guiNode?
  • Other suggestions?

    Thanks

You can use setLocalScale to increase/decrease the size of the crosshair. That would be a start but you can also use a more sophisticated system that moved textures around and such.

Make a crosshair object that consists of a textured quad that you scale.

Thanks to both of you, I’ll try a textured quad.

Have you also got ideas for the bonding the mouse/player/camera movement to this factor scale?

I have to listen to mouse movement? Or should I use camera/player rotation/direction?

What about nifty? With the effects it should be possible to make a nice crosshair, no?

I’m completly a layman about niftygui, but if you say it could be possibile, I’ll try. Are you thinking to use effects over a .png?

And how to recognize the intensity? Listening to mouse movements or camera/player rotation/direction?

Well the intensity is based on other information I guess, like how fast your player moves etc. idk where in your software you can access them best.

Depends on your game Layout, I for example would just use the Data I get from my network system when the new position rotation for the player is transfered. (As I have the difference betwenn old and new values directly aviable without further need to process anything)

just use the Data I get from my network system when the new position rotation for the player is transfered

Do you move you player using feedback info sent from server instead of move it directly with keyboardinput?
I really don't uderstand the second sentence:
(As I have the difference betwenn old and new values directly aviable without further need to process anything)

You understood it right, for my game design I decided that all calculations should be serverside wihle the client is just displaying stuff. But yours might be different, so what I basically wanted was to show the way that I use because it is completly different from the keyboardinput method.



Main motivation behind this post was, to show you that there are many problems where there is not a best solution, so it depends entriely on your game where the best position for such checks and calculations is.

Could you write the benefits of your layout, please? So I won’t waste time on developing mine, and after a while find is totally wrong!

And how do you manage rotation? With quaternions, matrix, other?!

I use quaternions for rotations, since I need a real 3d rotation in a space game, else I would use Euler angles.

Benefit of doing the calculations serverside is that there are less possibilites to cheat (go though wall ect), downside is that the server has to calculate more stuff of course and might become a bottlenneck.



Btw it won’t be a waste of time if your first attemps do not fulfull expectations. As long as you then go on analyse where the problem is and think about ways to solve it. The current concept is around my third implementation since in the tries before I had some serious design flaws. If I would start now the only thing I would change is reading a few books/articles about design patterns and networkcode first. I suggest taking a look at gamedev and gamasutra there are plenty of usefull informations.

I’ve read this one.

Ps: could you tell me how to use quaternions? I haven’t understand much reading the wiki here :?

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:math

https://wiki.jmonkeyengine.org/legacy/doku.php/rotate