SyntaxBomb - Indie Coders

Languages & Coding => AppGameKit ( AGK ) => Topic started by: MichaelUK on March 09, 2018, 18:32:36

Title: Announcing AppGameKit for Python!
Post by: MichaelUK on March 09, 2018, 18:32:36
https://www.thegamecreators.com/post/announcing-appgamekit-for-python (https://www.thegamecreators.com/post/announcing-appgamekit-for-python)
Just seen this on Facebook you can now use Python to access AGK2 commands

TheGameCreators have teamed up with developer Adam Biser to trial his Python version of AppGameKit.

With the help of a Python PYD plugin, Python developers now have a way to access the AppGameKit game making commands.

This derivative version of AppGameKit makes the language easily accessible to the huge Python development community and we are excited to see Python users make it part of their tool set.

For more details and download access, visit:

AppGameKit for Python Website https://fascimania.itch.io/appgamekit-for-python (https://fascimania.itch.io/appgamekit-for-python)






Title: Re: Announcing AppGameKit for Python!
Post by: Pfaber11 on March 09, 2018, 19:07:56
Very good looks like AGK is going to be around for some time to come . Think I'll be sticking with the basic version though.
Title: Re: Announcing AppGameKit for Python!
Post by: Rick Nasher on March 09, 2018, 20:06:59
I'm BASIC fan boy, but if I wanna pick up on Python then this a good stimulus to keep going.
Very nice.
(https://i.imgur.com/XJyemeI.jpg)
Title: Re: Announcing AppGameKit for Python!
Post by: MichaelUK on March 09, 2018, 23:50:06
I am not into python myself but I am so happy with the development that is happening with AGK always something going on, new releases, bug fixes, make me a happy camper :)
Title: Re: Announcing AppGameKit for Python!
Post by: Derron on March 10, 2018, 07:19:51
Isn't this similar to a dll-wrapper done by an external person? So this seems to be a work of a person not associated to the AGK team. One could possibly write that for other languages too.

Most interesting part might be this:
QuoteYou can also save 50% off AppGameKit and any of the bundles by using this promo code during checkout:  AGKPYTHONDEAL50.
https://fascimania.itch.io/appgamekit-for-python

bye
Ron
Title: Re: Announcing AppGameKit for Python!
Post by: Naughty Alien on March 10, 2018, 08:41:37
..very cool..nice to see AGK exposed to other languages..
Title: Re: Announcing AppGameKit for Python!
Post by: degac on March 10, 2018, 12:07:37
QuoteThe Print method was renamed to draw_text so that it wouldn't be confused with Python's builtin print command. 

Well, not so 'portable' as I think...
(just looking at the page and discovering the 'warnings'... of course better than nothing)
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 10, 2018, 16:57:18
Hi everyone, I hope that you're enjoying AppGameKit for Python!

@Derron: You're correct.  I'm not a member of the AGK team.  I approached them about the project and we came to an agreement so it can be released in its current state.  It could not have been released otherwise as it would go against their license.  This is a trial at the moment with the potential of becoming more official if get positive feedback from it.
"This Python version of AppGameKit is officially licensed by The Game Creators Ltd to Adam Biser."

If you find bugs in the project, I'm the one to contact about it.  I've set up a forum on the itch.io page which I monitor.  I'll subscribe to this thread, too.

@degac: Correct, it's not 100% portable from tiers 1 and 2 due to differences in how the Python language acts, but I tried to keep everything as close as possible.  In some cases, changes were unavoidable and when they were made, I went with the choice that seemed more Pythonic.

Changing Print/PrintC to draw_text was a difficult decision but I decided that it would be best not to have names that duplicated Python's builtin methods.  Using "from appgamekit import *" gives a slight performance boost over "import appgamekit" which some may want to use and the former would overwrite the builtin print method which could lead to confusion.
Title: Re: Announcing AppGameKit for Python!
Post by: Pingus on March 11, 2018, 17:54:55
Performance-wise, are there any advantage of using Python rather than Basic ?
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 11, 2018, 21:11:58
@Pingus: I did find that I could get slightly faster FPS in some cases while testing, but performance definitely wouldn't be a reason to switch from Tier 1.  For performance, C++ is definitely the way to go.

What Python does have over Basic is its more advanced programming structures and capabilities, such as classes, as well as all of its built-in and third-party libraries.
Title: Re: Announcing AppGameKit for Python!
Post by: MikeHart on March 12, 2018, 06:01:19
Why on earth did you basically change all the command names by introducing underscores in them?

Title: Re: Announcing AppGameKit for Python!
Post by: MikeHart on March 12, 2018, 06:08:40
And am i correct on assuming that it stops working after 12 months?
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 12, 2018, 06:20:13
@MikeHart: That is the standard naming convention for Python (https://www.python.org/dev/peps/pep-0008/#function-and-variable-names/).
The purpose of the project is twofold: to give another option to existing AGK users and to attract Python developers to AGK.

Luckily, due to Python's flexibility, the names can be changed to whatever you want really.  A script that cross-references from the Python naming convention to the Tier 1 & 2 naming would be simple to do.  And if someone wants that, I can write a script to export all the commands so the Tier 1 & 2 casing can be used instead.

from appgamekit import *

Print = draw_text
del draw_text

Print now does what the draw_text method did and can be used the same way.  The draw_text method itself has been deleted and can no longer be used.

As for the 12-month trial period (from the project page under End User License Agreement):
"The end user is permitted to create any type of project with this PYD, freeware or commercial, even in the event that the trial period expires and this project is removed from distribution."
If The Game Creators decide not to continue the project, I will be taking down the PYD and PYI downloads.  However, those who have it are still free to use it and distribute games with it.  The files themselves do not expire, just their availability on the project page and users are also asked not to distribute them unless as part of a game package.
Title: Re: Announcing AppGameKit for Python!
Post by: Rick Nasher on March 12, 2018, 19:16:00
@adambiser

QuoteAs for the 12-month trial period (from the project page under End User License Agreement):
"The end user is permitted to create any type of project with this PYD, freeware or commercial, even in the event that the trial period expires and this project is removed from distribution."
If The Game Creators decide not to continue the project, I will be taking down the PYD and PYI downloads.  However, those who have it are still free to use it and distribute games with it.  The files themselves do not expire, just their availability on the project page and users are also asked not to distribute them unless as part of a game package.

Thanks for clearing this up. Indeed was a bit vague.
Title: Re: Announcing AppGameKit for Python!
Post by: round157 on March 13, 2018, 01:13:09
Quote from: adambiser on March 10, 2018, 16:57:18
Hi everyone, I hope that you're enjoying AppGameKit for Python!


Hi, I think that you need to promote this software in the Python community(or the Pygame community) if you want to succeed. Right? Otherwise, not too many Python users will know the existence of this software.   

Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 13, 2018, 04:57:41
Quote from: round157 on March 13, 2018, 01:13:09
Hi, I think that you need to promote this software in the Python community(or the Pygame community) if you want to succeed. Right? Otherwise, not too many Python users will know the existence of this software.
I know.  It's a matter of finding where Python game developers hang out.  I'm not active of any such forum, but I've found a couple places.
Title: Re: Announcing AppGameKit for Python!
Post by: MikeHart on March 13, 2018, 06:09:14
Don't forget facebook groups and twitter and don't forget the power of hashtags.
Title: Re: Announcing AppGameKit for Python!
Post by: Rick Nasher on March 13, 2018, 17:27:48

From Phyton.org: PythonGameLibraries (https://wiki.python.org/moin/PythonGameLibraries)

Title: Re: Announcing AppGameKit for Python!
Post by: TomToad on March 14, 2018, 07:50:52
Had a heck of a time trying to get Python up and running.  Seems I had an old version (2.7) already installed and it was conflicting with the required version (3.6).  Can't expect the end user to mess around with trying to install Python.  Is there a way to compile everything into an executable, or install a localized Python runtime that won't interfere with other versions?

B4J has B4J packager that will install java runtime locally, a minimal version of java that is used only for your program so it will not interfere with other installed versions.https://www.b4x.com/android/forum/threads/ui-apps-packaging-self-contained-installers.56854/ (https://www.b4x.com/android/forum/threads/ui-apps-packaging-self-contained-installers.56854/)
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 14, 2018, 13:57:18
@MikeHart and Rick Nasher: Thanks.

@TomToad:Sorry you had trouble getting Python going, but glad to hear it's working now.

Yes, there is a pretty nice app packager called PyInstaller (https://www.pyinstaller.org/).  There may be others, but that's the only one I tested with this.  Others may or may not work.

PyInstaller uses a "spec" file which you can modify to set things like the game EXE icon.  It can generate the file for you or you can use this template to get started.


# -*- mode: python -*-

block_cipher = None


a = Analysis(['myscript.py'],
             pathex=['C:\\Path\\To\\Your\\Script'],
             binaries=[],
             datas=[('media', 'media')],
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=True,
          name='myscript',
          debug=False,
          strip=False,
          upx=True,
          console=False,
          icon='youricon.ico')
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
               name='myscript')

To use this template, change "myscript.py" to your main script file name, Analysis/pathex to your main script file's path, EXE/name to your output EXE name, EXE/icon to point to the icon file for your EXE, and COLLECT/name to be the output folder used when building the distribution package.  All files in the media folder are included (recursively) with this template.

Then generate your app package with "pyinstaller [options] spec-file-name.spec"

PyInstaller can package everything into a single folder or into a single file.  Though this PYD works with both methods, I recommend the former because when packaged as a single file, the contents are unpackaged into a temp folder when executing.  PyInstaller compiles your scripts into the EXE so they are not visible external files.

I'll post this as a topic on the project page community, too.
Title: Re: Announcing AppGameKit for Python!
Post by: TomToad on March 14, 2018, 16:42:57
Wow, took forever to figure out how to get PyInstaller working, but I finally did and successfully created an exe.  However, I did seem to get a few warnings.
This is my .spec file
# -*- mode: python -*-

block_cipher = None


a = Analysis(['box2d.py'],
             pathex=['C:\\Users\\James\\Projects\\AppGameKit\\python\\examples'],
             binaries=[],
             datas=[('media', 'media')],
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=True,
          name='box2d',
          debug=False,
          strip=False,
          upx=True,
          console=False,
          icon='box2d.ico')
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
               name='box2d')

This is the output from running PyInstaller
378 INFO: PyInstaller: 3.3.1
379 INFO: Python: 3.6.4
380 INFO: Platform: Windows-10-10.0.15063-SP0
383 INFO: UPX is not available.
388 INFO: Extending PYTHONPATH with paths
['C:\\Users\\James\\Projects\\AppGameKit\\python\\examples',
'C:\\Users\\James\\Projects\\AppGameKit\\python\\examples']
388 INFO: checking Analysis
389 INFO: Building Analysis because out00-Analysis.toc is non existent
389 INFO: Initializing module dependency graph...
395 INFO: Initializing module graph hooks...
401 INFO: Analyzing base_library.zip ...
10833 INFO: running Analysis out00-Analysis.toc
10840 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by C:\Users\James\AppData\Local\Programs\Python\Python36-32\python.exe
12811 WARNING: lib not found: api-ms-win-core-profile-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
12954 WARNING: lib not found: api-ms-win-core-memory-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
13098 WARNING: lib not found: api-ms-win-core-timezone-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
13240 WARNING: lib not found: api-ms-win-core-heap-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
13384 WARNING: lib not found: api-ms-win-core-libraryloader-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
13522 WARNING: lib not found: api-ms-win-core-string-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
13662 WARNING: lib not found: api-ms-win-core-processthreads-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
13801 WARNING: lib not found: api-ms-win-core-file-l1-2-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
13940 WARNING: lib not found: api-ms-win-core-namedpipe-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
14079 WARNING: lib not found: api-ms-win-core-util-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
14218 WARNING: lib not found: api-ms-win-core-synch-l1-2-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
14361 WARNING: lib not found: api-ms-win-core-file-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
14499 WARNING: lib not found: api-ms-win-core-interlocked-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
14638 WARNING: lib not found: api-ms-win-core-console-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
14776 WARNING: lib not found: api-ms-win-core-handle-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
14920 WARNING: lib not found: api-ms-win-core-file-l2-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
15058 WARNING: lib not found: api-ms-win-core-localization-l1-2-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
15196 WARNING: lib not found: api-ms-win-core-processthreads-l1-1-1.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
15337 WARNING: lib not found: api-ms-win-core-datetime-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
15474 WARNING: lib not found: api-ms-win-core-rtlsupport-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
15611 WARNING: lib not found: api-ms-win-core-sysinfo-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
15747 WARNING: lib not found: api-ms-win-core-synch-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
15887 WARNING: lib not found: api-ms-win-core-processenvironment-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
16029 WARNING: lib not found: api-ms-win-core-errorhandling-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
16168 WARNING: lib not found: api-ms-win-core-debug-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
16173 INFO: Caching module hooks...
16200 INFO: Analyzing box2d.py
16213 INFO: Loading module hooks...
16214 INFO: Loading module hook "hook-encodings.py"...
16465 INFO: Loading module hook "hook-pydoc.py"...
16468 INFO: Loading module hook "hook-xml.py"...
17361 INFO: Looking for ctypes DLLs
17362 INFO: Analyzing run-time hooks ...
17382 INFO: Looking for dynamic libraries
17800 INFO: Looking for eggs
17800 INFO: Using Python library C:\Users\James\AppData\Local\Programs\Python\Python36-32\python36.dll
17800 INFO: Found binding redirects:
[]
17808 INFO: Warnings written to C:\Users\James\Projects\AppGameKit\python\examples\build\box2d\warnbox2d.txt
17996 INFO: Graph cross-reference written to C:\Users\James\Projects\AppGameKit\python\examples\build\box2d\xref-box2d.html
18023 INFO: Appending 'datas' from .spec
18079 INFO: checking PYZ
18079 INFO: Building PYZ because out00-PYZ.toc is non existent
18079 INFO: Building PYZ (ZlibArchive) C:\Users\James\Projects\AppGameKit\python\examples\build\box2d\out00-PYZ.pyz
20418 INFO: Building PYZ (ZlibArchive) C:\Users\James\Projects\AppGameKit\python\examples\build\box2d\out00-PYZ.pyz completed successfully.
20445 INFO: checking PKG
20445 INFO: Building PKG because out00-PKG.toc is non existent
20445 INFO: Building PKG (CArchive) out00-PKG.pkg
20488 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
20492 INFO: Bootloader C:\Users\James\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyinstaller-3.3.1-py3.6.egg\PyInstaller\bootloader\Windows-32bit\runw.exe
20492 INFO: checking EXE
20493 INFO: Building EXE because out00-EXE.toc is non existent
20493 INFO: Building EXE from out00-EXE.toc
20505 INFO: SRCPATH [('box2d.ico', None)]
20506 INFO: Updating icons from ['box2d.ico'] to C:\Users\James\AppData\Local\Temp\tmpqzpyvv20
20507 INFO: Writing RT_GROUP_ICON 0 resource with 20 bytes
20507 INFO: Writing RT_ICON 1 resource with 67636 bytes
20516 INFO: Appending archive to EXE C:\Users\James\Projects\AppGameKit\python\examples\build\box2d\box2d.exe
20523 INFO: Building EXE from out00-EXE.toc completed successfully.
20534 INFO: checking COLLECT
20535 INFO: Building COLLECT because out00-COLLECT.toc is non existent
20536 INFO: Building COLLECT out00-COLLECT.toc
21966 INFO: Building COLLECT out00-COLLECT.toc completed successfully.

This is the warnbox2d.txt file
missing module named resource - imported by posix, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named posix - imported by os, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named _posixsubprocess - imported by subprocess, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named readline - imported by cmd, code, pdb, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
excluded module named _frozen_importlib - imported by importlib, importlib.abc, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named _frozen_importlib_external - imported by importlib._bootstrap, importlib, importlib.abc, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named _winreg - imported by platform, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named _scproxy - imported by urllib.request
missing module named java - imported by platform, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named 'java.lang' - imported by platform, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py, xml.sax._exceptions
missing module named vms_lib - imported by platform, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named termios - imported by tty, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py, getpass
missing module named grp - imported by shutil, tarfile, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named _dummy_threading - imported by dummy_threading, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named org - imported by copy, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py
missing module named pwd - imported by posixpath, shutil, tarfile, http.server, webbrowser, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py, netrc, getpass
missing module named 'org.python' - imported by pickle, C:\Users\James\Projects\AppGameKit\python\examples\box2d.py, xml.sax

Any idea why I'm getting these errors?  Is it something that I can safely ignore?
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 14, 2018, 17:14:26
Did you install PyInstaller using pip or some other way?

My warnings.txt file looks the same.  I assume as long as one doesn't use the modules that are being warning about, they can be ignored and nothing I've written has used them.

These warnings from the output starting with this line look suspicious.
WARNING: lib not found: api-ms-win-core-profile-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
Do you have a bunch of "api-ms-win-core-*.dll" files in your output folder?  (I do.)

Does the generated EXE run correctly?
Title: Re: Announcing AppGameKit for Python!
Post by: TomToad on March 14, 2018, 18:13:59
Quote from: adambiser on March 14, 2018, 17:14:26
Did you install PyInstaller using pip or some other way?
Tried using pip and that didn't work, then tried downloading the installer directly and installed it as per readme file
QuoteBefore using any contributed platform, you need to build the PyInstaller
bootloader, as we do not ship binary packages. Download PyInstaller
source, and build the bootloader::
     
        cd bootloader
        python ./waf distclean all

Then install PyInstaller::

        python setup.py install
After that failed, I searched some more and discovered that I needed to add a path to the Python\Scripts directory, which I did and then pip worked correctly, and PyInstaller installed with pip.  Don't know if the long way I did it had messed up anything.  Might just delete python and everything associated with it, then try starting over with installing.
Quote
My warnings.txt file looks the same.  I assume as long as one doesn't use the modules that are being warning about, they can be ignored and nothing I've written has used them.

These warnings from the output starting with this line look suspicious.
WARNING: lib not found: api-ms-win-core-profile-l1-1-0.dll dependency of C:\WINDOWS\system32\ucrtbase.dll
Do you have a bunch of "api-ms-win-core-*.dll" files in your output folder?  (I do.)
yes, 13 "api-*.dll" files to be exact.
Quote
Does the generated EXE run correctly?
The exe seems to run without problems.  Trying to test it out on another computer without Python, but I can't even get a tier 1 program to work.  Seems to be a driver issue.
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 14, 2018, 18:36:46
To use pip, I've found it necessary to start the cmd command prompt with "Run as Admin", but it sounds like it worked for you in the end.

Since you say 13 files, I think those are "api-ms-win-crt-*.dll" files since I have 13 of those.  I have 25 of those with "core" in the name.
You might try a reinstall.  Try to get PyInstaller to work with pip running in an admin cmd prompt.  I don't remember doing anything with a "Python\Scripts" path, but I might be forgetting.  I'll have to try it with a fresh VM to see.

Do you get an error with the tier 1 program and this Python app on the other computer?
AppGameKit for Python still has the same DirectX requirements that AppGameKit tiers 1 and 2 have. (As an FYI for everyone.)
Title: Re: Announcing AppGameKit for Python!
Post by: TomToad on March 14, 2018, 18:57:36
I get OpenGL errors.  Can't remember the exact error, but something like OpenGLFrameEXT missing, and a bunch of other OpenGL*EXT missing errors before finally giving a "Your graphics card does not support the needed features, try updating your driver" error.
Also, I have  no core* .dlls installed.
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 14, 2018, 19:01:03
What version of Windows are you using?
Title: Re: Announcing AppGameKit for Python!
Post by: TomToad on March 14, 2018, 19:20:28
Windows 10 Home.

Did a little search and it seems that Windows 10 has changed .dll dependencies, so PyInstaller cannot find the proper .dlls.  Not sure if that will be a problem, would have to test it on Win8 or Win7 computers to find out.
Title: Re: Announcing AppGameKit for Python!
Post by: TomToad on March 14, 2018, 19:24:29
Some good news.  Finished installing new video drivers on my desktop and now the exe works.  Unfortunately, My desktop is also Windows 10, so still don;t know if the missing .dlls will affect the game on older systems or not.
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 14, 2018, 19:49:22
I moved all of the api-ms-win dlls out of my dist folder and it still worked.  PyInstaller appears to be grabbing everything it could possibly need to run the DLLs on a clean Windows install.

It's possible that those files are installed via a C++ redistributable.  I won't have a chance to try things out until this evening.  I have a Windows 10 VM, so I'll start with it.
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 15, 2018, 06:12:49
OK. Most of the evening was spent waiting for my Windows 10 VM to update itself after not being turned on for awhile.

In the end, I tried out PyInstaller and didn't get ANY api-ms dll files and only had warnings about the crt files (not core for some reason).
It all centers around the Universal C Runtime, which is needed for C++ applications built with VS 2015 and 2017 and included with Windows 10 by default (without having those api-ms dll files as actual files, but more internalized which is why they aren't found).

This information is useful:
https://github.com/pyinstaller/pyinstaller/blob/develop/doc/usage.rst#windows
It depends on how you want to distribute things:
* If you want to be able to just zip up the folder and distribute, either option 1 or 3 seem best.
* If using an installer then option 2, which might be recommended anyway since AppGameKit requires the Jun2010_XAudio and Oct2005_xinput DirectX items be installed, too.
Title: Re: Announcing AppGameKit for Python!
Post by: TomToad on March 15, 2018, 09:49:23
Odd, After a drive search, I have found the missing files in a number of locations.  There is C:\Windows|Sysytem32\downlevel, as well as the Java runtime C:\Program Files\Java\jre1.8.0_151\bin. A few other places have them as well.
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 16, 2018, 16:57:29
I'm not sure about the downlevel folder, but on my Win 10 install, I see only api-ms-core files, no api-ms-crt.  The one in the Java JRE folder is its local distribution of the files.

From https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/
Item #6
QuoteApp-local deployment of the Universal CRT is supported.  To obtain the binaries for app-local deployment, install the Windows Software Development Kit (SDK) for Windows 10.  The binaries will be installed to C:\Program Files (x86)\Windows Kits\10\Redist\ucrt.  You will need to copy all of the DLLs with your app (note that the set of DLLs are necessary is different on different versions of Windows, so you must include all of the DLLs in order for your program to run on all supported versions of Windows).

Item 6 links to a web installer for the SDK.  Grab it and run it.  Read on before you deciding whether you want to install or download.

If choosing to download, note the download folder.  Go through the next screen (I chose not to send anonymous data).  From the features list, clear all checkboxes then check "Windows SDK for UWP Managed Apps" (which re-checks a few other options) and click Download.

If you chose install, you're done.  If you downloaded instead of installed, open the download folder.  Here you can run "winsdksetup.exe" to install everything downloaded or open the Installers folder and find the file called "Universal CRT Redistributable-x86_en-us.msi" and run it.  From what I can tell, that is the only part needed and the SDK doesn't include it as a separate installable component.  It installs the files to the default location (C:\Program Files (x86)\Windows Kits\10\Redist\ucrt) and can be uninstalled later if desired.

After Universal CRT is installed, add this open your spec file and modify the "pathex" line so it looks like this:
pathex=['C:\\Path\\To\\Script\\File', 'C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86'],
The warnings should now disappear and the files show up in your dist folder.  You might have to delete the build and dist folders that PyInstaller creates before running it against your spec file again.
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 16, 2018, 19:40:01
I generated a package with PyInstaller running on Windows 10 Pro x64 with Python 3.6 x86 after installing "Universal CRT Redistributable-x86_en-us.msi" and modifying the spec file as given above.

I then copied the folder to a fresh install of Windows 7 x64 SP 1 running as a VirtualBox VM and can confirm that the package works in it.
The only things I manually installed are the DirectX End-User Runtimes components that AppGameKit requires: Jun2010_XAudio_x86 and Oct2005_xinput_x86, and VirtualBox's guest additions in order to have a compatible 3D driver in the VM, but these items are needed by AppGameKit itself (both tiers 1 and 2).

Removing any of the DLL files from the game folder caused the program to no longer work on the Windows 7 machine, so these files are indeed needed for the rare machine that does not have Universal CRT installed already.  The files provided by Windows SDK for Windows 10 appear to work fine with Windows 7.  I don't have a Windows Vista VM for testing and haven't had time to install Windows 8 onto a VM.

Side note:
AppGameKit for Python will not work on Windows XP because the last Python version for XP is 3.4 and AppGameKit for Python requires 3.6.
Title: Re: Announcing AppGameKit for Python!
Post by: TomToad on March 16, 2018, 20:22:38
QuoteC:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x86
It looks like I already have this directory on my drive.  Added the directory to the spec file and now compiles without any warnings.  Now all I need to do is learn Python :)
Title: Re: Announcing AppGameKit for Python!
Post by: adambiser on March 17, 2018, 05:29:28
Glad to hear.  Enjoy. :)  Python is a fun language to use, in my opinion.
Title: Re: Announcing AppGameKit for Python!
Post by: Pfaber11 on May 31, 2019, 13:22:48
Hi guys been trying to install appgamekit for my python but it keeps saying no or words to that effect. Tried pip install appgamekit   and   python -m pip install appgamekit   but doesn't want to know . anybody know where I'm going wrong .
I moved the downloaded files from downloads to users folder where my python stuff is kept is this somehow wrong.
     It's ok found out why it's not working and its due to the fact I'm running a 64 bit version of python and not a 32bit version . why this should be in 2019 I don't know but there you go .
   The reason I didn't use appgamekit in python was I could not follow the documentation very well so was wasting my time . The documentation needs to be first class and it wasn't . The AGK classic documentation is second to none.