User avatar
WillBoxOwO
Posts: 116
Joined: Wed Jun 27, 2018 10:24 pm

Library to develop 2D game?

Wed Feb 06, 2019 11:25 pm

Hello there. Ive been trying to make a 3D c++ game on the pi.
Sadly, all of my tries didnt worked out. Tried out SDL, was way too slow. Found a workaround, but some "advanced" tutorials werent working anymore (particularly the ones using particles and stuff)
Tried lots and lots of other things as well. It just doesnt works, it seems. :roll:

So, instead of going 3D, I tought that, has a beginner, I could try doing 2D games first. Being good at drawing and stuff, I tought this would be a little more easier and fun!

Sadly, more, more, more problems.
I tried SFML, but the simple "Hello world" programs constantly draws 80% of the CPU (its just a green circle...)
When full-screened, it draws 100%.

Instead of trying every library I see, id like to have some advice here.

Is there any 2D c++ library out there that both works well on the Pi and x86 computers?

Cheers. :mrgreen:
I like cats

User avatar
WillBoxOwO
Posts: 116
Joined: Wed Jun 27, 2018 10:24 pm

Re: Library to develop 2D game?

Wed Feb 06, 2019 11:57 pm

In fact, im trying to achieve something similar to the following:
download.jpeg
download.jpeg (44.35 KiB) Viewed 704 times
I like cats

User avatar
Gavinmc42
Posts: 2749
Joined: Wed Aug 28, 2013 3:31 am

Re: Library to develop 2D game?

Thu Feb 07, 2019 2:42 am

I noticed Godot 3.1 has support for OpenGLES2 now.
Castle Games Engine?

Pi's have Android type OpenGLES2 hardware but run Linux which prefers OpenGL.
So we are sort of stuck in the middle.
It is getting very close to being able the run new 3D OpenGLES games now, not just ported versions of old games.

Libraries, plenty of these, any usable? Not so much.
The blog just had a text mode game.
I was hoping the new Wireframe Magazine would show me how to do it :(

Game Engine or Library?
Old engines have been ported, Doom, Quake etc.

Ren'Py?
https://www.raspberrypi.org/forums/view ... 8&t=232912
Pacman in Scratch :lol:

Lots of Android games are flat design and textures so processing power need is lower.

For Pi's you really need to maximize the use of the VC4 GPU to get good fps.
I have moved to Gentoo64 on Pi's as it has the latest OpenGL which has more tutorials.
Once I understand OpenGL hopefully OpenGLES will be easy to do.

I do like OpenVG for 2D but have yet to benchtest it, it is old and most regard it as a dead end.
But we have it on Pi's and it works, only tutorials, examples, benchmarks are hard to find.
I regard it as an unexplored, under utilised capability.

Tim's Star Citizen and Xmas demo shows what could be done on Pi's in OpenGLES.
https://www.raspberrypi.org/forums/view ... 8&t=214695

Hopefully by PI4 is out, everything will be Vulkan based and there will be plenty of choices.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
WillBoxOwO
Posts: 116
Joined: Wed Jun 27, 2018 10:24 pm

Re: Library to develop 2D game?

Fri Feb 08, 2019 1:33 pm

Godot seems nice tho. Would an apt-get do the trick or do I have to build from source?

...Most of all... Do I need experimental GL Drivers? Theyre a nightmare for me. :?
I like cats

User avatar
WillBoxOwO
Posts: 116
Joined: Wed Jun 27, 2018 10:24 pm

Re: Library to develop 2D game?

Fri Feb 08, 2019 9:58 pm

Update: I dont like Godot.

They use a scripting language called "GDScript" AKA not C++
Their software is clunky (mouse doesnt shows, you cant play exported games)

Ill try something else. Ill post back if I find something.
I like cats

User avatar
Gavinmc42
Posts: 2749
Joined: Wed Aug 28, 2013 3:31 am

Re: Library to develop 2D game?

Sat Feb 09, 2019 12:20 am

Update: I dont like Godot.
So not just me then ;)
It is a bit clunky.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

jdonald
Posts: 139
Joined: Fri Nov 03, 2017 4:36 pm

Re: Library to develop 2D game?

Sat Feb 09, 2019 3:38 am

WillBoxOwO,

The Hello SFML example runs at less than 15% (of a single core) at full screen on my Pi 3B+. It's only when I run with the legacy driver does it have a 350% CPU usage problem.

Based on your other posts, I suspect your problems with 2D engines could be related to the same issues you initially hit with 3D: drivers. Have you considered either abandoning BerryBoot or getting a second SD card so you could enable the Mesa driver?

User avatar
Gavinmc42
Posts: 2749
Joined: Wed Aug 28, 2013 3:31 am

Re: Library to develop 2D game?

Sat Feb 09, 2019 3:50 am

jdonald are you using mesa 18+ not the old 13?
I should have another look at Godot now on a newer OS.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
WillBoxOwO
Posts: 116
Joined: Wed Jun 27, 2018 10:24 pm

Re: Library to develop 2D game?

Sat Feb 09, 2019 8:02 pm

Damn... That berryboot thing is driving me nuts.
Its time to make the switch then. Ill try again later the SFML thing you linked (re-tried it just to be shure, it doesnt works as expected).

With that in mind, should I install Raspbian "Gentoo" (the 64-bit variant) instead? 64-bit would be useful for some programs like PocketMine-MP. Are there any disadvantages using this thing? Will I get OS updates like normal...? Its a lil confusing.

I also heard that those experimental drivers were really buggy. Is it still true? Ive never heard of the "mesa" driver before.
Im glad I found a solution tho, ill finally be able to do some more than simple terminal "games". Thanks alot. :lol:
I like cats

User avatar
Gavinmc42
Posts: 2749
Joined: Wed Aug 28, 2013 3:31 am

Re: Library to develop 2D game?

Sat Feb 09, 2019 11:58 pm

Well the good thing with Pi's is a swap of uSD can swap the OS.
In Gentoo64 "Sudo genup" will update your OS and it is setup to auto update once a week anyway.
Sakaki's Wiki's are the best.
Minetest and Minecraft server work on Gentoo64 ;)
Probably time to try Godot again.

Raspbian is Debian based and changes slowly, 14.4 kernel and Mesa 13.0.6?
Linux kernel is now 5.x (4.20)but LTS(Long term support) is 14.19, it will be next for Raspbian.

When dealing with games I would argue the Mesa3D drivers are more important.
But VC4 driver are arriving in the new mainstream kernels.
It can be a bit of a mess, so I am intending to use Ultibo with OpenVG.
More as a learning experience to separate the Openxx stuff from Kernel/GPU issues.

These days I do most VC4 OpenVG development on a USB booting Zero, no need for uSD card unless I want a portable version.
USB boot works pretty good from my Linux PC
https://github.com/raspberrypi/usbboot

Good game making on Pi's?
Apart from a few Scratch tutorials, someone needs to be first.
Have not looked, anyone written a book on this yet?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Gaming”