New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tombstone implementation #74
Conversation
Now matches the [simultaneous action documentation](http://docs.screeps.com/simultaneous-actions.html). Prior to this change creeps would be able to use `attackController` and `heal`/`rangedHeal` in the same tick.
Great job! As for vision, could you please test it? It may work automatically, since it has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Will tombstones be part of the OBSTACLE_OBJECT_TYPES? Now they're walk-able. |
Can confirm, vision is working automatically. |
src/processor/intents/creeps/_die.js
Outdated
} | ||
}); | ||
} | ||
|
||
if(container) bulk.upda |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed that, removed
src/processor/intents/creeps/_die.js
Outdated
creepBody: object.body, | ||
creepAgeTime: object.ageTime, | ||
creepBody: object.body, | ||
creepHits: object.hits, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to store creep's hits, it seems to be always 0 since the creep is dead, right? Also, body[].hits
is all 0 too, so we can store body in plain format ['move','move','work',...]
(but expose to user in normal Creep.body
format).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is hits 0 when a creep dies by TTL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it, people can use TTL to determine cause of death, TTL would be 0 on age death, suicides are user triggered, and death from damage would leave a positive TTL
type: 'tombstone', | ||
room: object.room, | ||
x: object.x, | ||
y: object.y, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x
, y
, and room
are the same as in the tombstone, no need to store them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are the tombstone x
, y
, and room
I don't think they should, they currently stack while in existence, one for each creep that has died on that tile. If they were obstacles, it would be easy to effectively blockade areas just by spamming creeps and suicide |
I agree! Just wanted to make sure |
…ts) is placed in tombstone
|
||
bulk.remove(object._id); | ||
delete roomObjects[object._id]; | ||
require('./_die')(object, roomObjects, bulk, stats, undefined, gameTime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now this will add to the creepsLost
stat, which isn't exactly what you want.
Using undefined
instead of stats
will fix this already, but maybe it's better to add options to disable this behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, IIRC, somewhere else it also passes undefined as stats, updating now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its spawn recycle-creep where it passes undefined
Code looks good to me, going to test it later on. |
This allows tombstones to contain the creep's last words
Tested with all of the above use cases, everything seems to work fine. |
* Tombstone implementation * Fixed new creeps auto-killing on blcoked spawns and recylcing * Drop to container * Adjust tombstones to use a stub creep * Only store body types, removed duplicate creepBody, fix TTL saving * Fixed syntax error and hitsMax * Fixed containers being overfilled * Adjusted so that any energy that won't fit into container (if it exists) is placed in tombstone * Fix Tombstones to never drop into containers when decayed. * Fix saving public say to tombstone * Fixed tombstone not spawning for TTL deaths * Tombstones: Don't pass stats to _die for TTL death * Allow creep say intent to be processed before the suicide intent This allows tombstones to contain the creep's last words * small fixes * remove `owner` and `my`
Engine side of tombstone implementation. Forum Discussion
A tombstone is generated when creeps die (Via any death method, ttl, suicide, etc)
Done
Needs constants updated. (Should I PR screeps/common for this?)
Working
As far as I can tell, this needs a driver/runtime update, do I need to write a PR for that?Vision is working automatically.
Find and look constants are also implemented.
Test Cases I'm testing with:
TOMBSTONE_DECAY_PER_PART * body.length
CARRY
also drop into tombstoneFor the rendering and constants, I'm using a tiny mod for testing