#programming

1 messages ยท Page 79 of 1

opaque sigil
#

would make sense, smart neuroPogHD

real sierra
#

oh its my fault somehow

#

wtf happened

opaque wharf
#

Oh, so you did bring shard3 down? neurOMEGALUL

#

Ladies and gentlemen. We got him!

olive sable
opaque wharf
real sierra
#

the console isnt running but the rest of my code is

#

so i cant fix a bug in the memory

#

srsly screeps

rough bloom
real sierra
#

nah its fine glueless

#

i just hope they dont randomly run later

#

i fixed it differently tho

rare bridge
#

pogs my code to get idle creeps off the roads worked

real sierra
#

but how performant is it

rare bridge
#

the tick that ran it used around 4ms of CPU time compared to my usual 1.5ms

real sierra
#

i dont use any pathfinding in my idle code

rare bridge
#

it only runs once though, if it detects a road below it

real sierra
#

here was my stroke of genius

#
creep.move(1 + util.getRandomInt(8));
#

WICKED fast

rare bridge
#

unironically, checking if there's a road below and if so, choosing a random direction would work

#

but i needed to write this code anyway for source management

opaque wharf
#

Man, I need some sleep. Brb in 4 hr

olive sable
#

4 hours KEKW

#

Our hired car is not allowed into albania so we're waiting on a taxi rn bwaadow

rare bridge
#

my pathfinding code is utter garbage ICANT

real sierra
#

tried to beat screeps at its pathfinding game Classic

olive sable
#

Screeps uses a modified A*?

#

Im planning on using my own modified A* but ill need to do some testing

rare bridge
#

currently waiting for my builders to finish building the roads

real sierra
#

In computer science, jump point search (JPS) is an optimization to the A* search algorithm for uniform-cost grids. It reduces symmetries in the search procedure by means of graph pruning, eliminating certain nodes in the grid based on assumptions that can be made about the current node's neighbors, as long as certain conditions relating to the g...

#

WHY ISNT THIS WORKING

#

UltraMad js

#

this doesnt make any sense

#
if (opts.callback) {
                    console.log("spawn item has callback, adding to memory");
                    opts.memory._removeCallback = opts.callback;
                }
                opts.memory._removeFromQueue = toSpawn.queueid;
                if (toSpawn.room) {
                    opts.memory.assignedRoom = toSpawn.room;
                } else {
                    opts.memory.assignedRoom = spawn.room.name;
                }
                console.log("spawning "+toSpawn.role+" with opts: "+JSON.stringify(opts));
#
[09:58:59][shard3]spawn item has callback, adding to memory
[09:58:59][shard3]spawning scout with opts: {"memory":{"role":"scout","_removeFromQueue":33094,"assignedRoom":"E38N39"}}
#

where did _removeCallback go

#

i dont understand

#

at all

#

js experts neuroDinkDonk

trim valve
#

isn't memory just strings

real sierra
#

functions can cast to strings in js

trim valve
#

or am Imissing something

real sierra
#

it works exactly like you hope it doesnt

olive sable
real sierra
#

screeps pathfinding is pretty good

rare bridge
olive sable
#

The only way to make it better is by using flags or something

#

Screeps can see flags they pass right?

sick owl
#

Decided to follow Pewdiepies lead and finally started decoupling myself from corporats this week neuroHypers

rare bridge
#

oh there's a bug

sick owl
real sierra
opaque sigil
real sierra
#
creep.pos.lookFor(LOOK_FLAGS);
#

or something like that

olive sable
real sierra
#

functions should stringify

#

monkaW wait they dont stringify?

olive sable
#

Can i put multiple flags on a tile?

opaque sigil
real sierra
#

have to explicitly call tostring

#

ofc

#

lets see if this works now

opaque sigil
#

is the plan to store it as a string and then use eval?

olive sable
real sierra
olive sable
#

Aight going in taxi now bye

olive sable
rare bridge
real sierra
#

do creeps even have a concept of "right"

#

you would have to track the direction yourself

#

but otherwise you just offset the position based on the direction and do the same thing

opaque sigil
#

also can i just say that JSON.stringify not caring about you passing it a function and just outputting undefined is crazy

real sierra
#

it worked PauseSama

#

it broke CatDespair

rare bridge
#

these 2 harvesters have different tasks, interesting

real sierra
#

finally got it working

#

now i can pass arbitrary callbacks to creeps placed in the spawn queue

#

this gives clients to the spawning api much more control over unit init

tender river
#

mrp meow

real sierra
#

mhm true...

nocturne olive
#

Whar you sillying?

tender river
#

you should use serde and RawMemory instead i think

#

this is true because the subscript operator calls a function so in the meanwhile the object may change (i'm making it up but it's probably true)

real sierra
rare bramble
real sierra
#

the scout is on its way to check a neighbouring room

#

go my child

#

find victims

#

wait why are you going that way Aware

#

there's a wall there...

#

theres no exits bro ๐Ÿฅ€

rare bridge
real sierra
#

๐Ÿ’”

#

you cant get out that way bro

rare bridge
#

poor scout

rare bramble
real sierra
#

why is Game.map.getRoomStatus(roomName) a medium cpu cost

#

this should be a real simple lookup

rare bridge
#

i wonder if i should build a scout that just goes to any room it can

real sierra
#

modified the target room finder to filter out adjacent rooms of different room status than the parent

#

this will keep me inside the novice zone, for example

#

which avoids these weird walls placed on the exits that cause this problem

rare bridge
#

send a scout to my one and see if it makes it cerbyLUL

real sierra
#

i legit cant get to u

#

the only room that connects us, some loser built walls along every exit

#

id have to pillage them first

rare bridge
#

lemme come take a look

real sierra
#

stuck in my corner

#

ReallyMad QIS

rare bridge
#

yo shiro

real sierra
#

whats up

rare bridge
#

half of these walls

#

are hit 1

real sierra
#

im aware

#

i didnt say they're good at the game

#

but i still have to write so much code to murderize them

#

cant wait to see what my room eval gives them

rare bridge
#

just manually write code from console to kill them cerbyLUL

real sierra
#

professionals have standards

rare bridge
#

yo wtf is this code their builders aren't bothering to repair the 1 durability walls

real sierra
#

if i have to lift a finger for them to disappear, i haven't earned their removal yet

real sierra
#

pick one and fix it to full hp before moving to the next!

#

genius!

#

efficient!

rare bridge
#

amazing!

#

i wonder what happens if i send a manual scout over to their base

#

i wonder if any of the rooms between me and you will try to kill you

real sierra
#

not much point killing people if you cant claim more rooms

#

plus most people in our zone know nothing about this game and it shows

rare bridge
real sierra
#

except crazyfish

rare bridge
#

only actual threat is crazyfish

#

Scared crazyfish

real sierra
#

true to their name

rare bridge
#

lemme create a simple scout quickly

real sierra
#
const roomsOfInterest = _.uniq(
                    _.flatten(
                        Object.keys(Game.rooms).map(
                            (roomName) => Object.values(Game.map.describeExits(roomName)).filter(
                                (exitRoom) => util.getRoomStatus(exitRoom).status == util.getRoomStatus(roomName).status
                            )
                        )
                    ).filter(
                        (roomName) => !Game.rooms[roomName] || !Game.rooms[roomName].controller.my
                    )
                );
rare bridge
#

it doesn't know what to do with this scout

#

the room directly above me does not like anything entering

opaque sigil
real sierra
#

it is what it is salute

opaque sigil
real sierra
#

it runs rarely

#

so its hopefully fine

rare bridge
#

anyway, i think the only rooms between us 2 with an ability to defend itself currently is you and pandan0id

#

that is including you and me btw

#

(i can't defend myself currently)

real sierra
#

the invader room is pretty spooky too

rare bridge
#

agreed

real sierra
#

invader units are

#

chonky

rare bridge
#

oh damn they are

#

how did bro spawn in a novice area tho

real sierra
#

must've gotten rolled

#

or just wanted to respawn somewhere away from bigger players

#

always a bigger fish

rare bridge
#

indeed

rare bridge
#

still got 3 options for defence

#
  1. just attack anything that isn't mine
#
  1. attack anything with attack and ranged_attack bodyparts
#
  1. wait for something to damage something of mine or get too close to certain structures, and then figure out the creeps interacting with that creep to grab the entire raid party
real sierra
#

screeps are not pursuant to the geneva convention

rare bridge
#

suggestion

real sierra
#

conventions are suggestions by definition

rare bridge
real sierra
#

POGGIES success

rare bridge
#

Hmm should i leak one of my creeps code

real sierra
#

up2u

#

up2u

#

i have no desire for others' code

#

my code is already perfect

rare bridge
#

damn you really wanted emphasis on it being up to me

real sierra
#

why did i type that twice

#

Dentge ?

rare bridge
#

idk LULE

#

well anyway

real sierra
#

BRUH why are we scouting this room again

#

we were here like 10 ticks ago

rare bridge
#
import { chooseSource } from "../utils/utilFunctions";

export function shouldRun(creep: Creep): boolean {
  if (Game.rooms[creep.memory.room].controller == undefined) return false;
  return Game.rooms[creep.memory.room].controller!.ticksToDowngrade < 2000;
}

export function shouldOverride(creep: Creep): boolean {
  if (Game.rooms[creep.memory.room].controller == undefined) return false;
  return Game.rooms[creep.memory.room].controller!.ticksToDowngrade < 100;
}

// Harvest and then upgrade the controller
export function run(creep: Creep, end: Function) {
  const controller = Game.rooms[creep.memory.room].controller
  if (controller == undefined) return;

  // Check if we have capacity left and are near a controller.
  if (creep.store.getUsedCapacity() != 0 && creep.upgradeController(controller!) == ERR_NOT_IN_RANGE) {
    const sources = creep.room.find(FIND_SOURCES);
    const source = chooseSource(creep, sources);
    if (source == null) return;

    if (creep.harvest(source) == ERR_NOT_IN_RANGE || creep.store.getFreeCapacity() == 0)
      creep.moveTo(controller!, { visualizePathStyle: { stroke: "#00ffff" } });
  } else {
    if (creep.store.getUsedCapacity() == 0) {
      const sources = creep.room.find(FIND_SOURCES);
      const source = chooseSource(creep, sources);
      if (source == null) return;

      if (creep.harvest(source))
        creep.moveTo(source, { visualizePathStyle: { stroke: "#ffaa00" } })
    }
  }

  if (controller!.ticksToDowngrade > 5000)
    end();
}

export const name = "harvestAndMaintainController";

this task handles maintaining the controller level, it's kinda sketchy and hacky tbh

real sierra
#

ew typescript

#

if this is "sketchy and hacky" my code is duct tape and chicken wire

rare bridge
#

i mean i'm literally making sure the creep doesn't leave too early by trying to harvest to see if i'm meant to be harvesting LULE

#

it's sketch af

real sierra
#

hows that sketchy

#

thats a very normal paradigm in screeps

dusk sierra
#

Anyone got experience with pyinstaller? I am banging my head around an ModuleNotFound error

rare bridge
#

i feel like there should be a way to check if i'm in range shrug

real sierra
#

if you weren't meant to do things this way, spawnCreep wouldn't have a dryRun option

rare bridge
#

Hmm true

#

i am happy with the shouldRun and shouldOverride tho

#

shouldRun runs only when the creep's task is undefined (aka idle), while shouldOverride runs every tick

#

since shouldOverride allows me to define a situation where a task needs to be switched to asap, such as low controller untilDecay and low structure hitpoints

real sierra
#

scout_33113 when it is sent to investigate E38N38 for the 10th time today sisyphus

rare bridge
#

i wonder @real sierra how do you handle tasks given to creeps, do you use a similar system to me?

real sierra
#

creeps assign themselves tasks

#

it isnt done centrally

#

found the scouting issue

tender river
#

first law of lattices never talk about lattices

rare bridge
#

technically the creep def files are the one's actually assigning the task

#

i'll drop one in here in a moment

real sierra
#

niche screeps feature #45368748793678

#

you can toggle ramparts to be traversible by hostile creeps

rare bridge
real sierra
#

i would use it to abuse their ai Tomfoolery

rare bridge
#

infinite maze coming right up

real sierra
#

assuming their units are coded to take a path to the controller instead of breaking walls if they can avoid it

#

you just install two ramparts and leave one open

#

when they get close to it, lock it and open the other

rare bridge
real sierra
#

Tomfoolery mad?

rare bridge
#

what about an infinite maze that rearranges itself

real sierra
#

CatDespair maze runner

rare bridge
#

ofc for your own creeps it can arrange to a corridor

real sierra
#

do keep in mind that ramparts have a high maintenance cost

rare bridge
#

doesn't matter if you control the entire area xdx

real sierra
rare bridge
#

just have your outer rooms dedicated to maze

real sierra
#

POGGIES scout is going somewhere new

rare bridge
#

scout is finally free

#

buh i need to upgrade my room controller for towers

#

guess i'll tell it to upgrade

tender river
#

hehehe i now know how to solve the function color problem now you just need to interpret functions in the correct category, category theory is truly magical

rare bridge
#

buh this upgrade is gonna take so long

#

lemme tell the builders to help

#

damn these builders lazy af

olive sable
#

Shiro can i put multiple flags on a road tile?

real sierra
#

unknown

#

maybe

#

i understandably never tried

rough bloom
#

you can stack flags, yeah
I'd assume that also works on roads

olive sable
#

This will majorly improve my road system if possible

real sierra
#

it doesnt seem to be an issue given the possible errors of createFlag but you would have to test to be sure

rough bloom
olive sable
#

Can they check the name of the flag?

#

And the colour?

real sierra
#

they

rough bloom
#

yeah, you still get every flag as a separate object

#

but iterating through them seems expensive if you stack many on the same tile

olive sable
#

Im gonna just make each destination have a flag colour, and put the flags as direction changes

#

This is the greatest plan

#

Nothing can go wrong

real sierra
#

wait till sam finds out about the cpu cost of placing a flag

olive sable
#

What?

rare bridge
#

Hmm i might have to assign a "minimum creeps running task" value for tasks

real sierra
olive sable
#

The flags will only have an initial cost, it should save recources in the end COPIUM

rare bridge
#

cos i've got my builders trying to upgrade the controller and my harvesters are focused on keeping energy at spawn at 200 at least

real sierra
#

thats your cpu to beat

olive sable
#

How much cpu does reading a flag take?

real sierra
#

negligible

#

lookup is cheap

olive sable
#

Nice

#

Big

rare bridge
#

but my creeps keep dying RAGEY

olive sable
#

I will put the direction and how long in that direction to go in the flag name

#

The colour of the flag will be the destination type

#

I will beat 1cpu, maybe, hopefully COPIUM

rare bridge
#

here's me not even bothering to try to beat 1cpu currently

#

i just want level 3 controller RAGEY

olive sable
#

If you only have 20cpu 1 is still a decent amount i think

rare bridge
#

yeah, 1/20 of your available compute

olive sable
#

I will beat it

rare bridge
#

okay finally my creeps can focus on.. why is it not focusing on upgrading the controller

#

nvm my code sucked LULE

#

it's gonna take forever to upgrade this room controller cerbyDead

#

i feel like this shouldn't be my priority currently

real sierra
rare bridge
#

currently trying to figure out how extenders are used

real sierra
#

extensions were the source of many logic bugs in my code

rare bridge
#

how do they even behave

#

do they like

#

get used only if the spawn is out?

#

if so that's annoying, i don't wanna have to write a util function just to get the true available energy for a spawn

real sierra
#

Room.energyAvailable

#

and potentially read the details of StructureSpawn.spawnCreep

rare bridge
#

buh i have to manually define them

#

okay sure

#

i'll build a util to return the correct amount based on cost

rare bramble
#

wondered why my CPU usage was high, turns out, my move calls were taking like 80% of my CPU usage ICANT

#

welp, at least I know what to optimize

sage crag
rare bramble
#

apparently all calls into Js from wasm are still pretty expensive, so the goal would be to keep as much in wasm as possible

real sierra
#

wait juho

#

are you on the official server

#

pogs ?

#

donowalled Sadgi im not cool enough for juho

opaque sigil
#

speaking of async runtime, konii did you see they (surely NeuroClueless) landed on a final version of async/await for zig neuroPogHD

fast pagoda
#

Dude built a wordle solver that uses python packages and the uv dependency resolver

tender river
# sage crag now write async runtime for hblang

if i do it will still have the function color problem neuroPogHD solving it requires functions to be generic objects over a category that has a built-in interpretation but can be abstracted over which is only possible if you either use a language with partial evaluation (preferably deep unlike haskell) or write an entire interpreter or compiler for a language (meow)

opaque sigil
#

huh is wordle np complete

fast pagoda
#

It's np hard I think

#

It's not 100% success

#

For this thing

tender river
opaque sigil
#

the new one?

tender river
#

huh is there a new one

fast pagoda
#

I'm not up to date on my wordle lore so idk what that is

opaque sigil
fast pagoda
#

Oh lol

opaque sigil
#

basically io as an interface is the idea i think

rare bramble
real sierra
#

you should've come settled with me and cloud

rare bramble
#

dont look at my room though, currently its basically nonfunctional

real sierra
#

we're over by E38N38

rare bramble
#

I didnt know where you were when I made this

#

though I might respawn, I dont have much novice area time left and i'm right next to a scary player

tender river
opaque sigil
#

huh how come

fast pagoda
#

Hates colorblind people

opaque sigil
tender river
#

it went one step further than rust in that, it may arguably be more ergonomic but imo its a step in the wrong direction

#

i like algebraic effects and free monads more

#

and also have some ideas i want to try in that regard

#

maybe you've heard of the "object algebras" approach to the expression problem

#

free monads are basically that but for functions

opaque sigil
tender river
opaque sigil
#

@real sierra @rare bridge pls nuke neuroLookUp

olive sable
rare bridge
#

hi

#

dealing with

real sierra
#

on it

rare bridge
#

thanks

opaque sigil
#

thanks

olive sable
tender river
#

too much stuff to figure out...

#

but i did make so much progress today so i'm happy

olive sable
#

Or if cloud decides to open the server sometime ill just immediatly go there

#

Aight, imma hop the border back to montenegro now

rigid snow
#

neuroMonkaOMEGA illegal immigration

real sierra
#

RCL4 attained

#

my empire cements itself ever more

tacit plover
#

Let's say, hypothetically, that I'm looking into learning Godot

#

How important would it be for me to learn what GitHub is

real sierra
#

vcs is overrated

#

just write good code

rare bramble
#

some people even use git for completely non dev stuff like configs and such

tacit plover
#

Ok, I'll read what's GitHub

real sierra
#

git as free storage gx_ez

opaque sigil
#

git != github, git is the important thing
github is just a place to remotely save your git repository

rare bramble
#

I mean git is the version control system, github is just a place to host git stuff online, it's not necessarily necessary for git. there is also sites like gitlab

#

ye, what Toast said

real sierra
#

@rare bridge

#

the second lag spike earlier was the dev testing in prod

rare bridge
real sierra
#

if even the screeps devs test in prod, surely i can too

real sierra
#

screeps now?

rare bridge
#

i improved my spawning code to take cost into mind

#

it'll now refuse to make big units unless it has the energy needed

#

but it won't get stuck and will still make smaller units

olive sable
real sierra
olive sable
#

Border control had a dog evilSoCute evilSoCute evilSoCute

real sierra
#

also i didnt realize but

#

there's factions in this game unofficially

rare bridge
#

neurocord faction

#

done

#

enjoy

real sierra
#

its terrifying

olive sable
#

Yay

real sierra
#

apparently they have an API for it

olive sable
#

Wut?

real sierra
#

the code is hosted in a burner account's public memory segment

rare bridge
olive sable
#

What does a faction do?

real sierra
#

no clue

olive sable
#

Ig its just a non agresion agreement?

dry charm
#

imagine the clan wars

olive sable
#

I will produce tanks

real sierra
#

only one person in the bottom right of our block is in a faction

olive sable
#

A group of 12 screeps moving as 1 unit made for pure destruction

#

This is a great plan, i can see nothing that could go wrong

real sierra
#

i had actually considered something similar

#

but ultimately i dont think its worth

olive sable
#

Does adding more cary body parts make you able to carry multiple screeps?

real sierra
#

no

olive sable
#

Ahhh

#

Shame

real sierra
#

look into creep.pull

#

there are some interesting things there

olive sable
#

Aight

real sierra
#

a notion that has grown on me is to ensure my creeps are making use of all their parts as often as possible

olive sable
#

That is a method, but i dont think im going that way

real sierra
#

less intended to be a method and more a metric

#

for spotting where you might need to specialize creeps

tacit plover
#

How to Git

olive sable
#

Make an account

#

Make a repo

dry charm
#

Thats github

olive sable
#

Use your repo

olive sable
real sierra
#

surely a website can explain this better than we can

olive sable
#

What the diffrence between git and gh?

dry charm
#

a pack of apple and a grocery store

#

you can pack your apples in a box, with history of what was put in and out

olive sable
#

Git is just local history?

dry charm
#

and you "put" those boxes on the store

#

git itself is the core of everything, rather would say, github is just a remote

olive sable
#

Ok

dry charm
#

You can use everything that is on github locally as well. Github is a "remote" where you can push your changes

#

But as Shiro said, lemme find a GOOD source for this

#

cause of course, in 2025 the first search page is useless

opaque sigil
real sierra
#

a beginner's guide might be more applicable

#

than a full details manual

dry charm
real sierra
#

and a source maybe more geared to the original question of "how to git"

#

as opposed to the tangent

#

might be handy

opaque sigil
real sierra
#

Prayge ty for your patience rytsty

rough bloom
opaque sigil
#

they do huh

#

i wish we could have pull requests and issues as part of the git repo

#

radicle kind of makes it possible but also who tf uses radicle neuro7

tender river
#

pull requests are just other people's branches you can pull locally if you want

#

issues yeah you dont use git for that

#

you can put them in an extra branch just for issues in md format if you want

opaque sigil
#

would still be nice to have them as first class citizens in git imo, not that it'll happen realistically

patent walrus
#

nerrrrrds

#

@real sierra especially

gritty dust
real sierra
noble zodiac
#

eh issues are just not in the scope of git and you can just send ppl your patches. heck the git cli command does that for you

tender river
#

its good not to have everything in a single spec because it doesnt force you to e.g. a specific issue format

tacit plover
#

Does Git weight a lot

bold hinge
#

Is neuro run localy or on server. I just confused with vedal talking about the financial aspect of running her.

opaque sigil
#

but no, git is pretty lightweight

#

well it depends on how you use it i guess, if you commit a bunch of big files that will add up

rough bloom
#

yeah, Git itself is pretty small, but repos can get big sometimes
-# mostly if you use them incorrectly

rare bridge
#

someone remind me to fix my screeps pathfinding (they do not like the road)

warped narwhal
rigid snow
#

neuro is definitely being ran mhm

wide bluff
#

If I want to learn to make a AI friend for myself where would I start? What should be my first step in learning what direction i need to walk, digitally speaking. LLm? Code? Python? Any channel suggestions for a less dry approach would be appreciated too if possible. I am more artistically inclined and have ADHD so dry facts tend to turn my brain away so to speak.

bold hinge
tender river
#

vedal has to do finetuning which is impractical to do locally

bold hinge
tender river
#

as for where neuro's models run, nobody knows yeah

tender river
rough bloom
#

thank you ClojureScript very cool hash

tender river
#

are you hashing integers?

rough bloom
#

I am hashing maps

#

idk if this is even supposed to work yet, but I don't think it's supposed to be sequential like that kek

tender river
#

neuroSHARK @trim valve

rigid snow
tender river
#

they mentioned "the financial aspect" which does include finetuning

rigid snow
#

sure

olive sable
#

Aight im back at the appartement neuroHypers neuroHypers neuroHypers neuroHypers neuroHypers neuroHypers neuroHypers neuroHypers

#

Still need to eat sometime, but firstmy screeps

real sierra
#

caption uuh

hoary lion
#

full code day

olive sable
opaque wharf
#

I'm not back reading anything today neurOMEGALUL

olive sable
opaque wharf
#

For real, usually I can keep up. This screeps fever is crazy ClaraKek

real sierra
#

my brain is on fire

#

how do i

#

what is the ideal attack force composition

#

i know roughly how much lifetime damage i need to win

#

but how do i compose that into units

olive sable
real sierra
#

i dont think it'll get a channel/thread

#

no other games do

olive sable
#

Fair

#

this one is backed by half the mods yho

tender river
#

Gรถdel's incompleteness theorem when Gรถdel's completeness theorem walks in

real sierra
#

nepotism AINTNOWAY

opaque wharf
opaque wharf
olive sable
#

Aight booting up my laptop vedSpinButCrazy vedSpinButCrazy vedSpinButCrazy ๐ŸŒช๏ธ ๐Ÿ”Š ๐ŸŒฌ๏ธ ๐Ÿ˜ญ

#

Wait need to eat brb

real sierra
#

salute OVER

#

DRAINING THE STORES

rare bridge
real sierra
#

i ranked up and the infrastructure system queuesd every building i could make

#

i guess i needed energy storage badly

rare bridge
#

i'm currently just making a bunch of extensions

real sierra
#

same

#

tons of extensions and a storage

rare bridge
#

so i can make better creeps

real sierra
#

plus associated roads

rare bridge
#

i have no storage rn tho

real sierra
#

cant make a storage until rcl4

rare bridge
real sierra
#

protip that wasted 5h of my life

#

containers are neutral structures

#

even if you built them

#

which means FIND_MY_STRUCTURES doesn't include them

rare bridge
#

i just FIND_STRUCTURES regardless CerberOMEGALUL

#

there's no chance my harvesters and builders would ever be in a situation where they're dealing with buildings which aren't mine anyway

real sierra
#

Stronge when i build a turret in cloud's room and they repair it for me

rare bridge
rigid snow
rare bridge
#

repair uses find my structures actually

#

so thanks for the heads up

#

but you're able to build structures in other people's rooms??

real sierra
#

not really

#

i was mostly joking

#

you can build up to RCL0 structures if you dont have ownership

#

which means roads and 5 containers

rare bridge
#

if that's happened my entire thing is cooked anyway

real sierra
#

spawn time is no longer trivial

#

45 ticks to spawn a builder

rare bridge
real sierra
#

unit size limits may be a feature in the near future

#

good problem to have

rare bridge
#

all my units CEASED

real sierra
rare bridge
#

it is trying to spawn

#

but i assume my code is saying no for some reason

real sierra
#

wait

#

can i do some crazy math to optimize my units here

rare bridge
#

found the bug

#

the spawner will not spawn if the energyStructure does not contain itself

olive sable
#

aight time for screeps finaly

#

4th tutorial level

real sierra
#

according to my metric, the best units are 50% move, 25% heal, 25% attack hmm

#

metric does not like ranged attack

#

i guess the trick is that heal cant be used if you attack

#

i should remove heal parts from my dps calc then

olive sable
#

cloud server when?

#

friday?

amber fractal
opaque wharf
real sierra
#

you could ranged attack and melee heal

dry charm
#

wonder if it works with latest

rigid snow
opaque wharf
#

Working the mods to the bone ClaraKek

amber fractal
rigid snow
#

back when js was abysmal dogshit neuroPog

olive sable
#

still is

rare bridge
#

@real sierra the code i wrote to avoid overcrowding at energy sources works... too well
when a creep gets to the one energy source it realises it's crowded and LEAVES

olive sable
#

lmao

rare bridge
#

come take a look at my area to see what i mean CerberOMEGALUL

real sierra
#

preoccupied atm

#

gotta finish this functiuon before i forget what it does

rare bridge
opaque wharf
#

Quick everyone, distract Shiro

#

And never let him save his code again neuroTroll

rigid snow
# olive sable still is

it's become infinitely better for sure, and the ecosystem has become better too. for example: good luck finding a sorta obscure package with types back then - now if you're using jsdoc types (as comments) instead of typescript you get weird looks, and if you don't have types at all literally nobody will use it

olive sable
#

nice

opaque wharf
#

Noble crypto save my ass a ton of pain

rare bridge
#

Okay my creeps will now refuse to go to an energy source if it's occupied

#

lemme make it so it remembers not to go there

rare bramble
#

overabstraction goes BRRRRRR

olive sable
#

the tutorial iteraly says "make one of the harvesters sudoku" AquaCry

opaque wharf
opaque wharf
amber fractal
rare bridge
#

hey uhh.. where are my builders

amber fractal
#

Reduced to scrap

olive sable
#

atomizer go brrr

tacit plover
#

Is version control even a necessity

real sierra
#

Aware my economy crashed

amber fractal
rough bloom
real sierra
#

wtf happened

amber fractal
#

o7 killed due to time limit

olive sable
#

im tryingto understand this language to cod emy own shit

#

but wtf am i looking at here?

#

var harvesters = _.filter(Game.creeps, (creep) => creep.memory.role == 'harvester');

real sierra
#

that function is not that expensive

#

how did it time out

amber fractal
#

javascrjpt mhm

olive sable
#

what is that underscore???

real sierra
#

the _ is a library

olive sable
#

why we using underscores as classes here?

opaque sigil
#

it's not a class it's a namespace

olive sable
#

ye

real sierra
#

theres probably a

const _ = require("lodash");

at the top of the script somewhere

opaque sigil
#

it's just convention to name it _ for lodash

olive sable
opaque wharf
#

Sam finally cave and learn JS for game related things neurOMEGALUL

opaque sigil
#

time to unpythonify your brain then smh

real sierra
#

stop overcomplicating it in your head

#

_ is a variable

rare bramble
#

oh it's just a name you gave to the library

real sierra
#

and theres an object in it

opaque sigil
#

it's the same as import lodash as _ if you had a lodash.py

real sierra
#

the keys are function names the values are functions

opaque wharf
opaque sigil
#

false neuroPogHD

real sierra
#

RTFM

opaque sigil
#

but yeah the module is an object

amber fractal
olive sable
real sierra
opaque wharf
#

Even the primitives are wrapped in an object under the hood neurOMEGALUL

opaque wharf
real sierra
#

or maybe i didnt

#

its just an inline function

#

same as calling a function there

#

but skipping the lengthy definition

opaque wharf
real sierra
#

definining

#

holy here comes the ๐Ÿค“ โ˜๏ธ

opaque wharf
#

Yes

real sierra
#

im going back to coding

opaque sigil
#

think of it as

var harvested = []
for (var creep of Game.creeps) {
    if (creep.memory.role === 'harvester') {
        harvested.append(creep)
    }
}
olive sable
opaque wharf
opaque sigil
#

semantically equivalent

#

you just pass a function to run on every element in the array

#

which in the case of filter has to return a boolean that decides whether to keep it or not

olive sable
#

where list coprehension? SCHIZO

real sierra
#

no list comprehensions TROLL

real sierra
#

functional programming all the way

opaque wharf
rare bridge
#

my code is refusing to add builders to the queue

real sierra
#

i have no idea why my script timed out

#

shouldnt be possible

#

makes zero sense

#

must have been a cosmic ray

opaque sigil
#

does screeps target es3 or why do y'all use var everywhere

olive sable
#

so what is the arrow/ "greater or equal than" doing?

rare bridge
#

where the FUCK are my builders

opaque wharf
opaque sigil
#

you talking about (creep) => creep?

opaque wharf
#

But yeah, it supports most of ES6

opaque sigil
#

that's just one way of defining a function

real sierra
#

i dont think i've usedvar once in my code gx_ez

hoary lion
#

are we still creeping

real sierra
real sierra
#

theres not actually a problem with it mostly

opaque sigil
#
function foo(x) {
    return x + 1;
}
const foo = (x) => x + 1;

these are the same

opaque wharf
real sierra
#

javascript addicts will just insist on using other things

opaque sigil
#

no var is just bad

real sierra
#

see what i mean

opaque sigil
#

it's objectively just bad and has no use case anymore

opaque wharf
#

Because var hoist things up

olive sable
opaque sigil
#

after the no

opaque wharf
#

And it can make your code don't do what you think it should do

real sierra
#

stop using the same variable name then

olive sable
#

so dont use var?

opaque wharf
real sierra
#

const and let are preferred

opaque wharf
#

Use let or const

rare bridge
real sierra
#

const for constants as you normally would

#

let for everything else

olive sable
#

let

#

huh

real sierra
#

and then the variables will be scoped as you'd expect

rare bridge
#

oh

real sierra
#

var scopes things more than desired

rare bridge
#

i am an idiot

opaque sigil
#

let for anything you directly reassign, const for everything else

opaque wharf
#

const also not the same const as you think it is

real sierra
#

just leave the explanation simple

opaque sigil
real sierra
#

ok im out

#

too many chefs spoil the pot

opaque wharf
olive sable
#

im just gonna wing it

opaque wharf
rare bridge
#

finally

#

i have a builder again

opaque sigil
#

mdn my beloved

real sierra
#

TLDR

  • let for defining variables you intend to direcly modify
  • const for variables you will not reassign
  • (arg1, arg2, ...) => body is a shorthand for creating an inline function
olive sable
#

okay

#

why not define the function at the start of the program? does lambda not use much cpu?

real sierra
#

it's often for functions used in a single place

#

or functions that need to reference variables defined in the scope of the caller

opaque sigil
#

do you want a top level function for every single lil function you use once?

olive sable
#

i mean ye, but its in the main loop

opaque sigil
#

overhead wise there's no difference

#

they all become "top level functions" later on

real sierra
#

e.g. with a lambda you could do something like

const multiplier = 3;
const nums = [1,2,3];
const multiplied = nums.map((number) => number * multiplier);
#

where the lambda function references multiplier from the current scope

#

can't do that if you pre-define it

rare bridge
#

tl;dr: fuck js

olive sable
#

okay

olive sable
#

i have never used map functio before ever in any lnguage lmao

opaque wharf
olive sable
#

i am

real sierra
#

array.map(fn) returns [fn(array[0]), fn(array[1]), ...]

opaque sigil
#

i should be going over my lecture slides ugh

opaque wharf
#

I am considering joining lots of different servers just for the emoji evilFumoFriend

opaque sigil
real sierra
#

just wait till you have to sum an array

#

you're gonna love that

rough bloom
#

screep unemployment soonโ„ข

olive sable
#

i ussualy just do a for loop lmao

opaque sigil
#

wtf am i looking at

real sierra
rough bloom
opaque sigil
#

oh

#

right

#

i wonder, what other languages transpile to js

real sierra
#

to js?

#

not wasm?

opaque sigil
#

maybe i should join screeps too and do scala.js neuroPogHD

real sierra
opaque wharf
#

Golang and TS also look similar enough that MS is migrating TSC to Golang

real sierra
#

MORE SCREEPERS

#

I LOVE YOU

opaque wharf
#

So by extension, maybe golang

opaque sigil
#

don't get your hopes up shiro neurOMEGALUL

real sierra
#

uncomputable when are you opening screeps susge

opaque wharf
rigid snow
#

it doesn't ICANT

olive sable
opaque wharf
real sierra
#

screeps wave

opaque wharf
#

So probably around the same time as Sam

olive sable
#

friday

#

yay

opaque sigil
#

TIL nim has a js target

stark needle
#

chat check this out

hoary lion
opaque sigil
#

not accepted

#

tolerated at best

olive sable
#

i might join the online server today if i finish the tutorial

real sierra
#

tolerated

olive sable
#

it is, acceptable

opaque wharf
stark needle
#

blender cycles renderer vs the disney RenderMan renderer

opaque sigil
#

idk maybe i'm too used to typescript

#

is one of my comfort languages

real sierra
#

types overrated

olive sable
real sierra
#

i store my typedefs in my brain neuro5head

hoary lion
opaque sigil
hoary lion
#

always type your code

#

even when it is dynamic

olive sable
#

my brain is enormous, surely i wont forget the purpose of certain functions NeuroClueless

real sierra
stark needle
real sierra
#

overrated for solo projects

opaque sigil
#

actually i do wonder how hard it'd be do screeps in zig

#

i guess bindings would be the most annoying part probably

#

damn got baited, thought someone wrote bindings already

olive sable
#

the tutorial is saying "lets wait for the builder to finish" and that litle fucker aint doing shit

rigid snow
real sierra
#

shard3 is healthy rn

hoary lion
#

ok yk I think type is always broken in ML

real sierra
#

moving quite fast in fact

olive sable
opaque sigil
#

do you actually need anything fancy for screeps or is it just writing into memory

rough bloom
hoary lion
opaque sigil
#

like idk, reading files and stuff

#

anything with side effects basically

real sierra
#

doesnt read files

#

there's console.log

#

but i mean its all exposed via api i think

#

no file manipulation, no web requests

#

no gpu access

olive sable
#

the builder script didnt spawn in when starting tutorial 5, thats why it was doing jack sit

opaque sigil
opaque wharf
rare bramble
real sierra
opaque wharf
olive sable
#

why cant the builder get energy from the spawn?

real sierra
#

it can if coded to

olive sable
#

ah

#

ok

rare bramble
#

I mean you can use 500ms of bucket per tick

#

so you could query an api

real sierra
#

fill the bucket and then burn all 500ms on querying chatgpt

olive sable
#

hihihi

rare bramble
#

also you dont have to get the response for the request the same tick

#

just send a request and check if it's done every tick after

real sierra
#

that implies you can store some kind of handle to the request somewhere

#

good luck serializing that into memory

olive sable
#

how does one manually assign a route to a screeps moveto?

real sierra
#

actually i guess global is available

opaque wharf
#

And build a proxy

real sierra
#

to follow?

olive sable
#

kinda ye

rare bramble
#

I mean you can deserialize it and store that in the json

olive sable
#

i want to say, go up, go up, go left

#

and shit

real sierra
#

oh

olive sable
#

okay thanks

real sierra
rough bloom
olive sable
#

oooho

real sierra
#

you can probably match the game's path format

#

and then hand it to this function

opaque wharf
#

Then you can use more than 2MB

olive sable
#

cloud when server? lmao

#

i finished the tutorial

rare bramble
#

also in WASM you can store arbitrary data in a thread local:

#

at least in rust

real sierra
#

i still dont think you can get web requests to work

#

there's more backend state that i feel needs to be kept

#

that is abstracted away

#

and probably cleaned up by the sandbox

olive sable
#

if the server isnt up today ill join yall in the official server

real sierra
#

@rare bridge ETA on server?

olive sable
opaque wharf
#

Will try something when I'm at it hehe

rigid snow
#

my internet is fine tho?

rare bridge
real sierra
rare bridge
#

i'll try get it working this week

olive sable
#

i wonder why screeps is using more cpu than gpu

real sierra
olive sable
#

doesnt it run on web or something?

real sierra
#

im sure theres still plenty of client side stuff, even if your sandbox runs server-side

#

the screeps client is a big browser wrapper from what i can tell

#

so all the netcode here is also js i imagine

warped narwhal
#

Does anyone here happen to have a good oled screen? I have an hdr image but I can't actually check if it looks ok cause my monitor is sdr

olive sable
#

found'ya hydrate

real sierra
#

look to my south a few rooms

olive sable
#

wdym?

real sierra
#

e37n34

olive sable
#

ah there

#

i ws going traight down

#

so uh, where do i go?

real sierra
#

in the novice zone ideally

#

almost everyone in here is restricted to 1 room only

olive sable
#

but like, do i go next to someone or?

real sierra
#

you're free to choose wherever you'd like

#

id pick a room with two sources

#

exactly what you're looking for is kinda up to you tho

#

has spawning gone too far

olive sable
#

im sure it doesnt matter, but why is screeps using the igpu?

rigid snow
# rigid snow erm

turned on my vpn and it works now. turns out my internet is not fine

#

but not in the way i thought

olive sable
#

fuck i dont remember the api commands

#

lemme get the docs on another pae

amber fractal
real sierra
#

ive made a mistake

#

i crashed screeps

olive sable
#

oh

#

no

#

what did you do? catdespair

real sierra
#

console.log in an infinite loop

amber fractal
real sierra
#
while (cost > budget || totalParts > 50) {
            const newProps = {};
            keys.forEach((key) => newProps[key] = nParts[key] / totalParts);
            const toRemove = keys.reduce(function (best, key) {
                const diff = newProps[key] - (proportions[key] || 0);
                if (diff > best[1]) {
                    return [key, diff];
                }
                return best;
            }, [0, 0])[0];
            nParts[toRemove] -= 1;
            cost = Object.keys(constants.PART_COSTS).map((partType) => constants.PART_COSTS[partType] * nParts[partType]).reduce((sum, cost) => sum + cost, 0);
            totalParts = keys.reduce((count, key) => count + nParts[key], 0);
        }
#

something is very broken here

#

i think im gonna annihilate all the yucky functional programming

tender river
real sierra
#

and go back to tried and true for loops

olive sable
#

nway im doing shit

#

this is horrible code lmao

real sierra
#

hopefully this fixes it

real sierra
#

ok

#

im at that final

#

make-it-work stage of this new feature

#

ive written all the pieces

#

i just need to connect them

#

and boy do they not fit together well

opaque wharf
#

Cue to the next shiro forgot to save neuroTroll

unkempt citrus
#

Use duct tape

real sierra
#

i am running out of duct tape

olive sable
#

ye i forgot how to do half this shit

#

lemme steal code from the tutorial

sonic scroll
opaque wharf
#

Anybody knows a good OCR for tabular data?

#

The table is a picture of printed document, not hand written or screenshot

tacit plover
#

What default editor should I use for git?

#

Notepad++?

olive sable
#

im not sure where the free energy is coming from but its spawning shit

tacit plover
#

Why the despair react neuroMonkaOMEGA

opaque wharf
#

What are you doing with git bro? catdespair

tacit plover
opaque wharf
#

Do you mean a code editor with good git integration?

tacit plover
#

Trying to code stuff in godot if that helps

opaque wharf
#

Oh

#

Isn't godot have built-in git integration?

tacit plover
#

I'm still doing the git setup thing