Log In  

Hi

I found a Pico-8 cart on Itchio (https://bati.itch.io/super-pico-fighter) and I want to take a look at the code to see how the block matching logic works.

Unfortunately I wasn't able to see a download link and I couldn't find it listed here in the Lexaloffle BBS.

Is there a way I can download it so I can learn from it?

Thank you.

P#78488 2020-06-25 09:58

There is a way to do it, although if the original creator themselves did not offer a way to download the file, one could ask how ethical it is to download it yourself despite it (let alone to share it with others!). The creator may have had various reasons to want to keep it online-only. They may have code in the cartridge they don't want others copying, maybe they're just really ashamed of that ugly-as-sin chain of if-statements that makes their whole program tick, or maybe they want you to visit their itch.io page when you want to play their game, as a form of making sure you really know who made it.
It would effectively be the closest one could get to piracy with PICO-8.

If you really want to obtain an offline copy of the cart, I suggest you look around for the method yourself. It is out there.

P#78491 2020-06-25 11:12 ( Edited 2020-06-25 11:36)

Thank you Decidetto for the reply! Those are good point that hadn't occurred to me. And yes, if it was a commercial game, then I guess it could open a way for piracy.

I had assumed it was because of the way Itchio didn't have a built-in way to download the carts, unlike the way the carts are displayed here on lexaloffle, which do allow you to download them.

One of the nicest things about Pico-8 in my opinion is that you can just view the code of any card you download. I think it's actually one of the factors that has shaped the community into one that welcomes and helps newbies and learner programmers like myself.

Anyway, thank you again for your thoughtful reply.

P#78500 2020-06-25 12:46

I'm glad you understand!
With Itch, it is up to the creators to set if and how people can download their games. The HTML5 player that allows you to play the game on Itch does not support cart downloads, so creators have to supply downloads for Windows/Mac/Linux executables or cart PNGs themselves. (It might be to allow creators to freely charge money for their creations.) I've seen games on Itch where you can grab the cart PNG for any price you want, but also some where they ask a minimum price in order to grab the cart.

Anyway, for the block matching logic, I suspect it's a recursive traversal of the block grid using a breadth-first exploration scheme. If that doesn't ring a bell, I could perhaps provide you with some example code from one of my own projects.

P#78501 2020-06-25 12:59
4

I wrote a tool that can convert a web build to a .p8 cartridge. Here’s how:

  • open the game in your browser
  • inspect the web page using your browser’s tool (usually Ctrl-Shift-C, otherwise press F12 and find the inspect tool) and click inside the game
  • find a reference to a .js script just below the game canvas:
  • right-click on that “puzzle.js” element and save it (by opening it in a new tab then saving, or by copying the URL… depends what browser you use)
  • download the z8tool utility from zepto8 (windows version here)
  • run the following command to convert the JavaScript back to a PICO-8 cartridge:
z8tool.exe convert puzzle.js puzzle.p8
P#78529 2020-06-26 05:54
2

Wow Samhocevar, thank you for making this tool, and for the the clear instructions about how to use it. I will use it responsibly! I also found you cart Rainbow Cats, where the cats follow you. I want to implement something similar in my game (with chickens!) so I've downloaded your cart and will see how it works.

Decidetto, the way you described the block logic as "recursive traversal of the block grid using a breadth-first exploration scheme" shows me that I am way out of my depth, because I just don't understand that at all. I guess I have a lot to learn before I can even begin thinking about making something like this.

Thank you both.

P#78534 2020-06-26 11:58 ( Edited 2020-06-26 12:01)

Interesting tool, but I wonder what @zep thinks about it.

I see it's merit as a learning tool, but I also see it as an easy way for someone to bypass any payment options to get a .p8 and then make their own standalone executable. Though I guess that could be fixed if someone only uploaded a demo/incomplete as the web player version, and complete version behind payment

P#78555 2020-06-26 20:02

@samhocevar did what you said in your post but it seem that your tool dont work any idea why it say that there is a syntax error near 'convert' here what i typed "z8tool.exe convert pyramid.js pyramid.p8"

P#132861 2023-08-08 07:51 ( Edited 2023-08-08 07:53)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 16:31:15 | 0.015s | Q:22