Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Fix Credits
Fix Credits [message #402990] Wed, 16 September 2009 08:12 Go to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3807
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Credits must be controlled by an int variable right now, it would be really nice if once you get up past 99999 (might need one more 9) it didn't suddenly jump to -######. Depending on how deep you were in ren's code you may be able to fix this I was thinking. But if you can't convert it into long int or something don't just make it so players can't go negative, some mods use the player's ability to go into "debt" as a feature.

Re: Fix Credits [message #403001 is a reply to message #402990] Wed, 16 September 2009 09:28 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

Not sure what you mean... You can already have >99999 credits, only you can not set it as starting credits, afaik? ints go up to 2147483647, so that should be enough anyway, shouldn't it? I think credits are stored as float though, allowing huge amounts. The only reason I see for a weird number would be some NAN (not a number/invalid) value?

BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Fix Credits [message #403025 is a reply to message #402990] Wed, 16 September 2009 14:11 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
Yea you are right. You can set starting money at a max of 99999 but you can have more when you start playing. It just jumps to 100000 and than just counts upwards without problem.

idk Jerad, how you got the idea it suddenly jumps to '-######' ???


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg
Re: Fix Credits [message #403096 is a reply to message #402990] Thu, 17 September 2009 09:09 Go to previous messageGo to next message
CarrierII is currently offline  CarrierII
Messages: 3804
Registered: February 2006
Location: England
Karma: 0
General (3 Stars)

The starting credits entry box for the Ren Client hosting options limits to 9,999.
A signed 16-bit integer would limit to 32767, so it could be a signed 16-bit. I've never had more than 15/17K credits. Someone try to give a player money above 32767, and see what happens (Either overflow to -32767 or it won't overflow till the number SEye gave earlier)


Renguard is a wonderful initiative
Toggle Spoiler
Re: Fix Credits [message #403098 is a reply to message #403096] Thu, 17 September 2009 09:30 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3807
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Yeah I look back into it, guess I don't remember how much money I was getting each second, I'll pin the number down and get it back to you guys.

Re: Fix Credits [message #403105 is a reply to message #402990] Thu, 17 September 2009 10:02 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

It's definitely stored as a float. It is possible that it uses another datatype in some calculation, but unlikely. If it ends up being ##### it is probably a corrupted float, for some reason. For example by money = money + blah/0.

BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Fix Credits [message #403109 is a reply to message #402990] Thu, 17 September 2009 10:53 Go to previous messageGo to next message
CarrierII is currently offline  CarrierII
Messages: 3804
Registered: February 2006
Location: England
Karma: 0
General (3 Stars)

As a float? Weird.


Renguard is a wonderful initiative
Toggle Spoiler
Re: Fix Credits [message #403124 is a reply to message #402990] Thu, 17 September 2009 14:03 Go to previous messageGo to next message
Ghostshaw is currently offline  Ghostshaw
Messages: 709
Registered: September 2006
Karma: 0
Colonel
If it was a short it would just wrap around to -1 not -####### that by itself indicates its a float.

BlackIntel Administrator
Re: Fix Credits [message #403174 is a reply to message #403109] Thu, 17 September 2009 23:50 Go to previous messageGo to next message
EvilWhiteDragon is currently offline  EvilWhiteDragon
Messages: 3751
Registered: October 2005
Location: The Netherlands
Karma: 0
General (3 Stars)

CarrierII wrote on Thu, 17 September 2009 19:53

As a float? Weird.


Probably has to do with your money being:
money = points/10 + 2*refinery_alive_time + starting credits + harvloads*300

Since you can get 1 point ( or even 0.1 point) the moeny should be a float to follow the points/10 "rule".


http://www.blackintel.org/usr/evilwhitedragon/pointfix.gif
BlackIntel admin/founder/PR dude (not a coder)
Please visit http://www.blackintel.org/

V, V for Vendetta

People should not be afraid of their governments.
Governments should be afraid of their people.

[Updated on: Thu, 17 September 2009 23:51]

Report message to a moderator

Re: Fix Credits [message #403198 is a reply to message #402990] Fri, 18 September 2009 08:26 Go to previous messageGo to next message
Sladewill is currently offline  Sladewill
Messages: 291
Registered: January 2009
Location: United Kingdom
Karma: 0
Recruit

ive seen it on servers b4, e.g if u make a command and u donate them a lot of money it would put that

FT-Owners - Sladewill,Snazy2007,Willdy
http://FT-Gaming.com for more info...
Re: Fix Credits [message #403201 is a reply to message #403096] Fri, 18 September 2009 09:02 Go to previous messageGo to next message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma: 0
General (4 Stars)
CarrierII wrote on Thu, 17 September 2009 09:09

The starting credits entry box for the Ren Client hosting options limits to 9,999.
A signed 16-bit integer would limit to 32767, so it could be a signed 16-bit. I've never had more than 15/17K credits. Someone try to give a player money above 32767, and see what happens (Either overflow to -32767 or it won't overflow till the number SEye gave earlier)

No wait one 5 hour game everyone donated me ther emoney, i had overr 100500 money or more i remember thinking over 100 thousand 500 credits maybe even more
Re: Fix Credits [message #403239 is a reply to message #403201] Sat, 19 September 2009 01:26 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3807
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Yeah its a float, sorry for saying int, and dang I keep forgetting to see if I can replicate it, I'll try tonight.

Okay, it doesn't seem to flip negative until it exceeds 9 digits, so it doesn't like 1,000,000,000 and more, so I have no clue why I was seeing the error of it flipping negative so soon, and adding numbers like 0.1 too it works perfectly fine too, so it might have been like what StealthEye said and maybe the server I was on did some bad division or something. Furthermore, I was happy to see that Ren doesn't round up, as rounding up the display and not the actual value would make it impossible to buy things (IE says 400 at the bottom of the screen but you really have 399.9).


[Updated on: Sat, 19 September 2009 07:34]

Report message to a moderator

Re: Fix Credits [message #403261 is a reply to message #403239] Sat, 19 September 2009 09:09 Go to previous message
CarrierII is currently offline  CarrierII
Messages: 3804
Registered: February 2006
Location: England
Karma: 0
General (3 Stars)

Jerad Gray wrote on Sat, 19 September 2009 09:26

Yeah its a float, sorry for saying int, and dang I keep forgetting to see if I can replicate it, I'll try tonight.

Okay, it doesn't seem to flip negative until it exceeds 9 digits, so it doesn't like 1,000,000,000 and more, so I have no clue why I was seeing the error of it flipping negative so soon, and adding numbers like 0.1 too it works perfectly fine too, so it might have been like what StealthEye said and maybe the server I was on did some bad division or something. Furthermore, I was happy to see that Ren doesn't round up, as rounding up the display and not the actual value would make it impossible to buy things (IE says 400 at the bottom of the screen but you really have 399.9).


Which is why using an int and div instead of floating divide would be faster...

Forgot points are also floating, could just take the integer part of them, though.



Renguard is a wonderful initiative
Toggle Spoiler

[Updated on: Sat, 19 September 2009 09:10]

Report message to a moderator

Previous Topic: Other graphical enhancements?
Next Topic: Player names that start with /
Goto Forum:
  


Current Time: Mon Sep 02 05:23:42 MST 2024

Total time taken to generate the page: 0.00839 seconds