Skip to content

Making bonzAI less evil

bonzaiferroni edited this page Dec 29, 2016 · 19 revisions

As a player I've always had most fun in PvP when both sides were willing participants, and so I'd like to program a way for this to happen.

How will bonzAI know who is a willing participant? Well really, it can't. Perhaps it can at least know who is an unwilling participant, and using heartless robot logic assume all others are willing.

My solution is to allow players to tell bonzAI to leave them alone. It will monitor all incoming market transactions and look for transaction amount of 111. When it finds one, it will check the description for a message. At the moment it understands the following strings:

  • "safe": This informs bonzAI that you do not wish to be attacked, and it will respect that.
  • "removeSafe": This will remove you from the safe list, which returns you to the default status.
  • "danger": This is informing bonzAI that you intend to attack it, or that you would like to defend against it. If bonzAI has the resources to do so, it will oblige.
  • "removeDanger": This will return you to the default status.

Apart from safe and danger, players can also be regarded as allies and enemies, which have similar effects but the values are determined internally.

Example console command:

Game.rooms[myRoomName].terminal.send("energy", 111, "E22S17", "safe");

gif example

What to expect

Default status

Having the default status doesn't necessarily mean you are in danger. With this status, bonzAI would only attack in the following two cases:

  1. Your room is a linear distance of 1 from a bonzAI owned room
  2. Your territory is in range and preferable above all other possible expansions

The 2nd condition isn't even coded yet, but eventually bonzAI will do analysis of nearby rooms and decide where it wants to settle next based on the density of energy sources and mineral type.

Safe status

bonzAI will not attack, even for expansion reasons. The only way it would attack is if you earn a place on the enemy list. This isn't coded yet, but here is what I have in mind:

  1. You attack an owned or reserved room
  2. You settle in a place that bonzAI has indicated in the controller message that it intends to settle there

Danger status

This isn't coded yet, but it will be a way to inform the AI that you actually want to PvP. This will probably be most useful on a private server where you want to have a more aggressive opponent.

In any case

I've only recently converted my raiding code to something that can be fully automated. Even monitored raids often do not go as planned, for it be completely automatic is bound to be tricky, full of bugs, and a huge waste of resources. I personally would not be worried about being one of my neighbors with default status.

It is my hope that my neighbors will not add themselves to the safe list but will engage with the AI in this way. I do not mind losing rooms and will enjoy it whatever the outcome.