I recently made a little 3D thing and after it took off on twitter I was asked to write up how it was done.
Please note though, that this was basically my first 3d-thing, so I'm likely not using all the right words. :) I started by jamming around with Zep's 3d dot party template and ended up with the above.
Anyway, as most things - it is not as complicated as it looks. It grew quite organically, but it boils down to these steps.
First I made sure I had a working grid.
I wanted to have a height map, so I used the sprite sheet to draw a very simple repeatable map.
Every tick I look at a slightly different position in the map, giving a nice scrolling feeling.
But it looks a bit dull, so I wanted to add some movement. This was done by applying a cos and sine function over time.
As it still was a bit static I also added a slight sway to the camera.
Adding it all together ended up with this very living scrolling thing. Since the sine and cos waves doesn't have anything to do with the terrain and run on a different frequency it looks very alive and smooth.
I'm pretty sure the whole thing can be done faster and better, but hey - if it looks right on the screen... ;)
Happy to answer any questions if needed.
This is an old cartridge my brother and I never quite finished because we hit the token limit. I am not very pleased about how it came out, as I don't have much skill in level design.
The name is a play on the Nighthawk, a version of the Blackhawk helicopter for the Navy. My dad flew them, so I went with that as the name.
Knighthawk's theme was inspired by a board game called Scythe. Scythe had great artwork, and I believe the game was based on the art. All the art in Scythe was painted by Jakub Rozalski. I loosely tried to follow the theme of the art. If anyone wants to know why I chose an orinthopter, it was because it seemed to fit this theme. I hadn't read the Dune books at the time, though I have started reading them last week.
The main mechanic of Knighthawk is to swap between weapons based on the situation at hand. Use X to do this.
Each weapon has strengths and weaknesses. No enemies have resistance or vulnerability to a certain type.
The boss at the end is a bit tough, and will follow you around to a certain extent. This boss really doesn't fit the rest of the game's theme, but was an attempt to make the player face a smarter enemy rather than a bigger one.
If you just want to goof around I left the invulnerability toggle in the pause menu.
"Oh My Blob!" is a turn-based puzzle action game where you play a knight fighting against a horde of different kinds of blobs.
X/O: Skip a turn
Levels 1-17 are complete, after that it just ends unceremoniously with a glitchy screen. If you go back to the menu and select a level, you can also try levels 20, 26, 28, 29 for some previews of upcoming blob types.
I'd love to get some feedback on how it feels, if you get stuck anywhere, if you feel like you're learning how the different blobs work and so on.
Thanks for looking!
My Father died nearly 20-years ago from today. Outside of my Sister and my Step-Mom, they are the only family I have now.
I remember my Step-Mom sending me the classic poem from Robert Frost.
And I remembered ... I remember when I was young.
So ... in tribute, I have two programs. One is to try and recreate that very program for the TRS-80 I typed in those so many years ago - and to have it run at the same speed.
The other is something a bit more magical. A year after the funeral I wanted to make SNOW, real snow, on the computer, and as accurately as I could. A majestic tribute to my Dad and that program typed in from so many years ago.
So I watched the movie, "Dr. Zhivago" and watched very carefully the snowflakes in them. One frame at a time. For many long days I studied their movements - and wrote down in my notes what I saw and what I observed.
 Few videogames to date apparently really follow the accurate movement of snowflakes.
 Some fall as fast as raindrops, big ones I believe.
 They do fall a bit slow and fast, based I think upon their shape.
 They are very light and airy and a slight wind will completely alter their course.
And today, I have what I believe is quite accurate for movement in snowflakes. And I had it available for GWBASIC in my S2 project, I had it for BlitzMAX, and now it is available - to you - for Pico-8, changing the math slightly to accommodate the larger pixels.
Please enjoy ...
I have never really liked to write code in BlitzMAX despite the fact it can work with a screen of 1980x1080 with true 64-million color pixels for a very simple reason. It takes time to compile the code and test it.
About 5-seconds to be precise, and that includes finding errors, even for a 2-line program.
My programming style if you are curious is a little like a rabid rabbit. It's like I take a cracker, nibble on it, look at it, nibble on it, look at it again, and nibble a little bit more.
That is - I write a bit of code, run it, add a bit more, run it again, then add a bit more.
My Dad was the opposite in that he could sit down and write a flawless program from beginning to end and NEVER have to run it once until he knew it was completely done. I can't do that.
So ... Pico-8 is a bit of my friend now for as you know when you RUN or press CTRL+R the language is already off like a shot and running.
Therefore I decided I could use it to write my Pico-8 website of favorite games.
And indeed I did.
All I'm doing is taking my text data file of:
# of stars author's name name of cart description of cart Actual cart ID name Website where cart appears
Have a blank line separate, and then give the data for my next favorite cart if there is one, run my program, and the HTML to show what you saw above is saved and written.
So I wrote a program in PICO to read that text data and create a HTML file that has a neat and ordered table appear with the graphic cartridge and if you hover over any of them, you will get the number of stars, name, description, and author.
I even wrote it so it sorts all the data from highest number of stars to then on down so I don't have to do it myself manually. I could make it alphabetically sorted if someone feels slighted. :)
Here then is the program:
Naturally it will not work in the BBS and is expecting a text file called, "list.txt" which has data as I described above. You need to LOAD this in immediate mode in PICO as follows:
Here is a sample of the data to see what it is reading when it writes back, "web.htm"
list=[[ 41 Alfonzo's Bowling Challenge kittenm4ster Not your average bowling game. abc-0 https://www.lexaloffle.com/bbs/?pid=66371 12 Jack Of Spades BoneVolt Turn-based RPG using playing cards. jostitle-5 https://www.lexaloffle.com/bbs/?pid=65294 ]]
You must have your data appear exactly like this. "list=[[" two open brackets, blank line, the cart info, another blank line, and two ending "]]"
Once your TEXT data is complete, save it.
Bring up NOTEPAD++ if you don't already have it open.
Open that TEXT data in there if you haven't yet done so.
Select from the menu, View, Show Symbol, Show All Characters.
If you see CRLF inverted then select from the menu, Edit, EOL Conversion, UNIX/OSX Format.
Then you should see only LF inverted which is the correct carriage return for PICO-8. CTRL+S to save.
Now, run my program. You can set DEBUG=1 to see each and every cart as it is processed. DEBUG=0 will just blur through everything and compile it quickly.
In your filer, delete "web.htm" if it exists. Rename "web.htm.p8l" to "web.htm"
Open "web.htm" in Notepad++ if you haven't yet done so. If you have and it's different from what the engine just created, you'll get a notice that the file has been modified and would you like to reload it ? Select YES.
Check the appearance. If the title's first character appears like this, â150â then in the menu select, Encoding, Encode In UTF-8 Without Bom.
Then all the special characters will change to their designated icons. ⭐ and 🎮
Bring up your free website. If you can't think of any may I suggest TUMBLR ... or do you know of a good free site to build your website in ? Tumblr is 100% free and allows true HTML paste - which is what we need here.
In your "web.htm" tab in Notepad++ press CTRL+A to select everything there. Then CTRL+C to copy it to the clipboard.
Then in your internet browser in the area where you can type raw HTML for your custom website, press CTRL+V to paste the contents of web.htm directly there.
Save it, view it, enjoy it. :)
Please let me know if you do decide to use my code to build your own website or to assist you in this endeavor, I'd be curious to see it !
Once again, comments, questions, or kerosene. Let me know what you think !
Here's my first video game with Pico8!
I know it's not very impressive but I hope
you'll have fun playing !
By the way I'm sorry the menu is in french,
guess I forgot to make the game in english,
next time will be better !
Defend the hen house from foxes uwu
Please let me know what you think in the
comments down below ~
up arrow/down arrow: zoom in/zoom out
left arrow: show/hide debug information
z: multiply gravity by 10
x: turn off gravitational influence on player
So, this is my second post. This time I'm posting some WIP of a gravity simulation I'm writing.
I'm not sure if this will ever turn into a game, maybe I'll just keep it as a "toy".
If you read "The Three Body Problem" by Cixin Liu and ever wondered how the trisolaran solar system worked, then take a look at the orbit of the planet in this simulation and imagine what it would be like, living on this planet. ;)
This cartridge implements a gravity simulation using a kind of modified newtonian gravity to make the simulation more stable for a simple toy like this.
Right now, the cart starts in "debug" mode and draws the field lines of the gravitational field as well as the current field line at the player position and the current acceleration of the player onto the screen. If you press left arrow, this debug layer is hidden.
The simulation coordinates and the drawing coordinates are decoupled via a global scaling factor. This makes it easy to implement a zoom function just by changing the scaling factor.
If you're interested in seeing different situations, you can easily add more gravitational bodies by calling 'create_body(x_position, y_position, mass, color)' in the _init function. The cart will automatically add this new body to all calculations.
Okay, so there's a lot to talk about here, so I'll split this one up into subsections
I'm using the velocity Verlet algorithm to compute the gravitational acceleration that acts on the player. The advantage of using velocity Verlet is, that it is a symplectic solver. This means that energy, momentum and angular momentum are actual conserved quantities like in real life even over long simulation times. That's an advantage over the simple Euler methods as well as over more complex Runge Kutta methods, making the whole simulation much more stable.
I am however only applying this gravity to the player character, the other stellar bodies are fixed in place and are not updated using this algorithm. It would be easy to implement a full n-body simulation, but for stability and simplicity, I opted to make only the player a dynamic body.
Modified Newtonian Gravity
You might be familiar with Newtons law of gravity. If you're not then just know that according to Newton the gravitational force between two objects is proportional to the distance squared of the two bodies. So if x is the distance, then the force/acceleration will go with 1/x^2.
The "problem" for a toy model like I'm programming here is, that for small distances x<<1 this force/acceleration becomes huge. At that point you're not only running into floating point errors, you're also bound to get a very unstable system where the player planet will be slung out of the "solar system" because the force was so big. To get any kind of stable system, you would have to really carefully tweak the starting parameters of the simulation.
In real life this "problem" is solved because everything on unstable orbits got either slung into the sun or out of the solar system, so now only planets with stable orbits remain. In the simulation I really don't want anyone to wait around for billions of years to find some stable orbits.
So how do you make the simulation more stable while mostly adhering to Newtons law of gravity? The answer is simple: replace the 1/x^2 Newtonian gravity with a modified 1/(b+x^2) with a small b (if you know a bit of math: the shape of this function is the shape of a Cauchy-Lorentz distribution curve). If x is much bigger then b, then this is approximately the same as 1/x^2 but for very small x this b prevents the force from becoming too big (as the biggest possible value for the force is 1/b for x=0).
In analogy to field lines in electromagnetism, I decided to draw gravitational field lines to depict the gravitational force. This is trivial to do, every celestial body added to the simulation also adds 16 points along it's surface as origins for field lines. At those points the direction of the gravitational field is checked, a scaled unit vector along the same direction is drawn with a line command and at the end of said drawn line, the field is check again etc.pp.
To save on resources, this calculation is only done whenever a new celestial body is added. The field lines are static afterwards, so no need to calculate them each frame.
I also thought about representing the gravitational field via equipotential lines, but the computational expense to solve the implicit function would be much bigger, so I decided against it.
So, there is a parsing bug with the unique "+=", "-=", "*=", "/=", and "%=" PICO-8 flavored lua syntax. In normal lua, something like this:
is valid syntax, treated as two separate expressions. That works in PICO-8, but this:
throws a syntax error. It's odd because this:
does not throw a syntax error. It seems to be only with the unique PICO-8 equals operators and directly after square brackets.
Fixing this could benefit people working on tweet carts as well as carts that are token & character/compression sensitive.
how to play
Use z to accelerate and the arrow keys to turn.
this is my first post here, so hopefully I'm doing everything correct.
I discovered PICO-8 around two weeks ago and was intrigued by its design philosophy. As someone who is only interested in Game development as a hobby, I love that basically all tools needed for developing a small game.
So I've been playing around with the program for the last two weeks and decided that the best way to learn how to use PICO-8 (and Lua, as I never used that language before) was to develop a small game.
The result is this small racing game against the time (as I don't have any idea how to write an AI for a racing game) with two tracks. The gameplay is nothing to write home about but I'm still quite fond of the end result.
In principle it's pretty easy to add more tracks, just "draw" them on the map screen with the sprites. However, I didn't bother to write a code that automates the finish-line or the creation of checkpoints along the track, so those have to be set in code.
Some small things I personally find neat:
Upon loading a track, the game checks for any audience sprites set in the map editor and replaces them with animated audience objects.
The animated audience will slowly bob up and down if the player is far away and will bob up and down fast and throw confetti if the player is close by. The confetti is done using a simple particle system, randomly spawning in particles with a random velocity and a fixed acceleration along the y-direction to make the particles "fall to the ground".
The distance to the player is checked using a modified Euclidean norm (basically n(x,y) = sqrt(x^2 + (a*y)^2) with 0<a<1) that deemphasizes the distance in y-direction. As long as the audience is mostly setup along a horizontal line along parts of the track that go along x-direction this means that the audience only reacts to the player as he's/she's driving past them but the player doesn't have to be super close to the curb in y-direction.
When the game detects a collision with one of the barrier sprites, the corresponding sprites are are replaced by "broken" versions of the object.
I used the particle system to draw tire tracks behind the car. Unfortunately handling the tire tracks this way it was too much of a drain on the performance to have them permanent.
Made this little cart as I was working through coding a look-at type function. Wanted to post it in case it's helpful for someone.
This type of functionality is useful for all sorts of things. Maybe you just want one character to look at another or a gun barrel to follow the cursor etc.
The more I've been experimenting with the #INCLUDE command, the more I'm realizing that when you compile to an executable that - well ... you're not.
You can test this quite easily by using my homebrew Pico-8 compiler.
It's very simple.
-- external p8 compiler -- written by dw817 -- note: you must compile this -- program to exe in order to -- use it cls() repeat flip() until forever
First, type out this code in the P8 source-code editor. Don't add anything else.
Save it. Run it. Press F7 for a screenshot even though nothing is there.
Now remove those 3-lines of repeat, flip, and until forever.
Go to sprites, mapper, sound, add stuff if you want. You don't have to.
When you're done with that, return to the sourcecode and add just below cls() the line:
Now save this to a filename as a normal .P8 first. You'll get a warning that "could not #include file: source.txt". But don't worry about that. It worked. Then export as an EXE.
Now with your normal filer, go inside the directory with the EXE, bring up NOTEPAD++
If you don't know what this is, you should get it. It is quite possibly the most powerful text editor on the planet, and it's 100% free.
Right, now start typing the source-code you want to have. Could be your own program. If you want sprites, mapper, or sound, you need to have created that above before you compiled to EXE.
Here is a sample program to test:
repeat for i=0,127 do for j=0,127 do pset(j,i,rnd(16)) end--next j end--next i flip() holdframe() until forever
Now in NOTEPAD++ make sure you are saving LF only, not CRLF or CR which cannot be read in Pico-8.
To do so, click in the menu, Edit, EOL Conversion, and UNIX/OSX Format.
To ensure this is the case, from the menu, click, View, Show Symbol, Show All Characters.
Your custom program should now show an inverted LF to represent carriage-returns.
Save it as the filename, "source.txt" Make sure it is saved right where the EXE is located.
Now, you've saved your source-code which could be anything at all. It's time to test it.
Run the executable.
You will see your program run.
This points out something rather important. When you compile to an EXE it is apparently including the entire P8 system instead of creating an EXE that truly does bind your exact source-code to an actual original executable. otherwise it wouldn't know how to interpret the source text you just gave it. And it does.
Now this is not unknown behavior. Other languages I've programmed in such as Delphi Noetic F-Basic for the Commodore Amiga and GFA-Basic for Windows 3.1 all do this.
GFA was clever to create really tiny executables that worked so long as you had on path the main 3-megabyte DLL runtime library.
And we've seen this in countless interpretive programming languages. Both Integer and Floating Point Basic for the Apple ][ and GWBasic and Q-Basic for DOS.
So the real question now is, is this a security breach ? Possibly. Someone could indeed compile to an executable a blank program like I wrote above and then use an editor like NOTEPAD++ to post to SOURCE.TXT and run the executable each time to see their Pico-8 work executed.
Obviously this does not include the slick sprite, map, sound, and music editor. But it DOES work to compile any source-code at all.
Comments, questions, or kerosene ?
I wanted to share a little work-in-progress I've been tinkering on.
Dungeon guy doesn't know what he's searching for. Maybe treasure? Maybe a way out? Maybe dungeon girl?
All he knows is to keep searching.
Levels are randomly generated and get progressively larger.
The only objective so far is to find the key and the exit door.
Nibble in Cyberspace: #Digipres Adventures, Volume 1
Nibble lives in cyberspace but their very reality is crumbling before them. Help Nibble fight entropy itself by following good #digipres practice - collect strategy and policy to actively tackle the degradation of the digital world around them. Along the way, avoid all the risks, viruses, physical damage, power surges; and try and get your score high enough to avoid the complete collapse of cyberspace.
Nibble is an infinity game. The game will eventually self-destruct, but can you prolong its existence by following good practice?
Nibble in Cyberspace teaches players that good digital preservation will help our digital materials last longer, but there is a cost to inaction as well. Players are invited to get the highest score they can before the eventual collapse of everything around.
After all, you can't beat entropy, but you can fight it as long as you try.
Notes on game-play:
In-game memory is actively corrupted as the player hits digital preservation risks such as viruses. Memory is corrupted at random. To a limited extent the player can "put memory back" by looking for good digital preservation practices in the game. The random decay of memory is designed to demonstrate to players the effect of bit rot in real time and demonstrate how its effect will be insidious, and different every time.
A Nibble is a 4-bit subset of a byte (8-bits); part of a byte.
Thanks all for checking out my first game! I've a few things to iron out, and some code to clean up. I'm hosting the game on Github as well Github Pages. I'd love your feedback, and hopefully I'll wrap this up and place it into the finished carts soon enough.
If anyone else has done any similar work, corrupting in-game memory, then I'd love to hear more and play those games also. One of the things I am looking to do next with nibble is protect the nibble sprites themselves so they aren't corrupted as the game progresses. I'd like to explore other corruption methods as well.
Anyway, thanks again everyone. Keep up the good work.
A few months ago I started trying to combine the flexibility and conciseness of both ECS (Entity-Component-System) paradigm and prototype-oriented programming (of which Lua is famous). After several iterations, the framework, which is named Fila, began to take shape and even gradually surpass my initial expectations. So after spending quite a few time writing the demo, I think it's time to share it to all of you.
To be short, Fila is not a framework built based on some foundation of software development such as OOP. It's designed to be the foundation, just like OOP, ECS and prototype-oriented programming. As a result, you don't need to know any of them to be able to understand Fila. What needed is a completely (or partially, maybe) renewed perspective of how the data and logic could be organized. This is where Fila looks really different from other programming paradigms:
If you are familiar with OOP - In Fila there is no class, every object (named fila) can be a class, or properly speaking, a template for its child instances. (Lua developers should be quite familiar about it - this is what metatable does!)
if you are familiar with ECS - in Fila there is no system, every fila can be a system, or properly speaking, can match and inject desired logic (rules) to its child instances.
When I was writing the demo of Fila, I was amazed by how elegant and intuitional it was to model the real world we are living (thus the game world). The only problem is that for PICO-8, taking up 2471 tokens for a mere framework is simply too much...So if performance is not your major concern (maybe also secondary XD), feel free to delete all the lines of code started from '-- Event Bus' and only use normal groups to inject your logic, which will save you total amount of 1049 tokens (you will understand what I am saying once you read the demo code in the 0 tab of the cart. And trust me! It's really fun to read).
All feedbacks and contributions are welcomed. Furthermore, since English is not my mother tongue, if you find any grammatical mistakes or typos in the repo, feel free to make a pull request.
Zep, your front page HERE:
When I click on any of the games, the middle screen stays dark and does not load any game as intended.
I'm using Windows 10, 64-bit, Firefox Quantum v69.0.
If it doesn't work here chances are it doesn't work there for someone else. Thought I'd let you know ...
. . .
Solved. Just needed to clean the internet cookies for Firefox. Runs well here now.
Now that I've learned where the files are located, I've started to put together a little engine for myself that can create a nice list of Pico-8 games.
Here is what I've done so far:
sorry, had to shift some things around.
Hover over the cart to get a brief description and list the author.
Unlike embedding once you click the game it goes straight to the post in Lexaloffle where the game was released so not only can you play the game but read the author's comments, comments and questions from others, if you're logged in get a chance to add your own comments.
Special thanks to kittenm4ster and BoneVolt for their excellent programming and carts in the current list.
If it all looks okay, feel free to reply and post your game information and I'll add it to the list.
All I need is the URL address of where your game is (in Lexaloffle), it will look like this:
http: // www . lexaloffle.com / bbs / ?tid=00000
That and a brief game description of your game if it's not already included on the page, and that'll do it ! I can code the rest and feed it into my database.
If you're curious (not now but later) the list will be sorted by highest number of stars and go on down from there.
Or would you prefer they appear in the list on a first-come first-serve basis as they are now ?
Here is my table so far:
41 Alfonzo's Bowling Challenge Not your average bowling game. kittenm4ster abc-0 https://www.lexaloffle.com/bbs/?pid=66371 12 Jack Of Spades Turn-based RPG using playing cards. BoneVolt jostitle-5 https://www.lexaloffle.com/bbs/?pid=65294 3 The Dead Should Die A demake of the ghostly children in Little Nightmares, The Depths. dw817 tdsd-9 https://www.lexaloffle.com/bbs/?pid=67442 31 Not A Creature Was Stirring (...Except Squeaky Whiskerson and his Marvelous Musical Mice!) kittenm4ster nacwseswahmmm-2 https://www.lexaloffle.com/bbs/?pid=59784
If I can remember I'll try to inject the list in every evening so you should always have an update and new cart every morning when you go to the game page.
. . .
Going to add the ability to sort the list by stars. I'll even post the code that is doing all of this once done. That's right, a Pico-8 program builds the HTML website !
Tried to make this pretty faithful to the original although I think it is too easy. Per the original there are two alien deployment patterns that alternate on levels. The large yellow UFO's also deploy as in the original. And the point value for the UFO's changes depending on the shot number you are on. Hint: 16th shot for max value.