Log In  
[back to top]

:: Unfold ::

Cart #57730 | 2018-10-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

These things always get stuck in my socks when I go hiking.

I've been playing with a z-buffer 3D rendering implementation, which lends itself to recursive additive fractal structures.

My ultimate plan was a static landscape renderer, but this was an interesting (if sluggish) detour.

-Electric Gryphon

P#57732 2018-10-09 02:09 ( Edited 2018-10-09 16:32)

:: Unfold ::

Cart #52504 | 2018-05-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Old Version

Cart #52440 | 2018-05-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Pilot your state-of-the-art RAH-66 Comanche helicopter over once-peaceful tropical shores. Take on an endless barrage of enemies and leave their wreckage littering the voxel landscape.

The engine and overall game is inspired by the Comanche series from NovaLogic.

--Voxel landscape engine (as seen in Tera Firma tech demo)
--Shaded 3D polygon enemies
--Seamless map
--Awful self-made music and sound effects

z: Fire Missiles
x: Fire Mini Gun
tab: Enable Mouse Control (left button fires gun)


P#52441 2018-05-06 02:51 ( Edited 2018-05-24 08:41)

:: Unfold ::

Cart #51644 | 2018-04-15 | Code ▽ | Embed ▽ | No License

Here's a landscape / flight simulation engine that I have been playing with. I'm still figuring out how to turn this into a game, but at least it's functional now and runs at 30 fps.

It takes a few seconds to generate the map using simplex noise mapped onto a sphere.

Arrow keys to turn and pitch up and down.
Z-key to accelerate

There's a 3D shaded polygon engine built into this as well, but I'm not using it yet.

Thanks Anthony DiGirolamo for the simplex noise:


P#51645 2018-04-15 17:32 ( Edited 2018-06-22 20:52)

:: Unfold ::

Cart #46523 | 2017-11-20 | Code ▽ | Embed ▽ | No License

Playing around for the text jam using Signed Distance Functions. It's not really fast enough for anything other than a proof of concept for textifying grayscale images.

-Electric Gryphon

P#46524 2017-11-20 16:28 ( Edited 2017-11-21 07:02)

:: Unfold ::

Cart #44775 | 2017-09-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I've become unhealthily interested in image compression on Pico8.

Hit the "z" key to see the next image.

What we have here is something that might resemble the JPEG compression scheme if you squint.
Compression goes like this:
--Discrete Cosine Transform + Quantatization
--Zigzag encoding of blocks
--Huffman encoding
--Run Length Encoding
--Conversion to a base 64 character set
--Overall compresses to around 1/5 of original 8-bit grayscale size.

What didn't work well:
Image quality is kinda low. There are only about 16 levels of gray that are discernible on pico8 with dithering. Not sure that it makes a lot of sense to encode 256 shades of gray in that case. Not to mention that the image quality at 64x64 is pretty lame to begin with.

This path may be a dead-end because I can only get about 12 64X64 images in here before hitting compressed code limit. If I drop the base 64 coding, I could fit maybe 10 images into the sprite area... Because Pico8 compresses data as well (definitely with better algorithms), my compression may be working at cross purposes to Zep's compression. I still need to do an experiment to see whether the base 64 encoding is any better than the base 16 coding.

I've got some glitching in the bottom right blocks.

Here's the compression script: https://github.com/electricgryphon/pico_8_jpg

Perhaps this will inspire someone to greater image compression heights :-D.

-Electric Gryphon

P#44776 2017-09-30 14:36 ( Edited 2017-10-06 20:58)

:: Unfold ::

Cart #44669 | 2017-09-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Step into cyberspace with cutting-edge 3D vector graphics. Battle tanks with your triangular pew-pew cannon. Explode into a number of polygons.

This is an homage to Specter VR, which came packaged with my Macintosh Performa back in the day.

-60 fps
-Motion blur effects
-Blue/Red 3D glasses mode (it actually works)
-Multiple camera modes
-An attempt at writing title music

Gameplay is a bit, well, simple. Basically drive around shooting and being shot at.

--Electric Gryphon

P#44653 2017-09-27 01:31 ( Edited 2017-10-02 00:51)

:: Unfold ::

Cart #43486 | 2017-08-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Take aim, fire and score! It's Desert Lead 3D!

Spread the desert with the dented and shattered remains of bottles and cans. It's like recycling, but more destructive.

For use with the Pico Light Gun, Desert Lead 3D is also compatible with the Pico Mouse.
(Pico Light Gun is only available in selected dimensions.)
Click at the bottom of the screen to reload.

Old version

Cart #43449 | 2017-08-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Sound effects could use some love. Anyone have a good shot and "plink" sound?
Affine texture mapped 3D isn't perfect, but it does create the appropriate effect.
Scoring system may be a bit glitched right now.

Thanks Felice for the sound and cross hair improvements.

-Electric Gryphon

P#43451 2017-08-20 02:24 ( Edited 2017-08-23 16:04)

:: Unfold ::

Cart #43087 | 2017-08-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I feel like I'm going around in circles here.

-Electric Gryphon

P#43088 2017-08-05 13:53 ( Edited 2017-08-09 00:07)

:: Unfold ::

Cart #40542 | 2017-05-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Here's a demo effect kludged together from some doodles I had been playing with.
I'm quite fond of my new and improved 3D shading. (It's not quite as speedy as the line shading I was using previously, but it gives smoother gradients.)

-Electric Gryphon

P#40543 2017-05-13 15:29 ( Edited 2017-05-20 06:26)

:: Unfold ::

Cart #47234 | 2017-12-10 | Code ▽ | Embed ▽ | No License

I've been hacking at a ray-marching 3D rendering app.

--Phong shading
--Dithered colors

playing with the dithering patterns a bit more.


P#40491 2017-05-12 02:36 ( Edited 2017-12-10 02:15)

:: Unfold ::

Here's a stab at some lossy compression of the Bad Apple animation-- clocking in at 25 seconds long without even touching the sprite sheet.

The compression algorithm finds the best possible dictionary of 32 different 8x8 tiles with which to represent all of the frames of the animation. Then for each 8x8 chunk of each frame that is being compressed, I find the closest possible match out of this dictionary and record the index of this chunk. Finally, I use run length encoding to compress the string of dictionary indexes for each frame. (That's the idea at least...)

That gets things down to around 54 bytes per frame while still being recognizable.

This is inspired by gamax92 (https://www.lexaloffle.com/bbs/?tid=3263) and this C64 version (https://www.youtube.com/watch?v=OsDy-4L6-tQ)


P#40010 2017-04-29 02:04 ( Edited 2017-05-16 21:39)

:: Unfold ::

Inspired by old-school demo-scene effects, here is a new and improved grayscale bump map render, which takes 8 bit height map input and generates real-time shading effects.

Please see GitHub for Python image conversion script and sample files. (https://github.com/electricgryphon/pico-9-height-map-converter)

I found the skull height map in the following forum:

--Electric Gryphon

P#39461 2017-04-09 15:51 ( Edited 2017-04-12 09:38)

:: Unfold ::

Why settle for single renderings of a Mandelbrot when we can smoothly zoom in?

--Dithered Palette Animation
--Smooth Bilinear Zoom from sprite buffer
--Background Rendering of Mandelbrot into a (third?) buffer

The way this works is that we graphically zoom into initially rendered view of the Mandelbrot from the sprite buffer. While doing this, we are drawing the next level of Mandelbrot zoom into a second background buffer. When it's done, this gets copied into the zoom/sprite buffer. Lather, rinse, repeat.

Overall, a neat effect I think. Though, I wonder if I should trade the (more or less) smooth frame rate and dithering for less chunky pixels.

Also, I realize that I am awful at spelling "Mandelbrot".

-Electric Gryphon

P#38735 2017-03-25 17:10 ( Edited 2017-04-03 10:11)

:: Unfold ::

Cart #38370 | 2017-03-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Happy Saturday!

This is an attempt to create a faster falling sand simulation (60fps) by reading and writing directly to screen memory. All pixels / sand particles are active at all times.

I was inspired by Helado's Tiny Terrarium and Axnjxn's Falling sand.

I'm writing 1X2 pixel blocks in order to work directly with bytes and avoid bit-masking to address individual pixels. Then, I am using the display mode hack ( poke(0x5f2c, 2) ) to stretch the vertical scale of the display by 2X without requiring me to write any more data to screen memory.

-Electric Gryphon

P#38371 2017-03-18 16:12 ( Edited 2017-03-19 00:01)

:: Unfold ::

Here's a toy I have been playing around with. Perhaps somebody can use these functions for fancy shaded 3D rendering or something like that.

I have a few functions that draw "RGB" pixels to the screen using pattern dither that are approximated using the rgb values of the pico8 palette.

color_bayer_plot_8(x,y,r,g,b) -- writes a given r,g,b at the x,y (r,g,b are from 0 to 1)

fast_rgb_create() -- pre-renders patterns using a 4X4 bayer dither representing 8 levels of R and B and 16 levels of G.
fast_rgb(x,y,r,g,b) -- writes a given r,g,b at the x,y (r,g,b are from 0 to 1)

function solid_trifill( x1,y1,x2,y2,x3,y3, r0,g0,b0,r1,g1,b1,r2,g2,b2)
Renders a triangle with the three corners colored at rgb and shades smoothly between them. Right now this uses the slower color_bayer_plot_8.

If you move the cursor around with the arrow keys you can see the triangles. The vertices can be grabbed with the "z" key and the color of the vertices can be changed with the "x" key.

Originally I had been thinking about making a gradient image compression algorithm, but it seemed less interesting after getting half-way through.

Here's a spinning R G B triangle for fun.

Cart #34413 | 2016-12-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#34412 2016-12-29 00:25 ( Edited 2016-12-29 15:42)

:: Unfold ::

I've been playing around with Floyd–Steinberg dithering in order to achieve more continuous color gradients.

This is slow as molasses of course, and even with optimization I don't think it could be used in a game. But perhaps it could be used in a ray tracer or other, more temporally relaxed image generation applications.

P#32610 2016-11-18 14:21 ( Edited 2016-11-18 20:08)

:: Unfold ::

old version:

Here is a cleaned up version of the 3D library that I put together for the Pico Fox game.

The demo code is commented in more detail, but here is the basic gist.

Copy the code between Begin Cut and End Cut. (It's a big chunk.)

In _init() function include:
--init_3d() --Need to call init_3d() to set up player, camera and lights
--use load_object(object_vertices,object_faces,x,y,z,ax,ay,az,obstacle,color_mode,color) to load 3D models into the world
--use read_vector_string and read_face_string to generate vertex list and face list from string data

In _update() function include:
--handle_buttons() -- handle default buttons for player-- this can be overwritten obviously.
--update_player() -- update the player with default movement, stopping at obstacles
--update_camera() -- update the camera based on player location and direction
--update_particles() --update 3D particles if used. (I didn't add any for this demo.)
--update_3d() -- call update_3d() at the end of the _update() function to transform etc.

in _draw() function include:
--draw_3d() --render objects into triangles, sort the triangles and draw them onto the screen

Please feel free to use this in your projects as well as to update it and make it work better.

New features for version 2:
--Significant speed increase (2X!)
--Load models from strings to save token space
--Python script to translate from ".obj" files to compressed string

Run the script in the folder with the files that you are converting.
python low_poly_compress-01.py filename.obj

Detailed instructions and script found on GitHub.

P#32574 2016-11-17 01:56 ( Edited 2017-06-28 20:27)

:: Unfold ::

Cart #32479 | 2016-11-15 | Code ▽ | Embed ▽ | No License

Fly your Arwing to victory in this demake of a certain, iconic SNES game.

Arrow Keys: Move ship, Select level in title screen
z/o: Fire

Filled 3D polygon graphics-- reminiscent of SuperFX chip
3 levels -- select with left or right on the title screen
2 enemy types

Special thanks:
Star Fox Cornerea music sequenced by PJBarnes.com (http://www.khinsider.com/midi/snes/starfox) and imported using kittenm4ster's midi to pico-8 tracker translator (https://github.com/andmatand/midi-to-pico8)

I finished this game with our three week old son sitting in my lap. I guess this is one our first father-son activities together--kinda sweet in a very nerdy way. Perhaps his first words will be in Lua.

Let me know if you would be interested in a cleaned up version of the 3D library that I put together for this project.

P#32480 2016-11-14 22:57 ( Edited 2017-03-29 17:11)

:: Unfold ::

Cart #32244 | 2016-11-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

The forest is looking more foreboding these days.

-Electric Gryphon

P#32245 2016-11-05 13:44 ( Edited 2016-11-06 01:52)

:: Unfold ::

Old version

The Galactic Tourism Bureau has put together a collection of postcards from their enticing travel destinations.
Postcards will switch every few seconds to ensure that you experience each of the 5,000 locales.

Thanks qbicfeet for the font library. (https://www.lexaloffle.com/bbs/?tid=27669)

V2 Changes:
--Improved near field clipping
--Water color can change
--Galactic index is readable

-Electric Gryphon

P#32242 2016-11-05 12:57 ( Edited 2016-11-07 01:50)

View Older Posts
Follow Lexaloffle:          
Generated 2022-11-30 16:13:52 | 0.072s | Q:77