Log In  
Follow
professir
Follow
PLORBO: Critter Getter
by professir
ISOL8: Build & Isolate
by professir
Chance of Rain: Evolutionary Simulation
by professir

Cart #simple_timer_service-6 | 2021-11-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

Simple Timers Service

Here is a Simple Timers Service that can manage multiple timed events -- feel free to use it in your games :D

How to use

This service is a Singleton and can be referenced with the variable "timer".

The service exposes 2 methods:

  • timer:start( _frames , _callback )
    • Simply start any number of timers, wherever you want in your code
    • _frames: the number of frames to count down before executing the callback function
    • _callback: the function to execute after the number of frames has elapsed
    • Example: "timer:start(600,my_function)" -- this will execute "my_function()" after 600 frames have elapsed
  • timer:update()
    • Simply place this into the pico _update or _update60 function to allow the service to update itself each frame
    • Note that update60 will cause the timer to "count" twice as fast, since it is counting down the number of frames
    • The service uses this internally to iterate all of the timers that have been started in order to decrement each / execute callbacks as necessary

The code

In the cart, Tab 0 is the Simple Timers Service code. Tab 1 is a commented example of how to use it in your project. I have pasted the code below for your convenience:

Tab 0 - Simple Timers Service

--simple timers service
--by buck young | professir
timer=(function()
 local sts={
  update=function(e) for i=1,#e.l do e.l[i].t-=1 if e.l[i].t<=0 then e.l[i].f();deli(e.l,i) return end end end,
  start=function(e,t,f) add(e.l, {t=t,f=f}) end,
 } 
 sts.__index=sts
 return setmetatable({l={}},sts)
end)()

Tab 1 - Example Implementation

-- example implementation
function _init()
 cls(0)

 -- start a timer
 -- from anywhere in your
 -- code. this code says
 -- "after 30 frames, call
 -- the 'green_screen'
 -- function":
 timer:start(30,green_screen)

 -- you can even in-line
 -- an anonymous function.
 -- this call says "after
 -- 60 frames, turn the 
 -- screen red":
 timer:start(60,function()
    cls(8)
 end)

 -- you can start as many 
 -- timers as you like,
 -- they are all managed
 -- within the service itself.
 timer:start(90,green_screen)

end

function _update()

 -- be sure to include this
 -- in your update function
 -- so the timers service
 -- can do its job:
 timer:update()

end

function green_screen()
 cls(11)
end

Many thanks to FReDs72 and merwok for some helpful discussions in the PICO-8 discord!

P#99913 2021-11-10 18:56 ( Edited 2021-11-23 05:01)

Cart #plorbo-3 | 2021-11-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

An alien abduction game with procedurally generated planets

ATTENTION, PLORBO! We require new critters from across the Universe for our intergalactic zoo, the Pride of Plorbia. You must venture to new, unexplored worlds to find specific critters that we beam to your Mothership and return them to us.

Controls

When controlling green ship:

  • ARROW KEYS: move
  • Z: boost
  • X: abduct

When docked to Mothership:

  • DOWN: undock

When out of energy:

  • LEFT / RIGHT: control Mothership for a rescue

Any time:

  • Press ENTER to VIEW THE ZOO or MUTE THE MUSIC

‚ÄčIn the zoo:

  • Left/right to scroll
  • Hold Z + left/right to scroll quickly
  • X to exit zoo

How to Play

View the required head and body at the Mothership, then explore the planet to find a critter with both that head and body. Abduct it and return it to the Mothership. Do this a few times to visit the next planet. You can collect extra research points by finding critters with similar features, even if you do not find the exact match. You may abduct up to 5 creatures at once.

In between planetary visits, you will see the zoo with all the critters you have found so far. The zoo has some statistics listed - they will turn gold once you "complete" each stat.

Watch your energy meter (yellow meter above your craft). Moving, abducting, and boosting (especially) uses energy. Recharge at the Mothership. If you run out of energy and crash, you can control your Mothership to stage a rescue. Crash three times and thats game over!

External Links

Itch.io Game Page

P#99784 2021-11-08 15:46 ( Edited 2021-11-23 17:30)

I found a potential bug with INFO+RESUME pico console commands. If you RESUME after calling INFO and then try to interact with a custom menu item, you get the following error:

ATTEMPT TO INDEX FIELD '?' (A NIL VALUE)
IN FLIP LINE 0 (TAB 0)
AT LINE 0 (TAB 0)

Example

Note: Ignore the second RESUME typed into the console after the program has already crashed

Sudden freeing of RAM after INFO+RESUME

Another curious thing is a huge RAM drop after INFO+RESUME (something getting GC'd that shouldn't be?). Notice the RAM display upon RESUME in this example (drops from 10% utilization to 7%):

Note: Ignore the second RESUME typed into the console after the program has already crashed

Steps to reproduce

  • Load any cart with a custom menu item
  • Press ESC and type INFO into the console
  • Type RESUME
  • Press ENTER and select a custom menu item
P#99222 2021-10-27 16:16 ( Edited 2021-10-27 17:28)

Cart #chance_of_rain-9 | 2021-10-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
13

Chance of Rain

A slightly interactive and slightly meditative evolutionary pond simulation

Controls

  • ARROW KEYS: control frog
  • Z: surface/submerge
  • X: tongue
  • ENTER: options

Gameplay

This simulation is meant to be watched more than played (though you may interact with it by suggesting actions for the frog).

There are four types of creatures living in this rainy pond: a frog, fish, flies, and dragonflies. Enjoy watching them swim, fly, eat, die, and birth new generations. Flies birth larva into the water which swim towards the nearest rock, where they slowly mature and eventually sprout wings - becoming flies themselves. Well-fed fish will turn green and reproduce when near each other. Dragonflies swarm the lillypad to spawn new. Each parent passes genetic predispositions onto their offspring - which allows for behavior evolution over time. Creatures may die of old age or starvation. All the while, a happy frog swims about - ready to offer a guiding hand (or, rather, mouth) if one part of the ecosystem becomes unbalanced.

Occasionally, you may see some event-triggered haikus or tips to help you further enjoy and understand the game. Statistics about your world will also slide by from time-to-time (and can be triggered manually from the options menu). If your ecosystem fails or you lose a creature type, just keep playing - there are heavy storms that roll in occasionally to replenish your stock.

Every game has randomizations, so each experience will be unique.

DNA System

A DNA system has been implemented that allows parents to pass certain parameters onto their offspring. There is even a chance of slight genetic mutations for each parameter. Through this system, each species will actually evolve its behavior over time to be best-suited to its environment.

  • Dragonflies pass on these parameters to their offspring
    • speed, initial lifespan, threshold for hunger, starvation resistance, tolerance for rain, and others
  • Fish pass on these parameters to their offspring
    • speed, initial lifespan, threshold for hunger, and starvation resistance
  • Insects pass on these parameters to larva which become adult flies
    • speed, initial lifespan, swarming location, tolerance for rain, and others

Full "technical" breakdown of the DNA system:


When 2 parents of any species produce an offspring, the child inherits parameters from the parents. For each parameter, there is a:

  • 33% chance the child will inherit the value from its father
  • 33% chance the child will inherit the value from its mother
  • 33% chance the child will inherit the average value of its mother+fathers parameter
  • 1% chance of a 'genetic mutation' which can increase the parameter beyond defined maximums

Options

Press the ENTER key to adjust these options:

  • If the text scrolls too quickly or too slowly, you may adjust your reading speed
  • If you are returning to the game, you may disable tips to enjoy only haikus and stats
  • If you want a more meditative experience, you may disable the text completely
  • You may also manually prompt gameplay stats to scroll by. This will happen occasionally through normal gameplay, as well.

Creature colors

  • Green: well-fed and fertile - will birth a new generation when a partner is found
  • Red: starving - will alter its behavior to look for food more seriously
  • Grey/Brown: getting old - will likely die soon
  • Peach: just born!

Final thoughts

There is a ton of nuance and complexity to the system but my goal was to simplify the player's experience as much as possible. Furthermore, I wanted to expose as much of the game as possible to the player from within the game itself (hence the tips that scroll by). Creature lifespans can be as long 40+ minutes, so this game was definitely meant to be enjoyed in the background / as a virtual aquarium. Personally, I turn off all scrolling text and leave it on during the workday to observe the system over many hours. I hope you, too, find enjoyment in this experience :)

Itch.io Link

Versions

FINAL VERSION RELEASED! (10/29/2021)

  • Version 9 will be the final update of this project, other than any future bug fixes or player suggestions

Click here for full change-log:

Version 9 | 2021-10-29 | chance_of_rain-9

Increase births

  • Only 1 side has to be fertile for fish and dragonfly
  • Increase fish lifespan to 23m-36m
  • Increase dragonfly lifespan to 14m-20m
  • Dragonflies stay fertile until 1/2 hunger instead of 1/4
  • Well fed fish head towards a submerged frog when fertile
  • Dragonfly hunger threshold lowered
  • 2 larva each time fertile flies meet
  • Drastically lower dragonfly birth rate
  • Rework fly stun/die logic to release flies from the mortal realm more easily

DNA System

  • Create DNA system so parents can pass parameters onto their offspring
  • Implement DNA for fish, dragonflies, and flies (thru larva)
  • Explanation of DNA system: When 2 parents produce offspring, the child inherits parameters from the parents. For each parameter, there is a 33% chance the child will inherit the value from its father, 33% chance from the mother, and 33% chance it will inherit the average of mother+father's parameter. There is also a 1% chance of a 'genetic mutation' which can increase the parameter beyond defined maximums.

Particle System

  • Particles on birth of all species
  • Particles on death of all species except larva

Music

  • Added intro and phrase 1 of e.sati g1
  • Play music on game start - refactor intro text a bit
  • Refactor and add sfx for the new interactions in versions 7/8/9

Misc

  • When fish are very close to starving, they will move towards a surfaced frog
  • Flies will still swarm on their fertility schedule even if not fertile
  • Flies revitalized on next storm anytime under 10
  • Fish are allowed to have a single member during a storm without being revitalized
  • Dragonflies die of old age in the action area
    • Fish can eat them - ~2x nutrition of stunned flies
  • Refactor stats haikus and tips to reclaim some compression space
  • Larva birth rate implemented
  • Fish max list count set to 5
  • Lots of rebalancing and tweaking (as always)
  • When creatures eat, their lifespan is extended slightly
  • Increase swarm-xy range - should see evolution over time where insects swarm closer to the rock
  • Increase/rework rand_int range on DNA parameters across all species - should allow greater evolutionary advantages to manifest
  • Repurpose some tips to explain new features

Version 8 | 2021-10-26 | chance_of_rain-8

Dragonfly and fish lifespans

  • Both dragonflies and fish can die of old age
  • Stats for tracking starvation and old-age death stats of dragonfly and fish

Reduce messiness of too many entities

  • Reduced the max list counts of all species
  • Stunned flies in the action area disappear after 83 seconds

Version 7 | 2021-10-25 | chance_of_rain-7

Hunger & lifecycle updates

  • Implement dragonfly hunger (6532->6619 - 87 tokens)
  • Implement dragonfly reproduction/birth (6619->6682 - 63 tokens)
    • dragonflies perform their mating dance near the lillypad
    • new dragonflies are born on the lillypad
  • Add dragonfly birth stats
  • Introduce "well fed" states for dragonfly and fish
  • Add fish birth - 2 fertile fish must collide & tracking stats (6682->6882 - 200 tokens [other stuff was included in this])
    • fertility occurs when a fish is over-fed (well fed)
  • Dragonfly and fish stay fertile until 1/4 and 1/2 hunger, respectively
  • fly fertility color changed to match fish/dragonfly standard
  • track fly and larva birth stats
  • fertile flies are worth an extra 5 nutrition (even if stunned)
  • fix fly and dragonfly despawning bug - rebalance init population sizes and fertility behaviors
  • flies only remain fertile for 10 seconds
  • fish and dragonflies can only be born at most every 60 seconds or 5 mins, respectively
  • flies age slower (hibernate/rest) when its raining too much for them (to help ease impact of long bouts of rain)

Reduce build-up of stunned flies on water surface (introduced in version 6)

  • reduce nutritional values for larva and flies (15&30/35 instead of 20&60)

Big code refactor to prepare for future changes

  • Introduce hunger behavior & refactor fish implementation
  • Reduce token count through some refactoring across the board (~7200->6485) and character count (~63k->58k)
    • mainly removing unneeded variables and functions (prefer inlining)
    • doing some DRY (though this sometimes created more tokens & was reverted)
    • flattening the objects (prefer global) (menu is a good example)
    • doing the math
    • multiple variable assignments on one line
    • introduce "rnd_int" to bucklib
    • comment out debug/unused code
    • remove lillypad movement
  • Deal with char limit reached
    • shorten parameter names in all behavior files
    • shorten variable names (direction->dir, etc)
  • Deal with compression limit reached
    • remove large blocks of comments and some whitespace

Misc

  • add current rain to world stats
  • change display order of world stats - creature-first focus
  • raise rock and lilly max_y to avoid overlapping titles
  • add force option to add_tip - force the wave revitalization tip on first storm
  • completely clear stats buffer on text hide
  • do not allow adding to buffer when stats are hidden
  • force storm when any list is 0 (dragonfly, fly, or fish)
  • introduce max list count for dragonfly, fly, larva, and fish
  • dragonfly draw order reversed so fresh births are drawn below flying ones
  • add additional read speed (1.5)
  • various bugfixes and rebalancing
  • fish no longer feed on larva during heavy rain (>70)

Version 6 | 2021-10-23 | chance_of_rain-6

Code refactor to prepare for future changes

  • Cleanup creature controller code for larva and dragonfly and fish
    • break draw & update functions into encapsulated pieces
    • refactor dragonfly execution flow for simplicity and readability
  • introduce birth behavior
  • introduce collision dumping ground
  • introduce "create_individual" paradigm
  • cleanup unneeded direction delay functions (make anonymous)

Menu

  • Add menu item to show world stats
  • Better behaved text change speed menu item (press left/right or enter to change speed)

Misc

  • Add sticky title to scrolling stats & updated many texts
  • Added to music (still wip)
  • Added a new tip: how to manage a large fly population

Version 5 | 2021-10-23 | chance_of_rain-5

Complete ecosystem failure should be less likely and easier to recover from

  • larva and stunned flies have different nutritional values now
  • fish hunger threshold has been increased
  • if fish population hits 0, a storm is forced on the next cycle
  • if fly population is below 10 (instead of at 0), it gets rejuvenated on next storm
  • ease lifespan suppression for large populations of flies (65->40)

Further limit dragonfly damage to fly populations

  • dragonflies must be in action area to catch flies

Misc

  • decrease frog tongue hitbox size
  • fix lillypad left-drift bug

Version 4 | 2021-10-22 | chance_of_rain-4

Limit dragonfly damage to fly populations

  • Dragonflies can only grab 1 fly per screentime - must carry off-screen to eat

Misc

  • Change tag line from poetic to meditative
  • Add runtime to world stats
  • Music skeleton (wip)

Version 3 | 2021-10-22 | chance_of_rain-3

  • Bugfix "hide tips"

Version 2 | 2021-10-22 | chance_of_rain-2

  • Capture new label image

Version 1 | 2021-10-22 | chance_of_rain-1

  • Bugfix fish starving haiku

Version 0 | 2021-10-22 | chance_of_rain-0

  • Initial release
P#99046 2021-10-22 19:45 ( Edited 2021-11-08 17:17)

Cart #stability_failing_ld49-2 | 2021-10-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
18

Stability Failing

A short story sets off a grand adventure of arcady, platform-hopping fun in an increasingly unstable world.

This is my submission for Ludum Dare 49, Theme: "Unstable"

Controls

Left/Right: Move character
Up/Down: Slow down or Speed up the platforms
Z/X: Jump

Note: you can press ENTER and SKIP TUTORIAL if you'd like to start the game at level 12

Gameplay

As the levels progress, various aspects of the game begin to breakdown...

(try to reach at least level 11 to see the full instability)

Spoilers:


First, your permanent platforms start to crumble. Then, the walls give way while dead-pixels fill your screen. Even your character isn't immune to the madness. By level 11, the game has fully broken down and you play like this for as long as possible. There are bits of story sprinkled throughout, all the way to level 300+.

Here are some examples of later stages:

Features

  • Platforms crumble faster as the levels wear on.
  • More and more dead pixels will fill the screen as the levels progress.
  • The storyline loosely progresses all the way past level 300! I don't expect anyone to make it this far, however it is there for the intrepid - and talented - soul.

Versions

  • Version 2 | October 6 2021 | stability_failing_ld49-2
    -- Extend starting platform size
    -- Add menu option to skip the tutorial
    -- Increased platform fadeaway time from 103 to 133 (eases difficulty of earlier levels)
    -- Increased minimum platform fadeaway time from 20 to 30 (eases difficulty of later levels)
    -- Bugfix horizontal movement
    --- reduce horizontal speed on platforms
    --- reduce slipperiness of platforms (add stick on first contact with a platform)
    -- Bugfix vertical movement
    --- disallow the false double jump
    --- formalize coyote jumping
    -- Bugfix platform collision
    --- normalize player position on first contact with a platform
  • Version 1 | October 4 2021 | stability_failing_ld49-1
    -- Title screen!
    -- Generative music on the title screen
    -- Many quality of life changes
    --- hide text when player reaches mid-height
    --- starting platform normalization when spawned near walls
    -- Additional SFX added & remastered existing SFX
    --- SFX added for holding up/down
    -- New cart cover photo
    -- Revised tutorial & built out storyline through level 300+
  • Version 0 | October 3 2021 | stability_failing_ld49-0
    -- Initial release

External Links

How far can you get? Post your highest level reached in the comments :)

P#98174 2021-10-04 15:58 ( Edited 2021-11-08 17:17)

Cart #isol8_build_isolate-3 | 2021-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

[0x0]

isol8: Build & Isolate

An original arcade game inspired by old-school games like Jezzball and Qix.

How to play

You must build horizontal and vertical walls in order to isolate the bouncing balls from each other. Once all balls are separated, you will proceed to the next level. If a ball collides with your wall while building, you lose a life. An additional ball is added each level, up to a maximum of 15 balls. Continue playing until you run out of lives and post your highest level reached in the comments below!

Features

  • Play with either 1, 3, or 5 lives (Easy, Normal, Hard)
  • Try "Endless" mode where you cannot die
  • Restart current level in the pause menu, if needed
  • Hand-chosen background color and ball color changes every 5 levels up to level 100
  • After level 100, the colors are randomized every single level

Notes for developers

  • A flood-fill algorithm is used to determine if the balls are isolated. Here is a super helpful resource on different implementations of flood fills: link.

Footnote

This game was originally designed for the upcoming Playdate device (crank to build walls). I have adapted it for pico8 as my first game on this console.

Enjoy!

Versions

  • Version 3 | 08/25/21
    -- Added indicator guide lines
    -- Added alternate control scheme (Pause during game and press "Toggle Controls")
    --- Toggles between default (X to build vertical, O to build horizontal) and new (Hold either X/O then press Up/Down to build vertical wall or Left/Right to build horizontal wall)
  • Version 2 | 08/22/21
    -- Added music to the title screen
  • Version 1 | 08/20/21
    -- Bugfix ball/wall collision issue - fix player position rounding error and additional wall overlap check
  • Version 0 | 08/20/21
    -- Original release

External Links

P#96274 2021-08-20 21:47 ( Edited 2021-10-19 15:30)

Follow Lexaloffle:        
Generated 2022-01-28 02:14:03 | 0.083s | Q:28