Defining Awesome
  • Status Updates

  • Written by . Posted at 11:05 am on October 2nd, 2010

    2 questions 2 experts:

    1. I want to make a video tutorial with keyboard displayed and keys that I press as I play displayed on the screen. Any software that can do this?

    2. Can I pack a float into 16bits and what would the precision loss be?

    Be Sociable, Share!

    19 comments.

    1. 2) What do you want to do with it? Cast it to an integer, or keep the float?
      Maybe the Bitoperators would help for this kind of Operation.
      But perhaps you could just make a cast, I don’t know wether it works.


    2. Well, I want to send it over the net. If I have an integer that I know won’t be larger than some value I can store in fewer bits. I want to the same with a float. If I have floats only going up to say 32000.0f then there must be a way to compress that.


    3. 1) This is a tutorial showing you how to do that using Hypercam: http://www.metacafe.com/watch/458454/improve_screen_captures_with_shortcuts_and_keystrokes/


    4. P.S. It doesn’t display a keyboard, just the pressed keys. I don’t think such a software exists.


    5. @MM

      As far as I know there isn’t any possibility to make a ‘short float’ and I guess ‘float’ is already the smallest float-type.

      But there must be a way to store a float bit by bit.
      I don’t know how the processor knows that a certain value is a float or an integer by just reading 1 and 0.
      Maybe in a byte is a “float-bit” that marks the byte as a float value.


    6. Fixed precision arithmetic. :)


    7. It doesnt know. Whatever you have that address cast to it will use.

      As far as I know in C there is no short float, there is something like that in GLSL, so it is possible. In the MD2 model format, floats are converted to either fixed point or integers, I cant remember. But fixed-point would seem to work very well, since you can choose your accuracy down to 1 bit. If its too slow, just multiply your float by 1000 or however much precision you want, and store it an an short int.


    8. Is there any way to edit comments?


    9. why not making an ingame console/dialog box/ that displays what buttons you press??? you can program it so it shows exactly what you do and how you want.


    10. You can do something like this:
      – Multiply the float by X where X is the desired precision (1000 for instance)
      – Store in 16bit int
      – Send
      – Receive
      – Divide by X and store in float

      Not sure if that’s too expensive but it does the trick, just need to figure if you can actually store what you want with that range/precision


    11. Underline

      1 – camtasia?

      2 – multiply by the precision, get the int(), send, convert. Like mar said.


    12. staticfloat

      You can either do the float -> integer trick, but that doesn’t give you the variable dynamic range that the floating point format gives you. I suggest you use the “half” floating-point number format, which use only 16 bits.

      http://en.wikipedia.org/wiki/Half_precision_floating-point_format

      Here’s a link to a forum topic in which a guy has written a class to do all the heavy lifting for you.
      http://www.gamedev.net/community/forums/topic.asp?topic_id=542179&whichpage=1&#3497291

      I haven’t tested it, but I have faith you can test it yourself. 😉


    13. staticfloat

      Oh, and as to precision loss; seeing as the float16 standard only has 10 bits for the fraction portion, you probably won’t get more than 4-5 significant digits. I would just plug it in and run some tests though. 😛


    14. Easiest thing to do, though a bit time consuming, is just make a flash app. Open a flash window that shows a keyboard. The app records keys being pressed (key listener) and highlights each key being pressed (when KeyIsDown). You can then use a program such as Crystal Chaos to make the flash app window translucent so that you can still see the bottom half of the game behind it. Easy schmeasy man.


    15. I’m gonna go with mar’s solution, seems the simplest.

      As for the keyboard, I think I’ll just need to code something like that myself.

      Thanks a lot for the suggestions!


    16. I have a template if you need it. I actually started on a flash app, then realized that you can’t use it while playing the game. Unless you have some wacky program that will let you, I don’t think you can use keypresses for 2 programs at the same time… in this case one being a flash player. I’m sure there is a background program that will let you do it, since I’ve seen similar being done in presentations. Sorry bro, I tried. :(

      Still DO REMEMBER Chaos Crystal. It’s the easiest way for making any window/program translucent to invisible… if you do find something. Otherwise you will have to code it.

      My suggestion is graphically wise and very simply. Copy the keyboard used in Windows (Start – All Programs – Accessories – Accessibility – On Screen Keyboard). Make a copy of each button you want to use – put each on a separate layer. Turn the fill color of each layered button from white to red. Then when you display a button press – it turns red.


    17. Hi Michał,

      If you are still looking for a solution to store float in 16bits then say so, now it’s too late for me… It’s about using simple logical ORs that prune the 32bit float into the 16bit half-float (the one mentioned in one of the previous posts). It still keeps 4-5 digits of precision.

      I can’t imagine how mar’s suggestion can fit your needs – you need to store maximum value of 32000.0f so how do you want to multiply it by 1000 and store in 16bit integer? Or maybe I didn’t understand it right.

      I came here by accident. Didn’t know that you are working on soldat (link-dead is an independent game or a new version of soldat or what in brief? Just curious).

      Regards and keep up the good work.


    18. Ok, never mind my solution, forgot about one detail due to late hour :)


    19. danyukhin

      Camtasia can capture keyboard input.


    Post a comment.

    Links