Screeps Few bugs / questions

I kind of want to use SO to point out some things.

First of all, there was a weird "script" in this game, because unlike a "normal" Javascript script, the way things are executed is different. We all know that in scripts, the first thing is done first. Therefore, if I have:

Game.spawns.Spawn1.createCreep( [Game.WORK, Game.WORK, Game.CARRY, Game.MOVE], 'worker1');
Game.spawns.Spawn1.createCreep( [ Game.TOUGH, Game.TOUGH, Game.MOVE, Game.HEAL], 'healer1');

      

You would assume that worker 1 will be created. It is not true. Healer1 is being created. It would be helpful to educate people about how scripts are executed. Now the example above is mostly simple, but in my case I had a lot of statements and it took me a while to figure it out.

Next is the name of the creep. In the event of a creep death, the name must be "gone". I checked this and the name was "available" to use YET again, for some reason the name is only available after some ticks. Not an instant! So there is a difference between client and server. Now this is obvious, can be eliminated by repeating a lot of time and not using name reuse. In truth, I prefer to reuse names. What for? Maybe your script will run for years and this will lead to names like "worker1209128102981209128" which in my opinion OCD is not "nice". In my case, I wait until the error name has already been used "gone" for several ticks and will create it after that. You may "waste" time on this.

console.log (); (empty) will cause your console mental. The style will be "auditioned".

Next: The memory state is not always cleared in a new game. As a result, some strange things happen: you already have material in your own memory and the enemy creeping waves are already on wave after wave 1.

Another thing I didn't find in the API; First Creeps get hits in their first modules. So you're smart to putt TOUGH first from the moment of its "useless" module. Other less useful modules follow.

Enemy AI can now be bugged for game mode. For example, if you don't move your creeps, the enemy simply won't attack. The same thing happens when you leave one enemy crawling alive from a wave, the AI ​​can get "bugged". Not sure if this is normal, but after a while I had the following: I can't "believe" it's okay to fight so fast against so many powerful enemy creeps (see body modules alreadyexample

As a last resort, I can ask the developer to do something where we can communicate with the developer. Even for stackoverflow ok, IMO more used for people looking to nudge a little in the right direction.

Thank you, I really like the game and I hope it gets big! :)

+3


source to share


1 answer


If createCreep is called more than once per tick, only the slider will be created in the last call. Each call will overwrite the creep to create. But this has some problems:



  • you cannot get if createCreep was called already in this tick - the spawning property will only be set on the next tick. So you have to track it yourself.
  • if you passed memory data to createCreep, it will be immediately set to memory, even if the creep is not actually created because another call to createCreep has overwritten it. This makes the memory messy with unused data unless you track (1) yourself and call createCreep on the same spawn more than once per tick.
+2


source







All Articles