Log In  
Follow
electricgryphon
Follow

Cart #jaburazaga-0 | 2021-07-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
15

The world needs more metablobs. 'Nuff said.

P#94379 2021-07-02 23:01

Cart #space_station_demo-0 | 2021-07-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
45

Here's a quick demo of a 6 degree of freedom 3D engine that I have been working on.
You can just explore a small space station in a Descent-like style.

Controls
Z: Thrust
Arrow Keys: Turn
X+Arrows: Roll

Notes
The map is stored in a long string and is generated from a Blender OBJ file. The station is as complex as I can make it before running out of compressed code space. To make something larger, I think I would have to switch to more of a 3D tile system with room building blocks that snap together.

The engine uses a simplified portal system paired with convex sectors to determine room visibility and draw order.

Thanks
Thanks to Fred72 for the polyfill code. (https://www.lexaloffle.com/bbs/?tid=3393)

P#94322 2021-07-02 05:53 ( Edited 2021-07-02 05:54)

I've found an issue in a recent cart where if I exceed CPU of 2, the reported CPU in stat(1) goes back to being less than 1. (Basically looks like stat(1) is reporting CPU%2.)

And here I was being excited about being able to handle 100 objects without breaking a sweat. :-D

Cart #diginbus-0 | 2021-05-30 | Code ▽ | Embed ▽ | No License
2

-ElectricGryphon

P#92758 2021-05-29 05:00 ( Edited 2021-05-30 04:22)

Cart #sphero_a1-0 | 2021-05-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
18

Sphero

Version a1

Rescue Blocklandia from the evil clutches of Duke Cube. Find the nine golden keys to unlock the gate to the magic portal and recover the crown.

Instructions

--Move the Sphero with the arrow keys
--Interact with special blocks by rolling over them
--Collect keys to open locked doors
--Collect floating coins
--Grab the crown to win the game!

If you beat the game, please post a picture!

Implementation Notes

There are some tidbits in this cart that might be interesting/useful to other pico8 programmers.

Level Storage

8X8 rooms are stored in a compressed format within a long string contained at the end of the P8 file. Blocks are stored in a manner that is closer to a drawing format-- e.g. change current tile, place tile at location x or fill a given region with tile. These instructions are tightly bit packed and then saved a single line of hex for each room.
This allowed for 117 unique rooms in the game with a reasonable level of detail before hitting the code compression limit. (15438/15616 in the end!)

I have tool to allow for rooms to also be stored in the cart data as well, but it didn't end up being necessary. (I got tired of designing rooms before I got ran out of space.)

I have a level editor (also made in pico8), which outputs levels to a text file, that I can share.

Sprite Packing

This game uses two sprite sheets worth of a sprites by mashing them together-- e.g. the first 2 bits code for sprite sheet one and the second 2 bits code for sprite sheet 2. I posted a demo cart of this earlier, and there are a couple of other carts on the bbs that explain this in more detail.

Physics

Collisions are handled using signed distance fields for the blocks in the local area of the ball, which make it really easy to check for where and when the sphere of the ball hits something--or multiple somethings. As a bonus, they also make it easy to find the normal at the intersection point, so bouncing type collisions are pretty straight forward.

I can do more of a write-up for these things if folks want.

-ElectricGryphon

P#92323 2021-05-22 00:57

Cart #gasefabufe-1 | 2021-05-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Here's a quick and dirty cart that will merge 2 PNGs into 1.
Assumptions: Use black, white, with Pink for transparent.
Drag first image onto cart.
Drag second image onto cart.
Output is saved in the sprite sheet.

This will only work on desktop pico8.

-ElectricGryphon

+

=

P#91562 2021-05-06 06:16

Cart #gesadupito-2 | 2021-04-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
60

PicoVox

version a2

Old versions

Cart #gesadupito-0 | 2021-04-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
60

PicoVox is a voxel art creation program for Pico8.
--Use your mouse to add, remove, and recolor blocks on an isometric grid.
--Render ray-traced images and rotation animations of your pieces
--Save and share your creations in the form of data PNGs
--Import data PNGs from others by dragging them onto PicoVox

saving and import

Click the disk icon to save your work. A PNG will be generated that contains the voxel data for your scene. This file can be posted on the BBS or social media.

To open a file, simply drag the image on top of the running PicoVox application window.
(Saving and opening may require standalone Pico8 and not work on the BBS web-player. TBD)
See example save image below:

mouse support

PicoVox requires a mouse to function properly, though it may work "ok" with a touch screen. With a mouse and the block tool selected, left mouse places blocks and the right mouse deletes them. The scroll wheel can be used to zoom in and out and clicking and holding the scroll wheel will cause the model to rotate.
If you do not have a right mouse button, you can delete blocks by selecting the black color with the red slash in the color palette.

rendering

PicoVox can render images in a dithered Pico8 palette using ray-tracing. Special rendering features include transparency, reflection, glowing, as well as shadows and ambient occlusion.
Click the camera tool to start a render, which will save to the desktop by default when complete. (Generally rendering takes around 10 seconds and will be interactively displayed while it progresses.)

The loop icon will render a rotation animation as a gif to your desktop by default. Please note that this will take a long time to render all of the frames. Currently, the animation render cannot be canceled so please remember to save your work before starting.

new scene

To change the width, depth and height of the scene, click the "clear scene" tool. Note that this will erase your current file.

tools

block: add blocks
brush: paint color
cam: render
floor: toggle floor
disk: save
bucket: fill color
hand: pan
loop: render animation
doc: clear scene
?: info text

blocks

solid block
transparent block
mirror block
bright block

colors

select color
black is erase

keys

arrow keys rotate view
z+arrow: pan
shift+up/down: zoom
x: quick render

wmouse

left: add block
right: del block
middle: rotate
scroll wheel: zoom
shift+middle: look at

P#90020 2021-04-05 16:46 ( Edited 2021-04-09 01:54)

I've seen a significant performance difference between the latest v0.2.2 and v0.2.1b.

For this particular cart, it runs significantly slower on the latest version when measured with a stop watch, but when using the stat(1), the system claims the opposite--i.e. that it's faster. (These are both being run from the .exe on Windows.)

  Version    stat(1)           Stopwatch Timed
  v0.2.1b    285               30 seconds
  v0.2.2     219               8 minutes, 14 seconds

I've included the cart for reference.

-ElectricGryphon

Cart #render_speed_dif-0 | 2021-02-18 | Code ▽ | Embed ▽ | No License

P#87830 2021-02-18 06:27

PICO-RAY

Brought to you by the same productivity-focused team as Hypercolor Paint, PICO-RAY offers state of the art 3D modeling and rendering capabilities for the Pico-8 computer system.

Cart #pico_ray_v1_0-0 | 2020-08-30 | Code ▽ | Embed ▽ | No License
45

Features:

--Ray marched, photo-realistic 3D graphics
--Soft shadows, ambient occlusion, reflection, refraction
--Materials properties, including: color, gloss, reflection, refraction, patterns
--Primitives including: box, sphere, torus, cone, plane, sponge, and landscape
--Realtime wireframe box previews
--Quick render modes for preview
--2x2 anti-aliased high-quality mode

Instructions:

PICO-RAY requires the pico-mouse to operate. Click on menus and increment widgets to create and edit geometric primitives.

Menus:

-REND- Control rendering options
1x1:No skipped pixels
2x2:Render 2x2 blocks
4x4:Render 4x4 blocks (faster)
QUICK: Render in fast grayscale with no shadows/materials (only 2X2 and 4X4)
NORMAL: Render with shadows, materials
HIGH: Render with anti-aliasing on (slowest)
OUTLINE: Show bounding boxes for all objects (selected object highlighted in blue)
HIDE MENUS: Hide menus for saving screenshots (click to turn menus on

-PARAM- Create new objects and change the dimensional properties and shape of objects.
[OBJECT TYPE] Type of the selected object primitive. Click left/right to change type.
[Properties] Depends on the object type (e.g. height, width, depth of box)
MAT: Material number (can also change form MAT menu)
NEW: Click to create a new object--defaults to location 0,0,0
DELETE: Delete selected object. Scene must contain one object, so last object cannot be deleted. (However it's object type can be changed.)

-LOC- Adjust object position and orientation
X:
Y:
Z:Click on arrow buttons to move selected object along axis. Hold down to repeat.
AX:
AY:
AZ: Click on arrow buttons to rotate selected object about axis.

-CAM- Control the camera location and orientation
CAM X:
CAM Y:
CAM Z: Control the camera location
CAM AX:
CAM AY:
CAM AZ: Control the camera angle

-SCENE- Adjust the scene properties
L AX:
L AY: Direction of light source. (Infinite, directional light)
SKY1 R,G,B: First sky gradiant color. RGB goes from 0 to 1 for colors
SKY2 R,G,B: Second sky gradiant color.
SUN RGB: Color of sun glow (seen when looking into the light source)

-MAT- Material properties
MAT: Material number of selected object. (Also, number of material currently being edited.)
COL R,G,B: Base color of material.
SPEC: Specularity of material.
GLOSS: Glossiness of material.
SHINY: Shine of material. (SPEC, GLOSS, and SHINY work together to create matte or glossy surfaces)
REFL: Reflectivity (0 to 1)
TRANS: Transparency of mateiral from 0 to 1 (completely transparent). This is affected by color of material. A value other than 0 will also enable refraction, which slows rendering.
IOR: Index of Refractin. A value of 1.5 is approximately equal to glass. A value of 1.0 is equal to air. Refraction slows rendering.

Material defaults:

1--White
2--Red
3--Green
4--Dark Blue
5--Yellow
6--Light Blue
7--Purple
8--Orange
9--Black
10--Light Mirror
11--Dark Mirror
12--Wood Pattern
13--Black and White Tile (works best on planes)
14--Clear Glass

Primitives:

BOX: Box with Width, Height, Depth
SPHERE: Sphere with Radius
TORUS: Donut with R1 Major Radius and R2 Minor Radius
CYLINDER: Cylinder with Radius and Height
PLANE: Plane -- no properties. Note that the plane defaults to to 0,0,0 which may block the camera.
SPONGE: Menger Sponge fractal
TERRAIN: Mountain range

P#81360 2020-08-30 06:17 ( Edited 2020-08-30 06:26)

Cart #landscape_16-0 | 2019-10-05 | Code ▽ | Embed ▽ | No License
24

Old Version

Cart #landscape_07-0 | 2019-09-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
24

Explore alien lands with a high-color world generator.

This is a new take on Postcards From the Fringe, which I made a few years ago. https://www.lexaloffle.com/bbs/?tid=28026

Press "z" to visit a new, random planet.

Features:
--High-color flicker dither technology with 4,096 indexed colors/patterns [Warning flashing lights]
--Endless bicubic noise mountains
--Mountain shape variations: islands, hills, spires, etc.
--Alien sunset sky with clouds
--Water with ripples and sky reflection
--Preview render in standard (non flicker) mode
--Anti-aliased image composing with alpha channel

To do:
--Ability to save / share worlds
--Controls to tweak variables

Technical:
This is a voxel landscape engine, actually adapted from Pico Kart but with height added. The system is not very optimized for speed right now... definitely room to make it a lot faster even if not real-time.
Color handling is taken from my Hypercolor Paint cart. The palettes of colors and patterns are loaded from cart memory and generated by another cart that takes ages to run.

-Electric Gryphon

P#68270 2019-09-30 05:26 ( Edited 2019-10-05 22:09)

Cart #hypercolor_paint-0 | 2019-07-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Introducing Hypercolor Paint, a high-color painting application for the PICO-8.

Features:
Paint in either high color mode (flicker) or standard (dithered) mode.
While editing, pixels are treated as 56,535 level 3-channel color.
Use a variety of brushes, with control of color, size and pressure to achieve desired effects.
Save images (requires download)
Export images (requires download)

Example Images: (High color mode is simulated)

<b>Keyboard:</b>
Z: Switch between paint mode and palette mode
Tab: Switch between high color and standard color mode
Mouse: Paint with left mouse button

<b>Palette Screen:</b>
?: Show splash screen
Color: Switch between paint mode and palette mode
Save: Save image locally to hyper_color_save.p8 (image will be cropped)
Load: Load image locally from hyper_color_save.p8
Export: Export image to hyper_color_export.p8
For standard color images, the sprite sheet will capture the full image.
For high color images, data is stored in sprite sheet as well as map and sound effect locations.

In order to view images, paste the following code into hyper_color_export.p8:
<code>
k_display_adr=0x6000
k_screen_1_adr=0x0000
k_screen_2_adr=0x2000
k_screen_len=0x2000
cur_frame=0

function _update60()
end
function _draw()
cur_frame+=1
if(cur_frame%2==0)then
memcpy(k_display_adr,k_screen_1_adr,k_screen_len)
else
memcpy(k_display_adr,k_screen_2_adr,k_screen_len)
end
end
</code>

Technical notes:
Two different 16X16X16 color look up tables are used to achieve responsive paint effects with dithering at 60 fps. In order to avoid a massive slow down (it takes a number of minutes to build the color cube) the look up table is generated by a different cart and loaded into sprite, map and sound memory.

Example exported cart:

Cart #bunny-0 | 2019-07-18 | Code ▽ | Embed ▽ | No License
22

P#65915 2019-07-18 06:08 ( Edited 2019-07-18 06:18)

Cart #flyover_toy-0 | 2019-05-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

Been playing with cubic smoothing of simple noise for endless landscape generation.
It's definitely slower than lerping, but I think it creates more realistic looking shapes. In order to get a nice interactive frame rate, I had to rely on scrolling the screen and just updating the top portion. It kinda works although the textures smear vertically.

Press "z" to randomize parameters.

-Electric Gryphon

P#64881 2019-05-31 04:43

Cart #image_morph_a-0 | 2019-02-24 | Code ▽ | Embed ▽ | No License
15

Pico Image Morph 2000

Use your personal Pico-8 computer to create professional-quality image morphing effects as seen in blockbusters such as "Willow" and "Terminator 2". Use the power of Pico Image Moprh 2000 to seamlessly transform one person into another or even change a cat into a dog!

Pico Image Morph 2000 can even be used to create wacky deformations! The possibilities are endless!

Instructions:

Pico Image Morph 2000 requires the use of the Pico Mouse Accessory.
While in "Position Mode", locate deform points along critical portions of the image, such as centers of eyes or the edges of lips.
Switch to "Deform Mode" to drag deform points to new locations.
Use the "Onion Skin" button to switch between viewing the Start Image, Target Image, or a blended overlay of both.
Click the "Animate" button to loop the animation
The system include 5 different image to morph between.

Technical notes:

Morphing is done by using affine triangle transformations, and blending control point and texture coordinate positions for a source and a destination image and then compositing them together. This is a naive way to morph images, but at this resolution it actually works pretty well.
Images are store in strings within the code--they are simply 64X64 16 level grayscale images. I can share the python script if anyone wants it.

https://en.wikipedia.org/wiki/Morphing

Totally worth watching is the demo real for Elastic Reality from the early 90's. https://www.youtube.com/watch?v=AD5R7dJM4eU

--Electric Gryphon

P#62193 2019-02-24 02:23 ( Edited 2019-02-24 02:30)

Cart #vox_mine_28-1 | 2019-01-18 | Code ▽ | Embed ▽ | No License
71

Mine your way to fame and fortune in a continuously generated 3D voxel world. But keep an eye on your energy level and make sure you can find your way back through the deep and twisted caves.

Build block fortresses with a variety of materials.

Use the Far-View 3D Map and GPS to stay safe.

Instructions:
s,f: turn left and right
e,d: move forward and backwards
lshift or z: jump (hold to jump higher if upgraded)

The mouse is required for mining and building.
Click on shop computer to enter store menu. Ore and gems will auto-sell.

With laser selected, click and hold on a block to mine it. Circular progress bar will indicate how long is left. Precious ores will take longer to mine.

With a placeable block selected, click on the side of an existing block to place a new block.

Energy will deplete when moving, jumping or mining. The battery can be recharged by standing on the glowing yellow charge squares near the shop. When your energy goes to zero, you will lose most of your money and be teleported back to the starting point.

Recommendations:

  • The GPS or Far View are good investments early on because it's easy to get lost.
  • Be very careful about falling into caves. They may go very deep and getting back home before energy runs out could prove a challenge.

Notes:
This game uses a modified ray-casting engine based on tutorials from (https://lodev.org/cgtutor/raycasting.html). This was extended to work with voxels, reading in a local 3-dimensional map array.

The map is generated dynamically as the player moves around. However, it is set up such that the same block will always exist at the same x,y,z coordinates. In addition, there is a user map that is used to store the locations of blocks that the user added or removed. These are essentially stored in a sparse matrix.

There is currently no way to save your constructions. It might be possible to save some aspects of the world with the persistent cart data, but I don't know that 256 bytes will be sufficient. Clipboard import and export might be a better way to allow folks to share creations.

The code is a dog's breakfast. Token count wasn't really a problem for me on this one, but it was a struggle to keep frame rate acceptable with the world rendering code. I'd love to be able to increase the view depth without dropping to 15 FPS.

-electricgryphon

P#60809 2019-01-14 06:52 ( Edited 2019-01-18 05:45)

Cart #bw_scroll1-0 | 2018-12-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

Take a stroll through the swirly bits of my imagination.

Technical details:
--Image size: 1536X128, 2 bit
--Scanned from a drawing and imported into Pico8.
--Utilizes RLE encoding as well as storage in both strings and sprite page

-electricgryphon

P#60037 2018-12-16 23:49

Cart #hituditeku-0 | 2018-12-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22


Cart #yonipakifi-0 | 2018-11-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Here's a Pico-8 ray tracer with the amazing ability to render both spheres AND planes.

Let it run all the way through even though the colors will be funky at first. After it renders the image, it will switch to high-color mode.

Features:
-NEW High Color Mode
-Spheres
-Planes
-Textures (2d)
-Diffuse and Specular Shading
-Shadows
-Reflections

-ElectricGryphon

P#59480 2018-11-30 05:24 ( Edited 2018-12-04 20:30)

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

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)

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

Old Version

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

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.
https://en.wikipedia.org/wiki/Comanche_(video_game_series)

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

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

-ElectricGryphon

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

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

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.

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

Notes:
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:
--https://www.lexaloffle.com/bbs/?pid=32443

--ElectricGryphon

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

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

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)

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

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)

View Older Posts
Follow Lexaloffle:        
Generated 2021-07-30 11:20:49 | 0.139s | Q:92