Superfluous ConstructionSites - Relocating structures



  • @o4kapuk said in Superfluous ConstructionSites - Relocating structures:

    @mrfaul if we run code for all players who don't exist in the game world every tick at each shard, the game would be unacceptably slow.

    I think there was an external script for spawning somewhere in the community, try lurking around.

    That is true but I never said anything about that, I talked about a button that runs your "setup code" which could be exported like the main loop.
    And I personally don't view relocating structures as that difficult I just thought pulling structures could look really funny.
    I just have this picture in my mind of a train of screeps all desperately pulling at one spawn 🤣



  • I like the idea of the "setup code" button. If the problem with placing spawn by code is just that you want to avoid running code for all players that dont have a spawn, this would solve it. Have some button for claiming a room, this will enable running your code even without a spawn/creeps/structures etc for a set period of ticks before timing out. Means your code can run and place the first spawn automatically, but it will only run for some ticks before it would get disabled if the spawn fails to place within the allowed time automatically.

    ☝


  • @estecka said in Superfluous ConstructionSites - Relocating structures:

    That is assuming the room you wish to remodel is RCL4 or above, which you doesn't reach in a snap, and 3,000 ticks of not being able to spawn creeps is still 3,000 ticks of other activities being potentially halted.

    I explicitly stated that as a criteria, hardly an assumption. After you've played a bit longer, RCL 4 isn't as daunting anymore. In some players are able to reach it within the safe mode after respawning, so in less than 20.000 ticks (roughly 16 hours). You'll get there 🙂

    Additionally, I said 3000 work actions: it would be 3000 ticks if you used 1 builder with 1 WORK part. Divide the number of actions by the number of WORK parts used to build each tick, like the builder with 6 parts in my example, and you'll get the total number of ticks spent on building. At RCL4 this can be finished in 500 ticks with a single builder, which gives a lot of margin for error (delays).

    @estecka said in Superfluous ConstructionSites - Relocating structures:

    Even with the perfect code, relocating would still be major inconvenience at lower RCL, not in term of how I can script this, but in term of how much it may impact the rest of the room's economy even if I do it right, and especially if I do it wrong.

    Well, yes, it is an inconvenience. But everything in this game is. Not being able to control creeps like in an RTS is an inconvenience. Not having vision in certain rooms is an inconvenience. Pathfinding brings inconvenience. Some structures have .store and some having .energy brings inconvenience.
    Overcoming these challenges is at the core of this game.



  • @geir1983 I also like the idea, it's a bit odd that I have to handle two cases - my bot builds the room around where I manually placed a spawn, vs the spawn is placed based on how my bot decides to build the room.

    👍

  • TMB

    @keenathar said in Superfluous ConstructionSites - Relocating structures:

    Well, yes, it is an inconvenience. But everything in this game is.

    These examples are hardly on the same scale, and can all have a definitive solution.
    I can give orders to my creeps through simplistic memory edits and flag placing. I haven't had to worry as much about room vision since I've been using a wrapper class for roomobjects.
    Some structures use store instead of energy and you can't harvest the extractor? those are the easiest. It takes three lines to write any of these properties then you won't have to think about it ever again.

    My bad for the misunderstanding about the work actions. I realized it as I attempted doing it myself, but it was still a whole operation that required human supervision and a tailor-made solution.


  • Dev Team

    @geir1983 I'm not sure if we can do anything like this being usable. You see, providing vision on all of the rooms is not possible technically, but without vision, you can't make decisions based on the most important starting criteria: controller and sources locations... even sources count! So even if we can add a special export for finding the initial spot, that doesn't add any game value.



  • @o4kapuk I think the player would still need to choose what room to claim, just not place the first spawn. That way he would claim the controller in the room, providing vision for his script who can then calculate the base layout and place the spawn. It is a special case scenario, as you dont respawn that often (except in botarena and swc) and you need to have code for creating your base layout, but it is a common request i believe.

    👍

  • Dev Team

    @geir1983 did you try the community solution I mentioned earlier?



  • @o4kapuk I never tried it, but from what i understand it does not call my own room planner, it has a seperate set of functions to do it "offline", so i would need to export and rewrite my own room planner to python to make it fit the needs of my own planner. Its quite interesting, but makes me have to maintain two different room planner projects for it to work.



  • @o4kapuk As geir said, the intention of the "Spawn here" button would be:

    1. Claim controller to provide room vision.
    2. run "setup code" function which should return a room pos for the initial spawn

    It is not a tool for continued self authorized respawning like the tool you mentioned.



  • Yeah, i think instead of a special setup code it should just run my script for a set amount of ticks, my script will then place a spawn construction site which should be instantly built as its the first spawn. This way you will not need to run code for all players who dont have spawns, this is triggered by a button press in the client. You can then stop this execution if the script failed to place a spawn within some reasonable amount of time, where the player would either need to press this button again or simply place the spawn manually.


  • Dev Team

    I still don't get what game value this feature have to invest development time and efforts into it. Maybe someone here respawns often enough to feel frustrated at doing this manually? Or someone here knows a player doing so?



  • My main motivator for this is to use it in the SWC or Botarena (and perhaps it makes sense for the upcoming Arena game?) where you always start with no rooms. Basically i want my script to find the location for the first spawn instead of me guessing and having to create a special handling of first room for the room planner (my normal room planner does not place the spawns as the first structures). Ideally the script can optimize the location for the base layout better than me.

    I also agree this is a niche application, but it is something that is requested from time to time in the slack forums and (to me) it sounds possible to implement without to much effort. It also feels in the spirit of the game to automate everything.


  • Dev Team

    @geir1983 Right, I get it.

    (to me) it sounds possible to implement without to much effort.

    I won't say it's fast and/or easy... I won't say it at all. I'm almost sure that implementing a client-side solution like ScreepsAutoSpawner would be easier.



  • it would also prob be easier to change it to where you claim the controller instead of "place first spawn." then, whether the player decides to manually place a spawn construction site or have the code place it, the first spawn after a respawn is free. this would satisfy the desire to let code place the first spawn, but would not penalize the noob players spawning in for the first time



  • @o4kapuk there is lately a talk about inconsistency.
    The fact that the first spawn has to be placed manually is a big one for me.
    Some roomplanner don't use use patterns but specific rules to build stuff so,
    it would be nice if it can plan right from the beginning with a optimized spawn position.

    That is something from day one that appeared quite odd to me to force the people to set the first manually.
    A "claim room" button is in my opinion more inline with the games theme of automation.
    If a "first function" is necessary is debatable you could also make the first spawn construction site free.
    This way people are free to let the script do it or them self.

    OH and hell no, a client side solution is for beginners a absolute no go.
    Client side stuff come up if you know what you are doing and aren't satisfied with the tools given to you.



  • Since we pretty much hijacked this I created a separated topic for it:
    Refining the game start: A "claim room" button instead of a forced "place spawn":