shadows — Multiplayer Shadowy Halloween Maze Game!
fuzzyastrocat (1867)

Welp, I misread the timestamp on the bramjam, so I guess I can't submit this, but I'm posting it here anyway! ( @bramley that is right, correct?)

This was a little experiment in raycasting and FOV graphics. The goal is to get to the green light at the end of the maze... the problem is that you only have a tiny lantern which casts light in one direction! So, it's basically a maze game where you can't see the goal, only what you could see in real life. Sounds fun, eh? :D

There is a server, so you can race your friends to the end. Additionally, you can drop beacons to help others out... provided that you're going the right way!

Gameplay Images



Controls:

  • WASD/Arrow keys to move
  • SPACE to drop beacon

Enjoy!

You are viewing a single comment. View All
realTronsi (923)

But just to be safe still send your submission to him via email

realTronsi (923)

@realTronsi btw is this non euclidian? the map seems to change everytime I loop around. Anyhow really nice simplistic graphics!

fuzzyastrocat (1867)

@realTronsi No, it's not non-euclidian. But there's quite a few similar paths, which would explain what's going on!

realTronsi (923)

@fuzzyastrocat ah okay lol, I got slightly confused, are the spawnpoints the same?

realTronsi (923)

@fuzzyastrocat and the raycasting is done on the client side?

fuzzyastrocat (1867)

@realTronsi Yes, so you could "hack" the graphics. But you can't hack the movement since that's all server-side.

realTronsi (923)

@fuzzyastrocat yeah, I mean I understand why you choose to do it client side, it would be exponentially harder on server, but just slightly disappointing lol

Still very good though, maybe you could make a version where your lanterns light up the map for other players as well

(also I see you used msgpack! basically no one uses msgpack for websockets except for me and the people I've talked to lol)

fuzzyastrocat (1867)

@realTronsi I'm not really sure what the value of doing it server-side would be.

That was planned, I just didn't have time to implement it. I was also worried that you'd end up with a situation where there's a billion players all lighting up the maze, which ruins the fun part.

(Lol it's so useful, mega compressor)

realTronsi (923)

@fuzzyastrocat yeah true, server side would be hard, but I have this idea of just sending the line segments over. The math might slow things down a bit considering this is repl, but otherwise it should actually not slow down too much

fuzzyastrocat (1867)

@realTronsi The math is surprisingly fast, and I've got it at a ray density where it's good enough that weird things don't happen often but it's not extremely slow.

realTronsi (923)

@fuzzyastrocat well what method are you taking? I never tried raycasting but I think I know the ideas behind it. If you use line intercepts, which in this case you could easily do so since all the walls are perfect mod 90 and the player rotation is also stored, it won't be a toll on the server

If you're just doing like a while loop and incrementing some coordinate by 1 each time then seeing if it is on a line or something, then that's really inefficient and slow

fuzzyastrocat (1867)

@realTronsi OH gosh no, that's not at all what I'm doing. It's just "do math and boom insta-get the coordinate of intersect":

// the math part

const den = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
if (den == 0) {
  return;
}

const t = ((x1 - x3) * (y3 - y4) - (y1 - y3) * (x3 - x4)) / den;
const u = -((x1 - x2) * (y1 - y3) - (y1 - y2) * (x1 - x3)) / den;
if (t > 0 && t < 1 && u > 0) {
  const pt = new p5.Vector(x1 + t * (x2 - x1), y1 + t * (y2 - y1));
  return pt;
} else {
  return;
}

And I still don't really get how having it on the server would help. It'll just mean a lot more socket traffic. And doing those calculations has basically no performance drag on the client.

realTronsi (923)

@fuzzyastrocat well the point of having it on the server is so people don't cheat, because that's really what makes multiplayer difficult.

I mean with raycasting on the client side, although from a efficiency standpoint it might make sense, but people are able to cheat the main theme of your game which is quite unfortunate

fuzzyastrocat (1867)

@realTronsi Ah, I see. Well, since there isn't any points system or leaderboard, I couldn't care less if people try to cheat. All cheating at this game does is make it boring, so honestly they kinda deserve it if they try.

realTronsi (923)

@fuzzyastrocat okay. kinda like how people cheat Among Us lmao. But just an fyi for the future though it is the best practice to keep everything that affects gameplay on the server side

fuzzyastrocat (1867)

@realTronsi Ye, that's an issue I'm having to deal with on Askew

realTronsi (923)

@fuzzyastrocat mhm, to be fair the other main reason that thes gameplay affecting things are on the server side is for uniformity, so that people don't have different results or displays due to different framerates, systems, etc

fuzzyastrocat (1867)

@realTronsi Yeah. I always do that though, even if I do things client-side I use time delta to normalize everything.