Petri Dish - Getting a PND together.


directive0

Very Active Member
Joined
Apr 8, 2015
Messages
840
Location
Toronto, Canada
Hello all,

I've been bitten by the python bug and I want to get a game on my favourite handheld system; the Pandy! So here is where I'm at:

I have started writing a 'game', its more of a sim inspired by SimLife. The aim of the game will be adjusting the ratio of organisms in the dish to create a balanced and self sustained ecosystem. You can download it here:

Petri Dish Github

Its not a complete game yet, I'm developing it on the sly at work. But its definitely "playable" sort of already. Buttons don't work but there are dudes that sit on screen and reproduce. I'd like to make a Pandy version to help test things and this is where I'm getting confused.

I followed some advice and looked at the the PXML spec page and the "Make and run a simple PND" page with some success! I am able to get a PND to show up in the list of apps on my Pandy, but it does not launch. I can confirm the game launches as is when run from the terminal. I read that there is a run_pnd.sh script that needs to be made, but I am unclear where and how that shell script needs to be assigned. I'm probably staring right at the solution but I would really appreciate some counsel.

As it stands my questions are:
  1. how can I get the game to launch as a PND from the menu?
  2. how can I package what I have into a single .pnd instead of just a folder?
Thanks for any help you can give me, please let me know if I can provide any more info!
 
Show us the PXML file.
[doublepost=1503002426,1502999694][/doublepost]Once the folder is startable from the menu, when the pxml file is valid, you just call the packing script that is on your pandora. (No idea how it is named now tho)

Hehe i love this kind of simulation, i did something similar ages ago. If you want to see:
This kind of script in python is however very CPU hungry and is too much for the pandora.

Now how are these things influencing each other? Is the algae serving as food?
 
Last edited:
The application area of a PXML file contains an <exec> statement that takes at least a command attribute. That is commonly set to run_pnd.sh or similar, and refers to a file in the root of the PND filesystem, or a relative location starting from there. A simple script to run a python file can simply be:
Code:
#!/usr/bin/env bash
python2 mygamescript.py

That first line isn't even required, but I consider it good practice to have it, as in unix it specifies the filetype and how to run it, when you don't tell it how to run otherwise.

I suppose for a simple python only project, you can make the first line of your python be '#!/usr/bin/env python2' and make that the command of your exec statement, and not even have a shell script at all.

You'll almost certainly need to make the run script or run python script executable, using chmod.
 
The shell script that starts your application is <exec command> in the PXML

You can use mksquashfs, genisoimage or mkisofs to create a PND file from a folder. Append the PXML and PNG files to the PND.
I do this on my laptop
genisoimage -o MyProject.PND ./myProject/
cat PXML.XML >> MyProject.PND
cat icon.png >> MyProject.PND

If you want to look at other PND's contents on the Pandora, start one and go to /mnt/utmp/[appname]
 
Incredibly helpful, thank you all. I got it working and I will soon be able to contribute something to the repo. Thanks again!
 
Back
Top