Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. Jabberwocky
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    Jabberwocky

    @Jabberwocky

    5
    Posts
    1143
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Jabberwocky Follow

    Posts made by Jabberwocky

    • RE: How i can control second room?

      Well, it's difficult to explain since I don't know your current code. If your current setup is running you should have code that makes creeps do stuff in your main room. Like look where the energy source is, move to the energy source and harvest it. After that move to the next spawn or storage and deliver the energy. Then back to the energy source and repeat. That would be a simple setup for a harvester. You don't have extra code for every single harvester, they all share the same code.

      So far there isn't much involved that would require any code to be duplicated or anything else very special if this creep would operate in another room.

      The only special task you need is to move a creep into another room and claim the controller. For this I had a creep type 'invader'. It would use findExit() to get into the next room, then just go to the room controller and claim it. From there just harvest energy and move back to the controller and upgrade it. Once you can build a spawn and extension the room operates normally like your first room.

      Another matter would be those rooms without a controller. You just need to move there, harvest energy and when the creep is full move back. (Source keepers make this much more difficult of course)

      posted in Help
      Jabberwocky
    • RE: How i can control second room?

      As a total beginner myself I found the following things helpful (mostly because that was what I had to change when I invaded the first room):

      Avoid using anything like Game.controllers.MyController, instead loop over the rooms like:

      for(var room_it in Game.rooms) {
          var room = Game.rooms[room_it]
          var spawn = room.find(FIND_MY_SPAWNS)[0]; // TODO: decide on multi spawn rooms
      

      This is the start of the loop that decides if any creeps need to be spawned. The following code will make decisions mostly based on number of creeps in this room (which I count in a different loop) and room params like energy available. Also there is a global object create where I hard code some tasks for each room that I can't calculate automatically (yet anyway, maybe when my code gets better).

      room_strategy : {
        'W5S7': {
          maintenance_area: {ax: 11, ay: 5, bx: 46, by: 30},
          min_wall: 300000,
      },
      'W4S7': {
        maintenance_area: {ax: 0, ay: 0, bx: 49, by: 49},
        min_wall: 75000,
      }
      

      Maintenance area is the area in which the creeps should upgrade walls (a bit specific to my rooms) and min_wall is the level to which they should upgrade (My older room with better walls is at a higher level). That prevents that creeps upgrade one wall to a super high value before going on with the next wall. That way I just adjust the level once a day. There are more such values in this data structure.

      The creeps themselves are just looped like this:

      for(var name in Game.creeps) {
      Game.creeps[name].runTask();
      }

      runTask() is a method I added to the Creeps.prototype.

      They will then take their current room object and make all decisions based on that (eg instead of moving energy to Game.spawns.MyFirstSpawn they will use

      creep.room.find(FIND_MY_SPAWNS)[0]
      

      Since by now I have only one spawn in my rooms (and all my rooms have a single energy source) that works good enough. There is no code duplication at all. Just make sure when you calculate any task targets based on the creeps position and room. I use something like

      creep.pos.findClosest(FIND_STRUCTURES... 
      

      a lot. Finding targets to get or drop energy for haulers, finding construction sites for builder or whatever, just use those room/position based finders and your code will run the same in all rooms.

      The only type of creep that needs special attention are those that move from one room to the next. Especially in the beginning I found it very helpful to have a permanent stream of creeps moving from room 1 to room 2 and helping with harvesting energy, since without extensions you can only build very small creep that do not fully harvest energy fast enough.

      They start with the second room as target hardcoded and will then move to the exit. Once they reach the exit and are in the next room I just switch the 'role' and 'task' stored in their memory. Then they are simple harvesters and their task assignment code will use above finders to search for the rooms energy source like any other harvester.

      posted in Help
      Jabberwocky
    • Some empty rooms are not downgrading

      I have several rooms near me that are empty for a long time now but the room controllers are not downgrading. For example W6S8 and W6S9. Room controller is on level 1 and not going down any further.

      posted in Help
      Jabberwocky
    • RE: Map expansion

      I agree with abnessor that there should be some density since otherwise there would not be much fighting. Though as it is at the moment you are more or less forced to attack your direct neighbors who more often than not are some beginners and it somehow feels like griefing.

      Also there isn't really that much to 'explore' anyway. Places are much the same all over the board.

      I think over time the map structure would need some changes that compel better players to move from their starting position towards other parts of the map that are more dangerous and competitive but allow for higher resource harvesting.

      posted in Help
      Jabberwocky
    • RE: Recomended IDEs

      I use Atom editor. It has plugins for mostly anything you may want to do.

      posted in Help
      Jabberwocky