I found a better, more long-term solution to problems like datetime: I defined an optional package called “morepy” which includes all standard Python modules that are not already part of the Panda3D mainline release.
So, in the future, if you try to build a p3d file and you discover it depends on a missing Python module, you can just add “-r morepy” to the packp3d command like (or require(‘morepy’) to your pdef file) and you’ll pick up the missing module(s).
The cost of this additional functionality is a mere 2MB additional download.
I’m downloading the new stainless p3d file now. Funny, it seems to think it doesn’t know how big the download is–the loading bar is always at the top, as if the server weren’t reporting the download size. But I think it does. Hmm.
Edit: and it doesn’t appear to want to cache the p3d file from one session to the next. Most curious.
Anyway, after loading, I can start the tutorial–looks great!–and then it soon crashes with this stack trace:
:task(error): Exception occurred in PythonTask Game loop
Traceback (most recent call last):
File "C:\panda3d\built_cmu\direct\p3d\AppRunner.py", line 396, in run
File "C:\panda3d\built_cmu\direct\task\Task.py", line 482, in run
File "C:\panda3d\built_cmu\direct\task\Task.py", line 440, in step
File "main.py", line 752, in gameLoop
File "main.py", line 374, in update
File "src\entities.py", line 62, in update
File "src\net.py", line 520, in update
File "src\controllers.py", line 989, in serverUpdate
File "src\controllers.py", line 538, in serverUpdate
File "src\controllers.py", line 489, in serverUpdate
File "src\components.py", line 161, in serverUpdate
ValueError: need more than 2 values to unpack
That looks like your problem to me.
If, however, I click on “Host”, it crashes immediately with this stack trace, which looks like my problem:
:task(error): Exception occurred in PythonTask eventManager
Traceback (most recent call last):
File "C:\panda3d\built_cmu\direct\p3d\AppRunner.py", line 396, in run
File "C:\panda3d\built_cmu\direct\task\Task.py", line 482, in run
File "C:\panda3d\built_cmu\direct\task\Task.py", line 440, in step
File "C:\panda3d\built_cmu\direct\showbase\EventManager.py", line 61, in eventLoopTask
File "C:\panda3d\built_cmu\direct\showbase\EventManager.py", line 55, in doEvents
File "C:\panda3d\built_cmu\direct\showbase\EventManager.py", line 122, in processEvent
File "C:\panda3d\built_cmu\direct\showbase\Messenger.py", line 325, in send
File "C:\panda3d\built_cmu\direct\showbase\Messenger.py", line 410, in __dispatch
File "C:\panda3d\built_cmu\direct\gui\DirectButton.py", line 103, in commandFunc
File "main.py", line 690, in startServer
File "src\online.py", line 14, in registerHost
File "C:\panda3d\thirdparty\win-python\lib\httplib.py", line 898, in request
File "C:\panda3d\thirdparty\win-python\lib\httplib.py", line 915, in _send_request
File "C:\panda3d\thirdparty\win-python\lib\httplib.py", line 842, in putrequest
LookupError: unknown encoding: ascii
I think this is another case of not including a standard Python library, in this case the “encodings” module and all of its fiddly bits. I’ve added this to the morepy module.
Your game is turning out to be an excellent customer to find the rough edges in the plugin support. Thanks for your patience!
David