12/26/2023 0 Comments Screeps arena documentation![]() ![]() This seems like a pretty solid starting point for organising my tick code. Then, because I am guaranteed that the previous ticks intents have all been processed, each of these ids can be used once this tick for something, so when I want to use them, I "shift" the id out of the list (so it won't be re-used this tick) and use the object that id relates to for "something". Every loop, I get hold of the ids of spawn structures and creeps that I own using map. So, something like this seems like a sensible way of keeping track of what resources I've got available each tick without re-issuing intents to game objects that have already received one (and I can think of a way I would encode the more complex edge cases you linked me to later down the line if/when I need to). Hopefully the devs will document this separately for Arena but as far as I understand it's the same as World right now. There's another undocumented problem here where some intents are mutually exclusive and some are not. It'll only process the last one.Ĭreeps can do multiple intents in the same tick. You can't tell a creep to move left and right at the same time either. You can only have one active intent of a given type. Screeps: Arena is an online RTS PvP strategy game for programming enthusiasts, wherein the core mechanic is programming your units AI. you can only have 1 "spawn" intent active on each "spawn structure". ![]() Originally posted by ShottyMonster:So, you can only have 1 "active" intent on each game "object" at a time? I.e. How do you "wait for your intent to process"? is there some state I can query? is an intent guaranteed to be completed (either success|error) by the start of the next tick or can they take an indeterminate amount of time to complete (kind of like a future?).Īnd then, the obvious question how can I know when it's "safe" to call "spawn" again and be sure it won't overwrite my old "spawn" intent? Is there a "hasActiveIntent" flag I can query on different game objects? So, you can only have 1 "active" intent on each game "object" at a time? I.e. Originally posted by Tigga:It seems a few people have this, or a similar issue. I do agree this could be better documented. What's happening in your case is that you're invalidating the first object by overwriting the spawnCreep intent with a new spawnCreep intent. FWIW this is super-useful later down the line, which is why I suspect this inconsistency exists (it's not done like this anywhere else). I would argue that the API is not completely broken and undocumented, it's just a bit confusing that spawnCreep returns an object. You're trying to stack things together on one tick and not waiting for your intents to process. You can see the changed game state and interact with it. The backend processes these and changes the game state Your code registers intents to do all these actions Nothing in the game happens in the same tick as your code executes. When you call spawnCreep, while an object is returned immediately, that doesn't mean your creep has spawned. ![]() It feels like maybe the earlier tutorials didn't hammer quite enough on the concept of ticks and how the game processes things. Due to significant rules change, existing codebases for advanced capture the flag and basic spawn and swamp are disabled, players rating for these arenas is set to 0.It seems a few people have this, or a similar issue.Changes in basic spawn and swamp arena: removed walls and containers in the middle of the room, containers with energy constantly appear in different places and disappear shortly.Changes in advanced capture the flag arena: creeps now have initial bodies, their count is reduced back to 14, each corner flag now have 4 towers, added one more flag with 1 tower in the center of the room.Spawns slowly regenerate energy (1 per tick).Tower damage power, heal power, and construction cost are reduced by 4 times (see TOWER_POWER_ATTACK, TOWER_POWER_HEAL, and CONSTRUCTION_COST constants).See documentation for module 'game/visual' for details Visuals provide a way to show various visual debug info in the game. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |