I opened the mac version on linux and ran it with Love. Didn’t get any of the weird visual artifacting but the basic game worked.
notapipe
Creator of
Recent community posts
Thanks! This was helpful. Now I’m currently on my v4 and used your great tips for shrinking setting the enemy positions and having them move 4-ways only. I also used your tip to set the temp vars in init too.
I updated the code above.
I’m still having some issues with the GOTO jumps after reading a bit but getting stuck on the limitations with nested functions. I only want the enemies to move only one step rather than continuously and wasn’t able to get this to work correctly.
Okay, I’ve shaved off a bit more. In the end, I moved the score in the location of the ‘cat’s tail’ (let me shave off the last 2 chars.
r,x,y,f=rnd,3,3,1function _init()
e={}a=r(8)\1b=r(8)\1
for i=1,5do repeat e[i]={x=r(8)\1,y=r(8)\1}until e[i].x!=x or e[i].y!=y end m()end
function _draw()v=btnp()
if(v==2)x+=1m()
if(v==1)x-=1m()
if(v==4)y-=1m()
if(v==8)y+=1m()end function m()d=16for y=0,114,d do for x=0,114,d do
fillp(r(9999))rectfill(x,y,x+d,y+d,2)end end
?"▒",a*d+4,b*d+5,9
?"🐱"..f,x*d+4,y*d+5
for j in all(e)do
j.x+=r(3)\1-1
j.y+=r(3)\1-1
?"😐",j.x*d+4,j.y*d+5,8
if(j.x==x and j.y==y)stop()
if(x==a and y==b)f+=1_init()
end end
Thanks, this helps a lot. I’ve implemented all of these except the GOTOs. Can you explain more about how that works?
I added in checks to make sure monsters don’t start on top of player when new level drawn.
Current code, 507 chars:
r,x,y,f=rnd,3,3,1function _init()
e={}a=r(8)\1b=r(8)\1
for i=1,5do repeat e[i]={x=r(8)\1,y=r(8)\1}until e[i].x!=x and e[i].y!=y end m()end
function _draw()v=btnp()
if(v==2)x+=1m()
if(v==1)x-=1m()
if(v==4)y-=1m()
if(v==8)y+=1m()end function m()c=114d=16for y=0,c,d do for x=0,c,d do
fillp(r(9999))rectfill(x,y,x+d,y+d,2)end end
?"▒",a*d+4,b*d+5,9
?"🐱",x*d+4,y*d+5
?f,2,2
for j in all(e)do
j.x+=r(3)\1-1
j.y+=r(3)\1-1
?"😐",j.x*d+4,j.y*d+5,8
if(j.x==x and j.y==y)f=1stop()
if(x==a and y==b)f+=1_init()
end end
One of my faves from class! Love the creepy factor! The turning and movement work extremely well. This is great on fullscreen mode. In terms of your screen tearing, I didn’t test it myself but I wonder if basically you can restrict the camera to follow up to but not exactly to the edge.
I thtink there is a good balance of difficulty but maybe a little more tweaking could be done. THis is always a hard part: finding the ‘goldilocks’ challenge level.
Overall, really nice work.
Your images here look really nice! I agree that it is easy to quickly build a mess of colors. I think building up so you don’t make a mess of dense cloud of colors is a challenge and probably takes some practice. I’m trying to get better myself. Having some nice routines that you can return to and gradually morph between might be one way to deal with this. Naoto Hieda does a nice job of manipulating hydra in intentional ways that are sharp/precise. You could check out their videos and tutorials for some ideas.
There’s also nice ways to integrate hydra and p5 together! And Ted Davis has a nice interview with Processing on this. I also like this unique tutorial on text collage with p5 and hydra by nervous data.
Hey, excellent visuals and ‘polish’ to the gameloop with start and endscreens as well. As you mentioned, you would benefit here from balancing the challenge. It’s too easy! :p Some sound would be fun too. I love your use of dithermark to create variants.
One simple thing would be to add an attribute like flipped to each squirrel. If moving left then flipped should be true and you display the sprite facing to the left. Otherwise, display right-facing sprite.
You could load two versions of the image. Some game engines have a way to flip sprites. I don’t think p5 does natively but one option:
if (facingLeft){
//need to add push and pop if woven into a larger program since scale will affect other draw functions afterwards
scale(-1, 1)
image(img,-width/2,height/2);
} else {
image(img,width/2,height/2);
}
Heheh, Alfie really gets knocked around in that last one.
Nice work building little learning modules leading up to the final version. Also, great work integrating lerp() for some more natural movement. Now you have a nice bag of tools. This is some good pre-written code that can be adapted for lots of projects going forward. I think slowing it down and adding your own graphics and more of a procedurally generated environment would be obvious next steps if you wanted to go further with this kind of thing.
I love the variety of output (sizes, positions, amount) this produces! Obvious next steps are to have them move, maybe with perlin noise or perhaps another algorithm.
Could use a simple countdown timer similar to our life timer we did in the last class on particle systems for having animations like rolling up.
Good list of links! How’s it coming along?
Not to add more to your plate, but you may also like puzzlescript.
As we discussed in class, I really love this one, and my appreciation has grown for it over time too! A great procedural system. We talked about a lot of ways you could keep building on this, with different names appearing at different times, more random timer triggers, and maybe even different people and different positions they pop up, and more names available potentially. To have it work more ambiently with much longer time between the graff writer popping up would enter the more ‘screen saver’ realm, which I don’t mean as a negative here. IT might let this have some breathing room and work in a more exhibition context.
The trippy flower and green matrix are cool effects.
Take a look Javascript tips section of the Hydra book to see how you can place different subprocedures into functions that you can independently call. Might help you automate/build up a workflow for live performance:
Nice! The challenge level is about right. My high score:
This is a pretty faithful recreation of the original. I think it works pretty well. Some minor improvements would be consistent icons/images, add sound.
The movement works well. One thing to consider would be diagonal moving (and could be reused in other programs as well). If that was the case
I made a little example of one way that could work. There are more sophisticated ways as well:
//moving on a diagonal
let x,
y,
xspeed = 0,
yspeed = 0;
//i left out setup() boilerplate
function draw() {
if (keyIsPressed) {
if (keyCode == RIGHT_ARROW) {
xspeed = 2;
}
if (keyCode == LEFT_ARROW) {
xspeed = -2;
}
if (keyCode == DOWN_ARROW) {
yspeed = 2;
}
if (keyCode == UP_ARROW) {
yspeed = -2;
}
} else {
xspeed = 0;
yspeed = 0;
}
x += xspeed;
y += yspeed;
circle(x, y, 10); //or draw player here
}
Yeah, it’s a great idea to do more of these. Past Merveilles jams/projects include:
- Merveilles Hyperjam in 2020 (which is how I learned of Merveilles).
- Elmet Brae: eb01 the land (current link to original site ) in 2023
- various Drawtobers
- informal Merveilles logo variants on Mastodon (a few examples at the bottom of Devine’s page on Merveilles )
It’s kind of great to see the path of the penguins!
I enjoyed this one! The rotation adds a lot. It will be cool to start to add in other behaviors (flocking), or potentially a finite state machine. For example, maybe the penguins follow the season, nest, breed, offspring are born, fishing, swimming, etc.
I think this is a cool approach to data visualization explaining social conditions or communities, and love that you’ve focused on rap here. This is very much in line with the Rap Research Lab. You might dig their projects.
Rap Research Lab is a community-based creative technology studio that uses a Hiphop framework to develop new ways for people to engage with data and culture.
One of their projects was the Mapper’s Delight.
Red/blue can denote gang afiliation, not sure if you meant to refer to that but maybe other colors would remove this connotation.
P, this is incredibly cool! I love the idea to incorporate poetry in this. It’s brilliant. Here’s my recent run.
This is cool as-is, but one thing that did come to mind was the idea potentially to have text fade after a certain amount of time.
Really nice work.
I think you’d like the work in the HTML Review. And maybe we can brainstorm some ideas for the next issue of Random Walk.
Thanks for this step by step description. Nice approach to figuring out the northerly approach of the iceberg, trying things out, doing some research, and trying again. It’s a good way to try to figure out how to combine these two different ‘random’ noise generation techniques.
You may have to turn on markdown mode for your code in these devlogs!
This produces really nice output. I love the slow-moving icy little berg. I know you said you weren’t implementing collision detection here, but I thought I’d drop this useful link in case you’re interested later. It’s for Processing, but could be ported to p5.js (or maybe someone’s already done it). Here is the point/triangle collision detection algorithm.
Thanks, I will direct folks to use environment variables in the meantime.
Sorry to jump in with another thing. This is a bug report I received that I’m passing along. No expectation that you have to fix but an FYI and my apologies for the length:
First I ran the game with `strace ./sfp` and among all the output, two
| interesting lines showed up:
|
| openat(AT_FDCWD, "game//news/2025-01-07.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied)
| --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xc0
|
| So I did an `ls -l game/news/` and among many others:
| -rw-rw-r-- 1 jules jules 652 Jan 7 00:15 2025-01-07.txt
|
| It seems that the news for that day is generated when the first player for that
| day logs in, and this file is created with the user and group of the player
| playing. The perms are 664 for some reason and not 666, which is not normally
| an issue because usually reading the news is enough for other players.
|
| Note that the openat() call specifies "O_WRONLY" or "write-only" however. I
| noticed in the past that if a player levels up a skill, this is shown in the
| news. Updating the news to reflect this requires write access to the file, not
| just read access. However, if the player who leveled up is not the same person
| that logged in for the first time that day and created the news file, the news
| for that day cannot be updated due to lack of write permissions. The game fails
| to take this into account and ends up crashing.
|
| Running the game with `gdb ./sfp` shows where the game segfaults more precisely:
|
| Program received signal SIGSEGV, Segmentation fault.
| __vfprintf_internal (s=0x0, format=0x530cc6 "%s\n", ap=ap@entry=0x7fffffffa160, mode_fl
| ags=mode_flags@entry=0) at ./stdio-common/vfprintf-internal.c:1218
|
| s is basically the location to read from, but it's 0x0 or NULL, and trying to
| read from that location results in a crash. My guess is that it is trying to
| print the news it just tried to write...? Not sure really.
|
| I kinda wrote this for myself because oddly enough I enjoyed figuring out why
| the game was not working for me, but maybe we should send this to the author
| of the game as a bug report?
|
| So basically I need to be the first one to play the next day or else I can
| never play again. Unfortunately, if another player levels up the same day then
| the game will crash for them. Hm.
Hi, I’m playing this and it’s really fun. I’m enjoying this as an ambient game I can play off and on and grow in. The different places to leave messages for each other and compare notes is great as well.
I installed this on a tilde server where I’m a user without sudo privileges. I found the sysop guide helpful and we have a number of players on the server. My question is about how the game can be launched from outside the directory holding sfp
. When any user (including myself) tries to run ~username/sfp-directory/sfp I get the following error:
`@ERROR: no game data folder exists at 'data//sfp'. Ensure you are running this
`2from the root folder of a game install.
Ideally I’d like to build an alias on the server so that would trigger running ~username/sfp-directory/sfp from anywhere without first requiring players cd to the folder which is just enough friction as to discourage new folks from trying it out, I believe. Is there a workaround that would permit that?