Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It seems to be typical - some calculations break while switching from x87 to SSE. The same happened with TF2 too - it's ammo calculation code worked slightly differently on GNU/Linux build of the game, because it was built with SSE instructions (Windows version still used x87).




I’m surprised to hear the ammo calculation code would use floats.

The game has ammo pickups that refill 20% and 50% of whatever your max ammo is, so floats have to be involved in there somewhere.

Dividing by 5 or 2, respectively, are integers, if the game developers wanted them to be. More so because the actual units of ammo need to be integers if they are to render as full bullets each

I think the only visible effect from that was the Engineer's metal, giving +40 or +41 from a small box, depending on the server platform (all classes technically do have metal, but the others can't use it).

It was always fun to play on a new server and check what OS it was running that way, too. :-)


And IIRC ammo for heavy and health for soldier!

I expect this is / was a very common problem for people porting 32-bit game code to newer compilers. I work on a fairly old codebase that forces use of x87 for a handful of code paths that don't work correctly otherwise. GCC will use default to x87 if you do an i386 compile, but will default to SSE for 64-bit builds, so you have to be careful there too.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: