#programming

1 messages · Page 74 of 1

real sierra
scarlet arch
minor crag
#

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

rigid snow
#

what

minor crag
#

If you share a copy it of the game you are also sharing your steam id

rigid snow
#

but everyone has different steamids

minor crag
#

Yea

real sierra
#

i think the point is

#

well wait

real sierra
#

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

rigid snow
#

also you can't serve a different bundle to every user afaik

rigid snow
minor crag
real sierra
#

are you baking all your assets into the executable or something

minor crag
real sierra
#

why would i use your launcher to decrypt it when i can do it myself

rigid snow
#

i think the point is that they are encrypted on disk and get decrypted when loading into memory

real sierra
#

but why would i use your loader at all if i have the key and know the encryption

real sierra
#

id just use an external tool i make myself

#

and process the files

minor crag
#

You can get the assets using your steam id but not the game code

rigid snow
#

but still, you can only serve one bundle per branch & you can't generate branches for each user on the fly

real sierra
rigid snow
#

then i'm not buying the game in the first place xd

real sierra
#

what why

rigid snow
#

that sucks

real sierra
#

wait till you see paradox games

rigid snow
#

i have and they do download the game files through steam no?

minor crag
real sierra
#

wait so

#

your gripe is just

#

that the particular server the updates come from

#

isnt steam

rigid snow
#

i want the updates handled by steam, if they had a system to plug third-party sources i wouldn't mind

minor crag
#

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)

real sierra
#

i still am pretty sure this can be decrypted easily enough at rest

minor crag
rigid snow
real sierra
#

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

minor crag
real sierra
#

?

#

oh i see

rigid snow
#

how is it more or less ethical than anything else

real sierra
#

hmm

#

id call this attributable not ethical

primal siren
#

I just got a Corsair Vengeance LPX 2×16 Go 3200 MHz CL16 for 90$ at best buy xD. Luck

rigid snow
real sierra
#

because none of us know how to socialize

real sierra
#

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

minor crag
real sierra
#

dont tell me you requested this only to donowall it

minor crag
#

You can't patch it out if there are like 700 loaders

rigid snow
real sierra
#

trivial enough too to make a burner steam account just for buying and leaking this game

minor crag
#

I'll probably use this and a second method

real sierra
#

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

rigid snow
real sierra
#

yes but i showed the previous idea was also easy to reverse

#

evidently that wasnt a large concern

#

keep the goalposts where they are

opaque wharf
minor crag
#

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

real sierra
#

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

rigid snow
#

steamid is 64 bytes you're probably not getting a single match even then, or do you mean hash

minor crag
#

It will take a very very very long time for a single match

real sierra
#

you only do this at compile time

#

so thats fine

rigid snow
#

me waiting for the server to increment my 64byte steamid enough times before my game starts downloading

real sierra
#

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

minor crag
#

There are 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096 combinations of 64 bytes

real sierra
minor crag
#

It will take a while

real sierra
#

then use half the steamid

#

you can configure this

#

tradeoff speed for security

#

up to u

rigid snow
#

oh i'm stupid it's 64 bit

opaque sigil
#

i was going to say

rigid snow
#

why did they name it that

minor crag
opaque sigil
#

64 byte steam id would be crazy

real sierra
#

you could also precompute the set of all 64-bit sequences in the executable

minor crag
real sierra
#

then sort the list and for a particular steam id, take the next sequence greater than it

#

and use the offset technique i mentioned

rigid snow
real sierra
#

then its very easy

rigid snow
opaque sigil
#

why waste 56 bytes when you can fill the entire cache line mhm

minor crag
#

64 bits is only 18,446,744,073,709,551,616 combinations

#

I think we will run out of possible steam accounts very soon

rigid snow
#

yeah idk what possesed me why did i think bytes vedalCry i need sleep

#

int64 is not 64 bytes

minor crag
#

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

rigid snow
#

as i said i have 4 in my immediate possession, and more are lost to time

minor crag
#

So we have even less

rigid snow
#

and i don't think that's very uncommon to have multiple

minor crag
#

I gotta email gaben about this issue before the earth blows up or whatever happens when we run out of steam accounts

rigid snow
#

steamuuid neuroPogHD

real sierra
#

everyone's steamid should be replaced with a (unique) 2048-bit RSA public key

#

there are plenty of those and they are also practical

opaque sigil
#

smh at least do 3072

minor crag
#

Then again we have declining birth rates so if we are careful then we won't run out until humans are extinct

rigid snow
minor crag
#

|| (BTW I am joking if you can't tell) ||

real sierra
#

no way around it then

#

there must be a culling

rigid snow
dark valve
#

Hello guys

real sierra
minor crag
dark valve
minor crag
dark valve
#

have you finished the project yet

minor crag
#

?

dark valve
minor crag
#

OK?

#

I'm confused

midnight sigil
amber fractal
#

Time to charge google for scraping neuroHypers

midnight sigil
#

they have web bot auth system

#

probably won't charge for recognized crawlers like web archive etc

#

or else this would get blamed quick neurOMEGALUL

unkempt citrus
#

How do they detect and verify though

#

other than IP comparisons

real sierra
#

chat I have a problem

#

I have locked my keys in my room and I am on the wrong side of the door

real sierra
#

screen

minor crag
#

Climb through your window

real sierra
#

screen

minor crag
#

?

real sierra
#

there's a screen in the window

minor crag
#

Ohh

#

Uhhh

#

Grab an axe and do what that one guy did in that one movie

amber fractal
real sierra
#

W landlord

#

I'm saved

minor crag
#

My idea was better

real sierra
#

your idea was definitely cooler

#

but my security deposit is an important stakeholder

minor crag
#

I HATE AUTOCORRECT

#

IT IS TRYING TO GET BE BANNED

real sierra
#

I saw the notification and my brain lagged

minor crag
wooden trellis
#

good afternoon(?)

#

Although it is morning where I live

real sierra
wooden trellis
#

lol

real sierra
#

closer to evening here

wooden trellis
real sierra
#

hi!

wooden trellis
#

happy birthday

#

lol

real sierra
#

i dont wanna get older

wooden trellis
#

I just saw a picture before, which said to wish Shiro a happy birthday every day

#

lol

real sierra
#

i must regret to inform you

#

it is not my birthday every day

#

regardless of what propaganda you may have seen

wooden trellis
#

“This year is my birthday”

#

haha

#

If this bothers you, I won't say it again.

real sierra
#

its fine neurOMEGALUL

wooden trellis
rare bridge
#

alright, since i talked about backups here previously, figured i should send my final msg on the subject here for now

real sierra
#

why does that sound so menacing

#

Aware am i being backed up

rare bridge
#

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

opaque wharf
#

Congrats. You have a better backup practice than ~70% of #programming

real sierra
#

i dont even version control

rare bridge
real sierra
#

nevermind backup

opaque wharf
#

I can't be arsed to do it neurOMEGALUL

real sierra
#

i dont wanna store the backup anywhere

#

i move too often for physical media to be worth keeping

rare bridge
#

hetzner storage boxes are pretty cheap ngl

real sierra
#

cheap by your standards maybe

#

i can barely justify two meals a day

opaque wharf
#

Yeah, there's also backblaze for personal computer backup

real sierra
opaque wharf
#

For server they did charge a bit more

rare bridge
#

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

real sierra
opaque wharf
#

Birthday gift for shiro lol

real sierra
rare bridge
#

this cold backup is gonna take a bit, but that's standard for cold backups

real sierra
#

but if they're using tape drive storage, it might only take a year

rare bridge
#

hetzner is one of the biggest companies for hosting

real sierra
#

why not?

rare bridge
#

i imagine they may be running storage boxes at a loss

real sierra
#

if its meant to be infrequent write

opaque wharf
#

They just have that much storage

real sierra
#

which is what "storage box" makes me think

#

then i can see it

rare bridge
#

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

opaque wharf
#

Cloudflare has R2 but its not meant for backup

real sierra
#

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

rare bridge
#

probably the human brain

#

or dna

#

but tech related? prob nvme ssd

opaque wharf
#

For backblaze its B2, their backup solution is a separate service

real sierra
#

cloud

rare bridge
#

i didn't go for backblaze cos i've heard issues about cancelling

opaque wharf
real sierra
#

they gaslit me into uploading all my screeps code here

#

and then didnt even look at it

rare bridge
#

either way, server tomorrow if it's straightforward enough

real sierra
rare bridge
#

but i also need to throw linux onto a box and config with pterodactyl daemon for mc server hosting

real sierra
#

should be straightforward enough

opaque wharf
real sierra
#

if you own the game there's literally a "start private server" button

#

so standalone cant require that many libraries

opaque wharf
#

Notably the steam web api key

rare bridge
#

YouActualDumbPieceOfShitFuckYou i just accidentally shutdown my machine and terminated the session running the cold backup

opaque wharf
# real sierra so standalone cant require that many libraries

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

opaque wharf
#

Shiro with VCS

real sierra
#

vcs? i just dont make mistakes

#

i understand that not every coder is ready for that tho

opaque wharf
rare bridge
#

that apparently INCREASED the eta

#

(it decided to find like an extra 100gb of my data)

#

alright, gonna let that run overnight

real sierra
#

probably the crash log from the last attempt

rare bridge
#

nah, that's not backed up to where i store local backups from the pc

real sierra
opaque wharf
#

Reminds me of Konii fast implementation of memory leak

real sierra
#

"implementation of memory leak"

opaque wharf
#

I think it was 1GB/s of memory leak

real sierra
#
void leak() {
  malloc(8);
}
sage crag
stable fractal
#

Why is typing on as phone with wet haa nss sso hars

sage crag
#

it was fast

opaque wharf
sage crag
#

im not a criminal im konii

rare bridge
#

each library needs a memory leak implementation!

real sierra
#

hmmmm

rare bridge
#

something for new contributors to try fix

real sierra
#

i wonder what the fastest way is that i can leak mem now

#

i think i have an idea

sage crag
#

i was trying to overcome the yes per second of the gnutils yes command

sage crag
#

optimal amortized growth

stable fractal
sage crag
real sierra
#

because this doesnt leak all the memory

#

you'll have a bit left over

rare bridge
#

what if you spawned cap more loops each loop

sage crag
opaque wharf
#

And now we discuss the best implementation of memory leak

real sierra
#
void leak() {
  long long size = 1 << 64;
  while (size > 0) {
    while (malloc(size)) {
      // :D
    }
    size >> 1;
  }
}
stable fractal
#

What is enub neuroSob

rare bridge
#

still leaks memory xdx

real sierra
#

hows that

#

no byte left unscathed

opaque wharf
real sierra
#

how do you even benchmark that

opaque wharf
#

That is the metric we use

real sierra
#

do you just spin it up in a vm and see how long it takes for the vm to crash

opaque wharf
sage crag
#

m

real sierra
#

i value my system

sage crag
#

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

opaque wharf
sage crag
#

the audience doesnt need to know about the amount of RAM i have

cobalt sigil
#

yo

real sierra
#

yo

sage crag
#

oi

opaque wharf
#

Thats your answer shiro. Have a RAM in the order of TB. Ez pz NeuroClueless

cobalt sigil
#

does anyone here knows how to do domain forwarding with masking (in cloudfare

sage crag
#

leaking 1gb/s? buy 100tb of ram and you have 27 hours before your pc dies

opaque wharf
sage crag
#

veedol

cobalt sigil
#

add-on info: i did try create a cloudfare worker, however i dont see any places to actually let me add a code

opaque wharf
sage crag
#

is it really a leak

cobalt sigil
sage crag
#

eliv is hungry feed her more memory

cobalt sigil
midnight sigil
opaque wharf
#

So

#

Fun fact

#

Our country has laws, EXPLICITLY stating that black magic is illegal

#

Bro, my country is cooked catdespair

#

And to be clear, not black magic the company

hoary lion
#

aww

real sierra
#

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

opaque wharf
#

Starting to think of specialization now

sage crag
hoary lion
#

this person is addicted to screeps

real sierra
#

im only rank ~1000 on the leaderboard

#

out of uh

#

1100

real sierra
#

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

oak flicker
#

better figure out the API calls to turn them all off

real sierra
#

but it costs an unacceptable amount of processing time

#

so im just gonna have to eat emails ig

#

new outlook rule

#

screeps -> spam

amber fractal
oak flicker
#

screeps -> trash -> empty trash

#

fixed

real sierra
#

if ("PANIC" not in email body)

amber fractal
real sierra
#

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

oak flicker
real sierra
#

thank god i have this set at least

oak flicker
#

hahaha

#

errors? what errors?

amber fractal
opaque wharf
#

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

real sierra
#

why would i want this code somewhere that people could easily associate it with its author

oak flicker
#

because you are very proud of your work most likely 😛

real sierra
#

yeah im also a multi millionaire

oak flicker
#

kick ass

unkempt citrus
#

You probably are if you switch currencies

real sierra
#

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

pulsar edge
real sierra
#

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

oak flicker
#

🤔

real sierra
#

im confused now

pulsar edge
#

shiro

real sierra
#

scrub

pulsar edge
#

your leak code doesn't work

real sierra
#

what

#

why

pulsar edge
#

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

real sierra
#

fuck size_t

#

malloc will take whatever the fuck i want it to

#

because im using C

#

also

#

yeah it should be 1 << 63

pulsar edge
#
#include <stdint.h>
#include <stdlib.h>
void leak() {
  size_t s = SIZE_MAX;
  while (s > 0) {
    malloc(s);
    s >> 1;
  }
}
#

better

real sierra
#

still bad

#

wont work

#

you'll have memory left over

#

🥱

#

mine leaves no crumb remaining

pulsar edge
#

fine

real sierra
#

actually no

#

im lying

#

yours works

#

i hate memory

#

im going back to screeps

pulsar edge
#
#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

pulsar edge
real sierra
#

every time i speak is a mistake

#

this is why i let my screeps talk for me

pulsar edge
#

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

real sierra
pulsar edge
#

they're right next to each other man

#

im on phone

fast pagoda
#

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

opaque wharf
real sierra
opaque wharf
opaque wharf
real sierra
#

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

opaque wharf
real sierra
#

it bed time

#

overnight I expect the builders will complete at least the first energy source container

#

and perhaps start the second

tender river
#

good night shir

real sierra
#

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 gx_ez

#

if it doesn't then I'll have lost an incredible amount of energy overnight catdespair

#

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

tender river
#

and can they carry while being carried?

real sierra
#

they should be able to work while being carried, yes

opaque wharf
#

Creeps centipede

real sierra
#

I don't know if they can carry while being carried

#

nor do I know if there's a use case for that ultimately

opaque wharf
real sierra
#

it's not less sadly

#

and would only be applicable in the oddly specific situation everyone is going to the same place

real sierra
#

further, you need MOVE parts to drag other creeps

#

but at that point, you yourself can walk

opaque wharf
#

When on the way, they could create a trains of screeps

real sierra
#

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

opaque wharf
#

But it is cool AND practical! neuroTroll

real sierra
#

you can make all the trains you want when the screeps server goes up

#

which may be tomorrow

opaque wharf
#

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

real sierra
#

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

random igloo
#

Claude sped up my shitty hand-written CUDA kernel by 7000x AINTNOWAY

stark needle
#

Morningniuh

hoary lion
opaque wharf
#

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

ScienceAlert

A French man who lives a relatively normal, healthy life - despite damaging 90 percent of his brain - is causing scientists to rethink what it is from a biological perspective that makes us conscious.

ruby timber
#

"french" I need no more xdx

amber fractal
#

:xdx:

rough bloom
#

Gleam JS interop sucks
static types do NOT map well to JS APIs

#

I want my Elixir back catdespair

ruby timber
tender river
#

mrow mrp

#

the voices

olive sable
#

Goodmorning neuroWaveA

#

Im beginning to think mine and shiro's scheduled dont match that well

opaque wharf
#

I just have a bad sleep "schedule"

olive sable
#

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

silent slate
rare bramble
safe path
olive sable
#

Cloudburst will make one

#

And otherwise i will

rare bramble
#

I will have to find a way to use a sane typed language though

olive sable
#

Use c and emscripten or whatever

rough bloom
olive sable
#

If you do you should lay off on the counting

rare bramble
olive sable
dry charm
tender river
#

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

opaque wharf
#

Oh, I know that thing

#

Just don't understand the underlying principle tho

tender river
hoary lion
#

time to actually sleep

#

its 1:42 am neuroDeadge

opaque wharf
#

How long before she got overwhelmed? hehe

safe path
#

Cry doctored image

sage crag
dry charm
#

ok anyone new to programming should start with The Farmer was Replaced

#

this is fun

rare bramble
opaque wharf
#

Shiro will have 2 full time job

olive sable
#

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

real sierra
#

my actual job and screeps

opaque wharf
#

You should welcome the 3rd then NeuroClueless

real sierra
#

time for my morning screeps checkup

#

lets see what they're up to

trim valve
real sierra
#

welp

#

they arent dragging it

#

thats not helpful

inner pike
#

the mines didnt work ?

#

miners*

real sierra
#

correct

inner pike
#

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 ?

trim valve
#

by default you get 20ms of cpu per tick that you can consume

#

you can pay more to get more cpu per tick

inner pike
trim valve
#

1 moment

opaque wharf
trim valve
#

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)

real sierra
#

ok i fixed part of the problem

#

lets see if it fixed all of it

trim valve
#

if you pay for an upgraded cpu you get more than 20ms that you can sustainably use (/ you regen cpu usage faster)

inner pike
real sierra
#

the static miner now requests a drag as intended

trim valve
#

but iirc shiro has mentioned you can get temp cpu upgrades via an ingame currency too

#

also 20ms is a decently long time

real sierra
#

dragging isnt working

real sierra
#

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

trim valve
#

reminds me of hypixel skyblock

inner pike
#

reminds me of bonds in runescape

real sierra
#

ITS WORKING

#

THE LOGISTICS CREEP IS DRAGGING THE STATIC MINER

opaque wharf
#

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

opaque wharf
real sierra
#

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

#

🔥

opaque wharf
olive sable
#

Cache GETHIM

real sierra
#

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

rough bloom
#

neuroNOTED added to the list of ideas to steal

real sierra
#

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

opaque wharf
#

Get to work, coding, back at home, coding NeuroClueless

scarlet arch
#

Recreational programming belly

real sierra
#

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

opaque wharf
#

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

real sierra
#

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

rough bloom
#

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 LULE
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

real sierra
#

Tomfoolery no maps?

rough bloom
#

off to try ClojureScript instead
anything except actually playing Screeps catSUS

rough bloom
#

it's stupid

real sierra
#

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

opaque wharf
scarlet arch
#

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?

opaque wharf
real sierra
scarlet arch
scarlet arch
#

That's huge

scarlet arch
rough bloom
#

this embed is stupid

real sierra
rough bloom
#

(yes, that's why I mentioned it)

scarlet arch
#

I like the logo

opaque wharf
#

(are this the new trend?)

scarlet arch
#

Little Ferris all over it nyaHehe

real sierra
#

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 Aware its over

opaque sigil
rough bloom
real sierra
#

ok last change

#

modified unit spawning code to target 1 logistics unit per container

#

now i go work

opaque sigil
#

well yeah

#

that's how maps work

#

is it because objects in js are super flexible and you can just throw in anything

rough bloom
#

yes

#

it's because JS is very much dynamically typed

rough bloom
#

and Gleam is the complete opposite

opaque sigil
#

i guess that's true, you can't use javascript's Map in screeps

rough bloom
#

in for example Elixir they're dynamic

rigid snow
#

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

rough bloom
#

Gleam does not have structs

scarlet arch
#

I ignore anything dynamic. Languages with dynamic typing need to be eradicated. stare

rigid snow
opaque sigil
#

records are basically structs

rough bloom
#

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

opaque sigil
#

i see

#

sounds annoying

rigid snow
#

sounds like a skill issue to me but i haven't looked into gleam at all so

tender river
rough bloom
#

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 evilDeadge

rough bloom
#

Gleam has like 3 users, nobody uses it for anything

opaque wharf
rough bloom
#

I shouldn't have believed

rigid snow
#

aren't they the same thing

#

both bundlers

opaque wharf
opaque wharf
#

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

rigid snow
#

wait no actually

#

nvm

#

you're all good

opaque wharf
#

Thank god its not another exception to keep in mind about JS quirk neurOMEGALUL

rigid snow
#

i'm like a reasoning llm i like to overly doubt myself

opaque wharf
#

I'm rooting for rolldown just because they are being used by vite lol

rigid snow
#

but the difference is that rspack is a webpack compatible api

#

so you can drop-in replace webpack

opaque sigil
#

i should've probably mentioned i've never actually used js as a target with gleam neurOMEGALUL

opaque wharf
#

Yeah, I don't need webpack and the mess that it entails. Sure it has a richer ecosystem, but also the baggage pre ES6

rigid snow
#

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

noble zodiac
rigid snow
#

nah i doubt a junior dev is a webpack wizard

noble zodiac
#

self inflicted wounds

tender river
opaque wharf
#

With LLM, you may as well be webpack wizard through vibing

real sierra
#

rule 1 of being a programmer

#

avoid the job title "devops" at all costs

rigid snow
#

maybe for someone it's fun to do ci for 10 hours a day

#

don't judge

real sierra
#

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

real sierra
tender river
#

senior yaml developer

real sierra
#

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

tender river
#

bikeshedding and NIH are the two inalienable rights of every programmer

real sierra
#

I wonder if creeps can be pulled across room boundaries

#

I wish I could push creeps instead of pull them

inner pike
#

imagine somebody eventually finds your base shiro and all they do is leave a message that says "HBD"

real sierra
#

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)

real sierra
#

nice try, but another server member playing screeps is simply not a canon event and cannot happen

rare bramble
#

I got Rust and WASM working in the Screeps Arena demo

real sierra
jagged turtle
rigid snow
#

"ci is fun" vedalHUH

jagged turtle
rigid snow
#

neuroNOWAYING he's from the future

jagged turtle
#

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

olive sable
#

I am here

#

Suffering

#

38C bwaadow

#

100.4F bwaadow

vivid tulip
#

I have successfully written a text file in APL, and read its contents in COBOL neuroHypers

jagged turtle
#

-# but why though

vivid tulip
#

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 neurowheeze

olive sable
#

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?

woven temple
olive sable
#

Im in montenegro rn

rare bramble
# rare bramble I got Rust and WASM working in the Screeps Arena demo

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:

GitHub

Starter Rust AI for Screeps Arena, the JavaScript-based strategy game - rustyscreeps/screeps-arena-starter-rust

#

apparently this can also build for world?

trim valve
#

I wonder if wasm has any real efficiency improvements over js

rare bramble
#

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

trim valve
#

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

tender river
trim valve
#

I am looking at an outdated repo oops

tender river
#

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)

trim valve
#

tbh I'm basically just reading through the docs and going "neat" to a lot of stuff

maiden geyser
trim valve
#

I just wish the game was written using risc-v assembly instead of js glueless

tender river
#

fuck, lattices dont form a lattice

#

i have a problem

trim valve
#

did I just not look deep enough into what astarpathfinder is

rough bloom
trim valve
#

wasm is so back 😎

rough bloom
#

the pathfinding implementation used by the private server is this
https://www.npmjs.com/package/@screeps/pathfinding

rough bloom
#

wtf Tutel

trim valve
#

Tutel now to find out which one they actually use

rough bloom
#

seems like it does use the one from the native library

tender river
#

konii i cant handle this lattices dont form a lattice whats even the point neuroDespair

sage crag
tender river
#

its ok when you cant do something in maths it would probably be super useful so surely i'm on the right track

sage crag
#

think (n+1) dimensionally

sage crag
#

this is why im working on 0.2.0 neurojuice

tender river
trim valve
#

glueless regardless the cheapest way to pathfind is to abuse the http api instead

olive sable
#

I am back to civilization neuroHypers

sage crag
#

we shall see if it was fruitful

olive sable
#

Spin

rare bramble
#

evilShrug just randomly move until find the path

trim valve
#

ok mis spoke

#

cheapest without compromising on the ability to find the damn path 😭

rough bloom
trim valve
olive sable
#

The ultimate pathfinding algorithm

#

💯

rare bramble
#

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

olive sable
#

If you run it on gpu you can easily do 100 rays

#

Should be pretty easy to do for 2D

olive sable
#

Still waiting gor quantum cores on gpu's or as a separate pcie card waiting

opaque sigil
#

nvm cuquantum is trash apparently neuro7

sharp mantle
olive sable
olive sable
#

Might do it if i have some time, im focussing on vulkan rn

warped narwhal
#

The progress has been progressed MinaBounce

opaque sigil
nocturne olive
#

How do you make it random though?

opaque sigil
#

Prng is good enough

rare bramble
#
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

olive sable
#

Im thinking for performance sake we limit the search area to a rectangle with the start and end locations as the lin and max

opaque wharf
olive sable
#

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

opaque wharf
olive sable
#

What are those abreviations?

opaque wharf
#

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

olive sable
opaque wharf
olive sable
#

The phase of the path gets added, but the phase of the other paths cancel it out

olive sable
olive sable
#

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

opaque wharf
olive sable
#

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* bwaadow

noble zodiac
#

A* is pretty good

opaque wharf
#

The curse of having square grid game

#

Lateral movements are 1 tile length, diagonal are √2

olive sable
#

A* is objectively good

#

But I wanted to use something else purely cuz I hoped I could

#

Using quantum mechanics would be objectively cool

opaque wharf
#

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 neurOMEGALUL

#

The benefit is that it could be brute forced on the GPU in parallel neurOMEGALUL

olive sable
#

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

opaque wharf
#

From the docs, its the same

olive sable
#

Aight

#

New algo

opaque wharf
olive sable
#

This probably already has a name but I'm calling it sam's stupid ass pathfinding algorithm.

opaque wharf
#

SSAO is Sam Stupid Ass Optimization

opaque wharf
olive sable
#

First calculate cost as h = min(∆x, ∆y) + max(∆x, ∆y) - min(∆x, ∆y)

#

Wit

#

I'm doing something tupid

#

I messed something up

opaque wharf
#

Just the max lol

#

The min cancels out

olive sable
#

Ye

#

Yes

#

The min is free since moving diagonal cot the same s going straight NODDERS

#

First calculate cost as h = max(∆x, ∆y)

#

Then we do A* like classic

opaque wharf
olive sable
#

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

olive sable
#

No

opaque wharf
#

Now that I think about it, U shaped path will be a nightmare with rays huh

rigid snow
#

a spiral is worse

olive sable
#

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

rigid snow
#

what is this blessing my eyes neuroLookUp

opaque wharf
olive sable
#

I'm on mobile, I can't see the formatting preview

opaque wharf
#

Git gud at markdown

#

Use \

#

Lots of \

olive sable
#

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

opaque wharf
#

This is depth first search

olive sable
#

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

minor crag
olive sable
#

NeurOhISee what are those?

minor crag
rigid snow
#

yeah my first thought was daughterboards

minor crag
#

Its basically a CPU with extra steps

opaque wharf
#

That's old ass computer

#

I know from the layout it is some form of logic gate

minor crag
#

Yea

#

It does some magic

#

Its also the most expensive computer I own

opaque wharf
#

Are you restoring it?

minor crag
#

It works

#

I can't use it since I lack a plane

opaque wharf
#

Yeah, I can tell since it is in a very good shape for an old hardware

#

You took good care of it

minor crag
#

Thanks

#

The underside is a mess

opaque wharf
# minor crag The underside is a mess

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

stark needle
#

chat

#

anyone remember this

#

@tight tinsel

#

didnt u listen to this shit in the plane