Let's play Commander Keen

Didn’t work, I am going to have to start from scratch and see if I get somewhere!

When you start over you should remove all CommanderGenius directories and files of course.

Here is my complete tutorial again with my complete output:

cpi@clockworkpi:~$ wget https://gitlab.com/Oet/Commander-Genius/uploads/edd704e814e9af202266068a05ff6be3/CommanderGenius.zip
--2018-09-25 20:36:38--  https://gitlab.com/Oet/Commander-Genius/uploads/edd704e814e9af202266068a05ff6be3/CommanderGenius.zip
Resolving gitlab.com (gitlab.com)... 35.231.145.151
Connecting to gitlab.com (gitlab.com)|35.231.145.151|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1535433 (1.5M) [application/octet-stream]
Saving to: ‘CommanderGenius.zip’

CommanderGenius.zip 100%[===================>]   1.46M  2.07MB/s    in 0.7s    

2018-09-25 20:36:39 (2.07 MB/s) - ‘CommanderGenius.zip’ saved [1535433/1535433]

cpi@clockworkpi:~$ unzip CommanderGenius.zip
Archive:  CommanderGenius.zip
  inflating: .CommanderGenius/cgenius.cfg  
  inflating: .CommanderGenius/gameCatalogue.xml  
  inflating: CommanderGenius/CommanderGenius  
cpi@clockworkpi:~$ mv CommanderGenius/ /home/cpi/games/
cpi@clockworkpi:~$ ln -s /home/cpi/games/CommanderGenius /home/cpi/.CommanderGenius/games
cpi@clockworkpi:~$ echo /home/cpi/games/CommanderGenius/CommanderGenius > /home/cpi/apps/launcher/Menu/GameShell/CommanderGenius.sh
cpi@clockworkpi:~$ wget https://gitlab.com/Oet/Commander-Genius/uploads/4fef7d77bce50d5d141ff6a622ad8c52/CommanderGenius.png -P /home/cpi/apps/launcher/skin/default/Menu/GameShell/
--2018-09-25 20:37:46--  https://gitlab.com/Oet/Commander-Genius/uploads/4fef7d77bce50d5d141ff6a622ad8c52/CommanderGenius.png
Resolving gitlab.com (gitlab.com)... 35.231.145.151
Connecting to gitlab.com (gitlab.com)|35.231.145.151|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12980 (13K) [application/octet-stream]
Saving to: ‘/home/cpi/apps/launcher/skin/default/Menu/GameShell/CommanderGenius.png’

CommanderGenius.png 100%[===================>]  12.68K  --.-KB/s    in 0.1s    

2018-09-25 20:37:47 (131 KB/s) - ‘/home/cpi/apps/launcher/skin/default/Menu/GameShell/CommanderGenius.png’ saved [12980/12980]

And reboot.

1 Like

Hey guys, Gerstrong here. Good effort. Thanks for porting Commander Genius to Gameshell. This really motivates continuing on this project. :slight_smile:

1 Like

Thank you for the project’s existence. :slight_smile:

We need people like you to run games natively on the GameShell.

If you want any feedback. The GameShell is not always connected to the internet since it is a portable device. It would be great if a next version boots as quickly offline as online. Then I can make a new tag.

The reason for the internet connection is the store. It is planned to upload more mods and I want CG instances to get informed.

I can add a macro so this won’t happen, but you might miss out newer mods.

Or better yet I take a look in how to let the update run in the background.

1 Like

Hi. I have updateg CG. Now it download in the background, making the boot much faster.

You can also disable the whole downloader if configure your build with CMake -DDOWNLOADER=0

Talking about version 2.2.7. Let me know if that works better for you.

Hi,

Well, I definitely see you updated it. :smile:

The latest stable version of cmake on the GameShell is cmake 3.7.2-1.
The minimal version to cmake CG 2.2.7 is cmake 3.10.

CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
CMake 3.10 or higher is required.  You are running version 3.7.2
-- Configuring incomplete, errors occurred!

After I set cmake_minimum_required(VERSION 3.7) a next issue emerges:

  CMake Warning at GsKit/CMakeLists.txt:83 (FIND_PACKAGE):
  By not providing "FindPython3.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Python3", but
  CMake did not find one.

  Could not find a package configuration file provided by "Python3" with any
  of the following names:

    Python3Config.cmake
    python3-config.cmake

  Add the installation prefix of "Python3" to CMAKE_PREFIX_PATH or set
  "Python3_DIR" to a directory containing one of the above files.  If
  "Python3" provides a separate development package or SDK, be sure it has
  been installed.


CMake Error at GsKit/CMakeLists.txt:91 (message):
  Python3 not found!


-- Configuring incomplete, errors occurred!

However, I have python-3.5 installed… Needs some investigation.

Okay got you covered with CMake 3.7. Just updated the code so that is the requirement now and the build system agrees.

Not sure why Python is not detected on your side but 3.5 should be fine. Do you have the C bindings of python installed as well?

sudo apt install python3-dev
sudo apt install libpython3-dev
sudo apt install libpython3.5-dev

With CMAKE DUSE_PYTHON=0 you can disable it. It is required for some mods though.

  1. You fixed the cmake restriction.
  2. This is the workaround: cmake -DUSE_PYTHON3=0 ..

Another workaround I did was reverting FindPython3 back to FindPythonLibs again. My best guess is that FindPython3 is introduced in cmake 3.12.

This would mean you are using cmake 3.12 or higher in your build system. Correct?

Currently building by the way…

Good to know. FindPythonLibs is considered deprecated. I had some problems with it. If it works for you I’m fine with it.

We can use this for now but will have to switch someday…

Well, I have tested it. Here is a comparison:

2.2.5

  • It always boots. :slight_smile:

When it boots:

  • Online is quick.
  • Offline boots LOADING screen and stays 100% for a while.

2.2.7

  • It usually does not boot, but sometimes it does. :frowning:

If it boots:

  • Online is quick.
  • Offline is quick.

When I output stderr to a file, and the boots fails, I only see “Segmentation fault”.

I cannot reproduce such issue, but I have an idea what could be. I pushed another commit. Can you test it again and let me know if it got better?

I am not sure. I found out some weird stuff with the current build:

  1. Unlike before (2.2.5), I now need to set “OpenGL = true” to make it work, although the GameShell does not support OpenGL.
  2. When I go from online to offline (or vice versa), CG needs to be started TWICE to notice that change.
  3. When I press “up” while the focus (blue border) is on the EMPTY games list, CG crashes.

So I guess we are getting somewhere, but it still has some glitches. It always boots fast though. :slight_smile:

1.- If you set OpenGL=true it searchs for that. At least this is what CMakeLists does for what I see. What message do you get if you disable it? Since SDL2 it doesn’t matter that much anymore. If you wanted gfx hardware acceleraction with SDL 1.2, OpenGL was a requirement. So better disable it, let SDL2 do it’s work. If it fails, let me know why.
2.- Will check how to reproduce that. Going online is only for downloading games and catalogue, not for playing within the games. It would be second nature.
3.- Got it fixed!

Further investigation to narrow it down:

  1. If I set OpenGL=true it seems to always boot. If I set OpenGL=false it “sometimes” boots. Here is the difference in logging between a successful run and failure run (so both runs OpenGL=false):
cpi@clockworkpi:~$ diff success.log error.log 
144,151c144
< n: Error loading the Virtual Gamepad!
< n: No game can be launched, because game data files are missing.
< n: Loading Resources [finished]
< n: Finished downloading from "http://downloads.sourceforge.net/project/clonekeenplus/Downloads/gameCatalogue.xml", destination: "gameCatalogue.xml"
< n: Loading catalogue file in the background [finished]
< W: ThreadPool: waiting for 1 threads to finish:
< W:   thread Loading catalogue file in the background is ready but was not cleaned up
< n: End of logfile
---
> Segmentation fault
  1. I reproduced the online/offline behaviour on my Linux desktop:
  • bring down ethernet
  • run CG (Add games still there)
  • run CG again (Add games gone)
  • bring up ethernet
  • run CG (Add games still gone)
  • run CG (Add games appears)

So this bug seems common behaviour (not GameShell-specific).

  1. Thanks for fixing it. Will check in the next build.

Sorry, but I cannot reproduce point 1. 3 is fixed. Can you cleanup caches and retry build. Sometimes there are caches hanging around. I tried what you told me, but no crashes.

The “+ Games” depends on whether you have downloaded the gameCatalogue or not. If you are offline but already have that file, you will see “+ Games”. You can see what is in the store but you won’t be able to download them, until you got a connection.

The behaviour with the catalogue file is a bit weird, now that I see, let me take a closer look.

Alright. I have improved the internal downloader a bit. You get more feedback with offline connections and it should feel much snappier. Let me know if it works better for you.

Okay. I need some time to test it. How can I scale up the debug level (if possible)? And what setting would you recommend for VirtPad?

The README has also been greatly improved I see. :wink:

To be honest I have no debug level. You can turn Debug build on CMAKE -DCMAKE_BUILD_TYPE=Debug and you get the usual stuff and some more messages. I put everything or as much as possible into the CGLog.html, be it debug or release. With the debug build you can of course let gdb run CG and get some stack traces.

I would disable virtpad. I might add a macro for that. It is meant to be used for touch only devices, like our smartphones. This will be more interesting for Android with SDL2 and CG. For anything multiple touch related, well maybe. For devices with real controls and not even a mouse, it doesn’t make sense at all.

Wow,

Okay, this time I tested it under the newer v0.2 GameShell image. It still sometimes boots.

When it does not boot I get 5 different reasons up until now:

n: Looking at: src/gameCatalogue.xml
n: Sorry, the catalogue file "gameCatalogue.xml" was not found 
*** Error in `/home/cpi/Commander-Genius/build/src/CGeniusExe': double free or corruption (!prev): 0x00d5c4f8 ***
n: Loading catalogue file in the background [finished]
*** Error in `/home/cpi/Commander-Genius/build/src/CGeniusExe': double free or corruption (out): 0x00fde358 ***
Aborted
n: Sorry, the catalogue file "gameCatalogue.xml" was not found 
*** Error in `/home/cpi/Commander-Genius/build/src/CGeniusExe': free(): invalid next size (fast): 0xace36750 ***
Aborted
n: Sorry, the catalogue file "gameCatalogue.xml" was not found 
*** Error in `/home/cpi/Commander-Genius/build/src/CGeniusExe': corrupted size vs. prev_size: 0xac936f08 ***
Aborted
n: Sorry, the catalogue file "gameCatalogue.xml" was not found 
Segmentation fault
n: Game Autodetection Finished
Segmentation fault

Now I have to test it again on the v0.1 image too. :confused:

(At least the “up” bug is fixed :slight_smile: ).