How powerful is the Librem 5, and how could I make games for it?

Sweet! I’m going to see how deep the rabbit hole goes and see if I can work through that treasure trove of information! Thank you for sharing :smile:

I’ll see if local electronic stores have the raspberry Pi 3B+ and see if that’s something I want to mess around with. I liked the idea of the librem5 also being the devkit to test on so I might wait till I have that and learn as much as possible until then.

Is C++ then the best language to program in? As it would be faster? I know they all have their own pro’s and cons but I thought I’d ask :slight_smile:

Will you upload your code to github if you do? Thought I’d ask seeing I’d love to look at examples of code! :slight_smile:

It depends on what you want to do. Fast operations what the engine needs should be written in C or C++, but things you don’t want to have to re-compile such as the plugins used to extend games like Oolite, The Powder Toy, Deliantra, and Minetest should be implemented in a script language like Lua or JavaScript or Perl. Those games can show you how that’s done because they are free/open source. Just know that if you copy their code, you will probably have to use their license.

Yes, unless I can find a better way to host my code.

1 Like

Okay! I’ll take a look at those games and their code. I’ll see if I can get a better understanding of everything in the mean time haha

What programs do you use or would you recommend for C++?

Depends on the OS you are using.

  • Windows, use Visual Studio
  • Mac OS X, use XCode
  • For everything else, you can use Geany, Code::Blocks, Eclipse, and emacs IDEs, as well as the nano and vim editors.
    You can also look up IDEs if you don’t like any of these suggestions.
1 Like

I’ve done a little more reading for the Raspberry Pi vs. Librem 5 comparison that I’ve been constantly making over the past several months. Quick summary: identical CPU architecture and speed, Librem 5 has 3x RAM size and ~3x 3D acceleration capabilities; roughly equivalent to a Qualcomm Snapdragon 801 (though with a slightly faster CPU).

CPU: both have 4x Cortex-A53 (https://en.wikipedia.org/wiki/Raspberry_Pi#Specifications, https://puri.sm/shop/librem-5/ and https://en.wikipedia.org/wiki/Freescale_i.MX#i.MX_8_series). RPi runs at 1.4 GHz, Librem 5 runs at 1.5 GHz - not really a difference there.

RAM: RPi has 1 GB of DDR2 running at 900 MHz, Librem 5 has 3 GB of DDR3 running at (unknown) MHz.

GPU: RPi has a single Broadcom Videocore IV with 1 gigapixel/second fill rate (https://github.com/hermanhermitage/videocoreiv/wiki/VideoCore-IV---BCM2835-Overview), Librem 5 has 2x 1x Vivante GC7000Lite (https://en.wikipedia.org/wiki/Freescale_i.MX#i.MX_8_series) which fills at 3.2 gigapixels/second (https://en.wikipedia.org/wiki/Vivante).

To compare with Qualcomm chipsets (which seemingly every other smartphone seems to have), we’d sit roughly in between the Snapdragon 801 and the 810 (https://en.wikipedia.org/wiki/Snapdragon_810#Snapdragon_808_and_810_(2015) and https://en.wikipedia.org/wiki/Adreno), with the CPU comparable to the 810 and the GPU comparable to the older 801. Hopefully we won’t get the overheating issues as well…

3 Likes

Are you sure with the double GPU? Mind that the librem uses the i.MX8M not the normal i.MX8. Wilipedia isn‘t that clear about it but i tend to asume only one GPU.

1 Like

You’re right, I misread the table. It’s 1x, so you’re looking at 3x the graphical power of the 3B+. Edited to fix.

1 Like

https://wiki.unrealengine.com/Compiling_For_Linux#Additional_Step_for_Linux-ARM_platforms

Unreal engine and the scripts you write are in C++ and it can build to linux arm platforms, so would that be a viable option to make games for the Librem? I use visual studio with Unity, though I don’t mind learning a different programming language if that means I can use a scene view such as Unity or Unreal has. Especially for games I really like being able to rearrange things and creating objects in a scene view and then attaching scripts to them.

If Unreal is a good option then I can start messing around and learning C++ and the engine, and test anything I might have made on the phone when it ships:)

If something from Unreal can work on a Debian-based install (I think Raspbian is close enough if you want to test on a RPi), I think it should work on Librem 5/Pure OS.

1 Like

I think it can! I downloaded it and I’ll start messing around in it :slight_smile:

Native apps for the librem 5 are (i think, check for confirmation ;)) written with gtk, in any language you prefer. If it’s a simple game gtk offers drawing libraries, but as it is a gui framework/widget framework, I’m not sure if it will be suitable for game development.

1 Like

I wonder if this could help promote Vala :thinking:… I was pretty excited when I discovered that but the use case couldn’t beat Java for me yet.

1 Like

As some have mentioned you could write your game from scratch or use the unity HTML5/WebGL backend but I don’t see native unity for 2 reasons. I don’t think unity has support for Arm Linux outside of Android and the bigger problem is I don’t think unity has any native Wayland support. I personally do all my game work from scratch, well I have my own engine I use. For at least a while using your own engine or doing stuff with WebGL will probably be the only way to properly support it as Arm GNU/Linux and Wayland is a combo that no one supports right now.

1 Like

You can use anything you want as long as it has native wayland support which both GLFW and SDL do so as long as you take the screen dimensions and such into account you should be able to do straight OpenGL ES. My bigger concern in this scenario would actually be getting touch input. I didn’t order a Dev board but when I get my actual phone next year I’ll probably play with GLFW and see how I could get input from the touch screen. Maybe you can’t use those libraries, maybe you’d have to use Wayland directly or use GTK+ with a GtkGLArea(Idk if it has ES support).

2 Likes

The Unreal engine supports ARM linux, but I’m not sure about the wayland thing, would this matter with unreal?

https://wiki.unrealengine.com/Compiling_For_Linux#Additional_Step_for_Linux-ARM_platforms

Interesting, although again it goes back to Wayland support. The librem 5 won’t have XWayland so if the software doesn’t do things Wayland native then it won’t run. I’m not sure if unreal has Wayland support but I’d guess not. If it does none of the unreal games in my steam library enable it. I’d have to do more research to know for sure but I’d doubt it. Wayland isn’t even supported by large FOSS software on Linux, Firefox and chromium for example, so I don’t see big engines supporting it yet although it would be nice. I found this but it sounds like they’re not talking about native Wayland but rather XWayland. https://answers.unrealengine.com/questions/429528/ue4-on-wayland-linux.html

1 Like

“New: Recompiled the bundled SDL library with Wayland support.” In the patch notes of unreal 4.19. So does that mean building games in Unreal would be possible?

Maybe? Sure sounds like it although I’d have to do some testing to know for sure. I don’t know why they’d compile it in unless the engine could at least sort of run on it.

1 Like

Aaaaah I can’t wait to get my hands on the phone and mess around with it! Really want to try and learn how to make simple games for it and add to them bit by bit haha