IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> The 7th Stat (and other always-a-zero values in the data files)
Mordion
post Dec 23 2018, 03:26 AM
Post #1


Vagabond
**

Group: Members Plus
Posts: 101
Joined: 30-September 07
Member No.: 3,924
referrer:The Super Seer



I was digging through the data files and I noticed there was always a 0 after the stats, and some other spots too. I finally got to the bottom of it while looking at the decompiled source. Visual Basic defines arrays in a weird way. "Dim stats(6) as Integer" will result in an array of 7 items numbered 0-6. (unlike C which results in 6 items, numbered 0-5). Nearly every array in the game is defined one bigger then it ought to because D.A. dimensioned the arrays using the number he wanted instead of one smaller.
Go to the top of the page
 
+Quote Post
Nudibranch
post Dec 23 2018, 05:05 AM
Post #2


Fire Master
*********

Group: Mordor MP Prog
Posts: 1,613
Joined: 19-November 04
Member No.: 71
referrer:search



VB does too many things in a weird way. It defaults to bankers' rounding even when (if I remember correctly) doing implicit conversions from floats to integers; and log() means ln().

Unexpected behavior is not okay in a programming language. F'in' Microsoft.


--------------------
I would have started with lasers. Eight o'clock. Day one.
Go to the top of the page
 
+Quote Post
Mordion
post Dec 23 2018, 03:35 PM
Post #3


Vagabond
**

Group: Members Plus
Posts: 101
Joined: 30-September 07
Member No.: 3,924
referrer:The Super Seer



QUOTE (Nudibranch @ Dec 23 2018, 12:05 AM) *
VB does too many things in a weird way. It defaults to bankers' rounding even when (if I remember correctly) doing implicit conversions from floats to integers; and log() means ln().

Unexpected behavior is not okay in a programming language. F'in' Microsoft.


Bankers rounding is the most accurate rounding mode and also the default on x86/x87. ANSI C is the weird language because it specifies truncation. Every time you convert float to int in C the complier has to save the rounding mode, switch rounding modes, do the conversion, and switch it back. (not so any more with SSE) Bankers rounding for float -> int is 6 cycles on a Pentium and an ANSI correct truncation rounding is about 80.

Log meaning natural log has no basis in hardware. back then the only log in hardware was log base 2.

The arrays are just madness. It would make sense if the arrays were one based because that's more natural to humans. Maybe they just split the difference because it "just works" when you throw RAM at the problem.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 22nd September 2019 - 07:33 PM
Bridged By IpbWiki: Integration Of Invision Power Board and MediaWiki © GlobalSoft
Copyrights and Credits