1 ticket = 0

Discussion in 'Feedback' started by Avair, Jan 1, 2008.

  1. Avair

    Avair Member

    Messages:
    402
    Likes Received:
    0
    Trophy Points:
    0
    since tickets mean respawns left, change the number everyone sees to be one less than it currently is, because at 1 you can't respawn
     
  2. Private Sandbag

    Private Sandbag Member

    Messages:
    7,491
    Likes Received:
    0
    Trophy Points:
    0
    i totally agree avair.

    I remember thinking this when i first started playing... but anyway good post, well made.

    it just makes sense.
     
  3. supaste

    supaste Member

    Messages:
    677
    Likes Received:
    0
    Trophy Points:
    0
    i think it was originaly set as 1 being the minimum because 0 caused the game to end and your team to lose and yes i do see your point and how it could be confusing to some.
     
  4. Superlagg

    Superlagg Member

    Messages:
    620
    Likes Received:
    0
    Trophy Points:
    0
    It should be set that when the counter goes to -1, the game ends, but shows a zero in the text instead.
     
  5. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    Having a -1 means that he has to change the variable type he is using. I am sure for efficiency reasons he is using an unsigned short.

    for explanation:

    * Checking against 0 instead of a number is much faster for the computer to do rather then using functions to determine if they are equal.
    EX. if(Tickets==0) Instead of if(Tickets==-1)

    * Using an unsigned variable allows almost double range.

    EX:

    Code:
    Type Of Variable	Bit Size	Variables Range		Use
    unsigned char		8		0 <= X <= 255		Small numbers and full PC character set
    char			8		-128 <= X <= 127	Very small numbers and ASCII characters
    unsigned short		16		0 <= X <= 65,535	Counting, numbers, loop control
    short			16		-32,768 <= X <= 32,767	Counting, small numbers, small loop control
    
    There is no reason for most aspects of this game to use negative numbers there fore he probably is using unsigned variables in 90% of the code.


    Currently his code probably looks like this (oversimplified example).

    Code:
    ...
    if(BE_Loose_Ticket&&(BETickets==0)) NFWIN();
    elseif(NF_Loose_Ticket&&(NFTickets==0)) BEWIN();
    ...
    
    To U and I the tickets say 1 but inside the code the tickets read 0.
     
  6. Krenzo

    Krenzo Administrator

    Messages:
    3,771
    Likes Received:
    0
    Trophy Points:
    0
    Nah, I could just alter the display to subtract one before drawing it to the HUD.
     
  7. Superlagg

    Superlagg Member

    Messages:
    620
    Likes Received:
    0
    Trophy Points:
    0
    That would be nice, because what he said above made no sense to me, but that does, and that's why we love you!
     
  8. ViroMan

    ViroMan Black Hole (*sniff*) Bully

    Messages:
    8,382
    Likes Received:
    4
    Trophy Points:
    0
    So your saying the code reads 1=0 not 0=0?

    And altering the display before and update? More slowdowns.... the inefficiency goes up... lordy lordy lord. "--" Thats gana take up a one operation to do, when if you optimize the code a bit by making it check against 0 instead of a number you will be surprised at the speed gained. Your talking (I think its) 3 ops to do a number check and only 1 op to do an 0=0 check. Don't get me started on your using floating point variables for armor.
     
    Last edited: Jan 2, 2008
  9. Solokiller

    Solokiller Member

    Messages:
    4,861
    Likes Received:
    7
    Trophy Points:
    0
    I think he just does
    if (reinforcements = 1)
    then draw 0
    Or something.
     
  10. MOOtant

    MOOtant Member

    Messages:
    4,047
    Likes Received:
    0
    Trophy Points:
    0
    Who cares about client side it can do much more random shit. For example GUI has controls which are named using NTS (null-terminated strings) and are referenced by the string. All in all 0 vs 1 is not a big problem from performance point of view but you have to make sure that nothing will go wrong after changing it (no crashes or weird game endings)
     
  11. Terminal58

    Terminal58 Member

    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    0
    That sounds good to me.
     

Share This Page