Zones v2

From Armagetron
Revision as of 10:03, 7 June 2007 by 208.30.47.6 (talk)

Preamble

You will note that the examples below dont sound that fun. I'd like to think its because my creative power went into building a good system, and now there is little left to put on examples. But I'm sure you will find interesting ways to use the mechanisms in here. My goal with this was to be able to have zones that could have different effect depending on who would use them. For example, having a fortress that team Blue could conquer, but only 2 of the players of team Red could actually defend. The other Red could still circle it and block the enemy, but they could not lower its value actively. Everything described here works. There are still glitches small and not so small. The code is in my private branch, but feel free to grab a local copy if you want to play with it.

The format is anything but closed. I'd like to hear your opinion on it too (yes it is a PITA to write, but if you have a constructive remark about that, I'd like to know it)

-ph

Most of this is from a forum post by philippeqc. I reworded some stuff and formatted a bit for the wiki. Some stuff might have gotten lost or reworded wrongly so cross refrence with the post if the wording gets hazy and/or just to double check @ http://forums.armagetronad.net/viewtopic.php?p=77491#77491. Some stuff might be in the wrong place. --Your mom 11:42, 30 July 2006 (CDT)


Zone element

Individual zones may have a name. Entering a name is optional, and re-using a name will be considered to mean "add/override with the following information". Dont rely on this behavior for anything, in other words Dont re-use the same name. All zones need a shape defined. At the moment only one shape exists, the ShapeCircle. More shapes are planned in the future and are ToDo

Ex:

<Zone name="redFortress">
 <ShapeCircle radius="29">
  <Point x="50" y="50"/>
  <Color red="0.988" green="0.059" blue="0.753" />
 </ShapeCircle>
</Zone>

Rules and EffectGroups

A zone can have up to 4 different "rules" (need better name ToDo). Enter, Inside, Leave, Outside. It classifies when the held elements should be inspected. Inside each of the "rules", one can define EffectGroups. EffectGroup(s) are the fundamental building blocks of this new system. It associate owners with consequences. Note that ownership is part of effectGroup(s), NOT the zone. So a zone may have multiple effectGroup(s), each with unique or interlapping owners. There are 2 types of owners: owner (individuals) and ownerTeam (every member of a team). It is possible to define 0,1 or many for each items.

HACK: ATM, only owner is supported, and it must be an exact match with a player's name to associated the effect. The real solution will translate the labels used to players based on some other logic depending on "game type". This is to be defined later.

HACK: It should be possible to associate individual with teams in some part of the map. In this text, I will user lowercase color name number for individual, and uppercase color name for teams. So the individual red1, red7 and red90210 should be considered as players of the team RED. I will also allow myself to insert _description_ in names to help the reader when appropriate.

Ex:

<Zone name="redFortress">
<ShapeCircle ...>
...
</ShapeCircle>
<Enter>
<EffectGroup owner="red1,red2" ownerTeam="BLUE,YELLOW">
...
</EffectGroup>
<EffectGroup owner="" ownerTeam="RED">
...
</EffectGroup>
</Enter>
<Leave>
<EffectGroup owner="green7" ownerTeam="">
...
</EffectGroup>
</Leave>
</Zone>


User element

Inside the EffectGroup, elements User are set. This element offers different readily made rules to determine if a player in the "rule" condition for the zone, is allowed to be considered a user. This is decided based from the following information: owner, ownerTeam and the player matching the rule. Two other conditions can be set for a player to be considered a valid user: positive and marked. These element are of type Triad. The possible values are true, false and ignore. We will come back to these later. If the current player is found to be valid, the processing will continue to the child elements. Otherwise, nothing happens. A valid user will be called triggerer from now on.


The following users are currently implemented:

  • all: Anybody can be considered a valid user,
  • owner: only a player direcly in the owner list can be considered a valid user,
  • ownerTeam: only a player member of a team mentionned in the ownerTeam list can be considered a valid user,
  • allButOwner only a player NOT mentioned in the owner list can be considered a valid user,
  • allButTeamOwner only a player NOT member of a team mentioned in the ownerTeam list can be considered a valid user, (TO COME, NOT IMPLEMENTED YET)
  • anotherTeammate only a player in the same team as one of the individual owner can be considered a valid user (TO COME, NOT IMPLEMENTED YET)


Ex:

<EffectGroup owner="red1,red2" ownerTeam="BLUE,YELLOW">
  <User user="all" >
  ... <!-- Anybody can trigger this -->
  </User>
  <User user="allButOwner" >
  ... <!-- Anybody but red1 and red2 can trigger this -->
  </User>
</EffectGroup>
<EffectGroup owner="" ownerTeam="RED">
  <User user="owner" >
  ... <!-- No effect as the owner list is empty -->
  </User>
  <User user="ownerTeam" >
  ... <!-- Only players of the RED team can trigger this -->
  </User>
</EffectGroup>

Inside a User element, it is possible to make use of 3 different elements. Target, ZoneInfluence and MonitorInfluence.

Target

The Target element will take the information of the valid user, and calculate who will receive the effect of the zone. Depending on the described target rule to use and the state of the game, the calculated target can be from no players to everybody in game.

The currently implemented target rules are :

  • self : the triggerer himself
  • teammate : a randomly selected teammate of the triggerer
  • team : all the member of the team of the triggerer
  • all : everybody in the game
  • allButSelf : everybody in the game BUT the triggerer
  • another : a randomly selected player that is not the triggerer
  • ownerTeamTeammate : a randomly selected player member of one of the teams mentioned in the teamOwner list.
  • owner : all the players owning the effectGroup
  • ownerteam : all the players member of the team owning the effectGroup
  • ownerteamteammate : a single player member from a owning team
  • anydead : any single dead player
  • alldead : all the dead players
  • singledeadowner : one of the owners that is dead
  • anotherteammatedead : a single player member of the team of the triggerer that is dead
  • anothernotteammatedead : a single player that is not member of the team of the triggerer and that is dead

*Much more are detailed in a document named zones.txt hidden somewhere on the forum.


Once the targets are selected, they all are applied all the effects described under the Target element.

Nota: In a User element, it is possible to user any amount of Target, ZoneInfluence and MonitorInfluence.

Ex:

<User user="ownerTeam" >
  <Target target="self">
  ... <!-- The player that is member of one of the team mentionned
  and that triggered the zone receive the effect -->
  </Target>
  <Target target="another">
  ... <!-- Some random player will receive the effect described -->
  </Target>
</User>

Effect

The Effect element hold specific effects. The attribute count can limit the number of times a specific effect can be used. By default, the count is unlimited.

valid effect currently implemented are:

  • win : win the round
  • death : kill the target(s)
  • point : give points to the target(s)
  • respawnplayer : Respawns target(s)
  • brakerecharge : Refills target(s) cycle brake
  • rubberrecharge : Refills target(s) cycle rubber
  • setting : has 2 attributes ; settingName