Forum for Titan 19 (#68)

[Posting] Start
Thread opener, Player 2 (The Fellas)
Posted Sun, 2022-01-30 11:08 GMT

Hi,

Anybody knows why the game hasn't started yet?

I thought they start automatically once all the slots are filled...

[Posting] Re: Start
Posted Sun, 2022-01-30 11:37 GMT

I thought they start automatically once all the slots are filled...

So did I.

Fixed it.

Post Mortem

The game did not start because PHost crashed. PHost crashed because PMaster does not create the file grey.hst (ion storms and alliances), so PHost called an invalid function (fclose(NULL)). This bug went unnoticed until now because, until the last system update by the ISP, I was using the i386 (32-bit) version of PHost, which silently ignores this problem; the x64 version is less forgiving.

Added a workaround for now.


--Stefan

[Posting] Re: Start
Thread opener, Player 2 (The Fellas)
Posted Sun, 2022-01-30 14:24 GMT

Thanks again Stefan.

There might be more hidden bugs like this one that only show up in 32 bits. We'll keep an eye for anything odd.

Cheers!

I thought they start automatically once all the slots are filled...

So did I.

Fixed it.

Post Mortem

The game did not start because PHost crashed. PHost crashed because PMaster does not create the file grey.hst (ion storms and alliances), so PHost called an invalid function (fclose(NULL)). This bug went unnoticed until now because, until the last system update by the ISP, I was using the i386 (32-bit) version of PHost, which silently ignores this problem; the x64 version is less forgiving.

Added a workaround for now.


--Stefan

[Posting] Re: Start
Posted Sun, 2022-01-30 15:01 GMT

There might be more hidden bugs like this one that only show up in 32 bits. We'll keep an eye for anything odd.

There actually are some 32/64 bit differences that I know of when floating point (fractional numbers) is involved, but I hope you only notice those as an improvement :smile:

The 32-bit version of PHost occasionally gave you one point happiness less than expected. The 64-bit version matches what VPA and PCC predict, and what you get by computing manually.

Likewise, mines-destroy-mines would occasionally destroy one mine too much.

The reason is that i386 (32-bit) FPUs round a little different than most people expect; when you ask for a 8-byte variable, you occasionally get a 10-byte variable instead, which gives the result a few more digits and thus makes it a little bigger. The happiness formula uses sin/cos, and the mines-destroy-mines formula uses square-roots, which are affected by this.

--Stefan