Add more filtering options for --skip-unknown

I've been using --skip-unknown which has been working great (eg to ignore a readme and license file) but I recently added some .json level files for my game and those were also ignored.

Ideally I'd like to specify the specific extensions to ignore, eg --skip *.txt, *.lic or something.

SDK 1.12.0

Workaround would be to convert you JSON files to Lua.

http://mageddo.com/tools/json-to-lua-converter

They will load faster this way, too!

Oh interesting! Silly question but if I convert a bunch of json files to Lua tables, is there some way to “lazy load” those tables? Otherwise won’t they all occupy RAM when my game starts if they’re all “statically declared” tables?

You could try compiling them separately as .pdz

And then use playdate.file.load() to get their contents at runtime
https://sdk.play.date/inside-playdate/#f-file.load

Also see @Nic's Hot Load Plugin Manager
https://devforum.play.date/t/splitting-a-game-into-several-functional-binaries-nics-plugin-manager/1387/5

1 Like

Cool, I’ll look into this, especially if my level data files are getting large enough to cause a slowdown when loading, thanks!

I came here to second the initial request. I wish there were more options to avoid the compilation warning when the files copied are in purpose.

My current use case is I'm using LDtk to create levels which creates an .ldtk file (which is just a Json file.) But LDtk also creates a local backup folder (under backups/ next to the .ldtk file), which I definitely don't want in my compiled game.

So I wish there was a king of .gitignore file where I could tell pdc which file to include and which ones to ignore. For example, a .pdignore file with, in my case:

!Levels/world.ltdk
Levels/world/backups/
1 Like

isn't this all a problem of how you structure your repository ? if your sources and gitignore file are at the same level the issue is that imo. Try moving everything to a SRC folder and put your source and lua files inside that or so then you would not pull the git ignore readme or license file at all

1 Like

I do have a specific src folder. Here's the exemple where I'm using LDtk: GitHub - hteumeuleu/celeste at feat/ldtk

if you move "support" (if that is required) and "Source" into a new folder of their own it would not pull the license files and such because you would run pdc.exe on that folder instead of the root of the repo.

But adding extra options would be fine but i think you can work around the issue as well.

Also what i do is use a github action in some cases to build the game and upload an artificat then you could delete files also in the github action before you build the game. Basically you make a Continiuous build integration using github actions (github will build your game). here is an example for a C api github action, it pulls and sets up the linux playdate sdk builds the game and creates an artificat, you can easily change that to just run pdc binary on what you want as well as delete files / folders before you run it. For releases you'd use the files github builded instead of the ones you build locally. as you can see i also remove an alternate "Source/Source1" folder (containing color assets used for other platform builds) before building my game. the example action requires manual triggering (choosing it to run) but you could also easily adapt it to make it run on each push and for each push you do github would run it and created your compiled game (pdx dir) already zipped up as an artificat on release you download the artifact's zip (it's in summary of the ran github action) and you can release that zip

Also technically if you don't want something included for playdate (like ran through pdc.Exe like your ldtk file or backup levels) it should be moved out of the Source folder or at least i would think so but not sure how that would work with ldtk, i'm guessing you can tell it to load your gfx assets from anywhere as well as export / load the levels from where you want. If not it's indeed a problem (but of ldtk imo).

I always assumed don't want something included don't put it on the Source folder where you run pdc.exe on