To support move events and other expensive ones, would it make sense technically to provide each user their own logs based on which events were requested on the previous tick. Will be slower than giving each client the same data, but you can charge CPU back to the client, since client can chose not to request data and not be charged?
UnFleshedOne
@UnFleshedOne
Posts made by UnFleshedOne
-
RE: Draft: room event log
-
RE: Screeps Discord?
Another vote for slack, mainly because of NSFW nature of discord.
-
RE: PTR Changelog 2018-01-18: isolated VM
PTR seems to be extremely slow to reload code? Something in my code was causing timeout errors, so I cutting out bigger and bigger chunks of code, sometimes it was running, most of the time I had timeouts and very often ticks would simply stop for extended time.
Script execution timed out ungracefully, restarting virtual machine
Now I'm down to this and there are no ticks at all:
/* eslint-disable */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function loop() { console.log("running"); } exports.loop = loop; //# sourceMappingURL=main.js.map
-
RE: Discussion: Contract system
Don't know if this was mentioned, but running contracts at the end of the tick might be problematic. More flexible way would be allowing contracts to be listed and executed as part of main tick (maybe as an option, default being at the end of the tick). This will allow better CPU handling (especially in the context of an OS). Contracts can then make executing frequency to be a requirement if it matters. Host can run contracts before own optional and expensive code.
An option for exposing some clearly separated host code would be nice too. Then players can define and implement interfaces for basic things like creep spawning. We already have POSIS (a solution waiting for a problem currently :)) that is implemented by several people and can be easily implemented by anyone running an OS.
For example contract can take in a context object provided by the host. It would be up to contact writer and host to negotiate exact details.
let context = {};
Game.contracts.forEach((c) => c.execute(context));
-
RE: PTR Changelog 2017-09-25: WebAssembly support
@artch OpenGL might make sense actually -- rendering room map to a texture, running shaders on it (I'm sure many image processing and computer vision algorithms can be done this way) then exposing resulting texture to the main script. Shared tenancy on GPU might be a problem though.
(Not that I'm saying we need openGL support, but that people will try to use it if it is available, and that's another resource that will need to be charged to CPU)
-
RE: PTR Changelog 2017-09-25: WebAssembly support
Nice, this is definitely something I would use if it ever makes it in. Finally my work experience apply to something that matters!
WebAssembly says it does or will eventually support pthreads, OpenGL and other system libraries. Will those be available in screeps and how would pthreads for example impact CPU usage? (haven't had a chance to actually try it on PTR yet)
Would .wasm file size would count against max script size I assume?
-
RE: Are private servers limited to 1 tick/s?
There is a mod to adjust tick rate: https://github.com/ScreepsMods/screepsmod-tickrate
-
RE: PTR Changelog 2017-09-14: WebGL renderer (WIP)
@artch no console errors, but game-field-container element has width of 0 (and what looks like full window height).
< div class="game-field-container" ng:class="{'pan-active': Room.panActive}" >
Also works fine on the same machine in Vivaldi 1.10.867.38 (Stable channel) (32-bit).
I have Screeps-SC extension in broken browser (https://github.com/stybbe/Screeps-SC), but disabling it doesn't change anything.
-
RE: [Tournament] BotArena: Pure AI Battle Royale
Another variation on shrinking map:
- start with tall map, say 5 rooms wide, 2 sectors tall.
- after a settle down period start disabling rooms from one of the long sides of the map (randomly selected for the round) and add new ones on the other side, making a conveyor belt of habitable space.
- gradually reduce number of rooms added (maybe making them highway rooms so nobody gets stuck on the edges), clinching all bots into the center until just a strip a few rooms tall remains.
There should be enough time for edge room to reach RCL 8 and work for short time pumping out armies before being eaten by the map.
Rolling map would reduce advantage of bots spawned in the center. Adding rooms in reverse arrow shape would reduce placement advantage even more (see illustration below, red rooms are all lava).
(please delete this post if a screeps bot ever becomes self aware and goes after its tormentors)