World mode + survival mode code behavior questions



  • World mode will be launched soon. So I have couple questions about world mode behavior and how it works together with survival mode.
    1. Are CPU ticks shared between modes?
    2. Will code (main module) called once per tick or once per mode per tick?
    3. Will Game.creeps contain all my creeps in all modes or just in "current mode"?
    4. Can I see hostile creeps and/or terrain data in other rooms without having of my creeps there? Manually or via room object.
    5. What error will be returned if I'll try to place construction site without owning a room controller?
    6. Are my buildings continue to function as intended if I lose room controller?
    7. Which rooms will be in Game.rooms object ("available to you")? Where I have spanwer/building/creeps, whole world, etc.
    8 Can I place first spawn by code?
    9 Will be code executed every tick if I lost everything?
    10 "To capture each new Controller, you must have a corresponding Global Control Level which is displayed in your profile" Does it mean that I need GCL 10 to control 10 rooms?
    11 "our room will be blocked by walls defending from outside attacks for 3 days" Can I detect if room is blocked temporarily or it has no this exit? Can I get time left to my room unblocking?
    P.S I don't know what is the better way, either separate post for each question or the way I did it.



  • Some answers, I hope they help you at least a bit:

    1. See https://www.facebook.com/ScreepsGame/posts/911624718870920 (this announcement is lacking from the updates here http://support.screeps.com/hc/en-us/sections/201055771-Announcements)
    2. Each bot gets their main module called once per tick

  • Dev Team

    Shedar,

    Thank you for good questions.

    1. Are CPU ticks shared between modes?

    Yes, CPU limit is linked to your account and shared between all the modes.

    2. Will code (main module) called once per tick or once per mode per tick?

    Once per tick.

    3. Will Game.creeps contain all my creeps in all modes or just in "current mode"?

    In all modes. You can split your logic using Room.mode property.

    4. Can I see hostile creeps and/or terrain data in other rooms without having of my creeps there? Manually or via room object.

    You can see everything in every room using World Map section on the site. There is no fog of war. Although, programmatically you can have access to the rooms with your creeps/structures only.

    5. What error will be returned if I'll try to place construction site without owning a room controller?

    There will be special error code ERR_RCL_NOT_ENOUGH.

    6. Are my buildings continue to function as intended if I lose room controller?

    No, they will become non-functional. The same if your controller level has been lowered.

    7. Which rooms will be in Game.rooms object ("available to you")? Where I have spanwer/building/creeps, whole world, etc.

    Only where your creeps/structures present in the given game tick.

    8 Can I place first spawn by code?

    No, you can't.

    9 Will be code executed every tick if I lost everything?

    No, it will not be active if you don't have any game objects, since it simply doesn't make any sense.

    10 "To capture each new Controller, you must have a corresponding Global Control Level which is displayed in your profile" Does it mean that I need GCL 10 to control 10 rooms?

    Yes, exactly.

    11 "our room will be blocked by walls defending from outside attacks for 3 days" Can I detect if room is blocked temporarily or it has no this exit?

    You can use methods from the Map object to make valid routes between routes.

    Can I get time left to my room unblocking?

    Yes, these temporary walls will have ticksToLive property accessible via the API or the properties panel UI.



  • Artem from Screeps, thanks for answers.

    "There is no fog of war."
    programmatically you can have access to the rooms with your creeps/structures only.
    Screeps is about code, so actually there is a fog of war for my creeps.
    It's a bit disappointing. It gives advantages to players with higher online, just because they can see information which AI can't.
    Any chance you'll make same info available to humans and AI?

    "No, it will not be active if you don't have any game objects, since it simply doesn't make any sense."
    It was a part of idea to start new game by code. It can analyze rooms, find best spot and create a spawn there. But I agree it makes no sense without ability to access room data without creep/structure and place spawn.



  • Hmm... personally I do use flags to communicate to my ai.

    Giving that there is (assumed to be) no fog of war, I could simply look at the rooms at the neighbors and let the ai attack a room I've commanded it to. This is a decision an ai currently can't do, as it has to sneak in the rooms before it knows whats inside that room, giving opportunities for other ai's to know someone went in there...

    So strictly speaking, there is (in current state) a kind of fog of war compared to human players


  • Dev Team

    Things can be changed after the Early Preview. Let's see how it will work out.