Message passing between players
Kitlith last edited by
The title explains this one. Suppose two players want to pass messages between their scripts, possibly to encourage teamwork. There is currently no way to do so, probably on purpose. I and my friend started looking about what an 'enemy' can see when it can look at your creeps in custom mode, which means that some stuff may be different in the actual game. Here goes our observations.
We started by checking the name, which would probably be the most powerful way of passing messages: through arbitrary text. Unfortunately, that attribute is undefined from the 'enemys' perspective. What appears to be defined, though, are the owner's username, the body parts, and the energy that is being carried. Additionally, presumably, you can see the creeps position.
For now, lets stick with energy, and attempts to send text. A creep can be sent with at least 6 carry parts (to carry 300 energy) and one move part. It signals a byte by dropping the amount of energy over the byte it is sending, eg., from 300 down to 65, and picks the energy back up the next tick.
The 'enemy' detects the drop of energy from this creep, and reads this number, passing it to String.fromCharCode and getting a single character.
Repeat as necessary until the entire message has been sent.
Thinking about it now, you may be able to compress this from 6 carry parts down, especially if you create your own encoding for it. I know strings may not be the best way to pass information either, but it's my example. Also, please note that this is all theory, there has been no testing, besides probing using the console in custom mode.
Finally... would this be considered cheating? Assuming, that is, that it isn't used by two accounts made by the same person, but by two seperate people who want to co-operate.
Seronis last edited by
It would be kind of stupid to consider this cheating. Anyone you are passing messages to by scripts you've obviously talked to directly so that you are using compatible communication protocol. So that means its consentual. And you are using your CPU allotment to do the communication so you paid for it.
Only issue i see is energy you drop evaporating and causing errors in the message.
_Zinal last edited by
You could make 2 creeps instead (both with 6 carry parts and one move part) and pass the energy between them. This way the energy would not evaporate.
avdg_ last edited by
hmm, how is data encoded, do we use ascii, or limit ourself to the set a-z0-9 (1 storage device alone can have up to 51 states though...)