Raspberry Pi 3 and C2

Discussion of tools and resources for game developers

Post » Wed Dec 28, 2016 7:04 am

Update 2017-04-30
Version: 4.4.50, dist: 2017-04-10 (Chrome: 56.0.2924.84)
Finally made a useful discovery - it's all about the RAM! By default you don't get much RAM allocated to the GPU, so this is what kills the WebGL usage. By running raspi-config, you can change the ram allocation to give more memory to the GPU. Updating to 256M, things are running better. Ghost shooter now hits, 40fps, and Rain Demo goes up to an astounding 7fps ;) Having said that, if you look at the memory usage after running Chrome and the Rain Demo, the system only has 64M of RAM free! Chrome consumes a chunk of memory, and then loading a game consumes more memory, so it's all matter of juggling RAM.
I did have to monkey with some Chrome settings. I found if you even touch WebGL2, it wrecks Chrome until the next reboot. C2 now checks for WebGL2, which I believe causes the problem and makes Rain Demo fail to draw (lots of GL_OUT_OF_MEMORY errors). By turning off WebGL2 support in Chrome, via flag settings, games work again.
As a final note, I did find Super Adventure World was playable now, even getting to level 3 (which I hadn't managed to do on my PC!)

Update 2017-03-03
Version 4.4.50. Almost back to 4.4.34 level of support. WebGL runs again, but still a bit dodgy. Kicks out to logon screen randomly.

Update: 2017-01-01
Bought a new SD card and went back to 4.4.34. Can now at least run (some) C2 games. I don't recommend upgrading just yet (see next update). (Minecraft doesn't run with OpenGL on). Also confirmed the Plymouth hack, so I've updated the original post with the correct format.

Update: 2016-12-31
Thought it would be a good idea to update the OS. Sigh... Upgrading from the latest distro (4.4.34 2016-11-25) got me to 4.4.38 2016-12-15. I was hoping this would improve things - it did not. Now WebGL is even worse than before and any WebGL test crashes the OS. I've also discovered that Minecraft won't run now (didn't check in build34).

Also it looks like the plymouth hack does work when added to that single command line, so the following is now my cmdline.txt file:

plymouth.enable=0 dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

2016-12-28:
Since Santa brought me a RPi3 for Christmas, the first thing I did was try running a C2 game on it. As expected, and mentioned in Ashley's blog, it ran SLOWWW. So I went to turn on OpenGL, as described, BUT it didn't work. Trying to do a chrome://gpu wouldn't even display anything in Chromium! After some research, I found that there is one more step needed (at the moment) due to a change in PIXEL for the RPi3. You need to add the following to the \boot\cmdline.txt file, to turn off Plymouth.

plymouth.enable=0

Since this took some time to research, I felt it worth while to start a thread so people can have somewhere to go to keep the instructions on interacting with the Raspberry Pi up to date.

Speed definitely improves with WebGL. It's still not 60fps though.

So, to turn on the OpenGL:
open a terminal and run sudo raspi-config - then in the menu that appears choose Advanced Options, GL Driver, then select Enable.


To turn off Plymouth, in the terminal, run sudo nano /boot/cmdline.txt, and add a new line with plymouth.enable=0 to the beginning of the one line in that file.

plymouth.enable=0 dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

You can confirm that it works by going to address chrome://gpu in Chromium. You will see WebGL: Hardware accelerated

Be warned though. The driver definitely is not finished. I found several glitches in graphics with OpenGL on within the OS, and did end up turning it off again to get other things working (the Turtle drawing mechanism doesn't work properly with OpenGL on, and in C2, sadly Paster fails and even locked up my unit when I tried to run my puzzle-template, that relies heavily on Paster).
Last edited by blackhornet on Sun Apr 30, 2017 3:00 pm, edited 6 times in total.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Wed Dec 28, 2016 12:28 pm

Interesting to know the RPi3 needs an extra step - any idea what "plymouth" is?

Also are the [url ] and [/url ] parts necessary? They look like forum BBCode rather than something you put in a config file.
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,625

Post » Wed Dec 28, 2016 5:00 pm

Plymouth is some boot-theme that prevents all of the screen flickering during the boot phase. I'm 99% sure I tried adding the plymouth setting to the first line, without the URL tags but it didn't work, as I thought the same thing. There were several posts referencing the same line of text to add to the cmdline.txt file though, so I just put it there verbatim, and it worked. I'll update the first post if I find any refinements along the way.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Thu Dec 29, 2016 10:24 am

I have a RPi 3B, will be sure to check this out :) Never tried any games on there before actually...
B
7
S
1
Posts: 50
Reputation: 556

Post » Sun Jan 01, 2017 12:56 am

Update in original-post.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Fri Jan 06, 2017 5:52 pm

@blackhornet did you play some games from scirra arcade or just your games? could you please tell what games you played?
B
69
S
33
G
69
Posts: 220
Reputation: 40,216

Post » Fri Jan 06, 2017 7:49 pm

ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Sun Jan 08, 2017 3:34 am

blackhornet wrote:I tried Super Adventure World.


Thanks

Did the game run OK or too slow? I am thinking to buy a raspberry PI 3 to make like an arcade machine with my C2 games :mrgreen:
B
69
S
33
G
69
Posts: 220
Reputation: 40,216

Post » Sun Jan 08, 2017 6:08 am

It was slow. I just did an experiment with Ghost Shooter and (GS) Rain Demo.
GS: PC 60fps, Mac 60fps, RPi 30fps
RD: PC 40fps, Mac 30fps, RPi 5fps
I tried your Monsters in the Night and it was OK, but noticeably not as quick as you'd expect.

Personally, I'd say if you have no other use for the RPi, I wouldn't bother. Especially given the newest OS update makes WebGL completely unusable.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Mon Jan 09, 2017 3:12 am

Thanks for your answer.

I will have to think in other way on how to make my arcade or wait for like a raspberry pi 4, 5, ..... :D
B
69
S
33
G
69
Posts: 220
Reputation: 40,216


Return to Tools and Resources

Who is online

Users browsing this forum: No registered users and 3 guests