#Screeps Sandbox

1 messages · Page 5 of 1

polar path
#

lol

rotund olive
#

Rust is too powerful for The Sandbox

torpid ledge
#

😦

torpid ledge
rotund olive
#

ah ok

#

yeah I'm good to blame you

#

@scarlet fossil get this guy out of here

#

I would login to the server to see but I don't think I have a valid ssh key anymore

torpid ledge
#

lmao

#

@scarlet fossil my creeps are rotting, sandbox requires assistance 😦

rotund olive
#

if you think you broke it, disable your code and see what happens

torpid ledge
#

just turned it off, still bugged

rotund olive
#

aww

polar path
torpid ledge
#

all my screeps... gone 😔

#

nooooo tunnel man

#

LMAFO it WAS me

torpid ledge
rotund olive
#

Why would that crash the server 😅 shouldn't you just hit the 500 CPU (1000 really) limit and time out?

torpid ledge
rotund olive
#

Ah

#

Weird

torpid ledge
#

I can provide the error rq

rotund olive
#

OK so it's fixed now right I can go back and get my pathfinder working?

torpid ledge
#

ticks seem to be ticking

rotund olive
#

Lovely

#

Now I just need to learn how to do JPS

polar path
#

Yay, now my creeps are working again too

#

Congrats on fixing the server Geo, lol. :P

torpid ledge
polar path
#

It is odd that is is able to crash the server for everyone. Although it's not the first time I've seen something like this happen. I wonder if it's the same think that happened with Gadjung a while ago.

rotund olive
#

lol @torpid ledge gtfo

torpid ledge
#

murder 🙂

rotund olive
#

safemode :))

torpid ledge
#

ye it is, but my defense blinikies consider WORK creeps dangerous

#

so now they're just camping you

torpid ledge
#

my rooms like to juggle defense creeps alot

rotund olive
#

In the next two hours I am going to go from creeps that can't move to an army that will demolish your rooms

#

Enjoy

torpid ledge
rotund olive
#

Yeah I'm working on a custom pathfinder ^

torpid ledge
#

oh ok

rotund olive
#

Going to be faster than the built-in one, by a lot

#

but it isn't working yet

#

when it is working I can start messing you up

torpid ledge
rotund olive
#

you sent me a Blinky lol

torpid ledge
#

I didn't it was trying to support another room with a blinky

rotund olive
#

Well then fix your code from trying to attack safemoded rooms that you pass through 😄

torpid ledge
#

fair, should be like a 2 second fix

#

gimme a moment

rotund olive
#

lovely

torpid ledge
#

@rotund olive btw even if you do murder me, I ask that you keep tunnel man alive

#

this room deserves to be in a museum

rotund olive
#

hahaha lol

#

Even if tunnel land bugs out I will work to keep them alive, I promise

scarlet fossil
#

Rebooted server just for the sake of it

sonic marsh
#

My bot's already marked the room as such XD

torpid ledge
#

oh also @rotund olive why did you choose to spawn in geoland when there was 2 completely free zones next to me

sonic marsh
#

Did he spawn in geoland, or were you squatting in marvinland without realizing 😛

torpid ledge
sonic marsh
#

Run him outta town before he owns the place lol

sonic marsh
torpid ledge
#

Like are vassals the highest level of friendship you have? Or some other tier of it?

sonic marsh
#

Oh, no. Codewise I don't have anything for vassal. Although the way my remote and supply system work, if I mark a player's room as a remote my creeps will just empty everything in it of resources that they can reach. So probably that.

torpid ledge
#

Oh

#

I assumed vassal was one of the tiers of your medieval bot

#

For friendship

sonic marsh
#

Nah, I suppose it could be though. My diplomacy is allies, ceasefire (non-hostile unless they shoot first or they walk in one of my rooms), and outlaws (actively hostile).

#

Which I'm not terribly happy with those names but haven't looked at that system in ages, needs another run through the creative process lol

torpid ledge
#

@rotund olive why'd you move closer to one of my rooms

rotund olive
#

To get closer to my subject

polar path
#

Hmmm

torpid ledge
#

@rotund olive what happened to the conquering?

scarlet fossil
torpid ledge
#

mutually assured sandbox shutdown

rotund olive
#

Hahaha

#

Yep

#

Nah I got the pathfinding working so now I gotta code more

#

Don't want to be distracted by an ant colony

#

Now designing an entity compotent system for room data, then compressing it with bitcode+base32764 into memory for Giga efficient parsing and storage efficiency (will basically make memory have 50x more storage efficiency than what I even had with commie bot TS)

#

You can basically only accomplish this with wasm as far as I'm aware. This should give me a significant advantage in CPU and Memory over basically every bot

slender compass
#

you're going for a ECS system?
what do you think the advantages will be for that?
im not too familiar with it but very curious as to why/how you would use it for screeps

rotund olive
#

I guess calling it an ECS is a bit unfair to real ECS systems. Basically I'm structuring room memory based on shared characteristics as you would for compontents in an ECS. I like this for type correlation - if I know a room is harvestable then I know it has recorded source and mineral positions - and it's easy to clean up data when things change. For example, if a remote is no longer close enough to a claimed room to be a remote, all its data can easily be deleted.

So RoomMemory only has the basic shared properties

pub struct RoomMemory {
    pub room_type: StaticRoomType,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub danger: Option<u32>,
    pub last_scout: u32,
}```
#

Hmm my copy+paste is broken

#

ok will continue in #the-international

polar path
#

Looks like my first test of emptying the terminal and storage before destroying them in migration worked mostly fine. Some resources decayed because the distance calculation in the job search made bad assumptions, but it saved most of the resources.

kind trench
rotund olive
kind trench
#

@scarlet fossil did some digging at some point

scarlet fossil
#

Did I? I don't remember looking at that one in particular…

#

When was that, I wanna see what the logs are

kind trench
#

some time ago, is the best i can do

scarlet fossil
#
screeps-1  | 2025-03-23T00:00:08.505882125Z [engine_runner1] process 167448 exited with code null, restarting...
#

First one is at ```
screeps-1 | 2025-03-22T23:43:43.530392973Z [engine_runner1] process 2254 exited with code null, restarting...

#

I mean, that's a good way to exhaust the process id space

polar path
#

Did you do it again, @torpid ledge? :P

#

I'm getting reset storms again

scarlet fossil
#

screeps-1 | 2025-03-25T06:46:21.016414509Z [engine_runner1] runtime restart signal

#

Server's always really helpful

#

Yeah, runner is getting SIGSEGVs in a loop

scarlet fossil
#

No idea why, but they're suspended now

#

I suspended everyone and went through each one by one until I got them sieved out

ebon palm
#

are we all on pause until we pass the test?

scarlet fossil
#

No, everyone should be running again

#

Unless I messed up somewhere

#

Gah, the server auto-reenabled them :/

polar path
#

Cool, glad you got that figured out. It is annoying that that is a thing. 🙃

scarlet fossil
#

Yeah, would love to have a bit more data but I'm not sure how to debug something like that

#

I've found one package that's supposed to help with catching segfaults like that to give you a log file, but I'd need to build the image with it because it needs node-gyp

#

So I'd need to somehow… get my own modified screeps package out somewhere, edit that in, then edit Jomik's image builder to use those instead, then check that it still magically hasn't broke itself

torpid ledge
polar path
#

Sorry, I just saw the same symptoms so figured it might be the same cause. XD

scarlet fossil
#

Okay, they fixed their code once I hinted that it could be a recursive loop

#

Would still love to get a better fix than "don't do it" though

polar path
#

In theory, the server should handle it more gracefully so it only impacts that player.

#

And so that they get feedback on the issue

#

I think I had runaway recursion during my tests on screeps-launcher and got decent feedback about it, so maybe this issue is exclusive to Jomiks?

scarlet fossil
#

Possibly? I'd have to check that at some point…

ebon palm
#

Could be worth asking O4, how they tackled it in MMO. So you're saying something as simple as ```
Func a(){ b() }
Func b(){ a() }
a()

Is good enough to crash a server ?
scarlet fossil
#

Unconfirmed, but possibly?

torpid ledge
#

So it looked more like
Func a() { a() }

ebon palm
#

Yeah, there is unlimited ways to code up recursion. Nodejs must have some protection against it

#

In PHP it's a maximum call stack, default to 100. You can change it in the ini

ebon palm
#

Some initial googling indicates that recursive code should throw an InternalError or RangeError . So this should be catchable. Sure the user code is wrapped in a try catch ?

scarlet fossil
#

I mean, my gut feeling tells me IVM should have complained loudly about that and not actually crash

ebon palm
#

yeah, also i might be over slimplifying the model. Considering try {/*user code*/ }catch{ /*handle bad user*/ } isn't good enough to stop syntax errors. So its probably much more complicated.

kind trench
#

also i've sent o4 mail and pm with code example quite some time ago

torpid ledge
#

@scarlet fossil sandbox down

scarlet fossil
#

Ooof, actually hard down

#

@radiant lily Sorry for the ping, but the server appears to be in trouble?

#

It's not responding to pings, and ssh is also down

scarlet fossil
#

Sandbox is back up and running. Looks like the server unexpectedly went for a nap

#

Had to help redis get its marbles back in line, so hopefully no data loss there, but I have honestly no idea

rotund olive
scarlet fossil
#

Yeah, we had a little chat just now

rotund olive
#

sweet

scarlet fossil
#

@storm hazel You seem to be struggling a bit?

storm hazel
#

don't have access to sandbox right now, what happened ?

scarlet fossil
#

Still do, about every 5 ticks

storm hazel
# scarlet fossil Still do, about every 5 ticks

well it looks like i was too optimistic when estimating how much rooms can i controll with (it is for sure less than GCL), so let's check if killing every creep and releasing one room helps

torpid ledge
storm hazel
#

for sure it will but i do not think i have to care that much about eco now (my creeps logic isn't that advanced)

polar path
#

First deposit mining in my new bot. 🎉

#

It still has some bugs to work out, for sure.

polar path
#

I think I am going to fully rework my resource handling system again.

#

I think I should make everything GOAP.

violet lake
#

hey, when trying to create an account with the unofficial HTTP API endpoint api/register/submit, it throws a 500 error code at me

#

the endpoint doesnt seem defunct as it works on https://screeps.com/api/register/submit

#

nvm, doesnt seem to work on any community server

scarlet fossil
#

Runner has started crashing :/

#

Anyone else just pushed some code recently?

sonic marsh
#

I didn't, but I'd be happy to level some unfounded accusations to get the ball rolling

scarlet fossil
#

Let the gossip flow lol

#

I have no idea who it is tho

#
screeps-1  | 2025-05-06T14:06:29.044189873Z [backend] Running cronjob 'screepsLauncherConfig'
screeps-1  | 2025-05-06T14:06:29.297152076Z [engine_runner1] Terrain shared buffer size: 10880000
screeps-1  | 2025-05-06T14:06:29.811369925Z [engine_runner1] (node:1218) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
screeps-1  | 2025-05-06T14:06:30.358855049Z [engine_runner1] (node:1218) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
screeps-1  | 2025-05-06T14:06:31.048785924Z [engine_runner1] process 1218 exited with signal SIGSEGV, restarting...
screeps-1  | 2025-05-06T14:06:32.045714299Z [backend] Running cronjob 'screepsLauncherConfig'
screeps-1  | 2025-05-06T14:06:32.055902452Z [engine_runner1] process 1251 started
#

I'm tempted to try and install segfault-handler into the Docker image and try to see if that gives me more info, but… meh

#

Welp, I rebuilt the container, messed up because it grabbed the prebuilt version without my tweaks, and started ticking right back up ¯_(ツ)_/¯

sonic marsh
#

The machine spirit just trying to keep you on your toes

ember axle
#

How much memory is the server rocking?

#

And do you have any o11y metrics for server/process -level memory use?

scarlet fossil
#

I have htop

#

That's about it lol

#

Holy smokes I just saw the history workers thunder-herd

ember axle
#

If you keep hitting issues like this, it might be worth setting up metrics on your cloud provider. In my experience, segfaults in node are usually due to something trying to allocate far more memory than it has any business using.

scarlet fossil
#

Yeah, I don't have access to the provider

#

I am using --max-old-space-size=4096 in NODE_OPTIONS in the compose file tho

ember axle
scarlet fossil
#

True, but I don't think I care enough to set that up 😅

#

I mean, it's been running for… ~40 days, and it just now had a little burp

ember axle
#

Fair. The only reason I'm so active on Discord is because I don't want to read this algo book so I can finish rolling my base planner :p

scarlet fossil
#

Haha, I know the feeling

ember axle
#

Yay not getting things done

scarlet fossil
#

I'm gonna try and see if I can get segfault-handler installed into the image for real, and try to wire it up

#

Also… I need to reapply my manual patches :/

ember axle
scarlet fossil
#

If only, lol

#

Bleh, failed compilation on missing execinfo.h

ember axle
# scarlet fossil If only, lol

As someone who has never been responsible for fixing merge conflicts between a fork and its upstream, I'm in favor of it 😆

scarlet fossil
#

Okay, I think I got it to run with segfault-handler?

#

Now I need a segfault 😅

scarlet fossil
#

I'm also a bit worried I saw a "missing return statement at the end of a non-void returning function" while building… something

#

either IVM or the pathfinder

scarlet fossil
#

Took me a bit, but added power, ops & battery buy orders to the market

#

Pretty sure it's not exactly balanced, so… yeah

sonic marsh
#

You got some thicc roads @cold zephyr

cold zephyr
# sonic marsh You got some thicc roads <@396443762001313802>

Yea my roadbuilder has some Problems. But only if it runs very often.(or if my base is there a long time) i think every 1500 Tiks there is a chance 1 more road gets added. I think it is when a creep is evading some other creep and the roadbuilder runs at that exact time.

sonic marsh
#

Interesting. I like it, it's intimidating XD

ember axle
#

LA freeway roads. It's a style statement

scarlet fossil
#

Bleh, there's a KasamiBot in the SW corner :/

#

-# I might have bumped tunnel man all the way to RCL8 to see how the bot would react

#

-# ||It did absolutely nothing||

sonic marsh
scarlet fossil
#

Truly 😅

#

Gave them the root boop

#

Alas, it really didn't do anything. I was half-expecting everything to start crashing, but no, still upgrading with way too many workers now, pumping those tunnels, and ignoring that tower

sullen condor
#

@cold zephyr Changed something in sandbox?

#

From yesterday, I watched my bot attacking yours and improved some of quad movement logic. And suddenly your defense looks better now

cold zephyr
#

no nothing changed on my part

sullen condor
#

Oh really

#

I was not seeing any repairer but now there are

cold zephyr
#

last change on sandbox was 14.3.2025

sullen condor
#

I see

cold zephyr
#

i should port over some bugfixes too sandbox (nothing in new combat though)

sullen condor
#

Cool. I changed auto attack ranged from 8 to 4. I wanted to test combat code in sandbox but there are not much rooms near my bot😅

cold zephyr
#

feel free to continue testing. maybee i can even look at my faulty repairercode🤔

#

now powerharvesting is fixed and over time i will be able to spawn a powercreep which should in theory help out in defence. never testet that though

sullen condor
#

Cool. Let me know when you use power creeps in defense

cold zephyr
scarlet fossil
#

Someone's crashing the server

#

Who pushed not that long ago? 😅

#

@sonic marsh Mind taking a look? I think it's you

sonic marsh
scarlet fossil
#

I'm confused, actually

#

I'm not sure it's you anymore

sonic marsh
#

Oh wait this is sandbox? The thunderdrone bug shouldn't be present in my bot here

scarlet fossil
#

I mean, I disabled everyone and started slowly reenabling players one by one

#

When I reached you, instant crash

#

So I just kept going, and then decided to YOLO it 'cause I have 61 of those to do

#

Reenabled everyone

#

Not crashing anymore

#

So maybe whatever it was that was crashing fixed itself?

sonic marsh
#

.>. Sketchy, you can just keep mine killed since we aren't sure. I'll double check to see if it has that bug when I get home

scarlet fossil
#

I've only noticed because of

sonic marsh
#

Lol, I dunno what that all means but I do know sudden spikes are generally a bad thing.

scarlet fossil
#

Red spikes are reset events

#

yellow is bucket, and the colored graph is avg CPU

sullen condor
#

Sandbox is weird

#

Btw I want to suggest a fresh start if others feel ok

scarlet fossil
#

Gave it a restart but I'm not seeing much

#

Jasper is using the bucket a lot but that's it

#

It's resetting a lot :/

sullen condor
#

I guess that's just because his gcl is too high for 100 cpu

#

Jasper bot has completely stopped

scarlet fossil
#

yeah, it's being skipped every tick

#

what's weird to me is that, clearly, there's something wrong, but I'm not getting my usual "runner process killed" errors

slender compass
#

Huhh, ill have to take a look

#

I wonder what its doing

slender compass
#

seems to somehow have gotten into a reboot loop because querying the room status is stupidly expensive and i don't have game.cpu.getUsed() checks for that

sullen condor
#

Can be fixed?

slender compass
#

absolutely, either i make it fast with some magicTM or add some checks and make all logic interacting with it more complicated

#

or i could pause my bot for even longer at startup and cache the room status of all rooms beforehand

#

the last one is definitely the easiest, since its loading segments anyway and not using any cpu i could just use the cpu im not spending there

sullen condor
#

Cool

polar path
scarlet fossil
#

Haven't had the time to do much code-wise

#

I did fix my inclusion mess, so at least I don't have to manually edit the final source file anymore 😅

sullen condor
#

inclusion mess?

scarlet fossil
#

Random OM issues of circular dependencies

#

It's a conjunction of my not quite complete renew support and improvements to colonization in the face of hostiles (what to do if there's a core, or reservation or whatever)

#

The renew support needed to know if there was a colonization directive in the room to disable the spawn and switch to renew-only mode, since the incubating colonies have a higher level than it can spawn naturally.

#

The hostile-managing colonization added a couple new overlords to the base directive, to potentially handle sending controller attack creeps.

#

The two merged together caused a shift in the inclusion order where CombatOverlord (the abstract combat-specific Overlord subclass) would end up being defined after its first use, thus causing a runtime error

#

I just broke the cycle from renew -> colonization, since I already have a state flag to know, I don't need to check for a directive (it's already handled in a way that doesn't introduce a cycle)

#

Best. Quality. Time. Spent. Coding.

sullen condor
#

Cool. So OM's directives are kind of missions and each directive can create other directive?

scarlet fossil
#

Yeah, exactly. It can happen, but generally it's up to the Overseer to place down directives

#

Directives have overlords, which are the actual creep managers

sullen condor
#

Can you explain more about overseer>?

scarlet fossil
#

Overseer is just the global "let's check what's going on" thing

sullen condor
#

Oversees the entire bot?

scarlet fossil
#

It's the one placing almost all of the directives around

#

Yeah, pretty much

#

So it's the one placing deposit gathering directives, the various types of defense directives, strongholds, poisoning when that's enabled, colonization

sullen condor
#

I see. Is there any "Big" directive? Like, "Kill this bot"

scarlet fossil
#

not really, no. There's "siege room"

sullen condor
#

I see

scarlet fossil
#

But OM's diplomacy system is really barebones. It only has ally/enemy, it doesn't know who you are

sullen condor
#

Does overseer have responsibility over both military and economic decisions?

scarlet fossil
#

Kinda, yeah

sullen condor
#

I wonder how much responsibility it has

#

Maybe almost everything?

sullen condor
#

It's interesting that my bot's mission system is being much like OM's

scarlet fossil
#

Though, I don't have any offensive military capability there

#

Wouldn't be that hard to add though

sullen condor
#

What's overlord then

#

The ones between overseer and directives?

scarlet fossil
#

Below directives and a few others, but those are special cases

#

Overlord is mostly a creep manager abstraction

sullen condor
#

In that case I'm not sure why there is directives and overlords

scarlet fossil
#

It's the part that has automatic population tracking ability, it's the piece that handles calculating an appropriate number of creep for each role it manages, and sends request to the spawn manager

#

It's also the place you find "day-to-day", "creep do this" code

scarlet fossil
#

For example, the colonization directive has a pioneer overlord, which is in charge of the workers to build the spawn, and a reserver overlord (which handles a CLAIM creep) to… do just that

#

once the spawn gets built, the directive sees that and reassign its pioneers to become the new colony's workers, then deletes itself

scarlet fossil
sullen condor
#

I see. So overlords are unit actions and directives are colection of actions for a certain goal

scarlet fossil
#

Pretty much, yeah

#

I like that, because it improves on composability

sullen condor
#

Now I can see the philosophy in it, after all these years of screeps

scarlet fossil
#

Like, my colonization improvements are just me tacking on a scout overlord if I can't get an observer to give me fresh data, then a controllerAttack overlord

#

OM has some really neat stuff when you look closer

#

The SpawnGroup system is great, for example

sullen condor
#

I'm planning to make them as one category though

#

Directives and overlords are both missions in my bot

scarlet fossil
#

It acts as a dispatching proxy over the Hatchery (the actual manager responsible for spawns, one per colony). So you can initialize one in your specific overlord (colonization does, for example, but there's a few others), and then any creep request made from that manager are actually dispatched around to all colonies that match the spawngroup filter

#

So by default you have one overlord linked to its colony, using its Hatchery, but if you need some extra spawning oompf, you set up a spawn group, and it just works. There's no difference in how the API to request creeps (it's wishlist()) is used

sullen condor
#

How does it calc proximity?

#

Actual path length or route length or linear distance

scarlet fossil
sullen condor
#

Isn't it very expensive to find the closest spawn?

scarlet fossil
#

So you can say "I want all RCL>6 rooms, less than 5 rooms away, with paths less than n tiles long"

scarlet fossil
#

You don't generally specify which spawn is gonna be used. You just ask the hatchery and it'll select one

sullen condor
#

Colony = one owned room?

scarlet fossil
#

Yep

#

You can, but as far as I'm aware there's only one use of it, the manager

#

And IIRC it's even hardcoded into the Hatchery itself

#

Actually, I'm wrong, it's not hardcoded

#

All of a colony's spawns have "cute" names, so there's core, left and right

#

One of the places that is gonna be trouble for me if I ever pick back up my dynamic planner 😅

sullen condor
#

So when overseer drops a directive, directive finds every room that can spawn creeps for it and remember them as spawnGroup?

scarlet fossil
#

It's not as static, and spawn groups are just an extra, optional layer

#

You can just add the spawn group at the directive level if you need to

sullen condor
#

I see.

#

I think that's cool to have, compared to fixed spawn room

scarlet fossil
#

Heh, colonize doesn't actually use a spawn group lol

#

Incubate does, that's why

#

Those are generally dropped together. Incubation is actually one of the pieces I restored from baseline OM

#

Mostly it's a hint that a colony has its spawning replaced by the spawn group attached to it

#

So when it's detected in a room, all of the colony's spawn requests are actually dispatched to every other colony nearby

#

And with the new renew code, those get to stay alive using the colony's now idle spawn

sullen condor
#

I see. So a new room can request creeps to other rooms

scarlet fossil
#

Yeah, that helps with bringing up rooms quickly

#

Since they get to use the higher spawn capacity

sullen condor
#

It might be possible to spawn a quad from two rooms, 2 creeps each

#

No need to waste ttl

scarlet fossil
#

Pretty much, yeah

#

A lot of the combat overlords do that anyway

#

It's actually automatically setup for those

#

The only "civilian" ones using spawn groups are PowerHauling and RemoteUpgrader

sullen condor
#

I see

#

Do you think is it really necessary to seperate directive and overlord?

scarlet fossil
#

I think so? It really helps with composability

sullen condor
#

Like reusing the same overlords in different directives

scarlet fossil
#

Yeah

#

Granted, it's not happening a lot, but it does happen

#

Things like scouts, where the directive might need visibility over the room to work

#

The reserver

sullen condor
#

Yeah

scarlet fossil
#

One I was thinking about was a wall-punching one

#

That would automatically do the most efficient thing to take out obstacles to its target

#

The miner could use that. Possibly dismantling a room

sullen condor
#

I have one which is similar to that

#

Dismantle to the controller

scarlet fossil
#

I don't have generic code for that, IIRC

#

but that's definitely something I thought about, since I think my colonization improvement did add handling for that

sullen condor
#

Hmm. It seems that the ones act like overlords in OM in my code is spread across several modules

scarlet fossil
#

I mean, it also works, it's just that OM makes it really strict by going hard on classes

#

You could have a bunch of more-or-less open-coded methods to do those sort of generic tasks

#

It's a bit messy when you have some need for external data to share

sullen condor
#

creepUtils, creepRoles, creepActions, spawnManager, etc

scarlet fossil
#

which is why having the Overlord around helps (the directive as well, in some cases). All the various pieces of the code have a quick access to their shared data

sullen condor
#

Blackboard thing, I know

scarlet fossil
#

Kinda, yeah. power mining is a good example of that. It tracks the global state of the mining attempt, and has two overlords: powerMine and powerHaul

#

I mean, all that stuff is really non-generic, so ¯_(ツ)_/¯

sullen condor
#

For me, it's weird to make a class when I will not make more than one instance

scarlet fossil
#

That can happen~ It's generally called a singleton

#

I have a bunch of those

sullen condor
#

Yeah

#

Unstable nature of screeps heap makes me hesitate to use classes often

scarlet fossil
#

unstable?

sullen condor
#

If I can make a mission as class and believe that it can last as long as I want, I would make my missions as classes

scarlet fossil
#

Ah, yeah, I understand

sullen condor
#

But since those missions classes csn be gone after reset, I made missions as object in memory

scarlet fossil
#

you could recreate them

sullen condor
#

And made missionHandler rather than missions

scarlet fossil
#

That's actually why directives are linked to flags here

sullen condor
#

missionHandler reads missions in memory and do its job

scarlet fossil
#

each color combo has its own (potential) Directive class, and on a reset, it just goes through all of the flags and recreates the instance

sullen condor
#

So there is only one handler per one mission type

scarlet fossil
#

Then those load their memory back and it's up to the races

sullen condor
#

I see. Though not sure that's better than handler approach. What would be pros and cons

scarlet fossil
#

Well, you have a well-defined class for the thing

sullen condor
#

My handler is not a class, it is object with various methods

scarlet fossil
#

And I'm pretty sure your handler is the same thing I have for the initializer

sullen condor
#

Usually createMission() and runMissions()

scarlet fossil
#

Ah, no, it's different then

#

I use the constructor for create, and run is one of the runtime phases

sullen condor
#

So I call createMission() when I want to create mission object in Memory.missions

#

And each handler runs every missions of its type every tick. All the necessary information is written in mission object in Memory

#

Like, target room, spawn room, when it is created, etc

scarlet fossil
#

Okay, it just feels more function-based that what I have, but kinda the same

sullen condor
#

Btw. Time to sleep for me. Was good convo. Got many inspirations. Thanks!

scarlet fossil
#

Sure! good night!

sullen condor
#

Is it only me that feels like sandbox is acting weird

scarlet fossil
#

I'm not seeing anything weird in the logs

#

There's a KasamiBot tho

#

And an Overmind, even

sullen condor
#

I'm seeing this rate of reset. Several of them are done by me (code push) but most of them are not

#

3~4 per minute?

#

And it's 12:03 now. So reset storm stopped

#

About 40 minutes ago

scarlet fossil
#

Yeah, someone might have messed up

#

I just rebooted the server after updating a few mods

sullen condor
#

Cool. Seems like working better

scarlet fossil
#

Removed the bots

sullen condor
#

Cool

#

Thanks!

scarlet fossil
#

Hello, fellow sandboxers! I was thinking of doing a reset, and setting up Alina's more recent Node server instead of the usual Jomik server I use. Hoping to give that a bit of actual run time to try and iron out issues we could find in it, both in terms of mods and bot behavior.

GitHub

Contribute to screepers/screeps-launcher-node development by creating an account on GitHub.

#

I mean, I should really start by doing a test run of that locally for the admin part, but… I feel like that could be an interesting thing to set up to try and get out of the old Node lock up problem

sullen condor
#

Oh cool, reset and some updates!

scarlet fossil
#

It's honestly just a try. I'm gonna have to look a bit closer how to admin that one, but I feel like it could give some nice data to @austere forge, at the very least in terms of things that are not working right

austere forge
#

I will note, that while it worked last I used it, I remember there were issues with node 22, I think it was working on 18 and 20 though. Its not battle tested like screeps-launcher or jomiks though

scarlet fossil
#

I get that, but I felt like doing something daring like giving it some battle testing would be a fun thing to do

#

Soooo 😅

austere forge
#

Testing in prod is the best way lol

ebon palm
#

So I assume or bots would be able to use node 20 features too?

scarlet fossil
#

Huu, I got the weirdest error…

#
Error: Could not find an object with ID 68d0950e92c235485b50fa07
    at data (<runtime>:24426:19)
    at Object.get [as fatigue] (eval at exports.defineGameObjectProperties (<runtime>:586:9), <anonymous>:7:66)
    at isCreep (main:2636:16)
    at Function.getCombatPotential (main:18742:33)
    at Function.getCombatPotentials (main:18768:36)
    at OutpostDefenseOverlord.getEnemyPotentials (main:40560:46)
    at OutpostDefenseOverlord.init (main:40583:28)
    at tryCatch (main:23171:33)
    at tryCatch (main:1593:9)
    at OutpostDefenseOverlord.doInit (main:23171:13)
    at Overseer.init (main:47676:22)
    at try (main:48967:38)
    at _Overmind.try (main:48833:17)
    at _Overmind.init (main:48967:17)
    at Object.main [as loop] (main:50139:16)
    at __mainLoop:1:52
    at __mainLoop:2:3
    at Object.exports.evalCode (<runtime>:15381:76)
    at Object.exports.run (<runtime>:20865:24)
#

that getEnemyPotentials is passed this.room.hostiles, which is a one-tick cached wrapper around .find(FIND_HOSTILE_CREEPS) + pcreeps

#

So the game gave me an object I couldn't touch or something…

neon rain
#

I seem to be getting lots of global resets even after I changed my code so it only prints the tick and bucket. Is something up?

scarlet fossil
#

I was trying to pin point an infinite loop I had and forgot I was doing that 😅

neon rain
#

Oh...

#

I guess everyone found it without finding it.

scarlet fossil
#

ahah, kinda, yeah

torpid ledge
#

did you ever fix that one bug that I found that crashes sandbox btw?

scarlet fossil
#

nope

#

I did get a core dump out of it, but it's just a standard stack overflow

sullen condor
#

Is it server or my bot that is weird

scarlet fossil
#

@kind trench you're eating your bucket I think?

#

let me kick the server just in case…

sullen condor
#

Thanks. Seems OK now

scarlet fossil
#

Gadjung is still skipping every few 6 ticks or so

scarlet fossil
#

Okay, it's time for a good ol' server nuke nuke

scarlet fossil
#

For the record, I'm grabbing a copy of the user table (NOT their code), 'cause there's like… 218 of those, and I'm pretty sure a cronjob that automatically prunes people that just log into the server and never spawn would be nice.

scarlet fossil
#

Okay, server map generated, so it's all set and ready

#

Do tell if you spot an exit "hole" somewhere tho

#

I made sure to close off all of the world borders this time

#

-# Something I should really be teaching maptool how to do on its own

#

Tick start… I don't know… next Saturday?

#

Next Saturday is good

sullen condor
#

Yeah. I love it!

#

We should advertise this

gritty river
#

what is required to set up for this? - it is my first time connecting to a community server. I was able to connect from steam client and choose a room no problem, but I am a little lost in terms of whether I need to set up a token or a password to be able to upload my scripts.

scarlet fossil
#

Any community servers depends on screepsmod-auth, and that mod exposes a special page to set your client password (since tokens aren't a thing on community servers as far as I'm aware).

#

You should be able to set new password and login with Steam, which will set your user's password, and then you can use that to push code to it

gritty river
slender compass
#

Oh, i totally forgot about sandbox, should be a excellent place to test my room based -> mission based rewrite!

sullen condor
#

Cool

slender compass
#

That part hasn't been transferred yet

verbal moth
#

if you just upload by copy pasting into your steam client while logged in you dont need to setup anything. if you want to push with your own script you'll have to set a password and then push using your username and said password. that's really all there is to it

scarlet fossil
#

Tick start for tomorrow is gonna be <t:1763226000:F>

storm hazel
#

should we be able to push code with grunt ? i got error code 401 which afaik means that i provided invalid credentials (email/password) but i double (or even triple) checked that and it seems to be set correctly

scarlet fossil
#

I… don't see why not?

#

I'm not using grunt tho, but I did rollup-push already

#

not seeing anything weird in the logs, but I don't think those kind of events are even logged

scarlet fossil
storm hazel
#

is such command grunt screeps --gruntfile gruntfileSandbox.js correct or am i missing something here ?

storm hazel
scarlet fossil
#

though I think doing it through the game is the same thing…

storm hazel
#

yes, and it looks like i got error somewhere in the command i posted above or in gruntfileSandbox.js which looks like:

module.exports = function(grunt) {

    grunt.loadNpmTasks('grunt-screeps');

    grunt.initConfig({
        screeps: {
            options: {
                email: '[email protected]',
                password: 'myPassword',
                branch: 'default',
                server: 'jayseegames.com'
            },
            dist: {
                src: ['ScreepsRabbitHole/*.js']
            }
        }
    });
}

because as i changed email and password here to my MMO credentials and commented server out the code got pushed to MMO

scarlet fossil
#

maybe… ```js
server: {
host: 'jayseegames.com',
port: 21025,
http: true
},

?
storm hazel
#

just added that, no difference, also tried to use 45.141.24.22 instead of yajseegames.com

scarlet fossil
#

Yeah, I'm baffled then

#

I don't see what would grunt be doing differently. It's really just an API call underneath it all

storm hazel
#

is there anyway to somehow "debug" such grunt screeps --gruntfile gruntfileSandbox.js command ? to see what it loads ?

scarlet fossil
storm hazel
#

i created password with link you provided earlier and set up an email but can i somehow create Auth Token on this server ? on MMO it can be done with UI in "Manage Account" Section

scarlet fossil
#

no, pservers don't do tokens

storm hazel
#

fixed that sh!t

#

please be nice enough NOT to ask what was wrong

#

(it was a typo)

#

anyway thank you @scarlet fossil very much for your time

scarlet fossil
#

you're welcome! glad you managed to join, too~

scarlet fossil
#

Whoops, forgot my alarm 😅

scarlet fossil
#

Hmm, lot of crashing players, I think

#

@normal tendon if you've got the time to look

#

idle?: PowerDuDe_DK, @slender compass, Brolaf, pelagian, jack
crashing: izmort
running: Buckle, Traxus, Harabi, Kalgen, Conventia, Kushy, @storm hazel

#

I don't think the idle group has anything pushed tho

#

(I don't want to look, I just peeked at console output for the ones that weren't actively moving)

slender compass
#

oh what? i thought i pushed something, ill have a look, thanks for the ping!

scarlet fossil
#

I was surprised to see you in there, since we went through that exact thing

#

@arctic pendant wanna join as well? 😁 if you want some speeeed

arctic pendant
#

bad timing for me, my codebase is all messed up for low RCL right now

scarlet fossil
#

well, I see an opportunity~

#

but I get that

slender compass
#

failed to plan room, auto spawn placement no work

#

ah yes, gotta love my hacky room planner

scarlet fossil
#

the one that's really odd is izmort. His bot ran, placed csites, but now it's stuck crashing trying to import an utils module

slender compass
#

running now, thanks!

scarlet fossil
slender compass
#

(:

#

laughs in permanent 0kb/2048kb

arctic pendant
#

I guess I'll try the steam login?

arctic pendant
arctic pendant
#

I guess technically I could push code, but I'm a long way from being able to run a codebase blind. (Is that even possible? can a script place its first spawn on its own?)

storm hazel
arctic pendant
#

oh, apparently I need to use the steam client to connect?

scarlet fossil
#

Yeah, the process is "use steam to create account", then go to the authmod page to set a password so that you can push through the API

arctic pendant
#

yeah, I figured that out

#

I just couldn't figure out how to actually get into the game interface

#

eventually tried the steam client and that worked

scarlet fossil
#

yeah, that or steamless should work

#

I think steamless is preferred for pservers tho? Not sure why tho

sullen condor
#

Oh. My bot was not crashed!

#

My bot was crashed several times in events (ba, swc, etc) so I was a bit worried

scarlet fossil
#

I mean, it's likely it crashed, but that's because I forgot to reboot the server, so everyone ate a couple ticks of "Missing room data" exceptions at the start 😅

#

But then it was part of the few that kept on going

haughty cloak
#

Is there a grafana dashboard for Sandbox?

scarlet fossil
#

you can use Pandascreeps

haughty cloak
#

Grafana is my kryptonite.

scarlet fossil
#

Heh, I can get that 😅

#

But if you're already using Pandascreeps for tracking MMO, you can just create another entry there, and pull the data into the same dashboard

#

You should be able to define 2, possibly 3 variables in there: $server, which is data.*, shard, which is data.$server.*. And if you set up a Stats prefix of "your username" in the management website, user, which is data.$server.$shard.*. Then you get a selector for each on your dashboard and can switch around

#

if you didn't setup a "user" stats prefix, you can ignore that, as there's no way to retroactively fix everything that's been pulled. And it's not even really useful in any case

haughty cloak
#

Yeah, I've never enabled panda for mmo either. Just used the public dashboards.

#

Maybe that's my rabbit hole for tonight. Either use panda, or set up my own grafana instance?

#

I've tried the latter a couple times in the past and always ended with Fail.

#

Maybe I give up and do it pandastyle.

scarlet fossil
#

either works, if you have a place to host. It's just a bit tricky, because Grafana just provides the visualization. You need another part to handle grabbing the data from the Screeps API and massaging it into something Grafana can work with

haughty cloak
#

That's been the issue. Getting the stats gateway to integrate and such.

scarlet fossil
haughty cloak
#

But I just did panda for jaysee and that was painless enough. Its supposedly pulling admin stats, but I don't see those.

#

(except of course now they do appear. pull delay, I guess?)

scarlet fossil
#

yeah, likely. The pulling only happens every few… whatevers

#

5 minutes?

#

you can check the pull logs from the management site

haughty cloak
#

6 minutes between last 2. I think the issue was the grafana dropdown not refreshing for new paths, since my first config didn't enable adminStats. Seems to be working now though, thanks!

scarlet fossil
#

I don't even know what adminStats is lol

#

If you want to look around at the raw data, you can use Grafana's Explore thing in the left pane, Datasource, select your Graphite source, then Explore Data at the top right

haughty cloak
#

adminUtilsStats comes from the adminUtils mod. Exports stuff like Game.gcl.level, Game.gcl.progress, CPU used, etc, for each player.

scarlet fossil
#

nah, because of the UUID

arctic pendant
#

ok, well, I threw together a stupid simple one-role codebase for the sandbox. it will chug along slowly overnight. I'm really more focused on room planning right now, so maybe I'll get to put some more of that into action tomorrow.

#

on the bright side, that role should be robust enough to serve as the emergency recovery life support role for any RCL1 / stunlocked / etc rooms in the future 🙂

arctic pendant
#

well that's a bad sign

#

I recall a long time ago figuring out it was possible to mine sourcekeeper rooms at RCL6. I guess I'll soon find out what fighting invader rooms at low RCL looks like.

slender compass
#

already found a ton of bugs that somehow never occured while i was testing on my own private server!
division by 0 panics, rooms are not registered as spawnable at global init, only after 5 minutes does it refresh, and some auto-expansion bugs causing it to not trigger when it should..

arctic pendant
#

I found a room with the controller on a 1x1 section of wall. Not sure that can happen on World.

arctic pendant
#

gonna be at RCL 5 before I stop using my RCL 1 life support role. I've been focusing on my room planner this whole time.

scarlet fossil
arctic pendant
#

I have no idea why/how my code start producing this error:

SyntaxError: Unexpected token u in JSON at position 0
    at Object.parse ()
    at global._init.global._start (:16017:61)
    at ()
    at make (/screeps/node_modules/@screeps/driver/lib/runtime/make.js:160:34)
scarlet fossil
#

should be fixed?

#

that happens from time to time. some sort of private server bug

#

(I rebooted the server)

arctic pendant
#

I'm still seeing the error

scarlet fossil
#

ah, no, someone did an infinite loop :/

arctic pendant
#

I may have done that earlier?

scarlet fossil
#

maybe? you tell me lol

arctic pendant
#

I don't know. My bucket ran out, but I don't think my code changed before or after that.

#

I've just been adding log functions since then to try to figure out what was causing the JSON error

#

the game interface says I'm using 0cpu

scarlet fossil
#

lol, it's me

#

okay, should be back in order now

arctic pendant
#

@scarlet fossil same problems again, parse error and slow ticks

scarlet fossil
#

Hmm, doesn't appear to be me this time…

scarlet fossil
#

Okay, server paused until I get more time to look at what's going on

#

The runner's crashing, but that's about what I could get out of the logs, even after trying to pinpoint who is running when that happens

arctic pendant
#

thanks for the update

scarlet fossil
#

Okay, it's running again

#

@viral olive I'm pretty sure you're the one crashing?

viral olive
#

Crashing the server? Not sure what you mean...

#

I just know that my code didn't really run

scarlet fossil
#

oh really?

#

I mean that if I reactivate your account, I get a ```
screeps-1 | 2025-11-17T19:00:24.354171919Z [engine_runner1] process 839 exited with code null, restarting...

which generally means there's an infinite loop in there that brings the runner process down
#

would love to fix that, but… I haven't found why it's even doing that. It's a SIGSEGV, and looks like a stack overflow

arctic pendant
#

I hadn't been paying attention as I pushed code, and ended up with broken code live when the server came back up

#

Fortunately noticed before everything decayed

scarlet fossil
#

Ha, I kinda half wondered if I should ping you

#

My bot deleted half its buildings because I changed branches and they have a different bunker layout between each

#

So now I know I have a problem with spawn reconstruction 😅

arctic pendant
#

Almost to RCL 5 and I finally managed to get a basic dropminer + hauler + filler setup going 🙂

sullen condor
#

Cool. Ticks running again?

scarlet fossil
viral olive
#

There is in if statement that checks if !memory.creeps = null. Maybe that's it...

scarlet fossil
#

I can re-enable you and see

viral olive
#

I do want to play and figure it all out. First I need to figure out a better way to create the first creep.

slender compass
#

huh, seems like invader reservations are currently breaking my bot by not having the username field
the reservations by a invader currently look like this:

"reservation": {
    "ticksToEnd": 4998
},

missing the "username": "Invader" part

i've now fixed it on my end so won't have this issue in the future but someone might want to know

scarlet fossil
#

Oooh, that's why they're weird on the map 😅

#

I was wondering what was going on there

#

I guess I did something weird in the db while I was looking for who was causing the crash

#

Yeah, I issued a non-$set update into those poors invaders

#

so the object is all mangled

slender compass
#

yep!

scarlet fossil
#

okay, good

#

someone needs to fix the server's CLI console. Having to type stuff in one line is just… ugh

grave island
#

gonna try this server out. new to the game any suggestions

scarlet fossil
#

don't make recursive functions that cause stack overflows 😅

grave island
#

alright lol.

next question. i picked a empty grid. but doesnt give option to place spawn

scarlet fossil
scarlet fossil
grave island
#

i figured it out apparently i selected a random spot earlier lol. so respawned

scarlet fossil
#

Ah, yes, if you're not using the steamless client it's really easy for that to happen 😅

sullen condor
#

Oh. My bot attacked you @scarlet fossil

#

I'm surprised that it started attack this early

#

What is this little guy

#

@haughty cloak No auto expansion? Your gcl is 5 and you only have 3 rooms

scarlet fossil
scarlet fossil
scarlet fossil
#

Ah, it's a distraction

sullen condor
#

He kept saying like, "yo, harabi, follow me" thing

scarlet fossil
#

yeah, that's kinda what it does lol

arctic pendant
sullen condor
haughty cloak
haughty cloak
arctic pendant
#

yeah, I'm working on that

#

I currently over-spawn some body parts, and don't spawn some utility roles at the right times

haughty cloak
#

Minor wrinkle: if you have 2 rooms at level 6, you get more spawns faster if one sends energy to the other to get to rcl 7 sooner

arctic pendant
#

I need to refactor my spawning to use a priority list instead of just "first unmet need"

#

my codebase is four days old 🙂

haughty cloak
#

No separate spawn queue

arctic pendant
#

yeah, that order is proving tricky to figure out

#

I also need to not spawn mining related creeps when there are hostiles on the way to a target room, rather than currently just if they are in the target room

haughty cloak
#

Not the best, but reasonable: harvester hauler for claimed room, remote defenders and new room claimers, then remotes in order of increasing haul distance.

#

Where a remote spawns defenders first, resrveres and harvester next, then haulers

arctic pendant
#

and a significant fraction of that time has been on room planning

#

this is my first time trying to automate room layout from scratch

#

I tinkered with the room layout systems in tooangel and kasami a long time ago, but this is new territory for me

haughty cloak
#

Yeah, room layout is tough

arctic pendant
#

just last night I got a working system for tracking round trip times to remote containers, for calculating hauler carry capacity needs

haughty cloak
haughty cloak
arctic pendant
#

my current system has each hauler track start and end times, then at the end of each loop it gets combined with a running weighted averge for that route

#

lots to improve, but it's plenty good enough for now

grave island
#

alright i have a question. i have two energy sources in my square. im wanting two miners on them at all times. ive tried several ways even asked AI but some reason when a new one is spawned it defaults to source 1 and not source 0 any better way to do it or idk what to do lol i keep manually changing it but that's not best practice so

scarlet fossil
#

You'd get more answers in #world-help 🙂

grave island
#

alright thanks

arctic pendant
#

my first invader squad. I am not equipped to handle it. another item for the todo list!

scarlet fossil
#

I might be dead, I think 😭

#

@slender compass doing Jasper things again

#

You really colonize far

#

or I guess you use portals

sullen condor
#

Yeah he use portals

#

Oh. Last time I checked my bot stopped attacking you. Did it start to attack you again?

scarlet fossil
#

Mhm, I thought I'd be able to recover. Had to manually tell the bot how to do that, and it still messed up. Then the moment things looked like it might happen, two quads popped up in the room

#

well one, then another one

#

at that point I'm kinda leaving the controller be hoping it'll stop it from moving a few rooms to the west 😅

#

This is… 4 rooms against 1 and OM military against you. I won't stand a chance lol

#

I like the opportunity tho. Having a room wrecked has a tendency to expose a lot of small edge-cases that never happen otherwise

#

Like I fixed a bug where an invasion defense directive popped and instantly caused a crash 'cause none of the rooms in range have the level to spawn lurkers

sullen condor
#

Yeah I can guess what happened.
My bot attacked you and then stopped yesterday because it had not enough boosts.
I guess my bot produced enough boosts today and decided to attack your bot.
Currently my bot is in ffa mode - does not like bots nearby

#

About @slender compass ... I think your automated portal claim is really annoying(which is in fact a compliment. It's really cool). It seems that it gives you much better survivability.
I want to write something similar... claim a room through portal and attack everything...

scarlet fossil
#

attack everything

Aren't you doing well enough on that front already 😩

#

(you're good, I'm joking)

sullen condor
#

Yeah thanksawesome_face It seems that my goal is to make everyone hate my bot(not me)

#

"harabi bot claimed a room near me! Should kill it before it makes more trouble!😱"

slender compass
# scarlet fossil or I guess you use portals

Yep, on mmo its even better with full intershard support, it can claim a room on s3 by spawing a claimer in s2, going to s0, hopping through 6 portals just to claim a room in s3 🙂

slender compass
arctic pendant
#

guess who didn't remove rooms from his "hostiles detected" list after they were cleared, and so lost all his remote mines?

arctic pendant
#

@slender compass should I predict an attack from you if I claim a room you've signed?

slender compass
#

Nope, my bot doesn't have attack capabilities atm

#

I dont really care about the signs either, overwrite them if you want

ebon palm
#

I was wondering how many days before all of sandbox was Harabi-land 😂

scarlet fossil
#

Might happen quicker than anticipated 🤣

sullen condor
#

Something happened?

scarlet fossil
#

I got wiped. Respawned to the south

#

Apart from that, not sure

grave island
#

lmao not even 2 days in server harabi wiped me lmao

scarlet fossil
grave island
#

lmao

arctic pendant
#

@haughty cloak playing leap frog?

#

I look forward to you trouncing me economically again despite my head start and lack of swamps to cross

haughty cloak
#

Yeah, my bot needed L as its 7th mineral, and there weren't any good closer ones. So trampoline across the world!

#

T3 combat boosts starting to cook. And eco has hit cap: nothing to do with all the energy except pump ramparts.

#

Fwiw, market is odd: there are NPC orders, but no terminals in the rooms the orders are from, so .deal returns OK but never succeeds.

#

Intentional? Oversight? Happy to go either way.

scarlet fossil
#

Oh, forgot about fixing the market stuff 😅

scarlet fossil
#

I forget that using the map-tool deletes all of the terminal objects, so the order table ends up full of references to dead objects

haughty cloak
#

Yay, credits at 0.01 per energy, here my bot comes!!

arctic pendant
scarlet fossil
#

Would love to use up dynamic market but really my issue is that market stuff usually makes my brain go all fizzy and uninterested

haughty cloak
haughty cloak
arctic pendant
haughty cloak
arctic pendant
#

Oh, not that

#

I mean specifically on the sandbox server this time around

haughty cloak
#

Yeah, I've done sandbox and swc and such. Don't have good rcl1-4 times, but once storage goes up, my bot is.. decent .. at eco. 😉

arctic pendant
#

Unless I misunderstand something, you're using terminals to send energy from your RCL8 rooms to your new rooms.

haughty cloak
#

Including funneling from one room to another, yeah

arctic pendant
#

so of course your new rooms grow faster than my first/only room

#

from 6 to 8, at least

haughty cloak
#

Even the 6s send to the closest 6 to 7. More spawns faster

arctic pendant
#

yeah, you mentioned that

#

also you have more capacity to send helper workers for new rooms

#

although I can at least do some of that too

past ice
#

I spawned in a while ago and didn't even reach rcl 4 in safemode, my early game definitely needs improvement, I think reliance on containers/storage is a big negative but not sure how to deal with that

haughty cloak
past ice
#

Hmm yeah, creep to creep logistics is probably the key, you just cant withdraw from a creep but I guess you can just kinda flip it around and do target.transfer(creep) instead of creep.withdraw(target)

arctic pendant
#

yeah, that's a straightforward option

#

a more complex way would be to process haulers first, have them register their desire for a transfer, then when the harvester runs it does a transfer

#

currently my RCL 4-6 code does a pretty bad job at 1-3. I'm drawing up a new plan, which involves no containers at RCL 1, one container pretending to be a storage in my bunker at RCL 2, then containers for the harvesters at RCL 3 once I can make full size harvesters

arctic pendant
#

@scarlet fossil ticks stopped in the last few minutes, now:

[9:44:24 AM]SyntaxError: Unexpected token u in JSON at position 0
    at Object.parse ()
    at global._init.global._start (:16017:61)
    at ()
    at make (/screeps/node_modules/@screeps/driver/lib/runtime/make.js:160:34)
``` again
scarlet fossil
#

Yeah, someone's crashing again 😩

arctic pendant
#

it's probably not me? I was emptying my cpu bucket earlier, but nothing worse than that

scarlet fossil
#

craaaap, I wiped someone

arctic pendant
#

(much earlier)

scarlet fossil
#

okay, they're dewiped

#

I need to really stick it into my skull that .update() is really dangerous

#

I'm too used to SQL semantics

#

this is really getting on my nerves…

#

Simulation paused

viral olive
#

I don't understand something: my spawner died and left a tombstone that is not decaying. I placed a new spawn in a different room. Now my code won't run. What is the solution for this?

scarlet fossil
#

so right now ticks are not happening

viral olive
#

Ah, okay. I see. Thanks!

scarlet fossil
#

@arctic pendant I think it's you crashing

#

not sure, actually. I suspended you, restarted ticks, then resumed you a bit later and it's not crashing anymore

#

and crashing again, so suspended again, and no more crashing

arctic pendant
#

I'm sorry 🙁

#

I'm not running out of CPU or getting any errors other than the "SyntaxError: Unexpected token u in JSON at position 0" that I think represents the server not working at all

#

@scarlet fossil I can pay attention for a few hours and see if something is going wrong, if you can unsuspend me for a bit. Do you have any advice on how I might narrow down the problem if it's me? Or even confirm that it's me from my end?

scarlet fossil
#

I don't have a good trick for identifying what's wrong. The only info is that the runner dies from a SIGSEGV, and the one core trace I had of that a while back was clearly from a stack overflow

#

-# It's running, no crashes, so not sure what's up

#

…likely from a recursive call smashing the stack

arctic pendant
#

I'm not even sure if I have recursion happening

#

it will take my code an hour or two to recover from this state, until then it won't be spawning more interesting roles

scarlet fossil
#

might have been a fluke? But it was really stuck earlier, crashing again after a few couple of ticks

#

and yeah, that's the tough thing; suddenly some random part wakes up and decides to run, and crash

#

I have that in one of my branches, where it runs okay until some % tick counter resets to 0 and it smashes its stack

#

A trick might be to add something like ```ts
export function emergencyBreak() {
if (Game.cpu.getUsed() > 100) {
throw new Error("Used way too much CPU there");
}
}

and pepper that over in a couple of places, hoping you get the one that might be close to where the looping happens
#

alternatively, pushing that code to the PTR, since I'm pretty sure the runner there is different and can actually survive a SIGSEGV

#

well, not survive, but at least it's not breaking everyone elses'

#

I've asked o4 about how they're doing it but didn't get an answer. My supposition is that MMO's running a completely different runner harness that's process-based, which allows it to just survive that sort of stuff?

arctic pendant
#

is that not what isolated-vm is meant to accomplish?

scarlet fossil
#

no, isolate-vm provides the sandbox

#

the runner's actually what's orchestrating those sandboxes, but if one of them freaks out like that, it's still the OS tsk-tsking at the whole process and signaling it

#

I've asked ChatGPT just to be sure my understanding was correct, and yeah, you can't do stackoverflow protection like that without some process isolation or some way of interrupting the signal and resuming into a place that's safe. And then you're left with whatever's the state of the V8 engine

arctic pendant
#

I'm using screeps-profiler, including wrapping my main loop. Maybe there's a way I can get it to probabilistically log the stack depth?

scarlet fossil
#

not sure… really once you're into boundless recursion you're pretty toast, unless you manage to somehow get something like that emergencyBreak in the right location

arctic pendant
#

I wasn't able to find any recursion in a quick survey of my codebase, but it's possible something is going haywire in a library (profiler and cartographer)

arctic pendant
#

@scarlet fossil did you suspend me again? my codebase was in a state where it was throwing an unrelated error pretty early in execution (I had creep roles referring to a nonexistent method). If it still reached a bad state from there, that would be very useful insight

scarlet fossil
#

yeah, it's crashing again

arctic pendant
#

ugh, I fixed the error, so that's not useful now 🙁

scarlet fossil
#

There's not much I can tell you, literally what I have is this: [engine_runner1] process 13456 exited with signal SIGSEGV, restarting...

#

and that's after my engine hack of reporting the other reason for a process exit

arctic pendant
#

I'm sorry

#

I don't know what to do without any insight into the problem

#

I guess just suspend me until I can do my state machine rewrite

scarlet fossil
#

well, okay

#

and no worries, that stuff happens

arctic pendant
#

it's extremely frustrating to get no feedback at all

scarlet fossil
#

I'm guessing you're running a different bot on MMO, right?

scarlet fossil
arctic pendant
#

yeah, I started a new codebase here

scarlet fossil
#

got it

#

it stopped crashing lol

arctic pendant
#

I suicided every creep

scarlet fossil
#

oh

#

so at least you know it's from one of the creep actor loops

arctic pendant
#

I don't think I have any loops in my creep roles 🙁 I intentionally got rid of them specifically to avoid this scenario. I explicitly unrolled what were supposed to be two iteration loops to just literally do the thing twice explicitly

scarlet fossil
#

oh, yeah, I meant it's from the place doing the creep role handling thing

#

i mean, it's a bit late now that they're all dead, but we could try disabling each one until we find the one that's causing the issue?

arctic pendant
#

sure, good idea

#

I'll make a role that doesn't spawn and does nothing if it exists

#

and swap that in

scarlet fossil
#

just ping me if you want me to check on what's happening serverside

arctic pendant
#
export const creepName = "Idle";
export function getBody(): BodyPartConstant[] { return []; }
export function getBodyMaxCost(): number { return 0; }
export function run() { return; }
#

not quite gonna binary search, but I'll disable 4 of 12 roles

arctic pendant
#

ok, reverse strategy, disabled every role

#

will turn them on one at a time

#

is there a way to get feedback at least when it does crash?

#

right now it takes minutes or longer to start getting the json parse error

scarlet fossil
#

I can tell you, but that's about it

arctic pendant
#

ok, keep an eye for the next minute or two?

#

I'll enable them one at a time

#

(already did two)

scarlet fossil
#

I mean, as far as I understand, as soon as it starts crashing, your code would never complete a tick

#

running still

#

still running

#

crashed

#

tick 612844

#

tick 612850, crashed

#

612854, crashed

#

…6 crashed

arctic pendant
#

disabling back down the list...

#

seems good?

scarlet fossil
#

yeah

arctic pendant
#

and round and round we go...

scarlet fossil
#

crash

arctic pendant
#

ok, I think I got [one of] the role

scarlet fossil
#

the manual binary search debugging trick lol

arctic pendant
#

still crashing?

scarlet fossil
#

in production 🌈

#

yeah

arctic pendant
#

ok, that wasn't it

scarlet fossil
#

yep, it's just crashing now

arctic pendant
#

I've disabled every role again

#

rollup says it has successfully pushed the code, but the game console doesn't show my usual reset messages (from profiler)

scarlet fossil
#

okay, it's… still crashing 🤣

#

yeah, I'm saddened to report it might not have been the roles

arctic pendant
#

screw it, commenting out my whole loop

scarlet fossil
#

wait, not crash– ah

arctic pendant
#

working my way down my main loop, returning early

#

and logging every tick to hopefully notice lack of log

scarlet fossil
#

yeah, that's what I was thinking. The moment you don't see a end tick log, you know you've crashed

arctic pendant
#

enabling my creep loop, but with every role disabled

scarlet fossil
#

doing good

#

random portal mod update, but still going

arctic pendant
#

everything is back on except the creep roles, so trying those yet again

scarlet fossil
#

mhm

#

still going

arctic pendant
#

oh yeah, logging start AND end of each tick

#

gonna take a few minutes after enabling each role this time

scarlet fossil
#

crash

arctic pendant
#

5 ticks after crash I got a reset and a tick, but now nothing again

#

I don't know how long after a crash it should take for an upload to be accepted and a reset to happen

scarlet fossil
#

it's still crashing

arctic pendant
#

is it possible my uploads aren't working during a crash?

scarlet fossil
#

you could do a console.log outside loop, that'll tell you if a reset happens

arctic pendant
#

I do!

scarlet fossil
#

I don't think so, no. pushes are done through the API, and that's not impacted

arctic pendant
#

ok, I'm running everything except my creep roles right now

scarlet fossil
#

not exactly sure how that's handled, but I believe a push should cause the running ivm to get yanked and rebuilt, effectively a reset

arctic pendant
#

this seems to be working fine

scarlet fossil
#

yep, can confirm

arctic pendant
#

enabling just one role...

scarlet fossil
#

still going

arctic pendant
#

I just did all of this, same order. I am afraid it's going to lead to the same result

scarlet fossil
#

yeah, maybe it's just… on some ticks or something?

arctic pendant
#

second role, successful reset

scarlet fossil
#

yup, going

arctic pendant
#

my immediate frustration isn't about which ticks crash, it's about not getting feedback when I fix it

scarlet fossil
#

yeah… maybe you could try editing the script directly from Scripts to cut down on the rollup noise

#

assuming the JS soup isn't too soupy

#

still going

arctic pendant
#

third role seems to be working. gonna give it time. this is a suspect.

scarlet fossil
#

seems to be fine?

arctic pendant
#

#4 enabled and reset

scarlet fossil
#

😰

#

still good

#

crash

arctic pendant
#

I can't tell if it crashed immediately before I uploaded, or after the upload before logging anything from the reset :/

scarlet fossil
#

running again

#

took it a few ticks to react, since I think I saw your push happen

arctic pendant
#

ugh, I disabled all roles and pushed just as it woke back up

scarlet fossil
#

wait, crashing again

arctic pendant
#

all roles are disabled, and I confirm in the Script tab of the client that that's the live version of the code (I hope)

scarlet fossil
#

still crashing

#

what is happening 😭

#

and back

#

had to suspend you a bit

arctic pendant
#

I'm editing from the Script tab even though it's awful working on the compiled js

#

running rooms but not creeps

#

running creeps (all roles disabled)...

scarlet fossil
#

yeah, that's ticking (the rooms)

arctic pendant
#

this time I'm going to leave the call to cartographer's reconciletraffic disabled

#

fuck

#

I can't enable/disable roles from the Script tab

#

because rollup didn't include the disabled ones

scarlet fossil
#

ah… treeshaken

arctic pendant
#

going through one role at a time yet again

#

this time I'll give it even longer

#

although enough creeps are dying that the overall behavior is not the same now

scarlet fossil
#

yeah, that might become a problem

arctic pendant
#

gonna try to enable in an order to help prevent that

#

extension fillers first

scarlet fossil
#

I love how I get [backend] invalid room from time to time

#

and I have no idea where's that coming from 😅

#

still going

arctic pendant
#

hmm

#

maybe I should add logging of when a spawn finishes

#

could be that I enable a role but no creeps have it, then it breaks when that role spawns, but that happens dozens of ticks after the spawning message I already log

scarlet fossil
#

yeah, likely

#

or edit one creep to give it that role

arctic pendant
#

my two main suspects right now are my dropminer role and my builder role

scarlet fossil
#

still going

arctic pendant
#

enabling my transport creeps...

scarlet fossil
#

meh, still going

arctic pendant
#

hopefully my storage doesn't run out, that would be a more significant failure mode

scarlet fossil
#

want me to create some unexpected conditions?

arctic pendant
#

nah

#

enabling builder

#

aside... wtf is up with getting a segfault and it not producing a stack trace on your end?

scarlet fossil
#

because it's the launcher process that gets the signal exit

#

so the "master" process of the server arch

#

I had to jump through a bunch of hoops to get a coredump out of that last time

#

and ended up with… 170000 frames of random unreadable 10 years old Node 10 repeated symbols

#

still ticking

arctic pendant
#

there's a npm package called segfault-handler that will write a log before exiting, but it would need to be implemented in the runner with process and filesystem access

scarlet fossil
#

that's what I used

arctic pendant
#

the roles I'm enabling now are the much simpler ones, like my room reserver

scarlet fossil
#

still going

#

someone else has logged in

#

and the room are still invalid

arctic pendant
#

the problem is going to end up being cartographer :/

scarlet fossil
#

that'd be really surprising

arctic pendant
#

I am NOT looking forward to giving it up. Movement reconciliation is one of my least favorite things to implement in screeps.

#

all roles enabled, but some of them aren't spawned 🙁

scarlet fossil
#

still going

arctic pendant
#

lack of cartographer is leaving traffic jams in my bunkers, but I'm gonna let it run like this until things get back up to a stable state

#

once all my remote mines and reservers and such are working, I'll try enabling cartographer again

scarlet fossil
#

it's ticking like a swiss clock

arctic pendant
#

logging one line per creep that runs will be massively spammy in the console. I wish there was a way I could log to a buffer that didn't flush til end of tick or segfault, so I could see the log from right before the crash without continuously logging hundreds of lines per tick

scarlet fossil
#

screeps-multimeter maybe?

#

might not help with the whole crashing thing tho

#

but you can leave that running and get yourself a few MBytes of tasty console output

arctic pendant
#

not the worst idea

#

ok, so, I'm suspecting cartographer at this point

#

gonna go over to #world-help with a question about something I'm doing with it

scarlet fossil
#

I'm keeping the console open but stop watching

#

ping me if you need me back

#

Hasn't crashed once: 614726

#

so yeah, sounds more and more like something to do with cartographer, if all your roles are up and running

sullen condor
#

Time to write your own movement function and use #1343254859377414186

arctic pendant
#

had more crashes with cartographer still not running its reconcile.

#

I don't think I'm having fun trying to track this down. This is probably enough to get me to give up on screeps again for a while 🙁

scarlet fossil
#

I could try bumping the stack size waaaay up, but… that might still result in either a stack overflow, or the runner timing out the ivm

#

one of those values isn't as it seems

#

I swear I was trying to make it larger 😅

haughty cloak
#

Shot in the dark: the time I had infinite recursion was when trying to save ticks, like hauler picks up and switches from fetching to delivering and calls do deliver() to walk the tick it picks up. Which was fine until storage and source had a single open tile between them.

arctic pendant
#

I got rid of all that sort of thing. I unrolled all my "maybe do two tasks in one tick" loops and recursions to just explicitly duplicating the code exactly twice.

arctic pendant
#

Suspend it

#

I'm afk for hours

#

And I meant I got rid of those things days ago

#

I'm hopeful someone in #servers can suggest a way to enforce the stack size limit like World does

scarlet fossil
#
$ ulimit -s
16000
#

you're running again

#

okay, so it was crashing, I bumped the stack limit even higher and after a container rebuild it's to crashing. Even restored the proper thread count of the runner now, so we're back in "normal behavior"

scarlet fossil
arctic pendant
#

it's to crashing?

scarlet fossil
#

not crashing at the moment

#

stack size is twice as large as it was now

#

but the server has a bunch of memory so it didn't really register anyway

arctic pendant
#

I'm gonna try to launch my codebase on PTR, but it will probably take long enough to scale up from a fresh spawn that I'll have lost all my rooms here before I can identify the problem 🙁

haughty cloak
#

Or do you need to totally destroy/rebuild everything due to incompat?

arctic pendant
#

I'll have to respawn, my sandbox codebase is in no way compatible with my rooms on World

#

orrr... I can just start over again

haughty cloak
#

Could hack in a rebuilder routine? Or even a less hacky one?

arctic pendant
#

I mean I could start a new codebase again

haughty cloak
#

ahaha. 🙂

arctic pendant
#

I did learn a bunch of stuff working on this one for a week

haughty cloak
#

That's also fun sometimes. When you've learned enough to want to try a different core architecture. I've been through 4 major cores, plus a few proof-of-concept prototypes.

arctic pendant
#

I'd prefer to keep going with what I have now

#

@scarlet fossil did you delete my account?

arctic pendant
#

not a big deal

#

it's a sandbox 🙂

scarlet fossil
arctic pendant
#

lol

#

code is still broken, don't un-suspend me

scarlet fossil
#

I did forget the $set part again 😩

arctic pendant
#

I hate all my paths forward, but the most productive and least annoying one will be to move all my roles to the same state machine

#

I still have no idea why/how World can get stack limit errors

scarlet fossil
#

yeah, I'm not sure

#

I mean… I could try bumping the stack limit even higher, but I'm afraid it still wouldn't tell us anything

#

we'd just get the standard "you took too long so I yoinked the IVM" error

arctic pendant
#

I can't figure out where I have any recursion

#

my stack depth should never be more than the ~10 of a normal non-recursive call flow

#

I went ahead and posted my whole codebase in #world-help to see if anyone wants to help figure it out

scarlet fossil
#

…the starter kit is so outdated it's not even funny

arctic pendant
#

locally? 24.7.0 but I don't know why that would be relevant

scarlet fossil
#
[!] Error: Unexpected token
rollup.config.js (29:52)
27:   console.log("No destination specified - code will be compiled but not uploaded");
28: } else {
29:   const screepsData = await import( "./screeps.json", { with: { type: "json" } } );
                                                        ^
arctic pendant
#

yeah, that was one place I had to update to work with newer... everything

#

I used the starter because I didn't want to spend my first dozen hours writing no screeps code and just trying to get all the typescript and rollup stuff working