Changelog 2017-09-28
-
I just noticed that
spawnCreep
(as opposed tocreateCreep
) does not automatically assign a name to created creeps anymore.I think this is an unneccessary complication for new players, which should not use a deprecated method like
createCreep
, should they?Was there a particular reason to leave that behaviour out? The pull request does not at all mention this change, I discovered it by chance after seeing that my spawning code does not work after changing to the new method signature.
In case you want to keep the behaviour as is: The documentation of return values should be updated. Currently it only points at an errorneous creep body, but not at a missing name.
-
@nobodysnightmare said in Changelog 2017-09-28:
I just noticed that spawnCreep (as opposed to createCreep) does not automatically assign a name to created creeps anymore
That's correct. There are multiple reasons why it was changed to this, but I'd rather like to know if you guys think this should be re-added.
Pro's and cons for re-adding this: Pro's:
- Easy code, no need to deal with names
- Lower entry level
Con's:
- Makes spawning code return an ambiguous type (error code or creep name)
- Prone to bugs (what if you name generator generates an undefined name?)
- Already easy to generate a unique name (
spawn.name + "-" + Game.time
)
What do you guys think about removing the automatic naming?
-
@dissi-mark said in Changelog 2017-09-28:
Con's:
- Already easy to generate a unique name (
spawn.name + "-" + Game.time
)
What do you guys think about removing the automatic naming?
I've had this, and similarly obvious long name strings fail to be unique (seems impossible).
I think the pros, particularly the Lower Entry Level speak for themselves. Not something a beginner needs to deal with.
A great game has a low entry level, and a ceiling that just keeps on going...
- Already easy to generate a unique name (
-
@mashee said in Changelog 2017-09-28:
ve had this, and similarly obvious long name strings fail to be unique (seems impossible).
I'd love to see this code fail, game.time is unique for every tick, and one spawn can never generate 2 creeps at the same time, so something else might have been off.
I do agree with the low ceiling. We can add this example to the tutorials though and explain it that way as well.
-
This is already in the tutorial by the way, see here.
-
I must admit that I'm a bit nostalgic about the default names that were generated by
createCreep
. Is there a way to expose the function that it was using to generate creep names?
-
@hyramgraff said in Changelog 2017-09-28:
I must admit that I'm a bit nostalgic about the default names that were generated by
createCreep
. Is there a way to expose the function that it was using to generate creep names?The function is posted in this thread https://screeps.com/forum/topic/626/please-give-us-access-to-random-name-generator-for-creeps/5
-
@dissi-mark Why do creeps have names in the first place? Seems like they should have ids like other game objects.
-
@shedletsky creeps have ids
-
@dissi the only reason I can think of that we can't remove creep names entirely is that there are a couple of places that they are used as keys in a colleciton, like Game.creeps[]
-
@shedletsky creeps will always need names. There's currently no way to get IDs during the spawn call.
The discussion is more about the extra requirement spawning a creep now has, namely giving a name to the creep.You used to be able to just pass "undefined" and it would generate a name for you.
-
I published a screeps specific uuid library that will generate unique IDs (even taking shards into account). You could use this for creep names and then you'd be able to ensure they could cross shards without collisions.