u/Daniel_Rybe
-
6points
-
61points
Smooth Snake Game with Odin + Raylib (v.redd.it)
- 6points
-
3points
-
10points
The "This video is peak" youtube comments. (self.PetPeeves) [Fairly Annoyed]
-
16points
JRO is so useful (self.tis100)
Daniel_Rybe
Daniel_Rybe
Hi! I didn't use any sprites. For the background, the "apple", as well as for the head, eyes and tail-tip of the snake, I used standard drawing functions that come with raylib. It allows you to draw circles, rectangles and other basic shapes. The body of the snake itself uses a custom fragment shader, which raylib makes easy to use.
Daniel_Rybe
thx!
Daniel_Rybe
If the predictor isn't 100% reliable I suspect that the situation becomes a lot harder to analyze, but if the predictor works by some understandable statistical method, then you are probably correct.
Daniel_Rybe
I understand that the predictor isn't actually traveling into the future and back. I just fail to see a practical distinction between predicting the future, and actually traveling there. If the predictor could travel into the future, it could make a decision in the present based on any info it collects there. But it already can do that because it effectively knows what will happen in the future, at least when it comes to the decision of the player. But maybe I'm wrong, I'm not sure.
i.e. Is there anything that a time-traveling predictor can do that a 100%-reliable predictor can't?
Daniel_Rybe
Even though the prediction is highly accurate, it counts as an external factor thats unrelated to your decision since it happened earlier in time before the game started.
Also, if the predictor is accurate, then that means it can predict the future. Maybe then the common logic that a past event is an "external factor" is less reliable here, as it's not as separated from the present?
What I'm trying to say is that if you can accurately predict the future, isn't it kinda the same as being able to actually travel into the future and back? It allows you to do the same things anyway: collect data about how events will unfold and change your behavior to your benefit.
Daniel_Rybe
What I believe is that what you should do is follow your goal. And your goal is to collect the most money before leaving the room. So since taking both boxes guarantees the most money, you should take both boxes. Even though the prediction is highly accurate, it counts as an external factor thats unrelated to your decision since it happened earlier in time before the game started. This possibly might be where we disagree.
I think that the statement "Taking both boxes guarantees the most money" is false from the perspective of the player.
Is simple words, I believe that the player is effectively hallucinating and perceiving the box as a sort of "magical" object that changes the amount of money within based on the player's decision.
I'll try to explain why I think that:
When we perceive reality, we create mental models for physical objects that surround us and for our own self.
But not every possible physical object can be modeled correctly, that is in accordance with reality, such that their actual physical behavior can be predicted by examining the mental model.
Namely, in order to model physical objects correctly while preserving the sense of self as an isolated entity, these physical objects must themselves be more or less isolated from the inner workings of the brain. Otherwise their behavior becomes too dependent on the functions of the brain to model correctly.
Because the contents of the box depend on the outcome of the predictor, which in turn must be deeply connected to the inner workings of the brain, I believe that the box becomes one such object that can't be modeled correctly by the brain, thus the player effectively perceives it to be magical, and we can no longer use everyday logic to figure out which action is the most rational.
Daniel_Rybe
I'm a one boxer and my argument is a bit esoteric, but hear me out.
Basically, I think that our perception of self, the world around us and rationality itself is not objective, but is really an internal construction of the brain. And when the brain creates this construct, it relies on certain deep-rooted unspoken/unconscious assumptions.
Here I think the important one is the assumption that the internal workings of the brain are more or less isolated from the outside world, which allows us to create a clear distinction between self and outside world, which in turn is what allows us to analyze reality and come up with rational actions in the first place.
I think most of these computations happen unconsciously, which is why when these assumptions are broken, it can lead to paradoxical experiences.
As the predictor becomes more and more accurate, the assumption of isolation becomes less and less true, leading to a contradiction in the way we perceive reality.
At what point of the predictor's certainty can you say that being a one-boxer is the more rational option? Ultimately, no matter how statistically correlated being a one-boxer is to getting one million dollars, it should not affect your decision in the moment.
I can't say when exactly, but my argument is that your brain is trying to present a sensible version of reality to your conscious mind, while preserving the separation of self and the outside world, but at some point the assumption of isolation becomes so unreliable that it creates a contradiction in your perception. Namely, the apparent way in which your decision seems to affect the contents of the boxes.
So from the outside perspective, everything is logical, people get predicted and the ones who pick one box get a million and the ones who pick two miss out.
The perspective of a particular player though is sabotaged and they effectively perceive their decision affecting how much money is in the box. But the outcome is consistent with the outside perspective.
Daniel_Rybe
Thank you though I already fixed the issue with my script, but I'll test syncplay out if more issues arise in the future
Daniel_Rybe
Ah, thank you. I asked the clanker how to use the luasocket library correctly, other than that it's my own code. Edit: I guess calling it my own code is a bit unfair, as it's mostly repurposed snippets from the internet.
Daniel_Rybe
Hi, thanks for your reply. I ended up rewriting the script based on your suggestions and am now satisfied with it. If anyone wants it, here it is:
local utils = require 'mp.utils'
local options = require 'mp.options'
local unix = require('socket.unix')
-- get the socket to connect to
local opts = {socket = ""}
options.read_options(opts, "sync")
if opts.socket == "" then return end
-- establish connection
local client = assert(unix.stream())
local ok, err = client:connect(opts.socket)
if not ok then
print("Failed to connect to Unix socket:", err)
return
end
-- utility functions
local function send_command(cmd_table)
local json = utils.format_json({command = cmd_table})
client:send(json .. "\n")
end
local time_diff = 0
function send_seek()
local new_pos = mp.get_property_number("time-pos/full")
new_pos = new_pos + time_diff
send_command({"seek", new_pos, "absolute+exact"})
end
-- send command to pause/unpause
mp.observe_property("pause", "bool", function(name, value)
send_command({"set_property", "pause", value})
end)
-- send commands to seek 1 per second
local should_send_seek = false
mp.register_event("seek", function()
should_send_seek = true
end)
mp.add_periodic_timer(1, function()
if should_send_seek then
send_seek()
should_send_seek = false
end
end)
-- close connection on shutdown
mp.register_event("shutdown", function()
client:close()
end)
-- keybindings to controll time_diff
mp.add_key_binding("KP_ADD", "watchalong_seek_forward_1", function()
time_diff = time_diff + 1
send_seek()
end)
mp.add_key_binding("KP_SUBTRACT", "watchalong_seek_backward_1", function()
time_diff = time_diff - 1
send_seek()
end)
mp.add_key_binding("Shift+KP_ADD", "watchalong_seek_forward_10", function()
time_diff = time_diff + 10
send_seek()
end)
mp.add_key_binding("Shift+KP_SUBTRACT", "watchalong_seek_backward_10", function()
time_diff = time_diff - 10
send_seek()
end)
Daniel_Rybe
I thought it was some kind of ammo shell with a metal name.
Daniel_Rybe
Not a paradox, but interestingly it does prove that the majority is sometimes wrong without explicitly providing an example of such an occurrence. (If the majority is always right then the poll option picked by the majority is correct, so the majority is not always right. A contradiction.)
Daniel_Rybe
Seems like it's structurally the same as "This sentence is false" paradox. That is you're basically wishing that you wish doesn't come true.
Daniel_Rybe
Sure, I made a google doc because reddit formatting sucks.
Daniel_Rybe
You can just drive all the bits off your second number into the bits of the first. You just need to not do it all at once but with some delay starting with the most significant bit. Also keep in mind that a bulb counter like this works in reverse ( 0 is on, 1 is off, so you have to invert all the bulbs of the first register and the second before feeding it into the first)
Daniel_Rybe
Hi! I'd like to join too.
Daniel_Rybe
Very impressive and cool, but if I may offer a bit of constructive criticism, maybe the graffiti could benefit from a more clear separation between the 'u' and the 'r'? I read it as cololr at first.
Daniel_Rybe
np!
Oh wow, you also posted a snake implementation recently, nice! I's a coincidence, I swear 😅 But yeah, I wanted to make something similar to google's version, so sprites wasn't really an option. I didn't do any sounds though, maybe I should.