#Screeps Sandbox
1 messages · Page 5 of 1
Rust is too powerful for The Sandbox
😦
I just edited like 13 files for my custom room.find code, that may have also been a problem
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
if you think you broke it, disable your code and see what happens
no I doubt it after thinking about it
just turned it off, still bugged
aww
you ARE actually, turns out I messed up my .find replace, so it spammed nearly 200 infinite recursive calls a tick
Why would that crash the server 😅 shouldn't you just hit the 500 CPU (1000 really) limit and time out?
I honestly have no clue, it had the same problem over in mmo, but actually gave me an error
I can provide the error rq
OK so it's fixed now right I can go back and get my pathfinder working?
I believe so
ticks seem to be ticking
this is such a strange bug
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.
lol @torpid ledge gtfo
murder 🙂
safemode :))
pretty sure that's a defense blinkie heading through your room
ye it is, but my defense blinikies consider WORK creeps dangerous
so now they're just camping you
in my defense, you spawned in the middle of my 3 rooms
my rooms like to juggle defense creeps alot
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
wait why are there just 2 creeps doing nothing?
Yeah I'm working on a custom pathfinder ^
oh ok
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
what did I do 😦
you sent me a Blinky lol
I didn't it was trying to support another room with a blinky
Well then fix your code from trying to attack safemoded rooms that you pass through 😄
lovely
should be fixed, lemme know if the blinky is still attempting murder
@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
Rebooted server just for the sake of it
He shall be my vassal
My bot's already marked the room as such XD
what is vassal in this case? A friendly but not-ally?
oh also @rotund olive why did you choose to spawn in geoland when there was 2 completely free zones next to me
Did he spawn in geoland, or were you squatting in marvinland without realizing 😛
he spawned here like 15 minutes ago
Run him outta town before he owns the place lol
I dunno if friendly would be the right word. I feel like tunnel guy would be more like a rare iguana you keep to show off to people 😄
I meant code wise rather than what you personally think of the relation
Like are vassals the highest level of friendship you have? Or some other tier of it?
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.
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
@rotund olive why'd you move closer to one of my rooms
To get closer to my subject
Hmmm
@rotund olive what happened to the conquering?
Internal dissent at the highest level of the Politburo
they realized I can launch what is essentially a nuke at sandbox at any point
mutually assured sandbox shutdown
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
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
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
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.
private servers dont like reccurency, mmo handles it well, PS likes to just do nope
Yeah obviously I see the pattern, that's not an explanation though
@scarlet fossil did some digging at some point
Did I? I don't remember looking at that one in particular…
When was that, I wanna see what the logs are
some time ago, is the best i can do
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
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
It's dawalishi122
No idea why, but they're suspended now
I suspended everyone and went through each one by one until I got them sieved out
are we all on pause until we pass the test?
No, everyone should be running again
Unless I messed up somewhere
Gah, the server auto-reenabled them :/
Cool, glad you got that figured out. It is annoying that that is a thing. 🙃
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
I was sleeping at the time, literally no way I could do that
Sorry, I just saw the same symptoms so figured it might be the same cause. XD
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
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?
Possibly? I'd have to check that at some point…
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 ?
Unconfirmed, but possibly?
I was having a function call itself
So it looked more like
Func a() { a() }
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
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 ?
I mean, my gut feeling tells me IVM should have complained loudly about that and not actually crash
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.
yes, it can be even recurrency with programmatic stop after x iterations, still will crash (as in stop code execution) private-server (but will run fine on mmo)
also i've sent o4 mail and pm with code example quite some time ago
@scarlet fossil sandbox down
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
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
Not sure if Jaysee got back to you in DMs or something
Yeah, we had a little chat just now
sweet
@storm hazel You seem to be struggling a bit?
don't have access to sandbox right now, what happened ?
You're showing up in the server logs for your bucket being empty
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
pretty sure killing every creep will cripple your eco even more for a bit
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)
I think I am going to fully rework my resource handling system again.
I think I should make everything GOAP.
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
I didn't, but I'd be happy to level some unfounded accusations to get the ball rolling
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 ¯_(ツ)_/¯
The machine spirit just trying to keep you on your toes
How much memory is the server rocking?
And do you have any o11y metrics for server/process -level memory use?
I have htop
That's about it lol
Holy smokes I just saw the history workers thunder-herd
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.
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
You can also use rsyslog or something like that, and then emit metrics to another server, then expose it via Grafana/etc.
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
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
Haha, I know the feeling
Yay not getting things done
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 :/
Time for screepers to fork engine/driver and get some PRs merged?
As someone who has never been responsible for fixing merge conflicts between a fork and its upstream, I'm in favor of it 😆
I mean, it's not even a big change: https://github.com/screeps/launcher/pull/16/files
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
Took me a bit, but added power, ops & battery buy orders to the market
Pretty sure it's not exactly balanced, so… yeah
You got some thicc roads @cold zephyr
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.
Interesting. I like it, it's intimidating XD
LA freeway roads. It's a style statement
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||
Tunnel man has been blessed by the gods
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
@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
no nothing changed on my part
last change on sandbox was 14.3.2025
I see
i should port over some bugfixes too sandbox (nothing in new combat though)
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😅
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
Cool. Let me know when you use power creeps in defense
ah just remembered. I turned if repairerspawning if my walls are over a threshhold to conserve energy. so Walls.hits < X ==> Spawn Siegerepairers
Someone's crashing the server
Who pushed not that long ago? 😅
@sonic marsh Mind taking a look? I think it's you
I won't be able to for a while, are you able to kill it?
Oh wait this is sandbox? The thunderdrone bug shouldn't be present in my bot here
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?
.>. 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
No idea, it's still running tho, so I'm gonna go on a whim and leave it be
I've only noticed because of
Lol, I dunno what that all means but I do know sudden spikes are generally a bad thing.
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 :/
I guess that's just because his gcl is too high for 100 cpu
Jasper bot has completely stopped
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
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
Can be fixed?
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
Cool
That sounds fine with me. I'll probably still be delayed a bit before I spawn in to it (since I'm in the middle of redoing an important module) but it certainly won't bother me. :P
That's doable, yeah. I'm more or less a crashing zombie right now, so I don't really mind
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 😅
inclusion mess?
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.
Cool. So OM's directives are kind of missions and each directive can create other directive?
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
Can you explain more about overseer>?
Overseer is just the global "let's check what's going on" thing
Oversees the entire bot?
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
I see. Is there any "Big" directive? Like, "Kill this bot"
not really, no. There's "siege room"
I see
But OM's diplomacy system is really barebones. It only has ally/enemy, it doesn't know who you are
Does overseer have responsibility over both military and economic decisions?
Kinda, yeah
It's interesting that my bot's mission system is being much like OM's
Though, I don't have any offensive military capability there
Wouldn't be that hard to add though
Below directives and a few others, but those are special cases
Overlord is mostly a creep manager abstraction
In that case I'm not sure why there is directives and overlords
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
Directives are a grouping above. They belong to a flag, and can have one or more (or sometimes none) overlords
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
placeDirectives() is actually most of the meat of the Overseer. The rest is just "code phase" stuff
I see. So overlords are unit actions and directives are colection of actions for a certain goal
Now I can see the philosophy in it, after all these years of screeps
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
I'm planning to make them as one category though
Directives and overlords are both missions in my bot
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
It does a pathing distance calculation, IIRC. But it also checks the others
Isn't it very expensive to find the closest spawn?
So you can say "I want all RCL>6 rooms, less than 5 rooms away, with paths less than n tiles long"
It's hand-waving. It uses the colony's anchor
You don't generally specify which spawn is gonna be used. You just ask the hatchery and it'll select one
Colony = one owned room?
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 😅
So when overseer drops a directive, directive finds every room that can spawn creeps for it and remember them as spawnGroup?
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
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
I see. So a new room can request creeps to other rooms
Yeah, that helps with bringing up rooms quickly
Since they get to use the higher spawn capacity
It might be possible to spawn a quad from two rooms, 2 creeps each
No need to waste ttl
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
I think so? It really helps with composability
Like reusing the same overlords in different directives
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
Yeah
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
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
Hmm. It seems that the ones act like overlords in OM in my code is spread across several modules
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
creepUtils, creepRoles, creepActions, spawnManager, etc
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
Blackboard thing, I know
Yeah. I don't use class much
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 ¯_(ツ)_/¯
For me, it's weird to make a class when I will not make more than one instance
unstable?
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
Ah, yeah, I understand
But since those missions classes csn be gone after reset, I made missions as object in memory
you could recreate them
And made missionHandler rather than missions
That's actually why directives are linked to flags here
missionHandler reads missions in memory and do its job
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
So there is only one handler per one mission type
Then those load their memory back and it's up to the races
I see. Though not sure that's better than handler approach. What would be pros and cons
Well, you have a well-defined class for the thing
My handler is not a class, it is object with various methods
Usually createMission() and runMissions()
Ah, no, it's different then
I use the constructor for create, and run is one of the runtime phases
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
Okay, it just feels more function-based that what I have, but kinda the same
Btw. Time to sleep for me. Was good convo. Got many inspirations. Thanks!
Sure! good night!
Yeah. Basically the same
Is it only me that feels like sandbox is acting weird
I'm not seeing anything weird in the logs
There's a KasamiBot tho
And an Overmind, even
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
Yeah, someone might have messed up
I just rebooted the server after updating a few mods
Cool. Seems like working better
Removed the bots
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.
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
Oh cool, reset and some updates!
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
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
I get that, but I felt like doing something daring like giving it some battle testing would be a fun thing to do
Soooo 😅
Testing in prod is the best way lol
So I assume or bots would be able to use node 20 features too?
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…
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?
Should be back
I was trying to pin point an infinite loop I had and forgot I was doing that 😅
ahah, kinda, yeah
did you ever fix that one bug that I found that crashes sandbox btw?
Is it server or my bot that is weird
@kind trench you're eating your bucket I think?
let me kick the server just in case…
Thanks. Seems OK now
Gadjung is still skipping every few 6 ticks or so
Okay, it's time for a good ol' server nuke 
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.
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
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.
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).
For this server, that's http://jayseegames.com:21025/authmod/password
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
thanks - got it now. My uploader script was incorrectly trying to use tokens for anything except local server
Oh, i totally forgot about sandbox, should be a excellent place to test my room based -> mission based rewrite!
Cool
Did you get some attack code?
That part hasn't been transferred yet
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
Tick start for tomorrow is gonna be <t:1763226000:F>
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
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
you did the authmod password thing?
is such command grunt screeps --gruntfile gruntfileSandbox.js correct or am i missing something here ?
what exactly is authmod password thing ? if you mean setting password and email in game UI then yes
that one
though I think doing it through the game is the same thing…
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
maybe… ```js
server: {
host: 'jayseegames.com',
port: 21025,
http: true
},
?
just added that, no difference, also tried to use 45.141.24.22 instead of yajseegames.com
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
is there anyway to somehow "debug" such grunt screeps --gruntfile gruntfileSandbox.js command ? to see what it loads ?
not really, but it's all in https://github.com/screeps/grunt-screeps/blob/master/tasks/screeps.js#L85
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
no, pservers don't do tokens
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
you're welcome! glad you managed to join, too~
Whoops, forgot my alarm 😅
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)
oh what? i thought i pushed something, ill have a look, thanks for the ping!
fixed, thank you for notifying
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
bad timing for me, my codebase is all messed up for low RCL right now
failed to plan room, auto spawn placement no work
ah yes, gotta love my hacky room planner
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
running now, thanks!
That spawn name 🤣
if I wanted to join, how would I? http://jayseegames.com:21025/web/ has a password change form but I don't think I have a password?
I guess I'll try the steam login?
I was considering naming my next codebase rabbithole
I found this link to set a password and login with steam... but that doesnt' seem to have really gotten me anywhere.
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?)
You can, but name it DepeerRabbitHole
oh, apparently I need to use the steam client to connect?
Sorry, missed you
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
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
yeah, that or steamless should work
I think steamless is preferred for pservers tho? Not sure why tho
Oh. My bot was not crashed!
My bot was crashed several times in events (ba, swc, etc) so I was a bit worried
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
Steam client bundles a super-old version of electron that's slower than modern browsers. But it works!
Is there a grafana dashboard for Sandbox?
you can use Pandascreeps
Grafana is my kryptonite.
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
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.
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
That's been the issue. Getting the stats gateway to integrate and such.
I think PandaScreeps is based on some variant of https://github.com/screepers/Panda-HostedAgent
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?)
yeah, likely. The pulling only happens every few… whatevers
5 minutes?
you can check the pull logs from the management site
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!
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
adminUtilsStats comes from the adminUtils mod. Exports stuff like Game.gcl.level, Game.gcl.progress, CPU used, etc, for each player.
nah, because of the UUID
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 🙂
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.
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..
I found a room with the controller on a 1x1 section of wall. Not sure that can happen on World.
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.
I'm pretty sure the map generator is just the one from the game, just lifted out, so maybe there's a possibility that this happens naturally?
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)
should be fixed?
that happens from time to time. some sort of private server bug
(I rebooted the server)
I'm still seeing the error
ah, no, someone did an infinite loop :/
I may have done that earlier?
maybe? you tell me lol
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 same problems again, parse error and slow ticks
Hmm, doesn't appear to be me this time…
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
thanks for the update
Crashing the server? Not sure what you mean...
I just know that my code didn't really run
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
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
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 😅
Almost to RCL 5 and I finally managed to get a basic dropminer + hauler + filler setup going 🙂
Cool. Ticks running again?
Yep
I had no idea there was an infinite loop in there. Just started from scratch. After starting it up for the first time it would work fine, then after a few iterations (5 or so minutes) the console.log errors would stop appearing. It didn't give me any clue that there was an infinite loop
There is in if statement that checks if !memory.creeps = null. Maybe that's it...
Do you want to push and give it another shot maybe?
I can re-enable you and see
I do want to play and figure it all out. First I need to figure out a better way to create the first creep.
Sent you a DM 🙂
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
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
better?
yep!
okay, good
someone needs to fix the server's CLI console. Having to type stuff in one line is just… ugh
gonna try this server out. new to the game any suggestions
don't make recursive functions that cause stack overflows 😅
alright lol.
next question. i picked a empty grid. but doesnt give option to place spawn
apart from that, the tutorial is a good starting point, there's also the wiki: https://wiki.screepspl.us/Getting_Started/
Screeps can be a difficult game to get started with. This tutorial will help you get your automated empire up and running.
empty room, right? what client are you using? how are you accessing the server?
i figured it out apparently i selected a random spot earlier lol. so respawned
Ah, yes, if you're not using the steamless client it's really easy for that to happen 😅
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
you were harassing my remotes a few thousand ticks earlier, the writing was on the wall
honestly? I have no idea 😅. I think it's a "I can't afford a big one" replacement?
Ah, it's a distraction
He kept saying like, "yo, harabi, follow me" thing
yeah, that's kinda what it does lol
I'm impressed at how well he is extracting energy around each of his rooms
Yeah. His economy is awesome
Nope, have to manually pick rooms and I haven't checked in on it recently. One of those todos..
Fwiw the "secret" is 2 parts: ABS (always be spawning), and BEAWYS (be efficient at what you spawn). CPU limits are super high on jaysee, so it's mostly a spawn constraint. Optimize for getting more spawns faster.
yeah, I'm working on that
I currently over-spawn some body parts, and don't spawn some utility roles at the right times
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
I need to refactor my spawning to use a priority list instead of just "first unmet need"
my codebase is four days old 🙂
As long as you enumerate unmet needs in priority order, works well. That's my current bot.
No separate spawn queue
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
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
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
Huh. A nice optimization, but not core?
Yeah, room layout is tough
if I don't make that core, then I keep sending miners to their death
just last night I got a working system for tracking round trip times to remote containers, for calculating hauler carry capacity needs
My bot doesn't predict and does harvester retreat + prioritize defender spawns. Predicting which room the attack is going to is imo hard
Sounds like you're on track then for a good eco. You can track how much it's been in practice, or issue a pathfind call as estimate and cache it
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
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
You'd get more answers in #world-help 🙂
alright thanks
my first invader squad. I am not equipped to handle it. another item for the todo list!
I might be dead, I think 😭
@slender compass doing Jasper things again
You really colonize far
or I guess you use portals
Yeah he use portals
Oh. Last time I checked my bot stopped attacking you. Did it start to attack you again?
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
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...
attack everything
Aren't you doing well enough on that front already 😩
(you're good, I'm joking)
Yeah thanks
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!😱"
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 🙂
Im scared, I've seen the crazy range increase it adds, dont add this!
It would be very bad for the rest of us 😛
guess who didn't remove rooms from his "hostiles detected" list after they were cleared, and so lost all his remote mines?
@slender compass should I predict an attack from you if I claim a room you've signed?
Nope, my bot doesn't have attack capabilities atm
I dont really care about the signs either, overwrite them if you want
I was wondering how many days before all of sandbox was Harabi-land 😂
Might happen quicker than anticipated 🤣
Something happened?
lmao not even 2 days in server harabi wiped me lmao
Heyy welcome to the club!
lmao
@haughty cloak playing leap frog?
I look forward to you trouncing me economically again despite my head start and lack of swamps to cross
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.
Oh, forgot about fixing the market stuff 😅
There you go, should be fixed
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
Yay, credits at 0.01 per energy, here my bot comes!!
Here I am still working on my first rcl8 room
Honestly, I have no idea if the prices make any sense. IIRC I kinda-sorta used them like weights and that's it
Would love to use up dynamic market but really my issue is that market stuff usually makes my brain go all fizzy and uninterested
You'll make progress. No one's bot was amazing after a few weeks or even months
They're reasonable. Minerals are maybe a little more expensive vs energy than MMO, but whatever.
I have to keep reminding myself it's not your first room on the server
Yeah. Apparently 5 years now of progress? Crazy
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. 😉
Unless I misunderstand something, you're using terminals to send energy from your RCL8 rooms to your new rooms.
Including funneling from one room to another, yeah
so of course your new rooms grow faster than my first/only room
from 6 to 8, at least
Even the 6s send to the closest 6 to 7. More spawns faster
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
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
You can check some videos in #speedrun for some ideas? Basic idea is to skip containers. Harvesters have a carry, there's a huge upgrader pool of creeps near controller, and haulers fetch from harvesters and deliver either to spawn/extensions if they need, or to upgrader creeps directly
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)
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
@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
Yeah, someone's crashing again 😩
it's probably not me? I was emptying my cpu bucket earlier, but nothing worse than that
craaaap, I wiped someone
(much earlier)
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
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?
Oh, I suspended the server because there's someone crashing it
so right now ticks are not happening
Ah, okay. I see. Thanks!
@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
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?
I can unsuspend you
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
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
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?
is that not what isolated-vm is meant to accomplish?
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
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?
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
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)
@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
I didn't
yeah, it's crashing again
ugh, I fixed the error, so that's not useful now 🙁
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
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
it's extremely frustrating to get no feedback at all
I'm guessing you're running a different bot on MMO, right?
oh yeah, definitely
yeah, I started a new codebase here
I suicided every creep
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
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?
sure, good idea
I'll make a role that doesn't spawn and does nothing if it exists
and swap that in
just ping me if you want me to check on what's happening serverside
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
it's crashing
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
I can tell you, but that's about it
ok, keep an eye for the next minute or two?
I'll enable them one at a time
(already did two)
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
yeah
and round and round we go...
crash
ok, I think I got [one of] the role
the manual binary search debugging trick lol
still crashing?
ok, that wasn't it
yep, it's just crashing now
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)
okay, it's… still crashing 🤣
yeah, I'm saddened to report it might not have been the roles
screw it, commenting out my whole loop
wait, not crash– ah
working my way down my main loop, returning early
and logging every tick to hopefully notice lack of log
yeah, that's what I was thinking. The moment you don't see a end tick log, you know you've crashed
enabling my creep loop, but with every role disabled
everything is back on except the creep roles, so trying those yet again
oh yeah, logging start AND end of each tick
gonna take a few minutes after enabling each role this time
crash
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
it's still crashing
is it possible my uploads aren't working during a crash?
you could do a console.log outside loop, that'll tell you if a reset happens
I do!
I don't think so, no. pushes are done through the API, and that's not impacted
ok, I'm running everything except my creep roles right now
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
this seems to be working fine
yep, can confirm
enabling just one role...
still going
I just did all of this, same order. I am afraid it's going to lead to the same result
yeah, maybe it's just… on some ticks or something?
second role, successful reset
yup, going
my immediate frustration isn't about which ticks crash, it's about not getting feedback when I fix it
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
third role seems to be working. gonna give it time. this is a suspect.
seems to be fine?
#4 enabled and reset
I can't tell if it crashed immediately before I uploaded, or after the upload before logging anything from the reset :/
ugh, I disabled all roles and pushed just as it woke back up
wait, crashing again
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)
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)...
yeah, that's ticking (the rooms)
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
ah… treeshaken
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
yeah, that might become a problem
I love how I get [backend] invalid room from time to time
and I have no idea where's that coming from 😅
still going
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
my two main suspects right now are my dropminer role and my builder role
still going
enabling my transport creeps...
meh, still going
hopefully my storage doesn't run out, that would be a more significant failure mode
want me to create some unexpected conditions?
nah
enabling builder
aside... wtf is up with getting a segfault and it not producing a stack trace on your end?
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
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
that's what I used
the roles I'm enabling now are the much simpler ones, like my room reserver
the problem is going to end up being cartographer :/
that'd be really surprising
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 🙁
still going
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
it's ticking like a swiss clock
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
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
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
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
Time to write your own movement function and use #1343254859377414186
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 🙁
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 😅
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.
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.
crashing still
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
$ 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"
I'm gonna keep glancing at it from time to time, but when you get the opportunity, I'd like to know how it looks from "inside"
it's to crashing?
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
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 🙁
PTR starts with your MMO progress as of Monday, so maybe a bit faster than a fresh spawn?
Or do you need to totally destroy/rebuild everything due to incompat?
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
Could hack in a rebuilder routine? Or even a less hacky one?
I mean I could start a new codebase again
ahaha. 🙂
I did learn a bunch of stuff working on this one for a week
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.
I'd prefer to keep going with what I have now
@scarlet fossil did you delete my account?
Okay, you're back
I did forget the $set part again 😩
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
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
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
What's your working Node version?
…the starter kit is so outdated it's not even funny
locally? 24.7.0 but I don't know why that would be relevant
[!] 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" } } );
^