#programming
1 messages · Page 85 of 1
that looks like a scam message?
turning everything to JsObjectID doesnt work either
Im seeing a designflaw o7
you can click the images 
My screeps go to the closest ones, but the miner next to the spawn keeps dropping new ones so none of thd gatherers go to the far one
Guys all these embeds are saturating mh connection 
@real sierra 


mods crush his skull
when will discord users learn basic internet security

Suprisingly not alot of Neuro merch 
I was able to take a pic with a neuro and evil cosplayer though!
controller at level 4
i hope you have good defences
now the big invaders can show up for you
their asses are too lazy
well.. but if they come.. they will fuck your shit up now 
better start building ramparts or walls 
fun
i was gonna work on splitting up the harvesters and builders roles today, i'll throw a few defenders into that too
the right ones can spawn now 
tell em to spawn already they've done fuck all until now 
tho rn my code is idling all my creeps to death
let's get these creeps working

i think storage first would be a good idea
I solved my issue, the solution was way dumber than it needed to be
lemme write some basic defence code quickly
what was the issue?
calling .ok_or() on a Option is eagerly evaluated so my error function was run regardless of the result:
let spawn = game::spawns()
.get(spawn_name)
.ok_or(self.abort_task("cant find spawn", "ID resolve failed"))?;
changing it to lazily evaluated .ok_or_else() solved my problem
let spawn = game::spawns()
.get(spawn_name)
.ok_or_else(|| self.abort_task("cant find spawn", "ID resolve failed"))?;
This is the first time I saw a really good opportunity to use these so I havent fallen into this trap before
ok_or_else!
so
I solved my problem but
since I spend hours on a trivial issue like this
I mean, I could see why the logic goes there, but my god that is such a funny thing to happen 

"rust compiler always tells you what's wrong!"
also rust:
welp, at least I solved like 20 unrelated issues in my codebase hoping that It would solve my issue with resolving the ID before getting to the actual issue
introducing water boiler pc
if it gets too cold you can heat it up 
water cooled (?)
is the point to use the pc as the heating element
my defender is confused
how the fuck
conditional spawning based on function calls implemented
Is it water cooled?
I think this is way better and more explicit than calling .ok_or_else() especially since Result<> has a similar function called .map_err()
my code handles this like:
the defender is set to have a max of 5 creeps at any one time, but to spawn more than the minimum i have set (1), the condition of room.memory.state == "defending" must be true (this is set when a hostile creep is detected rn, but i plan to make it a bit more detailed eventually)
so i'll always have 1 defender idle which can respond immediatly, but up to 4 more can be spawned if a hostile creep is detected
can't you do .ok().map_err()? .ok() isn't a function on options, nevermind
hot water cooled
water heated*
On steam it is 5$ but on the website it seems to be free so I'm a bit confused about the difference
steam allows you to play in the mmo world (which we're playing in rn)
i'm being constantly reminded to make a private server though
Does that mean I need the steam version to join any server?
only to join the screeps-hosted pesistent world
from what I understand you need the game to join the official world and to access the visualization client, you maybe could upload code to private server without owning the game but you couldnt see what's going on so I think that would be kind of pointless
Shiro recommended I join "the novice zone at shard3 E38N38". What kind of server is that and can I join without steam?
you have to own the game to join the official servers
you can use the live demo on the website to play the tutorial tho
but yeah to actually join us and such you would need the steam base version i think
but also i feel like its getting a bit cramped around us 
even more players would just cause problems for us all down the line
you'd have to buy screeps - world for that
Well I won't be able to play it right now unfortunately if that's the case unless there is a single player mode. Hopefully I'll be able to buy it eventually tho
well... there is the website's live demo that gives you a kinda single player mode.
That's mostly just a tutorial tho
I wouldn't last long
there is Tutorial + Training + Custom
you can select the other things too
its not a proper private server obviously. but it should teach you the basics and allow you to explore a bit how things work
That's great if the features and progression are mostly the same as on a server
Is there conflict with bots or is there conflict only against other players?
invaders can show up in your room every 100k energy mined roughly so you need somekind of defence. but there is also a stronghold of the invaders that you could raid it has resources and such that can definitely be useful
so its kinda pvpve
Nice
but.. since its a persistant world most people are wayyy outleveling you. and would just stomp you if you don't spawn in a respawn area or novice area to give you time to grow your base before they can expand into your room
i feel that most people are likely avoiding conflics.. unless they are in the way or overextending
But if I can only play these modes then wouldn't my area be seperate from the persistent world? I thought it would just be pve for me
the livedemo and your single player private server would be completely seperate and only pve
Ok that's what I thought. Thanks
but you can obviously keep your scripts that you developed in there
and move those over to the persistent world
@amber fractal ok in practice this is actually a lot better than I expected
now I need to figure out how I'm doing with my ME system 
because like, I would just tear down the old one fully but I'm a bit too busy for that atm
I love overly engineered minecraft modsd
Need more GPUs
2/10 cable management too good
first Screeps, now Minecraft?
this is actually becoming #gaming-2 
We did program here 
there
bet you dont have a phenom
I spot a HD6850 at the bottom 
my entire colony almost died out MONKA
Someone knows how evil's tts work?
Or multimodal models
Or none of us has the answer
Who has the picture
dont even think the chart has anything about evils tts
#programming message
is it?
Eh, might as well flex back
where is the lisp expert when I need them
I think my hash map implementation is working
tho its technically not a hash map but who is counting
konii is counting it probably
hi
Drag race it against hblang hash map
i am counting, 1, 2, 3, 4
coughing lisp baby vs hydrogen bomb (hb) 
I mean, if people drag race cpython and nodejs, why not 
its hash map vs hash array mapped tree
I can promise you that I use less memory tho
if you can beat inserting and popping 5 million elements in 339ms then you win 
what does that even mean. What kind of elements
space efficiency of hashmaps is awful 
Am being stupid lol
64 bit integer for key and value yeh
I assume both randomized
rust does is in ~240ms, so we currently within 30% margin
i never bothered to test with random keys and values since i havent written prng yet
id rather not do a getrandom syscall each time 
so what do you do then? inserting the same key isn't really the point, no?
okay, counter flex
Incremental key via loop is an option tho
key that increments, and the value remains constant
@real sierra you have no clue how close my creeps came to fully dying
that config is kinda sketch isn't it, are the gpus on pcie adapters?
its kinda more of a test of how well your hasher distributes values than the hashmap 

Yeah, those looked like server cards in the picture
That's epyc. They do have more PCIe lane than the usual plebs CPU
finally got my miner back
the point was that those are sxm cards so you can't just slot them into any old server unless you convert them to pcie 
I didn't notice that lol. I just saw nvidia and carry on 
But then again, it is possible that he has full blown server setup
i don't think you can mix sxm generations on the same board but i could be wrong on that
that's still sick though, hope the h100 pays itself off eventually 
yep...

hey, if it works it works
moreover i don't actually have a use for nvlink for now since my research doesn't actually require multiple gpus per subject
even better 
its also unfortunate that the PCIe version of the cards are worse than SXM version lol
they have a lower tdp right, or was there more
lower tdp yeah
They still have HBM memory though, right? That's their main selling point.
(for LLMs at least)
because they're not built for those high pressure 1U or 2U servers aswell
possibly why sxm version has higher tdp
i'm curious, have you considered amd gpus at all or are those out of the question (since iirc they tend to have higher fp32/fp64 performance right)
in my case their selling point is the fp64 lol
i gotta rewrite my whole compute api that way
surely it can't be that bad with rocm unless you do inline ptx
i mean, recompiling for the amd cards might work but might be pretty scuffed and need whole rewrite lol
rock em still isn't as good as cooda

soon 
and oh technically aside from blackwell, now i already have all the enterprise architectures
surely when rubin comes out the blackwell cards will go down in price 
get a 5050 
thought only consumer blackwell sucked, but apparently enterprise blackwell is also shit lol
who could have guessed, my hamt has a logic error somewhere
i'd rather get a 3060
5050 = 3060 super 8gb
sounds about right
i've been spending on used gpus and unique stuff like the titan v instead lol
i can't justify myself to get a new 50 series gpu.
The main problem I have with Blackwell is that none of the tools I want to use play into its strengths and new features. FP4 hardware support? Not supported for anything that is not Deepseek or Llama.
i like my 5070 ti for playing games
(fix your stupid freaking drivers nvidia
)
fixed what i think was the bug that broke my infrastructure for screeps 

Im am alive
We returned the loan car cuz parking is €10/h
Insane
There are 10x as many tourists here as last week
Anyways, time for screeps 
fp4 is useless
batshit useless
you can practically do nothing with it, and even if you do, bandwidth still fucks it up
its just a marketing number bs
(not to be confused with Q4 quantization, Q4 is actually batch-scaled int4, not fp4, computed by the fp16 component and its there just to make data transfer more efficient)
fp4 is to avoid needing to convert to bf16 before processing
brother what? 
how???

what happened???
not really... scaling factor is still a thing
and since the quantized value itself is a mantissa, it should be computed strictly in int4
not fp4
HUH??
you forgot to upgrade
what's that lol
i moved into E35N33
Aaaah what is up Nation
hi
Are you like a coder or programer
yes
My 3090 finished a training run while I was sleeping, Neuro RVC V12.1 to 200 epochs, at 32 batch size
U are now my sensei
10h training time
sure?
paywalled :/
you can just ask stuff here bro
there are a lot of progrsammers here wo are better thn me
Yo my bad Bruh
no worries
Cool
Aaa what is dis yo ??
A solution to said paywall
Personally I just block most paywalls through a pihole
Bro's going through some financial debt
I just don't like getting extorted 
thanks
Yeah I understand (relatable)
https://github.com/google-gemini/gemini-cli/commit/b0cce952860b9ff51a0f731fbb8a7649ead23530 Gemini 3.0 Pro beta spotted in a gemini-cli commit
gemini-beta-3.0-pro
paper hell 
i might be finally understanding how functional programming works
good now explain monads
monads are... monads
well
this video is a fun take on cs jobs
follow form more programming content specially in javascript , python , c++ , java and become skillful coder and developer
Don't forget to LIKE, COMMENT, and SUBSCRIBE for more tech comedy and insightful developer content!
#programming #coding #DeveloperLife#WebDevelopment #UIUXDesign #JavaScript #Python #J...
the "not oop = fp" belief strikes again
monads are some shit leibniz wrote about
monads are an oppressed class that must be freed
Low-brow explanation of free and freer monads and of the boilerplate they free us from
freest monad where though
This tbh
I cannot comprehend anything else than OOP
So they are now evil FP

monadigram
Half the time people say they do oop they don't even do oop 
true
I wonder how much batch size I'll be able to push on the 3090 with NeuroSynth when RVC lets me push 32
try it 
I don't have the trainer set up yet, and there's karaoke in 25 minutes
fair
awa
`wa
goodness
limited cpu 
i feel sorry for torturing mlokis 
would you rather have cpu, unlimited cpu, but no solution to halting problem, or solution to halting problem but no cpu
ive felt the same in the past 
poor guy expressed a similar sentiment about fuzzers and programmers back when i was starting to work on ableos for the first time
solution to halting problem would be based, but unlimited cpu would just make it possible to brute force so much shit
10 code samples in 2 days 
at least we have policy of giving code samples and not just screencaps of errors these days 
best i can do is "there is a bug somewhere" 
i founds a segfault

how made it? dont know!


guess who's screeps colony almost self-destructed 2 times because of checks notes creeps being stupid when pathfinding
if you search the old lily 0.0.x branch src code for bug: you will see some remnants of that time
i remember seeing comments like that in 0.1 i think
guess who actually died 
// ! (compiler) bug: inlining here crashes the parser. nice.
// ! (libc) (compiler) bug: NOT inlining here makes it sometimes not work
my brain is exploding i solve one problem and remember there was another problem i havent solved i want to curse programmers to an eternity of suffering which luckily is exactly the goal of erf 2.0
hblang's file type was .hb?
well at least you had an instant death, i had to painstakingly try to avoid my death by manually changing the tasks of creeps so they'd go and get energy themselves and then dump it in the spawners and extensions
it is

erf is fre backwards which is symbolism for how freedom will never be reached
my language found
it want instant, i just wasnt there

true 
right now all my creeps are either idle, working on building a container, or are currently shipping mined energy to storage so that if something like that happens again i can somewhat recover
erf is fre backwards and fre stands for free monads
erf is one letter away from being eff which stands for algebraic effects
erf is also what you will say (if you are neuro) after programming in it
erf
i should probably build pathfinding with creeps blocking themselves due to other creeps in mind...
All my screeps are currently harvesting energy
I changed some priority code cuz it was making 4 miners and no taxis before
Also put an emergency
if (controller.energy < 100)
{
Panic
}
By the way, because of the 3090 my PSU now has basically every single one of its power connectors except one molex/SATA one populated, the 3090 took all the rest of the 8-pins
it feels like there's 2 entirely seperate systems that are badly interacting with each other on my screep system 
(that's cos there is)
karaoke time 


Neuro RVC V12.1, now available
Model straight out of the oven (3090)
my new miner instantly killed itself
buh
it did it again
for context: miners are programmed to instantly murder themselves if they spawn and there isn't a valid position for them to go mine at
and my miner keeps overexcerting the source
need to tell it to use less
time to see if it tries to kill itself again 
okay i think i found and fixed the bug
@rare bridge i hope it works for you 🙂
have you tried giving it therapy?
Then why even spawn them?
Borger 
Looks nice 👍
i do have a question... why are you building so many single part creeps.. isn't that insanely innefficent. just build 1 miner with 3 parts and it can completely replace all those
That is true, but i still need to make my scaling code
also i preferhaving the source mined from all possible sides, idk why
oh thought id say, i managed to get this to work 
Guys, what is screeps, why has it infested this channel, and why has nobody told me about it before?
A strategy sandbox MMO game with a persistent open world where you play by writing JavaScripts to control your units. They live within the game and operate autonomously even while you are offline!
Screeps is cool
Dammit I guess I just lost all my free time once I get back home from abroad


invader 
same...
i wonder if the docs are lying...
they surely are 

Its for a Roblox game Lua btw
i spent like 12 hours trying to come up with a nice coercion system but then i realized programmers dont deserve it
lol
what i do is i put the playerpos as camera.center, then i do camera.pos = camera.center - camera.zoom * camera.forwards
That's smart...I could try that but I want that MiSide effect like you know when Mita Keeps Looking at You like uhm EUGHHH I don't know how to say it the right word isn't coming up, but it uses cframes
tbh i have no clue what you mean lmao
this is my code
idk if you're anzthing with it, but you shall reeive anyways
npc head locked into looking at player camera
ahh
tracking
then just make camera.forward into the direction of the npc
so basicly get deltaPos of camera and npc
they basically want this but backwards, point the head at the camera not the camera at the head
but yeah ez
ahhh
so just make the npc look at the cam? thats seperate code from the camera movement code but works the same way
why is it red?
deltapos, but change the npc's forward vec
oh just didnt send
or probably not at the camera but rather the player head because roblox and that may imply 3rd person
Im just sitting here giggling like a little school girl from the help I got
i don't play roblox at all
You guys helped me enough
LOL
I also don't play roblox at all, just popping into existence before vanishing
feel free to ping me for mor gamedev stuff, its the only thinng im good at lmao
Pin Sam's cursed code mhm
you might not need the alignas for the vectors, as I'm pretty sure glm does that already
it should ye, but i added it anyways to make sure
otherwise ill forget i even need to do that
hi cloud 
same... when shiro's available we can ask them what their experience is
looks like it does align by default, but only if GLM_CONFIG_ALIGNED_GENTYPES is true, and GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined
i just have
#define GLM_ENABLE_EXPERIMENTAL
#define GLM_FORCE_SIMD
#define GLM_FORCE_ALIGNED
the GLM_FORCE_ALIGNED seems to set the definitions, but GLM_FORCE_SIMD doesn't show up, so that was probably old documentation
you're looking for GLM_FORCE_INTRINSICS instead
both of my room controllers upgraded while I was at work so I'm chillingn
idk
i got told to do the simd one for simd
very possible it doesnt do shit tbh
it doesn't even exist in the entire repo
#define free malloc
// free memory leaks!
lmao
yes
nice
it automatically chooses the most advanced simd the platform your compiling for has

make sure to use target_compile_options(TARGET -march=native) or just run cmake with -DGLM_ENABLE_SIMD_AVX2=ON
???
I go so stuck on thinking about storage containers and who managed them, I came to the conclusion that miners manage their own containers, when a miner dies, the container ownership is automatically released and it's free to be claimed by the next miner
automatic and self healing state management my beloved
wait, lemme check gcc's docs, you might not need to do that, looks like you do, you need either -march=native or -mavx2
does this mean ```c
#define malloc free
#define calloc free

surely
o7

yes, immediately causing a free-on-null does prevent memory leaks 
or actually
I guess that wouldn't happen
why would you malloc 0
I need a job
lmao
free doesn't crash if you give it a nullptr iirc, meh, it's a no-op on nullptr, but undefined on non-nulls
#neurotic-neurons has many like-minded people, i think you'll fit right in 
im "hiring" unpaid interns for 3d modeling and art 
boilerplate player 
also shiro
how much resources have you collected over your lifetime on the game?
i'm at like 500k and i haven't seen an invader anywhere
might be a lower RCL limit on invaders but I can't find any docs to substantiate that claim
personally i think the docs are bullshitting the 100k + random value thing
as far as i can tell, i've had no invasions yet
which is very impressive if that means i killed them all
cos until today i've had no actual defensive creeps
i'm also on RCL 4 now, which means if i do eventually get an invader, it'll be a big one
the random value is adding between 0 and 10000000 to the required energy mined


where are you getting this from?
(idk obviously. but it does feel like it)
anyway, i'm about to manually spawn a big invader if you two wanna watch me absolutely fuck myself over
@real sierra @glass flower
i need to test whether i can defend against one
where i have a button to kill the invader if it gets too bad
yeah you do 
you can kill manually spawned invaders
what time window is this
my entire playthough
how the heck do you see that
which considering i've had one room the entire time
profile -> the dropdown above the stats
max is 7d
i spawned a small one earlier to fine-tune my defending spawn code + their targeting code
initially they did fuck all so i had to despawn them 
alright, gonna spawn this invading creep now
my base works like clockwork (I have literally nothing in my base, it's empty)
Yeah I'll look more into that @ home, for now I'll just check out the tutorial while I have time. ty
yeah im seeing your base is getting trashed
i would recommend going with atleast 1-2 melee guards. they do a lot more damage and can absorb the damage instead of your normal units
my turret is doing FUCK ALL
- if no damaged units, attack enemies with turrets (prioritize by number of heal parts)
- while enemies in room, spawn guard units with all available energy

has worked fine so far
it's just chilling there



relying on miners for energy is not a good tactic in invasion
i should maybe give it a try
i'll switch the logistics to rely on the storage during defence
if you are certain you'll hate it then theres no point
if you are just being silly tho, you can always refund it after an hour if its not for you
i mean i just suck at js
i didnt know any js when i bought the game
great way to learn
its just like python with java syntax
i suck at js too. thats why im using c# 
seems like i'm somewhat surviving this attack. not to my standards but i am surviving
hmmm alr alr
i think we have different definitions of surviving... just zerging your enemy isn't surviving 
this is literlay my irst time using js
well at least i'm not dead
not a day without bugs has happened so far
You need to be on 24/7 or can you also afk
nevermind i'm saying too soon
opposite of a 24/7 game
gonna kill the invader when this defender dies
i would not count on that... if the raid had a healer or ranged. you would most definitely be dead. or if it had more than 1 member 
nvm
oh absolutely
it runs 24/7 but since the whole point is to have your code play for you, you dont need to babysit it
it doesn't help that my turret is doing literally nothing rn??
you babysit it the first few days.. then just optimize if you see inefficiency
also is this like pvp
liar... i have 30 hours in the past 2 days...
is it assigned to attack targets?
yes but there's lots of crutches for starting out
just cause like i dont wanna play a game where u compete against someone who has been at this for years and will immediately cook you
there are novice areas where you can spawn, where the only way to get in is to spawn there (i.e. no long-time established players will be able to reach you)
these can last about 20 days
yes, it's meant to choose the creeps it considers the most dangerous (has ATTACK, RANGED_ATTACK, or HEAL) and attack
in addition to this, you obtain activations of a "safe mode" which makes your room invincible for like 20000 game ticks
which one od i need
the cheapest world one 
do i need a subscription😭
welp, time to debug 
nope
no subscription
subscription only required if you write bad code
nobody here has one and we're doing fine
anyway, damage reports:
like 5 creeps died, this miner is out of service for now, and currently 2 logistics are stunlocked by the lack of miner
that is only useful on shard 0-2. on shard 3 everyone is limited to 20 cpu
this too
subscription does literally 0 for you at the start

ok so is there like minecraft ticks where u get to do shit?
make that 3 logistics
every tick your code runs, and between ticks all the actions you took on the game world actually apply
lemme add code for detecting if the miner is just not there
but the inverse. instead of 20 ticks per second its 1 tick per 3 seconds
*when the server isnt lagging
god i dont know where tf i put my credit card
the wall making code isnt working 
thats why i manually build walls
i would never trust a algorithm to make good tactical choices
i have acquired a credit card
you havent seen my algorithm

its not not working because its a bad algorithm, its not working because im a fricking dumbass
shadow playing screeps 
im on the plane home tomorrow afternoon and im on my desktop by overmorrow 11am
then imma build th best goddamn screeps code yall have ever seen
maybe
i have a lot of shit to do

❓
debit vs creditcard?
dude ive always used this card on steam
we use bancontact so idk lmao
wait ill just use paypal lmao
ah that works too
alright, lemme look at some stuff
first of all, tough costs like.. 10 energy
7.50 chief money
it still adds the whole fatigue tho. so make sure you have enough move
indeed...

more people...
none of us will be able to expand once everyone is in our novice area
another person indoctrinate into the screeps cult
what am i doing
lmao
random question why dont yall just make a private discord or a thread or something in #gaming for screeps instead of clogging up programming with 100000 messages lmao
not nearly enough screeps players to justify that
even the genshin players dont have a channel
@rare bridge server ready by friday? we have a large influx of shadowlilac
just because i talked a few people into it doesnt mean it gets a channel 
this is the moment where you start a revolution and abuse your mod powers
and then i get fired
Even more people getting the silly expensive game

Very silliness
i dont mind abusing mod powers if its for the screep
lmao
surely "expensive" is a reach
not buying it is one thing but like
Well, I have negative money
why is this downloading at like
shiro what did you do to get your channel powers revoked?
16kbps
idk
nothing they just took them away

Anything is expensive when I have negative money
i cant be trusted with anything after my 2 years of service
too many birthdays

okay i'm getting sick of the harvesters
i need the normal right?
i mean i swear you just dont read the docs either

this code is so ass lmao
if (miners.length < 1)
{
if (spawn.room.energyAvailable >= 100 + 50 + 50)
{
let screepname = 'miner_' + Game.time;
if (Game.spawns['Spawn1'].spawnCreep([WORK], screepname, {memory: {role: 'miner'}}) == 0)
{
console.log('new miner: ' + screepname);
indexSource = 1 - indexSource;
let sources = Game.creeps[screepname].room.find(FIND_SOURCES);
Game.creeps[screepname].memory.source = sources[Math.min(indexSource, 1)].id;
taxiscreepname = 'taxi_' + Game.time;
if (Game.spawns['Spawn1'].spawnCreep([CARRY,MOVE], taxiscreepname, {memory: {role: 'taxi'}}) == 0)
{
console.log('new taxi: ' + taxiscreepname);
Game.creeps[screepname].memory.taxi = Game.creeps[taxiscreepname];
}
}
}
}
i forgor
if this is the amount of work i have to put in after an invader comes in i'm so cooked
it can always be worse
this is my entire harvester code (if we exclude the emergency no carry bot code)
this is just test code at the end of the day, i will make good code once im home
WHY DO THEY CONSIDER THE CONTAINER TO BE A PLACE THEY CAN PUT ENERGY INTO
your code is so short
i wonder what my worst coding sin is in this codebase
i just reworked my entire "do stuff" code i had like 50 code duplications everywhere where creeps were doing things.
now its just this:
public static CreepResult GoAndDo(this ICreep creep, IRoomObject? container, CreepAction what, ResourceType resourceType = ResourceType.Energy, bool warnMissing = false)
{
if (container != null && container.Exists)
{
var result = -1111;
switch (what)
{
case CreepAction.Harvest:
result = (int)creep.Harvest((ISource)container);
break;
case CreepAction.Withdraw:
result = (int)creep.Withdraw((IStructure)container, resourceType);
break;
case CreepAction.Repair:
result = (int)creep.Repair((IStructure)container);
break;
case CreepAction.Build:
result = (int)creep.Build((IConstructionSite)container);
break;
case CreepAction.Transfer:
result = (int)creep.Transfer((IStructure)container, resourceType);
break;
case CreepAction.Pickup:
result = (int)creep.Pickup((IResource)container);
break;
}
if (result == (int)CreepResult.NotInRange) //ERR_NOT_IN_RANGE
{
creep.MoveTo(container.LocalPosition);
return CreepResult.Busy;
}
else if (result != (int)CreepResult.Ok)
{
Console.WriteLine($"Unexpected result for {creep} while {what} from container: {container}");
return (CreepResult)result;
}
}
else
{
if (warnMissing) // Its okay that they don't exist. since nonfree ones will just return null. which is intended.
Console.WriteLine($"{container} does not exist for {creep} that is trying to {what} from it.");
return CreepResult.InvalidTarget;
}
return (int)CreepResult.Ok;
}
i need new energy quikly cuz i have no miners rn 
what do you think of this creep's code
perfect
bad
its so efficient tho
in comparison, my "idle" code
export function run(creep: Creep, end: Function) {
// Literally do nothing. We call end every turn so that the task manager is forced to continue finding new tasks
const onRoad = creep.room.lookAt(creep.pos).filter(obj => obj.type != "creep").some(obj => (obj.type == "structure" && obj.structure?.structureType == STRUCTURE_ROAD) || (obj.type == "constructionSite" && obj.constructionSite?.structureType == STRUCTURE_ROAD) );
if (onRoad) {
const nearby: {
type: string,
terrain?: Terrain,
structure?: Structure,
constructionSite?: ConstructionSite
}[][][] = [];
creep.room.lookAtArea(creep.pos.y - 2, creep.pos.x - 2, creep.pos.y + 2, creep.pos.x + 2, true).forEach(obj => {
if (nearby[obj.y] == undefined)
nearby[obj.y] = [];
if (nearby[obj.y][obj.x] == undefined)
nearby[obj.y][obj.x] = [];
nearby[obj.y][obj.x].push({
type: obj.type,
terrain: obj.terrain,
structure: obj.structure,
constructionSite: obj.constructionSite
});
});
const movableMap = nearby.map(y => {
return y.map(x => {
let keep = true;
x.forEach(obj => {
switch (obj.type) {
case LOOK_TERRAIN:
if (!["plain", "swamp"].includes(obj.terrain!))
keep = false;
break;
case LOOK_CREEPS:
keep = false;
break;
case LOOK_STRUCTURES:
keep = false;
break;
case LOOK_CONSTRUCTION_SITES:
keep = false;
break;
default:
// nothing
}
});
return keep ? x : undefined;
});
});
const nearbyMovableTo: { x: number; y: number }[] = [];
for (let y = 0; y < movableMap.length; y++) {
if (movableMap[y] == undefined) continue;
for (let x = 0; x < movableMap[y].length; x++) {
if (movableMap[y][x] == undefined) continue;
if (movableMap[y][x]!.length > 0)
nearbyMovableTo.push({ x, y });
}
}
if (nearbyMovableTo.length > 0) {
creep.moveTo(nearbyMovableTo[0].x, nearbyMovableTo[0].y);
}
}
end();
}
i use about 8ms with my code now.. only used like 5 yesterday...
shiro why is this only spawning taxis????
you're trying to spawn 2 things on the same tick
fuuuuuuuuuuuuuuuuuck
it's prob opting to spawn the last thing you asked for
literally first thing i built 
cloud right, from the docs:
i think the most cursed part about my code is the fact that i store all info that needs to be persistent for the current task in creep.memory.state 
honeslty cant be botered to make a queue, ill just put spawntaxi as a var that gets priority over everythign
good luck dealing with script restarting
that seems natural not cursed
i do the same
fair 
spawnqueue isnt terrible to implement in a simple form
nah im good
okokokok i am doing the tutorial i think i understand whats going on
i designed my code to work completely fine without any kind of memory. (besides the roles obviously, and a role limit)
opposite here
i use UserData in c# which is not persistent but will stay between ticks most of the time
i track and store critical statistics about my energy collection
my spawn queue isn't actually stored in persistent memory
these stats inform a number of processes

where do you put it
so.. on the heap 
???????????
how does that
persist between ticks
or i guess it could reside in the stack
vars persist
????????????????????????????
only until the script restarts
the only time vars dissapear is between restarts
your entire script isn't reloaded when it's your turn to tick, loop is simply called
saved a lot of overhead internally
ofc your script is subject to restarts at any moment
thats basically what i use for my statemachine
yeah screw that
im not risking all my state
memory 
if i dont use memory for this, what will i use it for
cuz im linking the taxis to the miners
fair enough
otherwise i get miners interfering witht he wrong taxi
or im just not doing it good but eh
i really need to make a parking lot area... my creeps block eachother all the time while waiting for energy and therefore my carry bot can't distribute energy
chat i'm a bit clueless so since the tutorial shows most stuff, whats the point of the game? are there just more enemies or something? or whats like the main problem

the tutorial is really just the beginnign
you havent gotten the conquering the map yet
nor the crafting system
nor the mineral and boosting system
yummy hydrogen
hydrogen

i have oxygen 
join near us 
where
gotta go do some stuff quickly, but when i get back i'll redo the builder to pull energy from the storage + redo the harvester as an upgrader
with 2 sources
whats that
zoom in
our area looks like this
what shard are yall
3
my memory about to 📈
updated the stats module to track on a per-room basis in addition to globally
im testing some shit rn
i realy shouldnt be making them commit die, and recycle them instead
you said two yellow cubes right?
can confirm.. having 1 will give you a bottleneck
but it does simplify my harvester code a ton 

my miners are all breaking cuy of my crazy taxis
stats change was a great change
the second room wasnt building any extensions until now
"we can store 1M energy why would be build more storage?" 
that aint your storage lil buddy
is this one bad
thats why i won't bother with automatic building for now
just don't do the same mistake as sam. and you'll be fine 
its not a perfect room.. but probably the best you can get in our novice area
died there cuz of bad code lol
what mistake
😭
if your room controller dies you're fucked
need to feed it enough or it starves to death
like mine is rn
you should fix that 
on it rn 
wtf is adesi speedrunning
rcl3 already
how did you manage that with this many creeps stationary

wdym stationary
hmm whos more trustable to have as neighbor sam or shiro or juho or some other randoms
i will probably move soon due to death anyways so idk
my creeps expand on their own
my creeps are not stationary
they are just a little stupid and like to block eachother
they may choose to murder my neighbours while im asleep
same 
my base is just locked up rightnow because they are repairing and building and carrying stuff all in like 20 tiles at the same time 
what the fuck is this builder doing
come take a look at my base
the builder near my expanders
should i care about uranium or whatever in the base
nah
nah
not useful until way, way later
this builder is going schizo
i had the same issue... its when you are moving to the same spot over and over
they just shuffle around a little

or wait.. nvm
what the fuck is it trying to get to anyway
it was when you go get energy from your storage but you also give it a different order the next tick
like the state switches every tick
so it does one thing then switches to another and then switches back and repeat
TypeError: Cannot read property 'memory' of undefined mf shut
my conclusion is my code is shit
i'm rewriting the builders anyway
they're on the old system
wha shadow in screeps 
okay everything is just.. broken
saaameee
WHAT THE FUCK IS THIS

hey.
well... today was 15 hours of schizoing (trying language ideas in my head) and i think i got to something thats at least like 5% reasonable
its automatic.
automatic my ass
they're dangerous
the code is thinking ahead, what if someone builds a tunnel there
busy
dw i murdered 3 different miners trying to get them to work
alright, time to write upgrader code cos my controller is very close to downgrading

(and i want GCL)
i need to pee now, i thought this woldnt take 2 hours
i should generalize collectFromStorage
i wonder what happens if i do
once i've finished upgrader and builder i'll have it make more extenders
fuuuck i just completed the tutorial and im already theorycrafting logistics optimizations
done, i read my code quickly i don't think there will be any issues
im gonna be so cooked

i guesstimated that it was indeed a busy error
and its working now i think
lemme check, i went brb for a bit
shard3?
what about shard 3?
where do yall even see?
im pushing 7 or 8 cpu
7/20
12kb
go my taxis, be free!

the taxis recycle themselve now upon finishing their move, so i need to fix some scuff for that
decided to finally remove the absurdly complicated idle "get the fuck off the road" code
.

im telling you, monte carlo fucking off is the way forward
changed mainly cos if they went into idle on my long road from spawn to left miner they'd just fucking
lots of my methods use randomness to speed them up
this is good code surely 
else if (creep.memory.role == 'miner')
{
let moving = roleMiner.run(creep);
let taxi = Game.creeps[creep.memory.taxi];
if(taxi)
{
if (moving == 1)
{
taxi.memory.hauling = true;
}
roleTaxi.move(taxi, creep);
}
}
like when i have expensive operations that need to be done on every room at regular intervals
every few ticks i just pick a random room and process it
tbh my codebase rn is a fucking mess
the builders, until now, were running on the old system

wtf cloud
i bet half of those files are like
5 lines
and the 5 lines in question are
function dikortjhoiejsyiohhd(creep) {
// nothing
}
mine is 47 lines
i feel like every file i have is 100 lines atleast
but that's cos the actual creep logic code is in tasks, not types
logistic creeps have collectFromMiners, collectFromGround, collectFromStorage, storeAtSpawns, storeAtStorage, and storeAtTowers
this is still crazy to me
surely those have like
extremely similar implementations
my latest rework was combining all of those
depends, some do logic checks that are intrinsicly linked to what they're exactly doing
this is my code where i tell my logistic bots where to put their energy and in what order





they should be coming from your west






















