#programming
1 messages · Page 74 of 1

I have figured out ethical anti piracy
I just encrypt all my games assets (llm, images, audio) and the encryption key is the persons steam ID
what
If you share a copy it of the game you are also sharing your steam id
but everyone has different steamids
Yea
burner accounts?
no this still doesnt make sense
if the idea was so you could figure out who leaked it if it gets leaked
why wouldnt you just decrypt the game with your steamid and then post the decrypted files online
instead of the encrypted ones and the key
also you can't serve a different bundle to every user afaik
i have like 4 steam accounts
You'd need to grab decrypted assets from memory
Patch out the steam Id check thingy
And patch out the decryption thingy
can you not decrypt it on disk
are you baking all your assets into the executable or something
That's already the idea but its possible to get those assets
why would i use your launcher to decrypt it when i can do it myself
i think the point is that they are encrypted on disk and get decrypted when loading into memory
but why would i use your loader at all if i have the key and know the encryption
Ye
You can get the assets using your steam id but not the game code
but still, you can only serve one bundle per branch & you can't generate branches for each user on the fly
you can just put the launcher only on steam and serve the game files third-party
then i'm not buying the game in the first place xd
what why
that sucks
wait till you see paradox games
i have and they do download the game files through steam no?
When you download from stream you are given the game code and a one time use key
And on first launcher the game code sends the key and id to my "very secure" server that then sends pre encrypted assets
wait so
your gripe is just
that the particular server the updates come from
isnt steam
i want the updates handled by steam, if they had a system to plug third-party sources i wouldn't mind
So each copy can be traced back to a user but also run offline (you just need WiFi for first run so it can grab assets)
i still am pretty sure this can be decrypted easily enough at rest
I doubt I'd ever need to update assets so updates can be done with steam
i expect the games to update automatically without having to launch the launcher
reverse engineer the decryption routine
which has to be unencrypted or trivially encrypted at rest
and then implement it yourself externally and write the results to disk
You can decrypt assets but you'd need to patch my game code to expect decrypted assets
how is it more or less ethical than anything else
I just got a Corsair Vengeance LPX 2×16 Go 3200 MHz CL16 for 90$ at best buy xD. Luck
#programming really is the twitter of neurocord
because none of us know how to socialize
i dont think this would be too hard in practice
i assume you have a centralized asset loader
and are not implementing it differently and separately for every asset or asset type or something like that
I'm just encrypting assets with traceable data while a lot of games want you to always have WiFi or whatever
That's a good idea
dont tell me you requested this only to donowall it
You can't patch it out if there are like 700 loaders
it changes nothing even if i crack the game in the most naive way possible by hardcoding the steamid, what will you do with my steamid? as i said steam accounts aren't really PII nor are they valuable
trivial enough too to make a burner steam account just for buying and leaking this game
I'll probably use this and a second method
still seems a bit overcomplicated
i would, instead of jumping to the game start address, encrypt that address with the steamid as the key
then if the steamid doesnt match, it jumps somewhere random or out of bounds in the code
and probably crashes
very simple
who cares if someone leaks the game assets if the game doesnt start
very simple to reverse too 
yes but i showed the previous idea was also easy to reverse
evidently that wasnt a large concern
keep the goalposts where they are
That's a good idea. If company can get away with selling buggy software, why can't I? 
I can probably use a separate asset loader for each asset then change each one just enough so it'll require effort to patch them all out
another idea
convert the steam id to a sequence of bytes
then find all instances of that byte string in the code and remove it
save the address of each in a list somewhere
then on start, the steam id of the user is converted to bytes and patched in at each address
incorrect steam id blows up the game
if the steam id isnt found anywhere in the executable, increment it and search for that new id byte string somewhere in the code, if found then repeat same process but save the increment to enable reversal
steamid is 64 bytes you're probably not getting a single match even then, or do you mean hash
☝️
It will take a very very very long time for a single match
me waiting for the server to increment my 64byte steamid enough times before my game starts downloading
the real flaw is that if two people get their game copies together, they can likely patch the gaps
but then at least you need a collaborative effort to pirate the game
at least two sales per pirate

There are 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096 combinations of 64 bytes

It will take a while
then use half the steamid
you can configure this
tradeoff speed for security
up to u
oh i'm stupid it's 64 bit
i was going to say
why did they name it that
115792089237316195423570985008687907853269984665640564039457584007913129639936
64 byte steam id would be crazy
you could also precompute the set of all 64-bit sequences in the executable
That makes sense
then sort the list and for a particular steam id, take the next sequence greater than it
and use the offset technique i mentioned
maybe valve went crazy on futureproofing
then its very easy
0 tech debt 
why waste 56 bytes when you can fill the entire cache line 
64 bits is only 18,446,744,073,709,551,616 combinations
I think we will run out of possible steam accounts very soon
There are 8000000000~ humans and everyone needs a steam account (basic human right)
So there are only 18,446,744,065,709,551,616 steam accounts left
as i said i have 4 in my immediate possession, and more are lost to time
So we have even less
and i don't think that's very uncommon to have multiple
I gotta email gaben about this issue before the earth blows up or whatever happens when we run out of steam accounts
steamuuid 
everyone's steamid should be replaced with a (unique) 2048-bit RSA public key
there are plenty of those and they are also practical
Might not be enough
smh at least do 3072
Then again we have declining birth rates so if we are careful then we won't run out until humans are extinct
will each atom in the entire universe have 10^500 accounts or what
Well apparently its common to have multiple accounts so I don't think we have enough unique possible accounts
|| (BTW I am joking if you can't tell) ||
that's still more than enough btw
Hello guys

Hello!!
Hi
Hi
have you finished the project yet
?
Nothing:3

Time to charge google for scraping 
they have web bot auth system
probably won't charge for recognized crawlers like web archive etc
or else this would get blamed quick 
chat I have a problem
I have locked my keys in my room and I am on the wrong side of the door
Window
screen
Climb through your window
screen
?
there's a screen in the window
Seems like it might be user defined? At least from what I'm reading
This guy
My idea was better
Just duck tape the door back together
I HATE AUTOCORRECT
IT IS TRYING TO GET BE BANNED
I saw the notification and my brain lagged

lol
closer to evening here
hi shiro
hi!
I just saw a picture before, which said to wish Shiro a happy birthday every day
lol

i must regret to inform you
it is not my birthday every day
regardless of what propaganda you may have seen
its fine 

alright, since i talked about backups here previously, figured i should send my final msg on the subject here for now
nah it just means i've managed to get it working
got cloud backups working! currently using a hetzner storage box and then encrypting my content via rclone crypt
seems to work like a charm
Congrats. You have a better backup practice than ~70% of #programming
i dont even version control

nevermind backup
I can't be arsed to do it 
i dont wanna store the backup anywhere
i move too often for physical media to be worth keeping
hetzner storage boxes are pretty cheap ngl
Yeah, there's also backblaze for personal computer backup

For server they did charge a bit more
i'm paying like £4/month for 1TB of storage with no egress fees
anyway, you wanted that screeps server right? i'll be looking into it tomorrow

Birthday gift for shiro lol

this cold backup is gonna take a bit, but that's standard for cold backups
i was trying to figure out what the break even time would be for this service
but if they're using tape drive storage, it might only take a year
hetzner is one of the biggest companies for hosting
Probably not
why not?
i imagine they may be running storage boxes at a loss
if its meant to be infrequent write
They just have that much storage
storage boxes is their answer to "i need massive amounts of storage but not in s3"
it's meant to be used in combination with their servers
but you can easily use it standalone
Cloudflare has R2 but its not meant for backup
i wonder what the highest information density storage medium is currently
having a value for the lower bound of the volume of a bit sounds amusing
For backblaze its B2, their backup solution is a separate service
cloud
i didn't go for backblaze cos i've heard issues about cancelling
Something etched to some crystal
they gaslit me into uploading all my screeps code here
and then didnt even look at it


but i also need to throw linux onto a box and config with pterodactyl daemon for mc server hosting
should be straightforward enough
I told you to make a github repo. Not upload it here 
if you own the game there's literally a "start private server" button
so standalone cant require that many libraries
It is not THAT straightforward. But yeah, I think it is not that hard either with container
Notably the steam web api key
i just accidentally shutdown my machine and terminated the session running the cold backup
This is the thing that I mentioned yesterday. The server need to authenticate to steam, so when running it from steam it is easy because the launcher can use the currently logged it user session token. But for standalone without steam installation, not so much
Mhmm, so this is what makes you Vedal987 mod
Shiro with VCS
vcs? i just dont make mistakes
i understand that not every coder is ready for that tho

Says the person that edited his message 
that apparently INCREASED the eta

(it decided to find like an extra 100gb of my data)
alright, gonna let that run overnight
probably the crash log from the last attempt
nah, that's not backed up to where i store local backups from the pc

Reminds me of Konii fast implementation of memory leak
"implementation of memory leak"
I think it was 1GB/s of memory leak
void leak() {
malloc(8);
}
not just any
Why is typing on as phone with wet haa nss sso hars
it was fast
Here is the criminal
im not a criminal im konii
each library needs a memory leak implementation!
hmmmm
something for new contributors to try fix
i was trying to overcome the yes per second of the gnutils yes command
cap := 1
loop {
malloc(cap)
cap *= 2
}
optimal amortized growth


i was gonna do something similar but the other way around
because this doesnt leak all the memory
you'll have a bit left over
what if you spawned cap more loops each loop
fork bomb
And now we discuss the best implementation of memory leak
void leak() {
long long size = 1 << 64;
while (size > 0) {
while (malloc(size)) {
// :D
}
size >> 1;
}
}
What is enub 
still leaks memory 
Benchmark how fast it is
how do you even benchmark that
That is the metric we use
do you just spin it up in a vm and see how long it takes for the vm to crash
If konii can do it, so can you 
m
i value my system
you know my mem leak wasnt even that bad
my system is just fast enough that i can do this 500 million times a second
This implies konii didn't, what is the defendant has to say about this?
the audience doesnt need to know about the amount of RAM i have
yo
yo
oi
Thats your answer shiro. Have a RAM in the order of TB. Ez pz 
does anyone here knows how to do domain forwarding with masking (in cloudfare
solution to memory leak is to outscale the memory leak
leaking 1gb/s? buy 100tb of ram and you have 27 hours before your pc dies
Not a bad one either. Wasn't it used somewhere in a control system? Where a memory leak occurs but the system will never run for that long anyway
veedol
add-on info: i did try create a cloudfare worker, however i dont see any places to actually let me add a code
I forgot about his memory leak lol
is it really a leak
he even leaks his ip to neuro lol
its more like an open window
eliv is hungry feed her more memory
So
Fun fact
Our country has laws, EXPLICITLY stating that black magic is illegal
Bro, my country is cooked 
And to be clear, not black magic the company
aww
update on screeps
i added a new class of miner, the "static miner"
inspired by what i saw other players doing
having the miners both collect the resources and carry them back is inefficient, as they only use their WORK parts while mining and only use their CARRY, MOVE parts while bringing them to storage
so if you split this process into one creep that mines and one that hauls the goods back, you can get max usage of each part
i already had logistics units that could reallocate resources between storages
but getting a miner with no legs to the mining site was a tricky problem
ended up adding another function to the logistics creeps which lets them carry any creeps that request a drag
this not only solves this problem but generalizes the solution for future use
Starting to think of specialization now

not even close to addicted
im only rank ~1000 on the leaderboard
out of uh
1100

id like to see them try to take my fortress now
oh frick i should probably untick that box
wait
why is it on for every single object

please i dont want that many emails
better figure out the API calls to turn them all off
i did
but it costs an unacceptable amount of processing time
so im just gonna have to eat emails ig
new outlook rule
screeps -> spam
Ah yes, we love 1 dmg attack spam
if ("PANIC" not in email body)
Rolling out a custom email client to do logic on screeps notifications, couldn't be me
the intelligent thing to do would be to not provide your email to the optional email field
i, however, am not in the business of intelligent things
just nuke it at the email server level lol
thank god i have this set at least
True, I should roll out a server for screeps
☝️
So, shiro, still not uploading it to github? I'm willing to concede to google drive even, or onecloud like what Sam did with his repo

why would i want this code somewhere that people could easily associate it with its author
because you are very proud of your work most likely 😛
yeah im also a multi millionaire
kick ass
screeps progress update
nothing is working anymore
i didnt even change anything
?
ah
i see
a while ago a creep wandered into another room accidentally
this just happened to coincide with the unit queue function
clearly you've never actually leaked before
which then queued units to spawn in there
but then the code didnt filter by room when counting how many units of a particular role were in the spawn queue currently
which biased how many units were set to be spawned
actually no thats not true
i filtered already
🤔
shiro
scrub
your leak code doesn't work
left shifting by bit width is UB
but also, 1 << 64 results in zero because you shifted the bit away
also also, malloc takes size_t (usually ull) instead of ll
fuck size_t
malloc will take whatever the fuck i want it to
because im using C
also
yeah it should be 1 << 63
#include <stdint.h>
#include <stdlib.h>
void leak() {
size_t s = SIZE_MAX;
while (s > 0) {
malloc(s);
s >> 1;
}
}
better
still bad
wont work
you'll have memory left over
🥱
mine leaves no crumb remaining
fine
#include <stdint.h>
#include <stdlib.h>
void leak() {
size_t s = SIZE_MAX;
while (s > 0) {
while (malloc(s)) {}
s--;
}
}
that will fill every single memory gap
malloc is both fun and annoying
though I can say that the biggest C project I worked on had 3 people including me on the team
every memory leak was caused by the others, and I wrote over 50% of the total code

wait no I think I had a single memory leak
that project was really fucking cool though and I would totally share it with you if my IRL identify wasn't tied to it
ignore the typo in the automod logs
surely balenaEtcher will work this time
and doesn't suck ass still
turned on my laptop and it thinks it's may 14th
this thing lives 1 day at a time
Come to Indonesia 
sounds like a fun vacation
Big C energy
Just avoid international tourist trap and you'll be fine
the current state of the empire
i think i have the second best screeps colony in my novice zone
only bested by this guy who is absolutely insane at the game
"""novice"""

i would've loved to stay up to see ift he new miners i made actually work
but i need sleep
ill just have to trust in my coding skills

Are you? 

it bed time
overnight I expect the builders will complete at least the first energy source container
and perhaps start the second
good night shir
but it's a gamba whether or not anything else will work:
- will static miners be added to the spawn queue?
- if so, will the AI error out when they are produced?
- if it doesn't, will it work correctly as written?
if it does all work then I'll be rich when I wake up 
if it doesn't then I'll have lost an incredible amount of energy overnight 
I definitely do think this is the future of mining tho
we just make creeps with no legs or spine
whose jobs are solely to extract energy
and then we have creeps that are only legs and spine to come collect all of it
can creeps work while being carried?
and can they carry while being carried?
they should be able to work while being carried, yes
Sounds cursed ngl
Creeps centipede
I don't know if they can carry while being carried
nor do I know if there's a use case for that ultimately
Less processing power
it's not less sadly
and would only be applicable in the oddly specific situation everyone is going to the same place
So marching army
further, you need MOVE parts to drag other creeps
but at that point, you yourself can walk
When on the way, they could create a trains of screeps
so you don't need to be dragged
stop trying to justify trains I agree it would be cool but we're going for practicality here
But it is cool AND practical! 

you can make all the trains you want when the screeps server goes up
which may be tomorrow
I'm going to make some abomination of a code for sure lol
I'm not good with AI programming, mostly I do data processing
this isn't exactly what I do for a day job either
I mean hell
I don't need to tell you my code is stapled together
is all up there somewhere
Claude sped up my shitty hand-written CUDA kernel by 7000x 
Morning
even the goat lucidrains uses claude for triton kernel

Shiro, if you're awake later and still wondering about the high density information medium, it reminds me of this story posted here before about a man with his brains compressed to just 10% of average size
https://www.sciencealert.com/a-man-who-lives-without-90-of-his-brain-is-challenging-our-understanding-of-consciousness
"french" I need no more 
:xdx:
Gleam JS interop sucks
static types do NOT map well to JS APIs
I want my Elixir back 
Unironically really interesting story
See, technically its also evening here
I just have a bad sleep "schedule"
Its 10am here rn
I probably will ruin my sleepchedule as soon as i have the chance
So im not too woried
Ill be home friday next week
Mornin
definitely more interested in screeps if we have our own server
chayleaf meow
We will
Cloudburst will make one
And otherwise i will
I will have to find a way to use a sane typed language though
Wasm
Use c and emscripten or whatever
TypeScript works well if you count that as "sane" 
If you do you should lay off on the counting
it's leaps and bounds better than implicit casting NaNs to strings

meowification of #programming 
The Banach–Tarski paradox is a theorem in set-theoretic geometry, which states the following: Given a solid ball in three-dimensional space, there exists a decomposition of the ball into a finite number of disjoint subsets, which can then be put back together in a different way to yield two identical copies of the original ball. Indeed, the re...
its like the chocolate thing
how do you expect me to stay sane when learning fixpoint and order theory
doctored image

Can also recommend, you can also get really in depth and advanced with some of the farming algorithms
Shiro will have 2 full time job
I liked programming with scratch when i first started
I have a book on it somewhere from when i was 7 or so
This one
Came out in 2016 so i was 9 then ig
I already have two
my actual job and screeps
You should welcome the 3rd then 

correct
rip
is it very expensive to play Creeps ? Cause when i checked the game on steam it said something about limited cpu and then the fact that there are items you can buy for real money to get unlimited cpu ?
by default you get 20ms of cpu per tick that you can consume
you can pay more to get more cpu per tick
what exactly does this even mean ?
1 moment
You ever program something? A CPU time is how long the program is being run by the CPU
basically, 1 tick per second
you get 20ms (max sustainable) to do computations
you can use up to 500ms per tick but it will only regen the bucket up to 10 seconds (based on limit - amount used on tick)
if you pay for an upgraded cpu you get more than 20ms that you can sustainably use (/ you regen cpu usage faster)
Yeah im a cs student, but i didnt know what this means in the context in the game
the static miner now requests a drag as intended
but iirc shiro has mentioned you can get temp cpu upgrades via an ingame currency too
also 20ms is a decently long time
dragging isnt working
yes 
people can buy CPU unlocks with real money and sell them on the in game market for other resources
it does happen but the prices are uh
reminds me of hypixel skyblock
reminds me of bonds in runescape
Mhmm, same as in the real program for the cpu time
It is a programming game after all
So even if you buy the dlc for additional cpu time, unless you write a good algorithm, you're getting rolled anyway
And the DLC/micro transaction thingy only valid on official server
Peak addiction
ok i had to fix one more bug
because i didnt refresh a cached value after fixing this bug last night
but now its working
🔥
Ahh, yes. One of the two hardest problems in CS. Cache invalidation
Cache 
other than that tho
its actually working now
i can already tell this is so much more income
the miner can now have twice the mining speed since it doesnt need movement or carrying parts
and it can stay mining 24/7 since it doesnt need to transport the resources back
and i already had logistics units which handle that transport so its no extra cost to facilitate
added to the list of ideas to steal
the only catch was coming up with a way to drag these miners to the energy sources since they're immobile
and also ensuring there is a container built beneath their work location so the energy dropped doesnt decay
my stats say 2.7 energy per tick
insane
thats usually way lower, if not negative
this should have some snowball effects as the next units produced will reflect the new amount of resource availability
very exciting
cant wait to see what this place looks like when i get home from work today
Get to work, coding, back at home, coding 
Recreational programming 
i didnt even think about it until now
but it means my miners dont need to make regular pathfinding calls anymore either
im probably saving CPU
The thing that takes up most of the compute lol
But also since the location of the resources are now fixed, you can safely cache the road to them for even better (less) pathfinding call
ehhhhhhhh
pathfinding caching seems complicated and annoying
i still wont do it

my priority is adding things to use my spare CPU
not trying to save more
im only using about 15% of my CPU budget per tick
holy
almost up to 3 energy per tick now
net, not gross
I'm giving up on Gleam, the ratio of effort spent writing the bindings to making Creeps do things was too high, like 10:1 
the static typing simply doesn't work well with the Screeps API, and for some reason Gleam does not have maps as a native data type, so everything you could possibly want to do with an object requires a new function
no maps?
off to try ClojureScript instead
anything except actually playing Screeps 
last place on the leaderboard
i need to change the logistics creep code when i get home
currently when transferring between storages it takes only what it needs to fill the destination
but for transferring from these mining source containers on the outskirts, its much more time effective to fill inventory before returning
TypeScript whispers from a distance
Dumb question but I'm curious cause I prefer compiled languages. Could you "compile" code down to IR code, and then from there to JavaScript, just to save a few more percent of CPU usage for the game?
You sure it won't blow up the pathfinding call again? 
screeps accepts wasm modules too
:O
That's called wasm
That's huge
Yeah obviously but didn't know it accepts that
someone made Rust bindings too
this embed is stupid
(which compiles down to wasm modules)
(yes, that's why I mentioned it)
I like the logo
(are this the new trend?)
Little Ferris all over it 
every unit we're producing is double size
once we get around to upgrading the logistics unit and static miner unit, income will skyrocket
this is only one energy source using this method too, the other is waiting on the container to be built
cinema cinema cinema
logistics creep died
its over
huh, they do have a map in their stdlib
is it not dynamic enough for javascript or what
ok now we are talking
all the keys must be of the same type and all the values must be of the same type.
ok last change
modified unit spawning code to target 1 logistics unit per container
now i go work

well yeah
that's how maps work
is it because objects in js are super flexible and you can just throw in anything
Isn't that how maps work...?
and Gleam is the complete opposite
i guess that's true, you can't use javascript's Map in screeps
when they're statically typed, yes
in for example Elixir they're dynamic
i don't get it either, how is it a problem
why do you need to represent js objects as maps
that's what structs are for
Gleam does not have structs
I ignore anything dynamic. Languages with dynamic typing need to be eradicated. 
what does it have 
records are basically structs
records
yeah, but I'm pretty sure they don't map 1:1 to JS objects, because they're more like enums internally
so I can't just have a Creep record type with the appropriate fields
it has to be opaque with functions to access the fields instead
sounds like a skill issue to me but i haven't looked into gleam at all so
that sounds fair though you'd do it the same way in something like rust
it's not that it's impossible, you can do it
I have a generic JS object type too that would allow working with pretty much anything
it's just a lot of bindings to write 
yeah, except there somebody has already done the work 
Gleam has like 3 users, nobody uses it for anything
Btw mlnt, I'm too lazy to look into it further now, but when to use rspack vs rolldown?
I shouldn't have believed
Got it, so its a preference then
I haven't look further into rspack
Which is why I'm asking. Because I'm on mobile and don't want to read the docs on tiny screen
But good to know, thanks
Thank god its not another exception to keep in mind about JS quirk 
i'm like a reasoning llm i like to overly doubt myself
I'm rooting for rolldown just because they are being used by vite lol
but the difference is that rspack is a webpack compatible api
so you can drop-in replace webpack
baited 
i should've probably mentioned i've never actually used js as a target with gleam 
Yeah, I don't need webpack and the mess that it entails. Sure it has a richer ecosystem, but also the baggage pre ES6
i shit you not "front-ops" is a term i hear used around me in professional circles to refer to people who specifically specialize in this, like devops
i don't identify as such
like how convoluted does an ecosystem need to be to have a separate title made up
know what they call them around my circles? junior devs
nah i doubt a junior dev is a webpack wizard
self inflicted wounds
sounds like a job for code generation 
With LLM, you may as well be webpack wizard through vibing
you know
if screeps cpu unlocks can be purchased with real money
and then sold on the screeps market for credits
then the screeps credit is backed by the US dollar
which makes it a pretty strong currency
maybe that someone should consider the value a good therapist can add to your life
senior yaml developer
chayleaf

I'm doing the programmer thing where I work on something easy to avoid working on something hard

fixing the economy stuff is certainly useful but it's a much more critical need to sort out my defense affairs
bikeshedding and NIH are the two inalienable rights of every programmer
I wonder if creeps can be pulled across room boundaries
I wish I could push creeps instead of pull them
imagine somebody eventually finds your base shiro and all they do is leave a message that says "HBD"
screeps can say thing that are visible to other players
and you can add publicly visible flavour text to rooms
so that's pretty doable
(better not happen tho)
nice try, but another server member playing screeps is simply not a canon event and cannot happen
I got Rust and WASM working in the Screeps Arena demo

ci is fun until you realise you're losing sanity
"ci is fun" 
he's from the future
I wish I was one hour faster
I feel like I am drunk
is this what it feels like to stay up a bit later
I have successfully written a text file in APL, and read its contents in COBOL 
-# but why though
Because while learning APL, people kept telling me to "learn a more readable language"
And what language is more readable than one that's basically written in English?
If you meant this exercise specifically, I figured it'd be a good way for me to sharpen my skills in both languages, as I've barely done much of this sort of thing so far
And true to form, the APL expression to write the file only has about three times more characters than the COBOL program has lines to read it—and that's including strings 
What defines an object?
What makes an object diffrent from a recourse?
Why is OOP hated?
Why do we write code, only to refactor it 100 times?
why do you live in a place that wants to kill you? 
Im in montenegro rn
used this as a base:
https://github.com/rustyscreeps/screeps-arena-starter-rust
-> src/lib.rs
erased everything and only had this:
use log::*;
use screeps_arena::{
constants::{prototypes, Part},
game,
prelude::*,
};
use wasm_bindgen::prelude::*;
mod logging;
fn setup() {
logging::setup_logging(logging::Info);
}
// add wasm_bindgen to any function you would like to expose for call from js
// to use a reserved name as a function name, use `js_name`:
#[wasm_bindgen(js_name = wasm_loop)]
pub fn tick() {
let tick = game::utils::get_ticks();
if tick == 1 {
setup();
}
warn!("Current tick:{}", tick);
}
as per the readme, installed cargo-screeps:
cargo install -f cargo-screeps
setup my screeps.toml to the following based on what was in screeps-defaults.toml and from the documentations:
default_deploy_mode = "default"
[build]
build_mode = "arena"
build_profile = "release"
out_name = "screepsArena"
[default]
destination = "./ScreepsArena/"
prune = false
# for full syntax, see
# https://github.com/rustyscreeps/cargo-screeps/blob/master/screeps-defaults.toml
ran
cargo screeps build
and
cargo screeps deploy
this generate a folder:
./ScreepsArena/default/
open the generated ./ScreepsArena/default/main.mjs file and rename the paths:
"./screeps-arena-starter-rust" to "./screepsArena"
and
"./screeps-arena-starter-rust_bg.wasm.bin" to "./screepsArena_bg.wasm.bin"
(no idea why changing the name in screeps.toml doesnt rename these?)
copy all 3 files to the screeps arena tutorial-loop_and_import folder overwriting the original main.mjs file
and when I play the tutorial I get the following output:
apparently this can also build for world?
I wonder if wasm has any real efficiency improvements over js
also there is the world specific one:
https://github.com/rustyscreeps/screeps-starter-rust
at least I got arena working, but since I dont know how the world version works yet, dont know if these are fully applicable
but in cargo-screeps screeps.tomlconfig guide it says:
# # allowed values are "world" and "arena"
so i'm assuming that you can use roughly the same things for world, you just have to tweak the screeps.toml config that I gave from arena to world and use the world api instead of the arena api in toml, maybe some other stuff too
ok so I did a little looking and you could reimplement pathfinding in wasm
(I think)
if true I wonder how much CPU you could save
pathfinding is already a wasm module
i am a screeps expert feel free to ask me any questions
(i read shiro's messages so i'm qualified)
(this is my only exposure to screeps)
tbh I'm basically just reading through the docs and going "neat" to a lot of stuff
you can put "2 years of experience with screeps" into your resume now
I just wish the game was written using risc-v assembly instead of js 
actually wait where is this I'm lost now 😭
did I just not look deep enough into what astarpathfinder is
unless they updated only their official server and not the public Screeps repos it's still JS
wasm is so back 😎
the pathfinding implementation used by the private server is this
https://www.npmjs.com/package/@screeps/pathfinding
https://github.com/jciskey/screeps-pathfinding/
there is this wasm one but it's third-party
Contribute to screeps/driver development by creating an account on GitHub.
wtf 
why do they depend on the pathfinding library if they have already reimplemented it themselves
now to find out which one they actually use
seems like it does use the one from the native library
you called?
konii i cant handle this lattices dont form a lattice whats even the point 
lattice of lattices is a higher dimensional lattice 
its ok when you cant do something in maths it would probably be super useful so surely i'm on the right track
think (n+1) dimensionally
i think for my next trick im going to restructure targets again
this is why im working on 0.2.0 
good luck lol, maybe look at some other stdlibs for inspiration
regardless the cheapest way to pathfind is to abuse the http api instead
I am back to civilization 
i have been
we shall see if it was fruitful
Imo the cheapest way to pathfind is to let actual physics figure it out
Spin


just randomly move until find the path
https://github.com/screeps/engine/blob/master/src/game/rooms.js
this uses the JS library?? 
the native pathfinding library seems to only be used by invaders but that's stupid

Does light take all possible paths at the same time? 🌏 Get exclusive NordVPN deal here ➵ https://NordVPN.com/veritasium It’s risk free with Nord’s 30 day money-back guarantee!✌
A massive thank you to Dr. Andrew Mitchell for all his help and expertise. If you want to delve further into this topic then we highly recommend his lecture ...
The ultimate pathfinding algorithm
💯
example rust setup for the tutorial 2, moving creep to flag
use log::*;
use screeps_arena::{
constants::{Part, prototypes::*},
game::{
self,
utils::{get_object_by_id, get_objects_by_prototype, get_ticks},
},
prelude::*,
};
use wasm_bindgen::prelude::*;
mod logging;
fn setup() {
logging::setup_logging(logging::Info);
}
// add wasm_bindgen to any function you would like to expose for call from js
// to use a reserved name as a function name, use `js_name`:
#[wasm_bindgen(js_name = wasm_loop)]
pub fn tick() {
let tick = get_ticks();
if tick == 1 {
setup();
}
info!("Current tick:{tick}");
info!("{:?}", game::utils::get_objects());
let flag = get_object_by_id(&"10".into()).unwrap();
let creeps = get_objects_by_prototype(CREEP);
let my_creep = creeps.iter().find(|c| c.my()).unwrap();
my_creep.move_to(flag.as_ref(), None);
}
the rust API doesnt seem too bad, if this is roughly what it will be for the screeps world too
edit: nvm the flag from the feature enable-flag is for capture the flag, could not find the flag item for the tutorial, had to get the flag by id
much rather use this than js
Tbh, it cant be that hard to calculate action
If you run it on gpu you can easily do 100 rays
Should be pretty easy to do for 2D
Still waiting gor quantum cores on gpu's or as a separate pcie card 
https://developer.nvidia.com/cuquantum-sdk this is the best you'll get 
nvm cuquantum is trash apparently 
https://fixupx.com/legit_api/status/1941165728708874514 this is speculative, but I hope it holds true (45% accuracy on Humanity's Last Exam with thinking)
Fine, il do it myself 
How hard can it be 
Might do it if i have some time, im focussing on vulkan rn
The progress has been progressed 
write a quantum simulator in vulkan 
How do you make it random though?
Prng is good enough
use log::*;
use screeps_arena::{
ResourceType::Energy,
constants::{Part, ReturnCode::NotInRange, prototypes::*},
game::utils::{get_objects_by_prototype, get_ticks},
prelude::*,
};
use wasm_bindgen::prelude::*;
mod logging;
fn setup() {
logging::setup_logging(logging::Info);
}
// add wasm_bindgen to any function you would like to expose for call from js
// to use a reserved name as a function name, use `js_name`:
#[wasm_bindgen(js_name = wasm_loop)]
pub fn tick() {
let tick = get_ticks();
if tick == 1 {
setup();
}
let creeps = get_objects_by_prototype(CREEP);
let my_creep = creeps.iter().find(|c| c.my()).unwrap();
let my_spawn = get_objects_by_prototype(STRUCTURE_SPAWN)[0].clone();
let resource = get_objects_by_prototype(SOURCE)[0].clone();
let max_capacity = my_creep.store().get_capacity(Some(Energy));
if my_creep.store().get_used_capacity(Some(Energy)) < max_capacity {
if my_creep.harvest(&resource) == NotInRange {
my_creep.move_to(&resource, None);
}
} else if my_creep.transfer(&my_spawn, Energy, None) == NotInRange {
my_creep.move_to(&my_spawn, None);
}
}
and here is an example for the last tutorial, harvesting resource and bringing it back to spawn,
this is the last one i post, at least for Arena. just examples for the rust API how to use it for anyone interested
You dont need to.
If we're using action to calculate our phase, then we just use the distance of each path
Im thinking for performance sake we limit the search area to a rectangle with the start and end locations as the lin and max
I woke up and chose violence
So uh... Quantum physics does not work well in a grid system
Everything has the same length so the same amount of action.
This would still work well tho tbh
For obstacle avoidance
Min path length will be ∆x + ∆y, then you just search for the first pth that meets this min lenght
And if non exit you go for the lowest lenght ig
You would need to store the current min long with it's index tho
You're trying to unify QM with GR? Sam will be the first one to solve the theory of QG 
What are those abreviations?
Quantum Mechanics, General Relativity, Quantum Gravity (distinct from Theory of Everything)
But you missed the path where the particle is going through the whole plane
Oh you're listing the least action
Nvm this then
Those do exist ye, but the problem become that those get canceled out by the ones doing the same in the other direction I'm pretty sure
I forgot the details, but I think it's not about cancelation and more like the contribution/probability of said path to the total sum of something is VERY small. But it could also be both (that the contribution is small and they cancel each other)
The phase of the path gets added, but the phase of the other paths cancel it out
Here the shortest path Is 8, and we have. Lot of lioness going to 8 which makes a lot of the phases amplefy each other
Gets explained a lot better 20 min into this vid
Basically, path of least action is based
@real sierra how big is a screeps grid?
Wait I could just Google it
Nvm shiro
My bad
50x50 grid apparently
So the maximum minimum lenght is 98

98!/(49!)²
That's only 2.5477612e+28 possible paths of lowest action
This is not that great tbh

Mayhaps not enough CPU, cuz even with early return there will be cases of millions of loops needing to happen
Even with each path calculated in a microsecond, it would take a couple trillion years
Wait, screeps can move diagonally right???
Scratch everything
Add a couple thousand extra zeros to the big number and the max min lenght need to be Pythagoras

Ye this system sucks 😔
Back to A* 
A* is pretty good
The curse of having square grid game
Lateral movements are 1 tile length, diagonal are √2
A* is objectively good
But I wanted to use something else purely cuz I hoped I could
Using quantum mechanics would be objectively cool
You can try to use flood fill and fill until the target square is occupied. The shortest path will then be just following the number
Not as optimal path as A* but I think its easier computationallly
But then again, for large grid value it'll be unusable lol
Hmmm, why is it suspiciously similar to A* now that I think about it
Ray tracing
Ray tracing as path finding algorithm 
The benefit is that it could be brute forced on the GPU in parallel 
Ray tracing is barely better than my quantum brute forcing
In screeps, does moving diagonally cost more or as much as going sideways???
Cuz I don't need the actual lenght, I need the cost
From the docs, its the same
This probably already has a name but I'm calling it sam's stupid ass pathfinding algorithm.
SSAO is Sam Stupid Ass Optimization
Should be an option on your game engine later 
First calculate cost as h = min(∆x, ∆y) + max(∆x, ∆y) - min(∆x, ∆y)
Wit
I'm doing something tupid
I messed something up
Ye
Yes
The min is free since moving diagonal cot the same s going straight 
First calculate cost as h = max(∆x, ∆y)
Then we do A* like classic

We just go towards the goal prioritizing straights, but when we reach a wall we make the first move of the straights we ended with a diagonal
Ray tracing 
No
Now that I think about it, U shaped path will be a nightmare with rays huh
a spiral is worse
So if we start at S
The goal is G
Walls are X
Then we do
S__X_G
___X__
______
As
S>>X_G
___X__
______
Fuck, discord formatting
what is this blessing my eyes 
Right, like that one guy which constructed whole ass maze
I'm on mobile, I can't see the formatting preview
Like I said before, when reaching a wall with straight we change the firstmstraight to a diagonal
S>>X_G
___X__
______
Becomes
S__X_G
_∆>X__
______
Which then becomes
S__X_G
_∆_X∆_
__∆>__
I don't have sideways arrows, you'll have to deal with delta
Basically, it's a perfect system
Perhaps because I'm ignorant on potential downfalls
Ye i am blind
We need to store wich straights have the clearance to become a diagonal
Which could also become bad
Hmmmm
Ye nah well need to make the last straight a diagonal, then if needed the one before that

This is depth first search
Kinda?
We're still basing our moves on the cost factor
There's less need to backtrack
What I'm mainly trying to do is turn a right and down to a singular diagonal
Ye, double checked
This should work as long as we keep track of the maluability of the path
I'll need to see if this checks out performance wise tho
Hehehe
what are those?
Cards from a 1970s RAF military computer
yeah my first thought was daughterboards
Its basically a CPU with extra steps
Are you restoring it?
Yeah, I can tell since it is in a very good shape for an old hardware
You took good care of it
Eh, I've seen worse lol. But yeah, it sucks that they're soldered. A control panel, no matter how messy it is, is still just a bunch of connector, not solder

i need sleep










