jeudi 2 mars 2017

GNOME Games 3.24

GNOME 3.24 will be out in a few weeks and with it will come Games 3.24. This new version will offer a few new features and many refinements, some of which have been implemented by new contributors theawless and Radhika Dua, kudos to them!

Find how to get the latest nightly and (soon) stable Flatpak versions of Games on its web page.

A Libretro Core Descriptor Specification

In its version 3.22, Games stopped using a hardcoded list of well known Libretro cores and instead looked for the right one to run a game by parsing files describing their corresponding Libretro core's capabilities. These files came from the libretro-super repository and were slightly modified to better suit Games' needs.

The concept was great but the format of these files proved to be not very well suited for the job: many information were not useful to Games, some information it needed were lacking, the syntax wasn't specified, complex cases like firmwares were implemented in a messy way, some useful information were present as comments and hence were not reliable… a better designed format fixing these problems was needed. Taking the desktop entry specification as a model, the Libretro core descriptor specification was born.

In order to use them, Games requires cores to come with a descriptor valid according to this specification — packagers, please remember to ship the needed .libretro files with your Libretro cores, you can find the ones used with the Flatpak version here.

Smooth and Sharp Video Output

So far, the video output of retro games in Games was smoothed out using bilinear filtering. It's a safe default, but you may prefer to see your retro games in all their pixely glory; head over to Games' preferences and you'll find the Filter option in the new Video page, letting you to choose between the familliar smooth video output and a new sharp one!

Smooth and sharp video filtering

Collection Loading Indicator

So far you had no way to know when Games finished loading the games collection. In 3.24, a small popup will appear while the games list is being loaded, letting you know when all the games are found.

Loading the games collection…

Smooth Collection Alignment

The game thumbnails spread evenly horizontally instead of packing themselves at the beginning of the line, making the games collection look more elegant.

Remembering the Window's State

Games remembers the size of your window and whether it is maximized or not, and restore the window's state when you start the application. Not only that, it also remembers whether your games should be displayed in fullscreen!

Improved Error Messages

Should a game fail to run, starting from 3.24 Games displays an error message in the error page explaining the failure in a non-technical way.

Games gives you some hint why a game failed to run

Supporting More Games

Famicom Disk System games are listed, and with the right firmware (see later) Games is even capable of running them!

A Famicom–Famicom Disk System combination — Evan-Amos, CC BY-SA 3.0

Games is also capable of listing and running standalone Libretro games — games distributed as Libretro cores — provided they ship a correct Libretro core descriptor. Notable examples are 2048, Dinothawr and Mr. Boom.

The Flatpak Version

The Flapak version of Games already shipped Libretro cores allowing you to play Super NES, Super Famicom, Game Boy, Game Boy Color and PlayStation games; Games comes with a few more Libretro cores:

  • Beetle NeoPop, allowing you to play Neo Geo Pocket and Neo Geo Pocket Color games;
  • Beetle PCE Fast, allowing you to play TurboGrafx-16/PC-Engine and TurboGrafx-CD/CD-ROM² games; and
  • Nestopia UE, allowing you to play NES, Famicom and Famicom Disk System games.

If you want to install the latest nightly — and soon the latest stable — Flatpak version of Games, head over to the documentation.

Firmwares

In most of the situations, no external firmware (BIOS) file is required to play retro games, but some Libretro cores may require an external firmware file to do so; these firmwares are described in the .libretro descriptor of the core. Usually, neither the Libretro cores nor Games can ship these firmwares for copyright reasons, so the user have to provide them in order to run these games.

Games 3.24 lets the Libretro cores look for external firmwares in the ~/.config/gnome-games/platforms/PLATFORM/system directory, where PLATFORM is the platform of the game as defined in the .libretro descriptor and in the known platforms of the Libretro core descriptor specification.

Games checks whether the required firmware files with the expected fingerprints are present and will fail to run the game otherwise.

For example, in order to run Famicom Disk System games in Games with the Nestopia UE Libretro core, you will need the ~/.config/gnome-games/platforms/FamicomDiskSystem/system/disksys.rom file with the right fingerprint, and in order to run TurboGrafx-CD and CD-ROM² games with the Beetle PCE Fast Libretro core, you will need the ~/.config/gnome-games/platforms/TurboGrafxCD/system/syscard3.pce file with the right fingerprint.

This is obviously not desirable to rely on such proprietary and globally illegal to distribute firmwares; become a video game preservation hero by writing a free implementation of these!

Various Fixes

In Games 3.24, all of the following bugs are fixed:

  • if the configuration move the application menu into the application's header bar, a menu bar was present in addition to the appmenu button;
  • an empty button was sometime present on the error page's headerbar;
  • keyboard shortcuts to make the game fullscreen made the application fullscreen even when the games doesn't support it;
  • keyboard navigation in the games collection was buggy.

Refactoring retro-gtk

retro-gtk is the library allowing Games to handle libretro cores, so it's one of its most important foundations. Unfortunately, the library's design has been rushed out in the first versions of Games which resulted in an overly complex library: it was harder to use than it should and making it evolve wasn't easy either.

A big refactoring of retro-gtk started this cycle: the retro-gobject and retro-gtk libraries were merged into retro-gtk; the Retro and RetroGtk namespaces were merged into Retro; many unused types where removed — they can be added back when they will actually be needed; and some parts of the code like the video and audio outputs have been simplified.

All of these simplifications will allow us to refactor the library even more, for example it would help us decoupling the process running the Libretro cores from the one running the UI, in a similar fashion to what WebKitGTK+ does with web pages; this would help resolving several problems with Libretro core support and would prevent the application from crashing because of a Libretro core.

As a reminder, retro-gtk's API is still extremely unstable.

mardi 10 janvier 2017

GNOME Gaming Handheld

Recently I got myself a GPD Win, to make it simple it's a PC in a Nintendo 3DS XL form factor, with a keyboard and a game controller. It comes with Windows 10 and many not too demanding games work perfectly on it: it's perfect to run indie games from Steam and for retro consoles emulation.

But who simply want to play video games, let's make it fun, let's put a penguin in it! On this GNOME wiki page I'll report all my findings on Linux support on this machine, focusing mainly on OpenSUSE for the moment. Wouldn't it be awesome to have a fully working and easily installable GNOME desktop running Games and Steam on this machine? 😃

vendredi 2 décembre 2016

GNOME Core Apps Hackfest 2016

This November from Friday 25 to Sunday 27 was held in Berlin the GNOME Core Apps Hackfest.

My focus during this hackfest was to start implementing a widget for the series view of the Videos application, following a mockup by Allan Day.

To make this more interesting, I implemented this view using Emeus, Emmanuele Bassi's new in-development constraints based layout system for GTK+. You can find the (clearly unfinished) result here: https://github.com/Kekun/totem-series. I will keep working on it with Victor Toso who did some initial prototype last year.

Working at the hackfest was a great experience, interaction with the other contributors was face to face which helps a lot strengthening GNOME as a community. 😃

Thank a lot to Kinvolk and Collabora for helping to make this hackfest a great event!

dimanche 18 septembre 2016

GNOME Games 3.22: the Giant Leap

I didn't blog about Games since quite some time and the app changed a lot since 3.18. 3.20 was quite a small update featurewise: it added support for MAME and Neo Geo Pocket games, added the About dialog, allowed l10n of the application, added a Preferences window listing the available plugins and fixed other small bugs, but this release mainly saw refactoring work with the introduction of the plugins system where plugins allow to list games: the Steam plugin lists Steam games and the SNES plugin lists SNES games.

So with 3.20, Games was ready to be improved upon and improvement there was! 3.22 is the first properly usable version of Games

The biggest change this cycle is the number of contributors to Games' codebase, first of all with two GSoC interns working on it: Megh Parikh and Ricard Gascons did a great job as I will detail it later. But Games didn't gain contributors only via GSoC: Bastien Nocera has been helping on the project since a year or so and got even more involved recently, and Mathieu Bridon implemented several new features and helped a lot working on Flatpak integration as well as on shipping the Libretro cores.

Supported Game Types

We disambiguated several games related MIME types in shared-mime-info:

  • SG-1000 and Game Gear games got disambiguated from the Master System ones;
  • Mega-CD, 32X and Sega Pico games got disambiguated from the Mega Drive ones;
  • Game Boy Color games got disambiguated from the Game Boy ones.

This disambiguation done, Games wouldn't be able to detect these games as it was only looking for Master System, Mega Drive and Game Boy games, hence we now suport them explicitly. Games also gained support for new systems, here are the newly supported systems in 3.22:

  • Atari 2600;
  • Atari 7800;
  • Game Boy Color;
  • Game Gear;
  • Mega-CD — a.k.a. Sega CD;
  • Mega-CD 32X — a.k.a. Sega CD 32X;
  • Mega Drive 32X — a.k.a. Genesis 32X, Super 32X and Mega 32X;
  • PC-Engine CD-ROM² and its variants — a.k.a. TurboGrafx-CD;
  • PlayStation;
  • Sega Pico — a.k.a. Kids Computer Pico;
  • SG-1000.

Keep in mind that what we mean by support is that Games can list the games for this system, it doesn't mean it can run them — this ability depends on other factors such as whether a Libretro core able to run the game is installed — nor that it will run properly — for example, games requiring a mouse aren't supported yet.

Covers and Icons

Batien Nocera wrote a Grilo plugin retrieving info from TheGamesDB.net and I made most game types use this in Games. The previously discussed new MIME types have been added to shared-mime-info to allow us to support more game types but also to discriminate properly the different types in this plugin: before that we had no proper way to know if a Game Boy game was a Game Boy one or a Game Boy Color one.

Games can automatically fetch covers from TheGamesDB.net.

Maybe TheGamesDB.net doesn't have a cover for your game, but that's not a problem: this website is crowdsourced, contribute a cover and it will appear in Games!

What if you simply don't like the cover the website returned for any reason: no problem, if you have a game located at /path/to/mario.nes, an image file will be used as the game's cover if it's named like:

  • /path/to/mario.*,
  • /path/to/cover.* or
  • /path/to/folder.*

where * is any extension.

If you have cover image files alongside your game files…

…Games will use them for the games' thumbnails.

Headers of Steam games are downloaded from the Steam store's website and used as the game's cover.

With pretty covers to show, we decided to double the size of the game thumbnails (from 128 pixels to 256 pixels) to better appreciate them! If your game still has no cover to display, it may have an icon: desktop and Steam games already displayed their icon, but now icons are also extracted from LÖVE packages and Nintendo DS games.

Fullscreen Support

I finally found some time to work on the fullscreen mode! It is available to Libretro based games: on the game display page at the top right corner you will find a Fullscreen button allowing you to switch to the fullscreen mode; in this mode the headerbar and the pointer will be hidden after 2 seconds of pointer inactivity, just move the pointer to reveal them.

You can toggle the fullscren mode by pressing Ctrl+F or F11, and you can escape it by pressing Escape; leaving the game will also quit the fullscreen mode.

Gamepads Support

Megh Parikh added support for gamepads to play Libretro based games; the gamepads are discovered with udev and are read with libevdev.

He implemented support for the format used by SDL2 to map the input events sent by the gamepad into meaningful gamepad events: with that, Games can know for any mapped gamepad that the Start button got pressed rather than the 10th button. Games comes with a large database of gamepad mappings.

Linux's input system has proper gamepad inputs (buttons, etc.), even though only a few gamepads send these proper events we should support them even if Games doesn't have a mapping for them: we already can know which button is which one! Hence I added support for these: to work with Games, your gamepad need to send proper gamepad events or to have a mapping available. If your gamepad doesn't work with the application, consider it a bug!

Games doesn't have a user interface to handle the gamepads — yet? — but it doesn't need it to be usable! Megh implemented an automatic way to assign a controller to a player, here is how it works:

  • when a gamepad is plugged in, it is assigned to the first player with no gamepad;
  • when a gamepad is plugged out, the player which had it have no gamepad instead and any other player keep its controller;
  • the keyboard is assigned to the first player with no controller after reassigning the gamepads.

If your gamepad doesn't work with games, consider it a bug too!

PlayStation Support

PlayStation support has been a big focus for Ricard Gascons and to a lesser extend for myself. Ricard added multi disc support for PlayStation games: if the game you are playing has multiple discs then the header bar will contain a button with a CD icon, pressing it will reveal a list of the discs of the game, selecting one will switch the disc in use for this game, allowing you to keep progressing almost seamlessly.

You can switch between the multiple discs of a PlayStation game.

Some discs have a title, if it's the case it will be displayed rather than Disc n as the disc's title.

If a PlayStation disc has a title, Games will display it.

The DualShock controller for the PlayStation which has been introduced after the launch of the console has two analog thumbsticks and several games take advantage of it. These controllers feature a button allowing to present the gamepad as a DualShock controller or as a classic controller, this was a workaround for compatibility purpose as earlier games wouldn't work with a DualShock. For gamepads to work seamlessly with any games in Games we needed to automatically select the correct gamepad type: if your game doesn't support DualShock, we present the gamepads as classic ones, otherwise we present them as DualShocks.

To achieve grouping several discs into a single game, knowing a disc's title and knowing the supported gamepad types, Games ship a database containing these informations so it can work out of the box; this also allow Games to display a good title for any known game .This database is built by dumping the PlayStation DataCenter website, if you find an oddity, it's either a bug in our dumper or in the website!

Pause on Focus-Out

You probably don't want to lose the control of the game because the window loses its focus and when playing you'll likely have the window focused, so I made Games pause a running game when the main window loses the focus and resume the game when it gains it back. If the window loses its focus to the Shell, the pause is delayed by half a second, allowing to pause when the shell takes the focus while avoiding annoying micropauses when a short notification appears on screen.

Inhibition

To avoid the screen to go black when playing a game, Mathieu added a screensaver inhibitor; and to avoid to loose a running game he also added a session inhibitor: when trying to close your session you'll be warned if a game is running.

Resume and Quit Dialogs

Unfortunately some integrated games can't be saved and resumed, hence quitting such a game implies you will lose your progress. To be sure you know that, I added a dialog letting you to quit the game and to lose your progress or to keep playing.

The dialog proposing you to resume the game or to start it over has been overhauled: it used to allow you to:

  • resume the game with a Resume button;
  • restart the game with a Main Menu button;
  • go back to the games list with a Cancel button.

This was confusing: Main Menu took you back to the game's title screen while many thought it moved you to the games list; also the Cancel button wasn't really useful as you could as well choose to resume the game and then quit it. So Mathieu refactored it by renaming the Main Menu button into Restart and by removing the Cancel button.

Mathieu then added a new dialog letting you to choose what to do in case resuming the game failed for any reason: you can reset the game with a Reset button or choose to do nothing and go back to the games list with a Cancel button.

Audio

There was an annoying bug which made the sound stop working after playing a game for some time, it was caused mainly by a poor usage of PulseAudio in retro-gtk, it has been fixed by using the PulseAudio Simple API instead. Another problem was that an error made any game run at 60 frames per second rather than the rate needed by the game's system. I fixed both problems into retro-gtk so sound and game speed should work as expected.

Running a Game Failed

When Games failed to run a game it used to display a message in an infobox at the top of the collection view, this didn't work well so I replaced this by the following page.

Distribution

Bastien and Mathieu worked a lot to make Games work better with Flatpak: they found missing functionalities in Flatpak which are now shipped, they made gamepads work in the sandbox, they helped making the nightly flatpak build, they added some Libretro cores to Games' nightly Flatpak… so many things I probably forgot some.

Speaking of Libretro cores, this is the biggest problem when distributing Games. We are currently relying on retro-plugins to distribute a curated set of Libretro cores but it doesn't work well:

  • it isn't very useful as it simply ships the content of other projects;
  • it limits Games to the cores shipped in it and there aren't many;
  • Games contains hardcoded information we need about these cores, which is terrible;
  • it gives us the burden to maintain this module when we have many more important things to work on.

retro-plugins was good when the project was young but now it needs a better way to ship Libretro cores. The libretro-super project seems to be the de facto standard way to install Libretro cores, it installs them in the $(libdir)/libretro directory with info files for each core. We started working on extending these info files to make them include the information we need: a way to pick the best core to run the games we want and whether the core supports resuming the games. We will help hardening this solution so we can deprecate retro-plugins and use this instead.

We started testing this solution in the Flatpak version of games: it doesn't depends on retro-plugins, instead we directly ship some Libretro cores with an extended info file.

Conclusion

Many other things happened, for example Games received many translations and I fixed some bugs in the PCSX-ReARMed Libretro core with the help of Alexis Puskarczyk.

Despite remaining rough edges and lacking features, I'm extremely proud of this release as it marks the first really usable version of Games!

jeudi 25 août 2016

GUADEC 2016 and the Butterfly Effect

Between August 10th to 17th included, I went to the nice city of Karlsruhe for GUADEC 2016.

The Trip to Karlsruhe

I arrived the 10th at 11 P.M. to Karlsruhe's train station after a 9 hours train trip, it was the first time I visited Germany and by night the city was calm and fresh which was nice after such a trip. Before going to the room I rented for the night I made a small detour to meet some gnomies as they were going out of their restaurant, it was nice to see some familiar faces again. :)

The Training Workshops: Discovering GStreamer

The 11th I participated to the GStreamer training workshop held by Olivier Crête, it was a really pleasant experience and I hope there will be more workshops during the next GUADECs!

The Core Days

This year again there were plenty of interesting talks, I won't give details as you can see them by yourself online... That being said, I helped filming some of these talks which was an interesting experience and I am eager to help doing so again the next years!

If you are going to some GUADECs you should really consider volunteering, it enhance the experience a lot for you as you are experiencing it from the inside and for the others as you are helping making it better!

The BoFs

On monday afternoon, the Games BoF went pretty well, with Bastien Nocera and Mathieu Bridon we worked hard on polishing Games:

  • we started the work to deprecate and drop the retro-plugins package as maintaining it is a burden to us
  • we made gamepads sending proper gamepad events to work out of the box
  • we polished some UI elements like the "Resume" dialog
  • we started the work to add session inhibitors to avoid the session to lock while you are playing, and to warn you if a running game can't be saved when quitting the session
  • ...

We also tried to make Games play nice with Flatpak: we ensured the Flatpak builds correctly, managed to package some Libretro cores with the Flatpak:

  • we ensured the Flatpak builds correctly
  • we managed to package some Libretro cores with the Flatpak
  • we managed to get the gamepads somewhat working
  • ...

The result is that now Games is usable as a Flatpak which will make its distribution way easier!

The Social Events

I attended the barbecue on Thursday, the picnic on Friday and the diner at the Hoepfner Burggarten on Sunday and all these events were really fun and well organized.

The Saturday with Bastien and Mathieu we skipped the social event at the Z10 bar to visit the RetroGames e.V, a non-profit organization holding an arcade full of retro cabs. The entrance is €3 and you can play as much as you want so it's really cheap and you can have plenty of fun with their exotic games!

On a sidenote, I recommend you to eat at Casa do José, it was really good. :)

Many Thanks to the Organizers

I want to thank again all the organizers for their awesome work and also the volunteers: this GUADEC was great! :D

Visiting the City

On Tuesday morning I had the chance to visit some parts of the city with Moira who knows it a bit, it allowed me to see the big castle and more importantly the very large park behind it. I will always be amazed by how much the parks and the country can be green and lush in the middle of summer in the North/in the continent. :)

Protip: there are plenty of blackberries in the park.

The zoo is just in front of the train station and it can be crossed for free on a bridge, from there you can see some elephants and by walking aside the zoo you can see some penguins.

Trying to Go Back Home

On Wednesday at 11:30 I took the train back to my hometown of Montpellier... at least that's what I thought! Maybe you remember Jeff's adventures in Frankfurt last year, well I lived something somewhat similar.

This very day a hailstorm hit cities between Montpellier and the nearby city were I grew up, this sudden storm caused a pine to fall on the rails just before Montpellier and a regional train hit it causing all trains between Lyon and Montpellier to stop. At 5:30 P.M. I had to leave the train in Lyon, after some time at the train station's reception desk to gather useful information I learned that traffic was planned to start again on Thursday morning, which implied that I had to pass the night there. Fortunately I have some friends in Lyon like Bastien Nocera and Mathieu Bridon (them again) whose train was planned to arrive a few hours later, hence after warning them I started moving to Mathieu's apartment where his wife received me. It ended up being a pleasant adventure for me as it allowed me to see her again after several months. :)

See you in Manchester!