Log In  
Follow
Powersaurus
Follow

Cart #portalsaurus-1 | 2021-10-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

Cart #portalsaurus-0 | 2021-07-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

Intro

Recently I decided to dig into portal renderers and start to build my own, inspired by this excellent write-up of BUILD. This is currently work in progress, no guarantee it will turn into a full game but thought it was interesting enough to share.

I used a lot of stuff from other projects

From Caped Feline Arena

  • Player movement
  • Floor and sky casting
  • Palette functions

From Cab Ride

  • Palette

I also revisited Lodev's raycasting articles, specifically the code to render sprites without fisheye distortion as they behave similarly to the ends of the walls.

Implementation Notes

01/10/21

  • New features including
  • Variable height sectors!
  • Distance based lighting!
  • Large performance gains!
  • Island sectors!
  • This is all thanks for being a bit smarter about how many walls to cast each ray for
  • After flooding portals, the walls of each sector are grouped into subgroups (referred to in BUILD terminology as 'bunches')
  • The bunches are ordered near-far (thanks to traversing the portal graph)
  • Island sectors get inserted before other bunches an enclosing sector (this would cause glitches with concave sectors, out of scope for now)
  • Walls within a bunch are ordered near-far, and projected into screen space, where they are further chopped down, grouped by walls that touch at one end
  • Portals take account of differences in sector height - this allows for doorways/overhangs
  • A very simple buffer keeps track of which x coordinates have had a wall drawn, to prevent overdraw of walls
  • Rays are cast for the walls nearest bunch (from the lowest to highest x coordinate). If a hit is recorded, the 'x buffer' is updated, so no further drawing happens - that coordinate is now occluded
  • Palette is set for each vertical slice of wall, based on distance from the camera

Original post:

  • At the moment it relies on casting a ray for every column of the screen to determine which walls to draw
  • One wall per column at the moment
  • Casting a ray traverses a subset of potentially visible walls
  • Potentially visible walls are calculated by traversing the portals in the world structure, starting with the 'sector' the player/camera currently occupies
  • World is represented by sectors, which hold references to a set of walls that border the sector
  • A portal is a wall shared by two sectors
  • Traversing the world tests which walls of a sector are in front of the camera, if any wall is a portal, it is currently discarded and the connected sector is visited, up to a hard limit of 10
  • The current sector of the player/camera (or starting sector for rendering) is determined by casting a ray to the left and the number of intersections with walls is counted. Even means outside the sector (and connected sectors are tested), odd means within the sector. A short description of this is found in the 'Inside a concave polygon' of the BUILD write-up
  • The world is created when the cart starts and builds a model of how sectors are connected to each other
  • tline() is used for floor and sky
  • No collision detection currently

Controls

  • Arrow keys - move around
  • X - toggle map view (off by default)
  • C/Z - strafe

Next up??? Maybe?

  • More performance
  • Sector based floor textures
  • Collision detection
  • / 'Island' sectors for columns
  • Basic level editor
P#95261 2021-07-25 07:30 ( Edited 2021-10-01 14:19)

Cart #cab_ride-6 | 2021-03-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
104

Drive a train, forever, through a dreamlike land.

Transport passengers to their destination.

Watch the world go by.

Listen to chilled out chiptune music.

In Cab Ride you can drive thousands of different train routes through rolling hills, winding tunnels and weaving between the tall buildings of vast cities. You can drive the train for as long as you like. When you're ready to end your journey, hold down the left arrow key to announce the last station. Stopping at stations along the way means you can pick up and drop off passengers. Try and stop at the marker at each station for a high rating. Or don't! It's up to you.

Cab Ride is a casual train simulation, not aiming for real world accuracy, but like a real train, it takes a while to brake. If you're overshooting stations, watch for the alert for the next station and reduce the throttle so you're ready to stop.

Controls

  • X - horn/start/restart the game
  • C - open/close doors at station (must have stopped just in front of signal)
  • Up - increase braking/decrease throttle
  • Down - accelerate/increase throttle
  • Left - hold down to announce the last station (will end the current journey)
  • Right - turn Express mode on/off aka Screensaver Mode

Version history

v1.1

  • Added - second track with train
  • Added - Weather - different cloud patterns and periods of rain
  • More performance fixes

v1.0.3

  • Changed - tweaked station stop ratings - slightly more forgiving and more consistent
  • Changed - all green signals when you're in express mode (after first couple of stations)
  • Fixed - all passengers would eventually get off if you opened the doors enough times at a single station
  • Various performance improvements

v1.0.2

  • Added - pause menu sound toggle - deals with no hardware button in mobile view - may fix in a different way in future
  • Added - 'very chilled' mode - no goal/help messages, no HUD other than station name messages, just driving trains - good for screenshots or screen savers (even better than what I claimed was a good screen saver mode before)
  • Fixed - another way to drive through the last station (activate Express mode after announcing last station)

v1.0.1

  • Fixed - crash bug where you could drive out of the last station when in 'Express' mode
  • Changed - you now have to hold down the right key for 2 seconds to enable Express mode (announcing the last stop also has a 2 second delay) - this is to prevent ending up in that mode by accident and locking the controls

v1.0

  • Initial release

Credits

Programming - Ben Jones / @Powersaurus Twitter

Music - Stephen 'rych-t' Jones / Twitter / Soundcloud

Based on code from the Pseudo-3D Racer tutorials by Tom Mulgrew/ @Mot https://www.lexaloffle.com/bbs/?tid=35767 licensed under Creative Commons 4 (CC BY 4.0) https://creativecommons.org/licenses/by/4.0/

Pre 1.1 version

v1.0.3

Cart #cab_ride-5 | 2021-02-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
104

P#86966 2021-01-30 16:09 ( Edited 2021-03-13 22:56)

Cart #caped_feline_arena-3 | 2020-07-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
20

I'm still working on this (-300- nope - 5 tokens left :D ) - let me know what you think here or on my Twitter - there might be bugs and/or unexplainable weirdness!

You're a cat, you're magical, you're in a duel with the finest feline magic practitioners the realm has to offer. Grab your wand and enter the arena!

Controls

  • Arrow keys - move
  • X - strafe/sidestep (press left and right)
  • Z/C - shoot

Use the PICO-8 menu to disable AI to wander round the maps, and to toggle overhead view.

What's new?

12 July 2020

FIXED crash bug when dropping the quad

11 July 2020

  • ADD single player red+blue keys+doors!!!! Check single player test map for an example
  • FIXED showing scoreboard upon being frogged in single player.
  • No more tokens left!

09 July 2020

  • ADD light viewbob
  • ADD damage indicator
  • ADD new map Tower Of Confusion
  • ADD basic single player map support (with sample map)
  • ADD 1 second delay on scoreboard
  • ADD 1 second invulnerability on respawn
  • CHANGED cat AI tries to find a wand if possible/pick up your stuff after frogging
  • CHANGED player movement
  • CHANGED minor texture improvements
  • FIXED Particles obey zbuffer
  • FIXED Sounds cutting off
  • FIXED Cats using incorrect palette when far away

Since April (v early itch.io release) I have:

  • Added several maps
  • Rewrote chunks of the graphics for more speed and more complex geometry
    -- diagonal walls
    -- working overhang textures
    -- faster ceiling rendering
    -- tline() floors/sky
    -- tall ceiling indoor spaces
    -- doubled texture limit from 16 to 32
  • Added 3 extra wands, and items
  • Improved sounds
  • Better AI
  • Better controls

Still to do

  • More maps
  • Map editing guide
  • More sounds
  • More textures

Credits

P#78599 2020-06-28 05:12 ( Edited 2020-07-12 01:11)

Cart #tline_rotation_demo-0 | 2020-04-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

I was excited by the new tline function in 0.2.0, immediately tried to plug it into my project and ran into problems.

I made this demo to break down rotating the map to a fairly minimal program. I've added comments to explain the different data points and what they achieve when plugged into tline.

The demo shows a rotated 2D view into the map.

Left and right keys move the view. X toggles the unrotated map to show the direction of the rotated view relative to the map.

I hope this is useful to you! :)

P#74994 2020-04-19 18:16

Cart #road_rex-0 | 2019-06-15 | Code ▽ | Embed ▽ | No License
11

ROAD REX
After a day's work Road Rex just wants to get home like everyone else. Road Rex is a giant dinosaur with laser eye beams.

Get home as fast as you can! Beat your arch-rival, the quick and messy Blue Dinosaur (tm). Stop tv traffic choppers from getting footage of the mayhem you cause. Try not to get a speeding ticket from a speed camera (speed limit is 70mph in the UK) - but if you do, make sure you do it in style for extra points. Shove cars out the way and spill delicious lorry loads of kebabs, shoes and beans. Try to exit the motorway in the left lane and don't get lost!

Controls

Arrow keys right and left - accelerate and decelerate
Arrow keys up and down - switch lanes, aim lasers
X - LASERS
Z/C - charge jump (release to jump)
Credits

By Ben Jones (Powersaurus on Twitter)

P#65223 2019-06-15 21:54

Cart #47475 | 2017-12-17 | Code ▽ | Embed ▽ | No License
4

Parking Masters is a game I made over a weekend for a friend's birthday. Said friend is fond of driving and once took a photo of his car parked very close to another which has become a running gag (many ridiculous photoshops).

I have turned the photo into a little arcade game/"very serious" simulation of parking in a manual car. I thought it would be a fun thing to do, turn a photo into some sprites for a PICO-8 game. Pleased with the results - photo-realistic action!

Controls

Up - gas pedal
Left and right - shift gear
X - Clutch
C - Brake

Park as quickly as you can, as close as you can! Try and avoid stalling and also from shunting the other car!

P#47401 2017-12-15 10:07 ( Edited 2017-12-19 01:11)

Cart #41233 | 2017-06-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Aim
Score 10 belief points by keeping your followers happy. They like trees and plants, and eating tasty corn. They don't like swamps, being stuck in one place or things being on fire. You can also win by making your opponent's (Omnicow) followers unhappy.

Controls

Arrow keys - move
Z - use power
X - change power

Story

Once, Henry was just a regular pig. He dreamed of being a magnificent wizard who was popular and cool. Through the sheer force of his own will and the belief of the nearby villagers, who saw promise in him - he became a giant flying head with reality bending powers. Summoning a mountain from the earth, he marvelled at his power.

"I will use my powers for good, and make my followers happy, with lovely forests and magical instant-corn from the fields"

As he said this, the earth shook and a giant cow's head appeared from behind the mountain he had just conjured, spitting fire from its eyes"

"Or maybe I'll just ruin someone else's day"

Powers

Raise power (yellow mana) raise the landscape. Followers cannot walk up steep slopes, and any upward slope will slow them down
Lower power (yellow mana) lower the landscape
Fire power (red mana) Create fireballs from your eyes. Destroys terrain and foliage
Forest power (green mana) Puts out fire and creates new foliage. Cleans out swampy land.
Rain power (blue mana) Puts out fire and cultivates fields that yield follower-pleasing corn. Too much rain makes the land swampy though.

P#39703 2017-04-15 18:28 ( Edited 2017-06-08 15:42)

Cart #38011 | 2017-03-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
12

Demo cartridge for creating 2D terrain. I'm using this for my own project but thought it would be useful for others. If you think you'll find it useful, please use in your projects. :) For more information see here - https://medium.com/@Powersaurus/journey-into-the-hills-part-2-8a209905d3de

Controls:

X - Regenerate landscape
Left/Right - change graphics mode
Up/Down - change amount of randomness

P#38013 2017-03-03 13:17 ( Edited 2017-03-09 08:37)

Hi all!

This is my first finished PICO-8 cart.

Its an arcade game where you high five and fist bump cats.

High five the cats with your hand moving at speed for more points. Build up a combo to get a chance to pull off a secret handshake.

Controls:

Arrow keys - move hand
X - Switch arm position
C - Switch between open hand and fist

This is version 1.1 - I tweaked the hit detection for high fives and added a tutorial skill level.

Hope you enjoy it! :)

P#37520 2017-02-16 12:19 ( Edited 2017-02-22 11:46)

Follow Lexaloffle:        
Generated 2021-10-24 02:35:46 | 0.106s | Q:42