32 bit vs 64 bit

32 bit vs 64 bit

Postby eugeneloza » 24 Mar 2017, 11:46

Eventually I've ended up with a problem that it's relatively hard to maintain both 32 bit and 64 bit versions for my games :) Hard to solve on Windows, where one should package appropriate versions of dll libraries... And nearly impossible to solve on Linux (even after installing cross-compiler I won't be able to test it properly without setting up a full-scale virtual machine).
Is there any solution to this problem?
I've been trying to analyze how many PCs still use 32 bit OS now, and found only one clue, that 56% of Windows 7 installations (in some unspecified year) were 32 bit.
So, piratically, 32 bit versions of binaries still seem as needed... right?
How this issue is usually solved on a single computer?
User avatar
eugeneloza
 
Posts: 500
Joined: 22 Aug 2014, 12:15
Location: Ukraine

Re: 32 bit vs 64 bit

Postby eugeneloza » 24 Mar 2017, 11:55

e.g. at this moment my configuration is the following:
Win7x64 -> Lazarus 32 bit -> 32bit exe
Debian8x64 -> Lazarus 64 bit -> 64 bit binary
Debian8x64 -> cross-compiler+build-tool -> Android (installed and tested at a tablet)
User avatar
eugeneloza
 
Posts: 500
Joined: 22 Aug 2014, 12:15
Location: Ukraine

Re: 32 bit vs 64 bit

Postby c_xong » 24 Mar 2017, 12:19

For Windows, just compile 32 bit because a lot of people are still stuck on that.
For macOS because they're all on an upgrade treadmill, you can assume almost everyone is 64 bit.
For Linux, don't bother because everyone builds from source (or the package manager does it :D)

But I don't do any compilation myself these days; I just use a free CI service. It's a pain to set up but CI has many other benefits so it's worth it in the long run.
User avatar
c_xong
 
Posts: 234
Joined: 06 Sep 2013, 04:33

Re: 32 bit vs 64 bit

Postby Duion » 24 Mar 2017, 12:36

I distribute 64bit for Linux and Windows and 32bit for Windows, since the Linux users are a small group and hopefully not that far behind and if someone still runs a 32bit System he probably does not meet the minimum hardware requirements anyway.
Duion
 
Posts: 251
Joined: 16 Mar 2013, 20:33
Location: Germany

Re: 32 bit vs 64 bit

Postby GunChleoc » 24 Mar 2017, 12:39

You can use AppVeyor for Windows. Each build will create an "Artifact" that's a downloadable executable.
User avatar
GunChleoc
 
Posts: 502
Joined: 20 Sep 2012, 22:45

Re: 32 bit vs 64 bit

Postby onpon4 » 24 Mar 2017, 14:56

I don't bother with 64-bit binaries on Windows. 64-bit Windows systems can run 32-binaries just fine (and probably will continue to do so for the foreseeable future since backward compatibility is one of Microsoft's big selling points), and none of the programs I write need 4+ GB of RAM.

For GNU/Linux, I build both 32-bit and 64-bit if possible. I don't really like cross-compilers, so I just do it on a virtual machine, with the oldest OS I can use (currently gNewSense).

To compile C code (Project: Starfighter) for Windows, I use MXE:

http://mxe.cc/

It's much, much more convenient than actually compiling on Windows, an experience I never want to repeat again if I can avoid it.

To "compile" Python code on all systems, I use PyInstaller on the target system.
onpon4
 
Posts: 596
Joined: 13 Mar 2014, 18:38

Re: 32 bit vs 64 bit

Postby themightyglider » 24 Mar 2017, 15:46

If I had to choose I always would prefer a 32Bit build. (As long your project isn't that hungry for resources that it wouldn't run on older hardware at all).
The modern AMD64 processors still can handle 32Bit binaries and particular in the GNU/Linux community there are many people who try to use old hardware as long as possible.
User avatar
themightyglider
 
Posts: 126
Joined: 23 Feb 2016, 12:13

Re: 32 bit vs 64 bit

Postby Akien » 24 Mar 2017, 15:51

- Windows: 32-bit
- Linux: 64-bit
- OSX: 64-bit

No need to bother with 32-bit OSX, it's virtually non existant.
32-bit Linux could be nice for those who are still running 10+ years old hardware (or who chose to install a 32-bit Linux on 64-bit capable OS for diverse reasons).
64-bit Windows is cool to provide if it comes at little cost, to help the Windows world finally get rid of 32-bit compatibility hopefully in 10 years ;)
Godot Engine project manager and maintainer.
Occasional FOSS gamedev: Lugaru, OpenDungeons, Jetpaca, Minilens.
User avatar
Akien
 
Posts: 737
Joined: 22 Feb 2014, 13:14

Re: 32 bit vs 64 bit

Postby eugeneloza » 24 Mar 2017, 15:59

Thanks a lot for suggetstions.
I'll stick with Win32 and Linux64 binaries then :)

The by-fact is that I actually might need a lot of RAM in some foreseeable future (at least for some intermediate alpha-versions, until I optimize the dynamic rendering memory consumption). I'm speaking of a huge overworld with multiple chunks dynamically loaded and processed in the memory (rendered into images). The last version required 6-8 GB of RAM...
User avatar
eugeneloza
 
Posts: 500
Joined: 22 Aug 2014, 12:15
Location: Ukraine

Re: 32 bit vs 64 bit

Postby onpon4 » 24 Mar 2017, 17:26

The by-fact is that I actually might need a lot of RAM in some foreseeable future (at least for some intermediate alpha-versions, until I optimize the dynamic rendering memory consumption). I'm speaking of a huge overworld with multiple chunks dynamically loaded and processed in the memory (rendered into images). The last version required 6-8 GB of RAM...

That could be a problem for a lot of people. My laptop, as an example, has only 6 GB of RAM.

I would suggest you change it to split the world into rectangular sections, and only load four sections at a time (the one the player is in, plus the three other sections closest to them).
onpon4
 
Posts: 596
Joined: 13 Mar 2014, 18:38

Re: 32 bit vs 64 bit

Postby eugeneloza » 24 Mar 2017, 19:09

onpon4 {l Wrote}:I would suggest you change it to split the world into rectangular sections, and only load four sections at a time (the one the player is in, plus the three other sections closest to them).

Yes, of course. I mean "intermediate result". The game will eventually be optimized to require approx. 1 Gb of RAM (to be able to play on Android tablets). But before I start the optimization, I need to test if the algorithm is actually working and going the right direction. And when I'm sure everything is working smoothly, then I'm able to "obfuscate" the code by optimizations without fear that I'll accidentally miss the forest for the trees.
User avatar
eugeneloza
 
Posts: 500
Joined: 22 Aug 2014, 12:15
Location: Ukraine

Re: 32 bit vs 64 bit

Postby mdwh » 26 Mar 2017, 20:23

I've been trying to analyze how many PCs still use 32 bit OS now, and found only one clue, that 56% of Windows 7 installations (in some unspecified year) were 32 bit.
I'm having a hard time believing that was ever true - if I remember correctly, 64-bit started becoming the more common version since Windows 7 (or possibly Vista). Maybe I'm wrong, but even so, this seems very out of date.

Steam hardware survey for Windows shows 8.42% for 32-bit, 91.49% for 64-bit (0.09% unknown). It may be that the 32-bit levels for people interested in either Open Source games or casual games may be higher, but I'd be surprised if it's that much higher. (I'm also not convinced Linux is that much better - for example, Ubuntu until 13.04 were still recommending people download the 32-bit version - https://www.howtogeek.com/165144/htg-ex ... ntu-linux/ - though people on Ubuntu may well have upgraded enough such that that doesn't matter now.)

Having said that, unless your game benefits from 64-bit, you might as well stick with 32-bit, which runs fine on 64-bit Windows, and not bother about two versions. I've always done 32-bit for Windows (especially as the Express versions of Visual Studio have traditionally only supported 32-bit - though this may no longer be the case, especially with the new Community Edition versions).

But then, if you need 6-8GB RAM, I don't see how that's going to be possible on 32-bit systems anyway...
mdwh
 
Posts: 67
Joined: 13 Aug 2011, 01:53

Re: 32 bit vs 64 bit

Postby Lyberta » 26 Mar 2017, 21:48

Deleted.
Last edited by Lyberta on 01 Oct 2021, 10:11, edited 1 time in total.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Re: 32 bit vs 64 bit

Postby ivanthekdefan » 26 Mar 2017, 23:28

64-bit OSes and 32-bit software if your priority is accessibility.
64-bit all the way if you are willing to leave users begind so that your system is faster.
Using KDE neon Developer Git-Unstable
Current libre software jobs: contributing to KDE
User avatar
ivanthekdefan
 
Posts: 8
Joined: 26 Mar 2017, 21:05

Re: 32 bit vs 64 bit

Postby onpon4 » 27 Mar 2017, 04:14

But how does 32bit versions handle 64 bit numbers?

I don't know how it's done, but one possibility could be to store the 64-bit number as two 32-bit components. It may be inefficient, but it's not impossible.

I've moved toward always using 64 bit numbers

That's bad programming. In C, you should let the compiler choose the size unless you have a specific reason to need a particular size. The compiler can optimize the exact choice depending on the target architecture.
onpon4
 
Posts: 596
Joined: 13 Mar 2014, 18:38

Re: 32 bit vs 64 bit

Postby Lyberta » 27 Mar 2017, 22:44

Deleted.
Last edited by Lyberta on 01 Oct 2021, 10:11, edited 1 time in total.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Re: 32 bit vs 64 bit

Postby onpon4 » 27 Mar 2017, 23:08

For example, on my Pentium 4 PC std::size_t is 32 bits but on a main PC it is 64 bits, what if I send it over the network?

Two things:

1. That's a very specific circumstance. You don't send every variable over a network.

2. Sending raw binary data to another computer is a terrible idea, anyway. What about endianness, for example? If you're just sending raw binary data from your big-endian computer and relying on the recipient interpreting the data the same way as your computer does, the little-endian recipient will read a value that's backwards (e.g. changing a signed 8-bit 5 to -32). Anything you send over a network must be architecture-independent entirely, e.g. a string that is interpreted.
onpon4
 
Posts: 596
Joined: 13 Mar 2014, 18:38

Re: 32 bit vs 64 bit

Postby Lyberta » 28 Mar 2017, 08:32

Deleted.
Last edited by Lyberta on 01 Oct 2021, 10:12, edited 1 time in total.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Re: 32 bit vs 64 bit

Postby onpon4 » 28 Mar 2017, 15:19

nobody works with bits above the OS layer.

You're contradicting yourself. If you're not working with bits, the number of bits used for a variable doesn't matter, as long as you have enough bits to represent the largest value you want to represent.

I don't know how your special library works, or how effective it is. But there just isn't any need for it. If you send the data as a string for the recipient to interpret (e.g. with sscanf if you're using C), it will work on any architecture. There's no need to work with variable widths or architecture-dependent binary data.
onpon4
 
Posts: 596
Joined: 13 Mar 2014, 18:38

Re: 32 bit vs 64 bit

Postby c_xong » 29 Mar 2017, 00:06

There's a performance penalty marshalling data to and from strings, plus it's not structured data so it's harder to work with. Usually people use something like protobuf which does both. I use nanopb which is a variant that uses static allocation which makes it fasterer (although I don't actually need the speed). Compared to the traditional ntoh/hton approach, it defaults to little endian which makes serialisation a NOP most of the time.
User avatar
c_xong
 
Posts: 234
Joined: 06 Sep 2013, 04:33

Re: 32 bit vs 64 bit

Postby Lyberta » 29 Mar 2017, 02:54

Deleted.
Last edited by Lyberta on 01 Oct 2021, 10:12, edited 1 time in total.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Re: 32 bit vs 64 bit

Postby onpon4 » 29 Mar 2017, 04:23

To be clear, I know nothing about how data is sent over a network. My only argument is against the idea that you need to specify the exact width of your variables as a general rule. You should avoid this whenever possible, and regardless of what kind of format you use to send data over the network, it should be an architecture-independent format of some sort and most likely converted to only when it needs to be sent over the network.
onpon4
 
Posts: 596
Joined: 13 Mar 2014, 18:38

Re: 32 bit vs 64 bit

Postby Lyberta » 29 Mar 2017, 11:13

Deleted.
Last edited by Lyberta on 01 Oct 2021, 10:12, edited 1 time in total.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Re: 32 bit vs 64 bit

Postby dusted » 05 Jun 2017, 13:28

I'm doing 32 and 64 bit linux builds, and then a 32 bit windows one, because many linux users does not have good 32 bit support on their 64 bit platforms (I do, because Steam). Windows seems to be just fine running 32 bit binaries and I can't make a game that's using that much memory anyway :) Just cross compiling with mingw and testing in WINE.
User avatar
dusted
 
Posts: 83
Joined: 27 Feb 2010, 04:35

Re: 32 bit vs 64 bit

Postby imaZighen » 13 Oct 2017, 18:57

I compile for both 32bits and 64bits under Linux Debian, and it's really that easy since Linux is multi-arch, I have both 32bits and 64bits archs installed, so I can boot with any of them, for the libraries, I just include the windowing static library as 32bit and 64bit version, and the compilation is easy asf.
ⵉⵎⴰⵣⵉⵖⴻⵏ / imaZighen
User avatar
imaZighen
 
Posts: 8
Joined: 13 Oct 2017, 18:31
Location: Thamzgha / North Africa

Who is online

Users browsing this forum: No registered users and 0 guests