63

Cart #picochak-0 | 2019-10-27 | Code ▽ | License: CC4-BY-NC-SA
63

My friends and I created a new demoscene production for PICO-8 — PICOCHAK. It was first presented yesterday at CAFe'2019 demoparty. It took 2nd place in Console Demo Compo.

Code: Megus
Music: n1k-o/Stardust
Graphics: Diver/Stardust

The full source code (including some tools) is available on GitHub: https://github.com/Megus/picochak

P#69361 2019-10-27 17:02 ( Edited 2019-10-28 05:50)

Superb ! Star for you.

Question, how do you do that dither rectangle effect with just two colors ? Could you post code please just for that ?

P#69367 2019-10-27 19:55 ( Edited 2019-10-27 20:00)
 ```dither = {0x1000.0000,0x1000.8000,0x1000.8020,0x1000.a020,0x1000.a0a0,0x1000.a4a0,0x1000.a4a1,0x1000.a5a1,0x1000.a5a5,0x1000.e5a5,0x1000.e5b5,0x1000.f5b5,0x1000.f5f5,0x1000.fdf5,0x1000.fdf7,0x1000.fff7,0x1000.ffff,0x1000.ffff} function draw_gradient(y, cols) local ptn = 1 while y < 128 do rectfill(0, y, 127, y + 3, cols + dither[ptn]) y += 4 ptn = min(ptn + 1, 17) end end```

This is the code I use in the demo. I use "fill pattern" feature of PICO-8 and the ability to include fill pattern in color number

P#69371 2019-10-27 21:26 ( Edited 2019-10-27 21:27)

Thanks ! Trying it out.

Oh ... so it's not pure math ? Hmm ...

I seem to remember doing ... something ... a long time ago, a type of pyramid logo that dithered diagonally using only math and logic. Let me see if I can find it today.

Qbasic 1.0. Here it is !

 ```'=========================================================================== ' Subject: EGA LOGO Date: 01-14-98 (23:30) ' Author: dw817 Code: QB, QBasic, PDS ' Packet: EGAVGA.ABC '=========================================================================== DEFINT A-Z DIM C(10), B(10) C(0) = 15 C(1) = 15 C(2) = 11 C(3) = 9 C(4) = 1 B(0) = 7 B(1) = 8 B(2) = 8 SCREEN 7 S = 14 N = S T = 0 LINE (159, 0)-(32, 127), 8 LINE (160, 0)-(287, 127), 8 LINE (158, 0)-(31, 127), 7 LINE (161, 0)-(288, 127), 7 FOR I = 2 TO 159 FOR J = 0 TO 127 C = C(T + (D XOR -((J + I) MOD N = 0))) IF C > 0 THEN PSET (159 - J - I, J), C PSET (160 + J + I, J), C END IF NEXT A = I / 4 B = I / 6 C = C(T) IF C > 0 THEN PSET (160, 66 - A), C PSET (160, 62 + A), C PSET (160 - A, 64), C PSET (160 + A, 64), C PSET (162 - B, 66 - B), C PSET (158 + B, 66 - B), C PSET (162 - B, 62 + B), C PSET (158 + B, 62 + B), C END IF C = B(T) IF C > 0 THEN PSET (159, 64 - A), C PSET (161, 64 - A), C PSET (159, 65 + A), C PSET (161, 65 + A), C PSET (161 + A, 63), C PSET (161 + A, 65), C PSET (159 - A, 63), C PSET (159 - A, 65), C PSET (159 + B, 64 - B), C PSET (161 + B, 64 - B), C PSET (161 + B, 64 + B), C PSET (159 + B, 64 + B), C PSET (161 - B, 64 + B), C PSET (159 - B, 64 + B), C PSET (161 - B, 64 - B), C PSET (159 - B, 64 - B), C END IF N = N + D * 2 - 1 IF N = 1 OR N = S THEN D = 1 - D: IF D = 0 THEN T = T + 1 NEXT ```

Not sure if that can be made heads of or tails today. I wrote this so long ago I'm not even sure how it works now.

P#69376 2019-10-27 23:32 ( Edited 2019-10-27 23:41)

I'm also not getting your code to dither. Here is the code for it:

 ```dither = {0x1000.0000,0x1000.8000,0x1000.8020,0x1000.a020,0x1000.a0a0,0x1000.a4a0,0x1000.a4a1,0x1000.a5a1,0x1000.a5a5,0x1000.e5a5,0x1000.e5b5,0x1000.f5b5,0x1000.f5f5,0x1000.fdf5,0x1000.fdf7,0x1000.fff7,0x1000.ffff,0x1000.ffff} function draw_gradient(y, cols) local ptn = 1 while y < 128 do rectfill(0, y, 127, y + 3, cols + dither[ptn]) y += 4 ptn = min(ptn + 1, 17) end end cls() draw_gradient(64,5) ```
P#69377 2019-10-27 23:36
2

@Megus, I appreciate the code you posted, I just wish you would've checked to make sure it would work.

In any case, I learned something new:

THIS code works:

 ```function draw_gradient(y, cols) local ptn = 1 color(cols) while y < 128 do rectfill(0, y, 127, y + 3,cols+dither[ptn]) y += 4 ptn = min(ptn + 1, 17) end end dither = {0x1000.0000,0x1000.8000,0x1000.8020,0x1000.a020,0x1000.a0a0,0x1000.a4a0,0x1000.a4a1,0x1000.a5a1,0x1000.a5a5,0x1000.e5a5,0x1000.e5b5,0x1000.f5b5,0x1000.f5f5,0x1000.fdf5,0x1000.fdf7,0x1000.fff7,0x1000.ffff,0x1000.ffff} cls() poke(24372,1)--required for -- dual color fills for i=-64,127 do draw_gradient(i,7) flip() end ```

Now that dithering effect is a thing of beauty ! I just may do something interesting with it.

P#69385 2019-10-28 03:14 ( Edited 2019-10-28 04:52)
2

I'm... speechless...

P#69391 2019-10-28 05:02
1

@dw817 Yes, sorry that I forgot about that poke. I had so little sleep last days — finishing the demo, traveling to the demoparty and having fun there... :) Glad that you figured it out yourself.

P#69392 2019-10-28 05:45
1

BTW, I made the full source code (including some tools) available on GitHub: https://github.com/Megus/picochak

I'm also going to write a "making of" blog post soon to explain the tricks I used to fit all these effects in a single PICO-8 cartridge.

P#69393 2019-10-28 05:50
1

Must be fun where you are, @Megus. :)

Yes, this dither technique is quite interesting. I've only seen this on Pico-8 and that diagonal thing I did above years ago.

Will be experimenting with it most of today.

P#69405 2019-10-28 15:25
2

You're famous ! Well ... more famous than you already are. :)

https://www.lexaloffle.com/bbs/?tid=35781

P#69415 2019-10-28 20:05 ( Edited 2019-10-29 19:59)
1

I really like not just the quality of the effects, but I really like the creative theme here. You definitely earn a star.

P#69465 2019-10-29 19:11

Picochak 2: Revenge of the Ramen

P#74282 2020-03-28 19:37
1

I wrote a post about some technical challenges I faced when creating PICOCHAK: https://megus.org/2020/05/04/making-of-picochak.html

P#75795 2020-05-04 11:41

Nice write up - I ran the demo again and did not see any textured poly.
Has it been removed from the final version?

P#75829 2020-05-05 06:12

Thank you! No, it hasn't been removed. The PICOCHAK is a textured object, it first appears after the twister part. He is the main character and he defeats Megadonut :)

P#75832 2020-05-05 08:30
1

This cart broke on version 0.2.1b. The movement of the donuts is choppy, and eventually it crashes when it tries to catch up.

P#86513 2021-01-16 21:54

It didn't crash for me instead all of the text was messed up a long side a cutsecene or two so the people who made the game were "lets conquer th" and chalk turned evil... wonder how it broke?

P#86515 2021-01-16 22:15
2

Thank you for reporting! Yes, it became broken on the latest PICO-8. I'll try to fix it when I have time.

P#86526 2021-01-17 09:04
4

Cart #picochak_fixed-0 | 2021-02-22 | Code ▽ | License: CC4-BY-NC-SA
4

I think I found the issue. The code tries to draw circles of unusually large size, and that's apparently causing the lag. I added a simple condition, and it seems to have removed the lag.

P#88006 2021-02-22 15:36
2

This is why you dont do donuts kids. Being addicted to donuts is bad quit now or never get addicted.
But seriously this is amazing

P#88012 2021-02-22 16:42

Thanks for pointing that out @rnd -- I've added a clipping test for large circles in 0.2.2b so that when the clip region is contained by the circle/oval, it is (almost) free, and when the clip region is contained by a filled circle/oval it costs the same as an equivalent rectfill.

P#88361 2021-03-01 09:51

I give you... THE MEGA PIE [PicoChak]

P#101171 2021-12-01 04:36