Limit AI player to a given area?

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Limit AI player to a given area?

Post by beetlenaut »

kurt751 wrote:Because the TerrainCodesWML page suggests "o" stands for orcs. Or so it seems.
Wiki wrote:Additional letters do not always follow the same meaning, but are as consistent as possible.
The engine only recognizes whole terrain strings like "Cud". The engine doesn't pull that apart into "castle", "underground", and "dwarf" before deciding what tile to use or how it works. The developers just wanted people to be able to do that (as much as possible).
kurt751 wrote:So, to limit movement of the AI, one just has to add to any existing terrain type following overlays:
Impassable Overlay: ..^Xo
Unwalkable Overlay: ..^Qov
Yes, but in Simpleton's case, it wouldn't work because he is trying to limit just one side. That's the case where you would need to define some new overlays and a new movement type for any units used on that map. What we really need for this is a new micro AI that treats defined areas as impassable.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Limit AI player to a given area?

Post by Ravana »

Giving something impassable overlay makes it impassable for everything that is not made able to move on impassable, not just ai. Though you could continually switch terrain in turn events.
kurt751
Posts: 232
Joined: June 4th, 2016, 11:17 pm

Re: Limit AI player to a given area?

Post by kurt751 »

beetlenaut wrote:The engine only recognizes whole terrain strings like "Cud".
I see.
In this case the "TerrainCodesWML" page is a little misleading. It should specify this "Decoding the Terrain Codes" part is just a mnemonic help for the humans, and that you can't just freely assemble terrain codes (which is what one could think after reading that chapter).

Are there other terrain strings, or are they all listed in the TerrainCodeTableWML page? I'm asking because some terrain overlays are nothing you couldn't do with a {PLACE_IMAGE} macro (sand crater comes to mind, or the unlit brazier), so I'm wondering how far the "terrainization" of scenery images went.
kurt751
Posts: 232
Joined: June 4th, 2016, 11:17 pm

Re: Limit AI player to a given area?

Post by kurt751 »

Ravana wrote:Giving something impassable overlay makes it impassable for everything that is not made able to move on impassable, not just ai.
I forgot about that... :(

Ravana wrote:Though you could continually switch terrain in turn events.
Hmm, clever! :D
Wouldn't that tax the engine to much? If not there are lots of nice things you could do with that trick...
Post Reply