CodeWalrus

Development => PC, Mac & Vintage Computers => Topic started by: Duke "Tape" Eiyeron on April 16, 2015, 08:44:02 AM

Title: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 16, 2015, 08:44:02 AM
I discovered about PICO-8 (http://www.pico-8.com/) months ago and Lexaloffle was kind enough to give me a code for alpha builds of it.

What's PICO-8? PICO-8 is a fantasy console project. Run in Lua and with SDL2, it aims to be run on computers and the Raspberry PI. It greets you with a Lua shell/CLI not too far from good old computers like C64 but that's not the only thing it includes. It includes a code editor (up to ~15KB lua code), a sprite editor (~256 different sprites), a map editor (one only map, 256*256, and the tileset is the spritesheet) and even sound/music editors.

(http://www.lexaloffle.com/gfx/pico8_boot_edit.gif) (Found on the site home)

It's quite easy to program with, I'm also going to add one mid-minor project done here in my list. I started programming on it because I was reminded of LuaFX or my days when learning programmation on my G100+. Projects or mockups on it looks already promising as even in the demos we have a simplistic raycaster!

Here's a quick thing I did with to get my hands on (twitter GIF/video): [LINK (https://twitter.com/Eiyeron/status/586091956360609793)].

It should be released as alpha for next LDJAM.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 16, 2015, 12:26:15 PM
This looks really sweet! I love lua for smallish stuff like this, and I think it's a perfect language to use.

EDIT: I wonder if this would be able to be ported to the Nspire?
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 16, 2015, 12:51:27 PM
I asked about Lexaloffle for hypothetical power requirements. Looks like the host needs to bear 2 millions LUA's VM operations/s and drawing the sprites, maps and drawing commands without slowing down. It could be feasible but it'll be clocked down a lot. I'll eventually suggest him to try porting it on Nspire.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 16, 2015, 01:01:01 PM
Wait, is this an OS? that is really awesome *.*
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 16, 2015, 01:24:22 PM
Quote from: Cumred_Snektron on April 16, 2015, 01:01:01 PM
Wait, is this an OS? that is really awesome *.*

It looks like it's more of a VM/emulator, kinda like computercraft or (less so) LÖVE.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 16, 2015, 01:36:56 PM
Still cool! Also i noticed it will also be available for web, so that'll be cool too
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 16, 2015, 02:02:17 PM
Oh I overlooked that detail.
Quote from: Cumred_Snektron on April 16, 2015, 01:01:01 PM
Wait, is this an OS? that is really awesome *.*
Quote from: Ivoah on April 16, 2015, 01:24:22 PM
Quote from: Cumred_Snektron on April 16, 2015, 01:01:01 PM
Wait, is this an OS? that is really awesome *.*

It looks like it's more of a VM/emulator, kinda like computercraft or (less so) LÖVE.

Yeah, it bears both of these parts. You can mess with some files and folders in a cart repository. As in Voxatron, a saved file is actually a program with its data (map, sprite, sound, etc...). You'll be able to save them non compressed or compressed into a picture with a thumbnail.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 16, 2015, 02:32:25 PM
Is it going to be opensource?
Title: Re: PICO-8 : Fantasy console
Post by: CKH4 on April 16, 2015, 02:33:17 PM
This looks really cool and I can't wait to try it.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 16, 2015, 02:46:04 PM
Was the editor written in lua?
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 16, 2015, 04:10:05 PM
I don't really know. It's like a console, you don't really know what's inside. We have although something like a memory map to fiddle with some memory zones (like Maps or SPR data)
Quote from: CKH4 on April 16, 2015, 02:33:17 PM
This looks really cool and I can't wait to try it.
Try asking Lexaloffle then ;) But make sure you give feedback, alpha testing is crucial!
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on April 16, 2015, 04:37:25 PM
This looks really cool and fun to play with. I like such old school stuff. I don't do Lua but I am curious about what people will come up with. Maybe someone could port some old calc games to it? :P
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 16, 2015, 04:46:15 PM
But if this uses cartridges, then wouldn't it need like an usb peripheral or something?
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 16, 2015, 04:47:22 PM
Quote from: Cumred_Snektron on April 16, 2015, 04:46:15 PM
But if this uses cartridges, then wouldn't it need like an usb peripheral or something?

It doesn't use physical cartridges (I think, correct me if I'm wrong),  that's just the name the developer chose for the bundled programs/data.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 16, 2015, 04:48:21 PM
Ah okay. That confused me for a bit.
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on April 16, 2015, 05:11:17 PM
Yeah, that looks pretty fun, can't wait to see it released.
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 16, 2015, 05:16:30 PM
I see why you can be excited to get your hands on, you LÖVE lua, right! ;)
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 16, 2015, 06:52:50 PM
(http://static.comicvine.com/uploads/original/14/145586/3231222-i+see+what+you+did+there.jpg)
Title: Re: PICO-8 : Fantasy console
Post by: DarkestEx on April 16, 2015, 06:54:17 PM
Looks nice.
Definitly going to put that on one of my Pi's.
Title: Re: PICO-8 : Fantasy console
Post by: CKH4 on April 16, 2015, 07:02:47 PM
Quote from: Duke "Tape" Eiyeron on April 16, 2015, 04:10:05 PM
Quote from: CKH4 on April 16, 2015, 02:33:17 PM
This looks really cool and I can't wait to try it.
Try asking Lexaloffle then ;) But make sure you give feedback, alpha testing is crucial!
I can wait unless he actively wants alpha testers.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 17, 2015, 02:37:51 AM
Quote from: Duke "Tape" Eiyeron on April 16, 2015, 04:10:05 PM
Try asking Lexaloffle then ;) But make sure you give feedback, alpha testing is crucial!

How would I contact him for an alpha version? I can test on a mac and nspire (linux :) )
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on April 17, 2015, 11:30:15 AM
I think you could do it via Twitter at https://twitter.com/lexaloffle but Twitter lacks any private message notifications if I recall correctly. Maybe he has a website?
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on April 17, 2015, 12:07:38 PM
Of course. (http://www.lexaloffle.com/)
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 17, 2015, 12:19:38 PM
Quote from: DJ Omnimaga on April 17, 2015, 11:30:15 AM
I think you could do it via Twitter at https://twitter.com/lexaloffle but Twitter lacks any private message notifications if I recall correctly. Maybe he has a website?

I don't have twitter

Quote from: Juju on April 17, 2015, 12:07:38 PM
Of course. (http://www.lexaloffle.com/)

Thanks, I found his email on the site.
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 17, 2015, 02:00:00 PM
Quote from: DJ Omnimaga on April 17, 2015, 11:30:15 AM
but Twitter lacks any private message notifications

Nope, I usually get correctly my PM in order and with notifications.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on April 18, 2015, 07:33:41 AM
Ah strange, I never got them. On top of that, my old PMs got deleted >.<

Also I just checked Voxatron and it really looks cool O.O

Now if only we could get some of those old school developers interested in calculator-oriented forums to showcase their products, since people on calc forums are fans of old-school stuff, after all :P (especially CW which has a very large retro gaming userbase).

I wonder if PICO-8 itself could do voxels? I know that the TI-89 can do it at very decent frame rate even though it runs at 12 MHz, but that was in pure ASM or C.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 18, 2015, 09:00:42 AM
You mean like 3d? won't that be very low res and not playable at all?
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 18, 2015, 09:28:50 AM
VOxels? Don't you have Voxatron for this? After all, voxels in the 89 is usually demoscene tricsk. THey won't be as flexible as you would need to uise them in a game. And it'll probably run quite slowly, but that's to test.
Quote from: DJ Omnimaga on April 18, 2015, 07:33:41 AMNow if only we could get some of those old school developers interested in calculator-oriented forums to showcase their products, since people on calc forums are fans of old-school stuff, after all :P (especially CW which has a very large retro gaming userbase).

Why not? Why not poking at them with one or two sticks then?
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 18, 2015, 11:07:42 AM
Yeah thats a good idea :P
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 18, 2015, 12:51:11 PM
Woo, PICO-8 alpha has been released!

Quote from: Cumred_Snektron on April 18, 2015, 09:00:42 AM
You mean like 3d? won't that be very low res and not playable at all?

One of the demos is a 2.5D (like DOOM) ray tracer that runs surprisingly quickly.
Title: Re: PICO-8 : Fantasy console
Post by: CKH4 on April 18, 2015, 05:34:45 PM
Quote from: DJ Omnimaga on April 18, 2015, 07:33:41 AM
Ah strange, I never got them. On top of that, my old PMs got deleted >.<

Also I just checked Voxatron and it really looks cool O.O
I was just about to say that.

Edit. Does anyone know the estimated release date?
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on April 18, 2015, 06:06:26 PM
What I am curious about is if PICO-8 will be free.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 18, 2015, 08:02:08 PM
Quote from: CKH4 on April 18, 2015, 05:34:45 PM
Quote from: DJ Omnimaga on April 18, 2015, 07:33:41 AM
Ah strange, I never got them. On top of that, my old PMs got deleted >.<

Also I just checked Voxatron and it really looks cool O.O
I was just about to say that.

Edit. Does anyone know the estimated release date?

There are redemption codes for a alpha version on his twitter.

Quote from: DJ Omnimaga on April 18, 2015, 06:06:26 PM
What I am curious about is if PICO-8 will be free.

Well, the alpha is free, I hope the final product will be too.
Title: Re: PICO-8 : Fantasy console
Post by: CKH4 on April 19, 2015, 05:44:05 AM
I've been using the alpha and its the coolest thing I have ever seen / used ever. I wonder where he wants bug reports though.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 19, 2015, 10:06:28 PM
Quote from: CKH4 on April 19, 2015, 05:44:05 AM
I've been using the alpha and its the coolest thing I have ever seen / used ever. I wonder where he wants bug reports though.

The only gripes I have are the lack of sqrt, pairs, and ipairs. sqrt can be worked around with x^(1/y), and there is an all function which works like pairs, but why change something that's already in lua?
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 20, 2015, 04:28:21 PM
Quote from: Ivoah on April 19, 2015, 10:06:28 PM
Quote from: CKH4 on April 19, 2015, 05:44:05 AM
I've been using the alpha and its the coolest thing I have ever seen / used ever. I wonder where he wants bug reports though.

The only gripes I have are the lack of sqrt, pairs, and ipairs. sort can be worked around with x^(1/y), and there is an all function which works like pairs, but why change something that's already in lua?

Because it wouldn't be fun. The interest point into PICO-8 is you have basically a fantasy retro console. YOu probably need to redo more or less all the work around and you usually don't need such things like sqrt in games (distance calculations stay the same when squared or not).
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 20, 2015, 04:30:31 PM
Well i wouldn't call the lack of basic functions "fun" but okay
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 20, 2015, 04:45:22 PM
That's not fun I know, right. But do you know how Doom calculated distance? Inverse square black magic
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;

x2 = number * 0.5F;
y  = number;
i  = * ( long * ) &y;                       // evil floating point bit level hacking
i  = 0x5f3759df - ( i >> 1 );               // what the c?
y  = * ( float * ) &i;
y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//      y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed

return y;
}


WHen you don't have the function/opcode, do something clever! :)
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 20, 2015, 05:43:43 PM
ah yes, i know that function. I use it in my particle systems too
Title: Re: PICO-8 : Fantasy console
Post by: CKH4 on April 20, 2015, 09:32:21 PM
Is there a way to fill a portion of the screen?
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 20, 2015, 09:48:15 PM
Quote from: CKH4 on April 20, 2015, 09:32:21 PM
Is there a way to fill a portion of the screen?

draw a solid rectangle
Title: Re: PICO-8 : Fantasy console
Post by: CKH4 on April 20, 2015, 10:02:43 PM
Sorry, I should have been more specific, I meant an irregular part of the screen.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on April 21, 2015, 06:04:11 AM
I think I should be fine with the limitations if I ever attempted learning Lua for that console, because most games I do are RPGs and only requires basic math operations and no 3D.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 21, 2015, 11:19:02 AM
I'm mainly confused as to why he removed a standard function and reimplemented it with a different name.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 21, 2015, 12:28:34 PM
3d on this would be cool though :o
Title: Re: PICO-8 : Fantasy console
Post by: CKH4 on April 21, 2015, 12:39:26 PM
If you have the alpha load either of the music carts because fake 3d. Also there's a demo that looks like doom.
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 21, 2015, 01:25:27 PM
Eyup, the raycasting one. There aren't any textures though. Probably would be too slow.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 21, 2015, 01:26:27 PM
Does anyone know how the data is stored when saving a cart as a png file?
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 21, 2015, 01:27:36 PM
Look at the pixels, it seems that he changes some parts of the colors on the carts. I would have prefered a SPORE-like storage, where the data were stored into PNG comment section.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 21, 2015, 01:29:08 PM
I thought that the map/sprite data would be stored in the blank area in the middle so it could be seen, that would have been neat.
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 21, 2015, 01:31:05 PM
THe blank area is actually the thumbnail area. Press Fx (I don't remember which one) to PICO to store the current frame and when  you will save the cart, the thumbnail will be present. Just wait until I finish to post my project and you'll see a functionnal cart with thumbnail.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 21, 2015, 01:32:14 PM
Ah, that's better than my idea :)

EDIT: I'm working on a game in PICO-8, I'll probably post when I'm done/have a working prototype
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 21, 2015, 01:38:20 PM
Theeere : (http://codewalr.us/index.php?action=dlattach;topic=409.0;attach=272;image)
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 21, 2015, 01:39:28 PM
fancy
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 21, 2015, 01:42:01 PM
Sooo, F6 to make a screenshot that will be stored on your desktop
F7 to store the current screen state to write it later on future picture carts ('save name.png")
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 21, 2015, 01:44:29 PM
Here's a (buggy) prototype of a game I'm working on
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 21, 2015, 01:45:13 PM
Another trick I read from the system, the first two text lines on the cart can be replaced for two commented lines (starting with --).
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 21, 2015, 01:45:41 PM
I thought it was only two

Quote from: pico8.txtThe first two lines of the program starting with '--' are drawn to the cart's label.
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 21, 2015, 01:47:07 PM
Corrected, I though we could be able to change the last one.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 21, 2015, 02:15:38 PM
Hmmm. I should try to make something with this too
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on April 21, 2015, 08:22:22 PM
Gotta download it as well. Just saw a tweet on Lexaloffle's account saying something about how you can claim PICO-8 if you already bought Voxatron on Humble Bundle.
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 21, 2015, 09:34:17 PM
And earlier I didn't noticed the new 0.1.0 version. Neat, neat, neat.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 22, 2015, 10:18:11 AM
And, does it add anything notable?
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 22, 2015, 11:30:14 AM
It's mostly bugfixes and about binary operators.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 22, 2015, 02:31:08 PM
Ah. Binary operators are quite useful though
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on April 22, 2015, 04:25:35 PM
Will we need to buy PICO-8 in order to play games written in it?
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 22, 2015, 04:36:35 PM
At this moment you need to buy Voxatron to play games written in it i think.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 22, 2015, 04:39:16 PM
Quote from: Cumred_Snektron on April 22, 2015, 04:36:35 PM
At this moment you need to buy Voxatron to play games written in it i think.

I have the PICO-8 alpha, and I haven't bought anything
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 22, 2015, 04:40:41 PM
ohh, where can you get it then?
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 22, 2015, 04:41:30 PM
He said something on twitter with redemption codes
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 22, 2015, 04:42:53 PM
Ah okay, i'll look into that :)
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 22, 2015, 04:52:47 PM
Or buy Voxatron and you'll be able to test PICO.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 22, 2015, 05:07:20 PM
Eiyeron read only 4 posts back? :P
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 22, 2015, 08:20:16 PM
Getting through the already published carts, I checked out one which are already rocking hard aaand
- Hug Arena (http://www.lexaloffle.com/play/?pid=10022) looks as polished as a finished game
- Write Fite (http://www.lexaloffle.com/play/?pid=10024) does have a interesting gameplay but doesn't look like it was finished.

Both games are done for LDJAM which was last weekend or the previous one, I don't remember.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 22, 2015, 08:23:20 PM
So you only need to buy it / get the alpha to devfor the game, it looks like
Title: Re: PICO-8 : Fantasy console
Post by: Strontium on April 22, 2015, 08:25:35 PM
Lexaloffle released a huge list of keys on the Ludum dare website. I'm not sure if I should post the link, though, since it seems to be for Ludum Dare-ers only.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 22, 2015, 08:29:31 PM
Ah okay. Shame.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 23, 2015, 11:43:31 AM
Quote from: Strontium on April 22, 2015, 08:25:35 PM
Lexaloffle released a huge list of keys on the Ludum dare website. I'm not sure if I should post the link, though, since it seems to be for Ludum Dare-ers only.

He posted a link to the pastebin with all the keys on twitter, and that's what I used.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 23, 2015, 12:50:59 PM
Would you mind sharing that? :P
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 23, 2015, 12:53:57 PM
http://pastebin.com/1viWQZ5X
http://pastebin.com/f5MZ2Nb3
http://pastebin.com/TGQqpJLC
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 23, 2015, 12:55:08 PM
Thanks, i'll see if i can use that if i get home :D
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 25, 2015, 09:01:08 PM
Something I've been working on since yesterday: (http://a.pomf.se/krcbgm.gif)
There is a bug when you zoom past {0,0,0}, haven't fixed it yet.

cartridge attached
Title: Re: PICO-8 : Fantasy console
Post by: CKH4 on April 25, 2015, 09:04:15 PM
That's very cool Ivoah, maybe I can use it with the ti basic 3d that I've been working on.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on April 25, 2015, 09:07:13 PM
yeah that's awesome :D
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on April 25, 2015, 09:56:52 PM
Looks nice Ivoah. Does it run smoother in real life than in the screenshot?
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on April 25, 2015, 10:00:23 PM
Quote from: DJ Omnimaga on April 25, 2015, 09:56:52 PM
Looks nice Ivoah. Does it run smoother in real life than in the screenshot?

Yes.

EDIT: I found another bug, if left spinning for a while, the cube will start to get skinnier and taller. It's probably due to rounding.
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on April 27, 2015, 08:11:13 PM
Yup, to avoid such precision error IIRC you should use quaternions.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 01, 2015, 04:26:00 AM
By the way, is this language entirely dependent on the computer speed or are there ways to throttle speed to have everything run at the same speed on every platform?
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on May 01, 2015, 04:34:08 AM
According to the docs, it should always run at 30 fps, unless your computer is too slow to render stuff at 30 fps, in that case the update function is ran twice at 15 fps.

Also, I wrote a script to import pictures into PICO-8, I should probably make a tutorial.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 01, 2015, 05:16:32 AM
Ok but I was talking about execution speed, not the frame rate, unless you mean that a loop cannot loop more than 30 times per second?
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on May 01, 2015, 05:19:15 AM
Of course execution speed depends of your computer, but yeah, the update and draw functions are called 30 times a second.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 01, 2015, 05:25:09 AM
Ok thanks. And there are timers, delay and wait commands to slow things down, right?
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 03, 2015, 09:45:17 PM
Today i finally got around to downloading it, and it looks very cool. Is it possible to edit code outside of pico-8 btw?
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on May 03, 2015, 09:46:50 PM
Yes, if you edit the .p8 file it should work.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 03, 2015, 09:49:11 PM
ah yes, i've found the "folder" command :)
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 05, 2015, 04:49:44 PM
That's nice juju. Also is the music tracker built-in the software or is it a separate cartridge? And can music be edited outside PICO-8 such as Notepad?
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on May 05, 2015, 06:45:24 PM
The music tracker is built-in.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 06, 2015, 04:07:33 PM
Cool to hear :). I'll see if I can try making a song with it at some point.
Title: Re: PICO-8 : Fantasy console
Post by: Siapran on May 21, 2015, 08:01:42 AM
on an unrelated note, I found this:
https://gist.github.com/paniq/7814560e2b560b76911b (https://gist.github.com/paniq/7814560e2b560b76911b)

could probably be used for some fancy effects etc
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 21, 2015, 08:41:55 AM
Oh cool. This is becoming like calculators where everyone is hacking it too to find secrets :P
Title: Re: PICO-8 : Fantasy console
Post by: Siapran on May 21, 2015, 11:27:33 AM
oh my god
I tried getting the code from a cart png with a text editor

I though it would just be some extensive metadata in the picture
I was wrong

the whole thing is encoded into the pixels themselves
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 21, 2015, 12:50:35 PM
Whoa.... how did they do that O.O
Title: Re: PICO-8 : Fantasy console
Post by: Siapran on May 21, 2015, 02:44:15 PM
I think each byte of the cart is spread on the last 2 bits of every channel:

take for instance, the keyword "local"
hex: 6c 6f 63 61 6c
binary: 0110 1100 0110 1111 0110 0011 0110 0001 0110 1100


now for a gray pixel on the png:
hex: 66 66 66 FF
binary: 0110 0110 0110 0110 0110 0110 1111 1111


now for each pixel, spread a char on the end of each channel:
binary:
0110 0101 0110 0110 0110 0111 1111 1100
0110 0101 0110 0110 0110 0111 1111 1111
0110 0101 0110 0110 0110 0100 1111 1111
0110 0101 0110 0110 0110 0100 1111 1101
0110 0101 0110 0110 0110 0111 1111 1100
hex:
65 66 67 FC
65 66 67 FF
65 66 64 FF
65 66 64 FD
65 66 67 FC


the color change is so subtle you can't even see it, but the data is still there
with a picture of 160*205, you have 32800 pixels, that makes 32K of data for a cart
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 21, 2015, 03:13:14 PM
That's awesome O.O I love these kind of hidden secrets :D
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on May 21, 2015, 04:05:01 PM
Yeah, I looked at it the other day and found nothing. Thank you!
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on May 21, 2015, 04:52:31 PM
Quote from: Siapran on May 21, 2015, 02:44:15 PM
I think each byte of the cart is spread on the last 2 bits of every channel:

take for instance, the keyword "local"
hex: 6c 6f 63 61 6c
binary: 0110 1100 0110 1111 0110 0011 0110 0001 0110 1100


now for a gray pixel on the png:
hex: 66 66 66 FF
binary: 0110 0110 0110 0110 0110 0110 1111 1111


now for each pixel, spread a char on the end of each channel:
binary:
0110 0101 0110 0110 0110 0111 1111 1100
0110 0101 0110 0110 0110 0111 1111 1111
0110 0101 0110 0110 0110 0100 1111 1111
0110 0101 0110 0110 0110 0100 1111 1101
0110 0101 0110 0110 0110 0111 1111 1100
hex:
65 66 67 FC
65 66 67 FF
65 66 64 FF
65 66 64 FD
65 66 67 FC


the color change is so subtle you can't even see it, but the data is still there
with a picture of 160*205, you have 32800 pixels, that makes 32K of data for a cart
Or you can just ask Lexaloffle. That's a classic way to store data in picture : changing the less signifiant bits.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 21, 2015, 05:44:19 PM
What if there's a secret message hidden in the original Walrii? O.O
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on May 21, 2015, 06:26:39 PM
I just wrote a little script to test this algorithm up, it indeed seems to work. I can see about 32K of memory with some Lua code in it.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 21, 2015, 06:41:36 PM
Quote from: Siapran on May 21, 2015, 11:27:33 AM
oh my god
I tried getting the code from a cart png with a text editor

I though it would just be some extensive metadata in the picture
I was wrong

the whole thing is encoded into the pixels themselves
Seems like something I wanted to do on-calc a while back.

What surprises me though is how someone uploaded a cart a while ago, yet I couldn't see any different color difference between pixels of the same hue.
Title: Re: PICO-8 : Fantasy console
Post by: Duke "Tape" Eiyeron on May 21, 2015, 07:40:24 PM
Hre's the base ram laout, found directly from the readme
0x0    gfx
0x1000 gfx2/map2 (shared)
0x2000 map
0x3000 gfx_props
0x3100 song
0x3200 sfx
0x4300 user-defined
0x5f00 draw state [,cart data] (1024 bytes incl. unused)
0x6000 screen (8k)
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on May 22, 2015, 03:40:34 AM
Quote from: DJ Omnimaga on May 21, 2015, 06:41:36 PM
What surprises me though is how someone uploaded a cart a while ago, yet I couldn't see any different color difference between pixels of the same hue.
The data is encoded in the 2 least signifiant bits of each channel, and a difference of 4 out of 255 in each color is pretty much imperceptible. Myself I was fooled, it's kind of incredible when you think about it.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 22, 2015, 06:33:46 AM
Yeah I didn't see the color difference myself, which is why I was wondering lol when Ivoah posted that 3D cart. I was asking myself: "Where is the code? O.o" It's a good idea I think, providing that people use common sense and don't start distributing cartridges in JPEG format. :P
Title: Re: PICO-8 : Fantasy console
Post by: Siapran on May 22, 2015, 07:20:10 AM
Quote from: DJ Omnimaga on May 22, 2015, 06:33:46 AM
Yeah I didn't see the color difference myself, which is why I was wondering lol when Ivoah posted that 3D cart. I was asking myself: "Where is the code? O.o" It's a good idea I think, providing that people use common sense and don't start distributing cartridges in JPEG format. :P

if you're looking for the differences, check the 10~ rows of pixels under the green cube, that is the zone mapped to the code
(http://codewalr.us/index.php?action=dlattach;topic=396.0;attach=289)
(use GIMP or something)
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 22, 2015, 11:09:45 AM
I actually maxed out the image gamma three times and I see it now :)

Title: Re: PICO-8 : Fantasy console
Post by: CKH4 on May 22, 2015, 12:27:15 PM
That is very interesting, what's the blue line through the cube for?
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 22, 2015, 02:30:37 PM
OH that's cool, really easy to see now
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on May 23, 2015, 01:20:56 AM
[spoiler=Some random code]
<?php$im = new Imagick($argv[1]);$it = $im->getPixelIterator();foreach($it as $row => $pixels) {  foreach ($pixels as $column => $pixel) {    $c = $pixel->getColor();    $cn = $pixel->getColor(true);    $mem[] = ((floor($cn['a']*255)&3)<<6)|(($c['r']&3)<<4)|(($c['g']&3)<<2)|(($c['b'])&3);  }  $it->syncIterator();}for($i=0x4300;$mem[$i]!=0&&$i<count($mem);$i++){  echo chr($mem[$i]);}?>
[/spoiler]

I said absolutely nothing. >.>

So yeah, it's pretty much what Siapran said, but the alpha channel's 2 least signifiant bits are the characters' 2 most signifiant bytes, that is, it goes first. The memory map should be pretty much what the doc said about it, and Lua code starts at 0x4300 and probably goes until 0x7F00. Finding a library that doesn't convert the 8-bit alpha channel value to 7-bit (GD) or 1-bit (non-normalized Imagick) was kinda tedious, though.
Title: Re: PICO-8 : Fantasy console
Post by: Strontium on May 23, 2015, 04:36:43 AM
I lost my Lexaloffle acc. so I can't use PICO-8 anymore :(
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 23, 2015, 06:15:31 AM
@Juju does that script return the actual code? I don't know PHP that much.

@Strontium that sucks :(. Did you get hacked or did you just forget your password? You should maybe contact the author about the issue in case he can restore your access.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 23, 2015, 09:57:51 AM
Maybe there are still some codes left, strontium. Atleast i hope so.

Also would it be possible to have more than 16k lua code by encoding it into the sprites, map, sound and music areas and just copying it somewhere else on runtime?
Guess not since the lua ram is not accessible :/
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on May 23, 2015, 06:26:46 PM
Quote from: Strontium on May 23, 2015, 04:36:43 AM
I lost my Lexaloffle acc. so I can't use PICO-8 anymore :(
Yep, you should contact Lexaloffle.

Quote from: DJ Omnimaga on May 23, 2015, 06:15:31 AM
@Juju does that script return the actual code? I don't know PHP that much.
Yes, give the .p8.png file as input and it spits out the Lua code.

Quote from: Cumred_Snektron on May 23, 2015, 09:57:51 AM
Also would it be possible to have more than 16k lua code by encoding it into the sprites, map, sound and music areas and just copying it somewhere else on runtime?
Guess not since the lua ram is not accessible :/
Guess not. 15k is quite a lot, though. It's the point of PICO-8, though, making stuff with such limitations.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 23, 2015, 08:37:58 PM
I guess if someone was to make a linear RPG, he could just split his game into multiple cartridges and require the user to enter a password to continue to the next cartridge, where the password would be given at the end of the first chapter and so on. But then people could just share the password with everyone and the player would lose his stats.

I'm curious about a Supersonic Ball style game, though.
Title: Re: PICO-8 : Fantasy console
Post by: Siapran on May 23, 2015, 08:43:24 PM
I did a thing.
http://www.lexaloffle.com/bbs/?tid=2015 (http://www.lexaloffle.com/bbs/?tid=2015)

also, noticed that the TID is 2k15 :D
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 23, 2015, 08:46:01 PM
Ooh I like it. Did you also make the music?
Title: Re: PICO-8 : Fantasy console
Post by: Siapran on May 23, 2015, 08:47:50 PM
nope that was just the music of a demo cart
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 23, 2015, 08:51:00 PM
Aaah ok thanks for the info. I really need to try to make a song in PICO-8 (most likely a cover of one of my songs). I didn't do many chiptune songs in the past (both of the ones I made were on the Game Boy Color with Pocket Music)
Title: Re: PICO-8 : Fantasy console
Post by: Strontium on May 24, 2015, 04:30:22 AM
All the pastebin links are expired.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 24, 2015, 05:45:07 AM
Yeah it might have been a limited offer from him or maybe he set the pastebins to expire by accident.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 24, 2015, 09:35:13 AM
Yeah he probably doesn't want people to find free codes when it's released
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 25, 2015, 07:20:55 AM
By then I bet that most codes will not work anymore anyway since they'll have been used already. But it depends of how popular PICO-8 is and how many people got a copy already. If it didn't get many downloads, then if he wants to make some money from it then I guess it's a good move to remove the codes.

Also to support him, something I thought is that if someone decides to make a third-party PICO-8 web editor, then I think the editor should check your computer for a valid copy of PICO-8 (after asking permission, of course), if it's possible to do that. That way such third-party editor would be mostly for developer convenience. That's unless of course the author doesn't mind such tool.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on May 25, 2015, 08:26:10 AM
Maybe lexaloffle can make some sort of authentication api. That would be best so you can save cardridges under your name too
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on May 27, 2015, 09:27:55 PM
T
Quote from: Cumred_Snektron on May 25, 2015, 08:26:10 AM
Maybe lexaloffle can make some sort of authentication api. That would be best so you can save cardridges under your name too
That could work too, provided it's secure.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on August 28, 2015, 04:05:04 AM
PICO-8 now has an IRC channel!!! Come hang out with us in #pico8 on Freenode (irc.freenode.net)
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on August 28, 2015, 04:09:25 AM
Did the author just create it? Because I am surprised there was no official channel yet. I don't think I'll join for now, though, since I still monitor the Omninet #CodeWalrus channel, but once we ditch Omninet I might re-add Freenode to my server list on IRCCloud. I tend to not visit many channels other than CW and some friends private channels, tho, for the same reasons why I left #cemetech and the entire Omnimaga community.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on August 28, 2015, 04:11:34 AM
Quote from: DJ Omnimaga on August 28, 2015, 04:09:25 AM
Did the author just create it? Because I am surprised there was no official channel yet. I don't think I'll join for now, though, since I still monitor the Omninet #CodeWalrus channel, but once we ditch Omninet I might re-add Freenode to my server list on IRCCloud. I tend to not visit many channels other than CW and some friends private channels, tho, for the same reasons why I left #cemetech and the entire Omnimaga community.

It's kinda official. It was started by regular members, but zep sometimes drops by, and has added a link to it on pico-8.com
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on August 28, 2015, 04:15:20 AM
Aah ok. I guess maybe he wasn't much into IRC at first or didn't feel that it was big enough to warrant a channel, but it's a good initiative for people who need quick help or wants to discuss in real time. I usually encourage forums for help/showcase, though, since posts remain forever, unlike logs, and are easier to search through. :P

And CW isn't solely about calcs so anyone is free to cross-post their PICO-8 dev here too :)
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on November 08, 2015, 11:15:24 PM
This is something someone on the PICO-8 BBS made:

<iframe src="http://ivoah.github.io/psp.html" width=600 height=675></iframe>

(link: http://ivoah.github.io/psp.html)
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on November 09, 2015, 05:49:33 PM
Seriously, that is just freaking epic. I always wondered if 3D stuff was feasible in PICO-8. Also this seeems to run quite nicely.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on November 09, 2015, 05:52:34 PM
Quote from: DJ Omnimaga on November 09, 2015, 05:49:33 PM
Seriously, that is just freaking epic. I always wondered if 3D stuff was feasible in PICO-8. Also this seeems to run quite nicely.

Don't forget the 3D demo that I made!
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on November 10, 2015, 07:31:27 AM
Yeah true but this new one seemed to push things even further due to graphics reminding me of Star Fox for the SNES. I am curious if the engine will be open-sourced so it can benefit other users. That said, a scaled-down 3D engine would also be nice, for people who wants faster speed.
Title: Re: PICO-8 : Fantasy console
Post by: p4nix on November 10, 2015, 09:51:12 PM
Casuals: wooo, 128x128 is really retro, I wonder if it is just a little bit too less pixels.
DJ Omnimaga: Why not scale it down?
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on November 15, 2015, 06:25:02 AM
I was not talking about the amount of pixels, but rather the amount of polygons and details.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on November 28, 2015, 03:16:45 PM
I saw this on Twitter and thought this was awesome:

https://twitter.com/tiagosr/status/670392119035588608

[video]https://pbs.twimg.com/tweet_video/CU211HGWwAUcHQ7.mp4[/video]
Title: Re: PICO-8 : Fantasy console
Post by: p4nix on November 28, 2015, 04:37:44 PM
I didn't really understand the concept when I read how they work in particular. Otherwise I'd have loved having a motorbike game on calculator :P
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on November 29, 2015, 06:54:39 AM
Yeah I am unsure either. I would probably like to give such project a try on my HP Prime at some point.
Title: Re: PICO-8 : Fantasy console
Post by: Yuki on November 30, 2015, 05:36:37 AM
Looks like some pretty nice Mode 7 here.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on November 30, 2015, 02:10:14 PM
Quote from: DJ Omnimaga on November 28, 2015, 03:16:45 PM
I saw this on Twitter and thought this was awesome:

https://twitter.com/tiagosr/status/670392119035588608

[video]https://pbs.twimg.com/tweet_video/CU211HGWwAUcHQ7.mp4[/video]

Looks pretty sweet :o
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on November 30, 2015, 02:55:08 PM
You can play it here: http://www.lexaloffle.com/bbs/?tid=2828&autoplay=1#pp
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on November 30, 2015, 06:54:04 PM
I really want to figure out how to make such game properly now (eg not the TI-BASIC way like I did in 2002 and 2007). I'm fairly sure that the HP Prime could pull it off. Otherwise I could use Mac Bernick's  engine from Trailblazer. I'm glad that PICO-8 is able to pull this off, though.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on November 30, 2015, 06:56:58 PM
Well effectively it would just be solving the intersection of a ray and a plane, which is pretty easy to do, and probably doesn't even require any expensive calculation like square roots.
Title: Re: PICO-8 : Fantasy console
Post by: Ivoah on November 30, 2015, 06:59:12 PM
Quote from: DJ Omnimaga on November 30, 2015, 06:54:04 PM
I really want to figure out how to make such game properly now (eg not the TI-BASIC way like I did in 2002 and 2007). I'm fairly sure that the HP Prime could pull it off. Otherwise I could use Mac Bernick's  engine from Trailblazer. I'm glad that PICO-8 is able to pull this off, though.


If you have PICO-8 you could download the cart and look at the code. Even if you don't, I'm pretty sure there are some tools to extract data from a PICO-8 cart.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on November 30, 2015, 07:11:54 PM
Yeah that's what I might do. Otherwise, if Juju still has his tool then I could use that instead. Of course it depends how much I could understand Lua, though, since I am more fluent in HP PPL and TI-84+ BASIC.
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on December 03, 2016, 12:52:07 AM
Wow I just saw this on Twitter *.*
(https://media.giphy.com/media/3oz8xBbpAMhoqVpRh6/giphy.gif)
https://twitter.com/chiptune/status/804403727444611073
http://giphy.com/gifs/move-spaceship-voxel-3oz8xBbpAMhoqVpRh6
Title: Re: PICO-8 : Fantasy console
Post by: aetios on December 03, 2016, 01:13:27 AM
c that's amazing
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on December 03, 2016, 09:15:51 AM
By the way, the road at the bottom seems to be made with rectangles. I'm wondering if a similar technique of drawing objects could be used on-calc... (eg the CE and Nspire CX or even HP Prime) with less details. I don't know how maps would be done, though. Maybe it could just be cubic buildings for the most part.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on December 03, 2016, 09:23:31 AM
i dont klnow how fast the CE is at rectangle drawing, but if its fast enough i think this might be possible to make :o
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on December 03, 2016, 09:27:53 AM
ICE language can draw about 4500 sprites per second. If rectangle drawing is at the same speed then that gives an idea of what performance you would get, but of course it depends how much processing is required to calculate the 3D perspective and stuff. Hence why I think it should be limited to rectangular buildings like that one Star Fox demo in 84+ ASM a few years ago.
Title: Re: PICO-8 : Fantasy console
Post by: Snektron on December 03, 2016, 09:48:13 AM
well everything seems to be made up of these rectangles. Also, since the camera can only look in one direction i think the matrix calculations
normally used can be optimized by skipping a few entries (i mean, there is no rotation and such so that doesnt need to be calculated)
Title: Re: PICO-8 : Fantasy console
Post by: garvalf on December 03, 2016, 10:54:32 AM
very cool, can't wait to try this on pico8!
Title: Re: PICO-8 : Fantasy console
Post by: Dream of Omnimaga on January 02, 2017, 02:35:51 AM
Yeah I think with much fewer rectangles, this could be feasible on a calculator. I'm just worried that creating the maps might be quite a lot of hassle lol, with so many layers of stuff XD