Author Topic: Setting PyProcGameHD and SkeletonGame up on Popeye  (Read 3261 times)

uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Setting PyProcGameHD and SkeletonGame up on Popeye
« on: June 14, 2015, 03:41:39 PM »
So I am trying to setup PyProcGameHD and SkeletonGame for my Popeye, and I am running into a few issues:

1st up is my install of open CV.  I have tried adding a registry entry to the Open CV directory, and then setting up a path to the Dlls, but I am still getting an error telling me OpenCV is not installed.

2nd.... Something is going on with my path setups in my config file.  The game keeps looking for dmdgrid32x32.png in the root of my game rather than the asset directory.    I can get around this by moving my dmd grid file to my project root, but this is not a good solution.

3rd..  Even with pinproc_class: procgame.fakepinproc.FakePinPROC  setup in my config.yaml, the game appears to still be trying to find my Proc hardware (see attached).  I think this may be related to my 2nd problem.

Any help here would be appreciated...

For ease of looking over my code, I have setup another github repository for my popeye code.  You can find it here-->  https://github.com/UncivilEngineer/popeye
« Last Edit: June 14, 2015, 03:45:11 PM by uncivil engineer »

Curbfeeler

  • Wizard
  • *****
  • Posts: 239
  • Dan - Des Moines, IA
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #1 on: June 14, 2015, 04:25:46 PM »
I'll pm you a link to my pinbot 2.0 stuff.

Sent from my SM-G900V using Tapatalk


uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #2 on: June 14, 2015, 06:17:33 PM »
thank CurbFeeler.  At least I have some know working code to start with. 

I tried launching your code, I am now having issue with the font_path (see attached).  The path is set in my game config.yaml, but something must be over-riding it somewhere in my setup.  Any ideas what might be causing this error?

MOcean

  • Moderator
  • ****
  • Posts: 822
  • Michael Ocean
    • View Profile
Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #3 on: June 14, 2015, 07:06:12 PM »
These problems tell me that your config.yaml is malformed and so the game proceeded without it (hence looking for the dot filter in the wrong place and ignoring your FakePinProc settings).

Make sure you have no tabs in your yaml file. Always edit with a smart editor that lets you see your whitespace when you highlight it (I like SublimeText 2 which runs on anything, Notepad++ on Windows is a quick download). I'm not at my laptop so I can't check out your config.yaml at the moment, but I guarantee that's the problem there.

Edit: from my phone I looked at your GitHub.
This might be the problem?
PYSDL2_DLL_PATH:
    - C:\Python26\DLLs\sdl2\

Shouldn't be a list. Should be all on the same line without the dash. Also check for tabs. Only spaces.

- Michael
« Last Edit: June 14, 2015, 07:08:18 PM by MOcean »

uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #4 on: June 14, 2015, 07:34:10 PM »
Michael,
I have been using Wings 101 to edit my YAML files, and it seems to have done a pretty good job in the past.  I am having the same issue with both the clean pinbot code, and my popeye code. 

I fixed the PYSDL2 path, and I get the same result.

MOcean

  • Moderator
  • ****
  • Posts: 822
  • Michael Ocean
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #5 on: June 14, 2015, 07:49:46 PM »
WingIDE is a good one, for sure. That particular error message is the pySDL2 font manager failing to find a specific font (so an HDFont as listed in your asset_list.yaml). You might want to check that you have those fonts installed (or you could add a "file" attribute to load the fonts from a direct path --the value would be the relative path to the font file). Regardless, I need to see what's going on with that yaml file. I'll grab my laptop...

MOcean

  • Moderator
  • ****
  • Posts: 822
  • Michael Ocean
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #6 on: June 14, 2015, 07:58:51 PM »
Okay. I pasted it here:
http://yaml-online-parser.appspot.com

And it found what I missed. Line three there needs to be a space between the dash and the "." That starts the path of that value

Curbfeeler

  • Wizard
  • *****
  • Posts: 239
  • Dan - Des Moines, IA
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #7 on: June 14, 2015, 09:54:03 PM »
One quick thing, I assume you are in Windows. you will need to install fonts. any TTF font you find in the assets folder must be installed

Sent from my SM-G900V using Tapatalk


uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #8 on: June 15, 2015, 12:32:20 AM »
Ok, I think the fact that the TTY fonts were not installed was half of my problem.  I got through that problem, and then had to install two dmd fonts, which just meant copying them to the DMD directory.

Fixing my config.yaml now means it is parcing correctly, and the game is no longer looking for a Proc to be connected, and it is booting the virtual game class correctly.  Next ups is setting up my score display yaml.

I still need to fix my OpenCV install.  The installation instructions are kinda cryptic to folks like me.  I am trying to use the pre-built libraries to install version 3.0.0.  However, from further reading, it looks like this is setup to work with Python 2.7.  What version are you guys using with PyProcGamesHD?  Are there any other prerequisites to installing OpenCV?

Curbfeeler

  • Wizard
  • *****
  • Posts: 239
  • Dan - Des Moines, IA
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #9 on: June 15, 2015, 12:51:06 AM »
Post 46 here are my notes to Michael about my install process.  Cryptic, but best I could do.  http://www.pinballcontrollers.com/forum/index.php?topic=1500.msg14287.msg#14287


Sent from my SM-G900V using Tapatalk


uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #10 on: June 15, 2015, 01:28:03 AM »
Post 46 here are my notes to Michael about my install process.  Cryptic, but best I could do.  http://www.pinballcontrollers.com/forum/index.php?topic=1500.msg14287.msg#14287


Sent from my SM-G900V using Tapatalk


Sweet.... This worked!  I was trying to install OpenCV 3 also, and was having no luck.  I was able to install CV2 finally, and it worked!!!  I was able to run the Pinbot 2.0 code. 

Just for reference, I did find I had to make a small change to the install directions you supplied.

Quote
1.  Install PIP
https://pip.pypa.io/en/latest/installing.html
https://bootstrap.pypa.io/get-pip.py
From the CMD line, run:
python get-pip.py

This will allow you to install Python libraries from wheel files. 
Now go to :http://www.lfd.uci.edu/~gohlke/pythonlibs/  and get the following wheel files:
opencv_python-2.4.11-cp26-none-win32.whl
numpy-1.9.2+mkl-cp26-none-win32.whl

Place the files in your root python directory.  In this case it is c:\Python26

Now run the following from the cmd line:
C:\Python26\Scripts\pip install C:\Python26\opencv_python-2.4.11-cp26-none-win32.whl
You should see some output that looks like the following:
Processing c:\python26\opencv_python-2.4.11-cp26-none-win32.whl
Installing collected packages: opencv-python Successfully installed opencv-python-2.4.11

Then install the numpy wheel file:
From the cmd line run:
C:\Python26\Scripts\pip install C:\Python26\numpy-1.9.2+mkl-cp26-none-win32.whl
You should see some output that looks like the following:
Processing c:\python26\numpy-1.9.2+mkl-cp26-none-win32.whl
Installing collected packages: numpy
Successfully installed numpy-1.9.2

Now test your Open CV install by doing the following:
Open a python terminal session (just enter python at the cmd prompt)
then enter the following commands
import cv2
print cv2.__version__

You should not get back any error, but instead get the installed version of CV (in this case is 2.4.11).


MOcean

  • Moderator
  • ****
  • Posts: 822
  • Michael Ocean
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #11 on: June 15, 2015, 09:27:24 AM »
Awesome!

I'll update the instructions to reflect the proper versions of Python and OpenCV, and also the other changes.

I really need to make a version of the SampleGame that includes all necessary assets and shows the new use of HDfont loading from file, instead of needing to install the font to your system...

Sweet.... This worked! 

Curbfeeler

  • Wizard
  • *****
  • Posts: 239
  • Dan - Des Moines, IA
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #12 on: June 15, 2015, 09:33:10 AM »
Awesome, just so you're aware, that version of pinbot is about a week or two behind, and more importantly it's an older version of Micheal's procgame.  I'd recommend wiping out the procgame folder and replacing with the latest from Michael's github.

Now get to codin'!

Dan

uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #13 on: June 16, 2015, 10:43:12 AM »
I have updated my SkeletonGame on Sunday, and I am hoping that tomorrow I find some time for some serious coding.

I know the basics of mode coding, but this one will be a challenge as I will have do deal with the display for the first time. 

On the hardware front, I picked up a lower panel that goes under the backglass off ebay last week, as well as a 15.6" LCD laptop monitor.  Now I just need to get a controller for the monitor.

So yeah... Its time to get started.

MOcean

  • Moderator
  • ****
  • Posts: 822
  • Michael Ocean
    • View Profile
Re: Setting PyProcGameHD and SkeletonGame up on Popeye
« Reply #14 on: June 16, 2015, 12:48:07 PM »
My favorite SkeletonGame feature is the displayText helper function, which should hopefully make dealing with the display easier for folks.

Here's some examples of its use (from mode code):

Code: [Select]

self.game.displayText('Ball Saved!')

Will put a message "Ball Saved!", centered on your display.

Code: [Select]

self.game.displayText(['Ball Saved!','', 'Good Job'])

Will make three lines. At 1/4 down with Ball Saved, 1/2 down is blank, 3/4 down is Good Job.

Code: [Select]

self.game.displayText(['Ball Saved!','nice one'], 'anim3')

Will show Ball Saved! At the top 1/3rd, nice one at 2/3rd, and both will be shown on top of the asset_list.yaml entry tagged with the key anim3

Finally, you can also use a list of background assets to make a group on the fly if you want a stack (eg, one of the animations/stills has transparency)

Code: [Select]

self.game.displayText(['Ball Saved!','nice one'], [ 'anim3', 'chrome'])

As before but the text is on top of anim3 which is on top of chrome.