Hi folks,
I stumbled upon something strange while experimenting with maps. When making a fort map for 3 teams, i figured I had to write four zones in the file to have three of them showing. Same with other numbers... n zones need (n+1) lines of code. Anyone knowing what's wrong?
(0.2.8.3 client, WinXP)
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE Resource SYSTEM "map-0.2.8.0_pig2.dtd">
<Resource type="aamap" name="x" version="1" author="Wik" category="test">
<Map version="0.2.8">
<Settings>
<Setting name="fortress_collapse_speed" value="1"/>
<Setting name="fortress_conquered_score" value="0"/>
<Setting name="fortress_conquered_kill_min" value="0"/>
<Setting name="fortress_conquered_kill_ratio" value="100"/>
<Setting name="fortress_conquered_win" value="0"/>
<Setting name="fortress_conquest_decay_rate" value="0"/>
<Setting name="fortress_conquest_rate" value="1"/>
<Setting name="fortress_conquest_timeout" value="0"/>
<Setting name="fortress_defend_rate" value="0.75"/>
<Setting name="fortress_held_score" value="0"/>
<Setting name="fortress_max_per_team" value="1"/>
<Setting name="fortress_survive_win" value="1"/>
<Setting name="sp_auto_ais" value="0"/>
<Setting name="sp_game_type" value="1"/>
<Setting name="sp_min_players" value="0"/>
<Setting name="sp_num_ais" value="0"/>
<Setting name="sp_team_balance_with_ais" value="1"/>
<Setting name="sp_team_max_imbalance" value="0"/>
<Setting name="sp_team_max_players" value="3"/>
<Setting name="sp_team_min_players" value="3"/>
<Setting name="sp_teams_max" value="3"/>
<Setting name="sp_teams_min" value="3"/>
</Settings>
<World>
<Field>
<Axes number="8"/>
<Spawn x="100" y="100" angle="45"/>
<Wall>
<Point x="0" y="0"/>
<Point x="500" y="0"/>
<Point x="500" y="500"/>
<Point x="0" y="500"/>
<Point x="0" y="0"/>
</Wall>
<Zone effect="fortress"><ShapeCircle radius="50"><Point x="100" y="400"/></ShapeCircle></Zone>
<Zone effect="fortress"><ShapeCircle radius="50"><Point x="250" y="250"/></ShapeCircle></Zone>
<Zone effect="fortress"><ShapeCircle radius="50"><Point x="400" y="100"/></ShapeCircle></Zone>
<Zone effect="fortress"><ShapeCircle radius="50"><Point x="400" y="100"/></ShapeCircle></Zone> <!-- Needed, but why? -->
</Field>
</World>
</Map>
</Resource>
(NOTE: This is no real fort map btw, I just need something similar to rubberzones)
Fortress map for three teams: code buggy?
Fortress map for three teams: code buggy?
Last edited by Wik on Tue Aug 10, 2010 2:32 pm, edited 1 time in total.
Re: Fortress map for three teams: code buggy?
Dunno. Works for me both on recent trunk and 0.2.8 clients from bzr if I replace the DTD line with
Code: Select all
<!DOCTYPE Resource SYSTEM "AATeam/map-0.2.8.0_pig2.dtd">[/coode]
(And correct the copy/paste errors in the kind of overused variable section)
I'll try to check with our prebuilt exe on XP later.
Re: Fortress map for three teams: code buggy?
You know your map looks like this, right?
Now, as soon as I saw the code I had a sneaky suspicion, but you have one spawnpoint, so the teams form in blues in the middle, then yellows then reds on the outside.
So with 3 total zones, the reds are closest to the two outside zones, and blues are closest to the single inside zone, while yellow get no zone.
So reds = 2 zones, blue = 1 zone. Armagetron says this is a problem. You need to have 2 zones each. Make an even number of zones is the way to correct this.
I rewrote your map with 3 zones and 3 spawnpoints in the centre of each zone. Guess what, it worked.
Now, as soon as I saw the code I had a sneaky suspicion, but you have one spawnpoint, so the teams form in blues in the middle, then yellows then reds on the outside.
So with 3 total zones, the reds are closest to the two outside zones, and blues are closest to the single inside zone, while yellow get no zone.
So reds = 2 zones, blue = 1 zone. Armagetron says this is a problem. You need to have 2 zones each. Make an even number of zones is the way to correct this.
I rewrote your map with 3 zones and 3 spawnpoints in the centre of each zone. Guess what, it worked.
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE Resource SYSTEM "AATeam/map-0.2.8.0.dtd">
<Resource type="aamap" name="x" version="1" author="Wik" category="test">
<Map version="0.2.8">
<Settings>
<Setting name="fortress_collapse_s peed" value="1"/>
<Setting name="fortress_conquered_ score" value="0"/>
<Setting name="fortress_conquered_ kill_min" value="0"/>
<Setting name="fortress_conquered_ kill_ratio" value="100"/>
<Setting name="fortress_conquered_ win" value="0"/>
<Setting name="fortress_conquest_d ecay_rate" value="0"/>
<Setting name="fortress_conquest_r ate" value="1"/>
<Setting name="fortress_conquest_t imeout" value="0"/>
<Setting name="fortress_defend_rat e" value="0.75"/>
<Setting name="fortress_held_score" value="0"/>
<Setting name="fortress_max_per_te am" value="1"/>
<Setting name="fortress_survive_wi n" value="1"/>
<Setting name="sp_auto_ais" value="0"/>
<Setting name="sp_game_type" value="1"/>
<Setting name="sp_min_players" value="0"/>
<Setting name="sp_num_ais" value="0"/>
<Setting name="sp_team_balance_wit h_ais" value="1"/>
<Setting name="sp_team_max_imbalan ce" value="0"/>
<Setting name="sp_team_max_players" value="3"/>
<Setting name="sp_team_min_players" value="3"/>
<Setting name="sp_teams_max" value="3"/>
<Setting name="sp_teams_min" value="3"/>
</Settings>
<World>
<Field>
<Axes number="8"/>
<Spawn x="100" y="400" angle="45"/>
<Spawn x="250" y="250" angle="45"/>
<Spawn x="400" y="100" angle="45"/>
<Wall>
<Point x="0" y="0"/>
<Point x="500" y="0"/>
<Point x="500" y="500"/>
<Point x="0" y="500"/>
<Point x="0" y="0"/>
</Wall>
<Zone effect="fortress"><ShapeCircle radius="50"><Point x="100" y="400"/></ShapeCircle></Zone>
<Zone effect="fortress"><ShapeCircle radius="50"><Point x="250" y="250"/></ShapeCircle></Zone>
<Zone effect="fortress"><ShapeCircle radius="50"><Point x="400" y="100"/></ShapeCircle></Zone>
<!-- Needed, but why? -->
</Field>
</World>
</Map>
</Resource>
The Halley's comet of Armagetron.
ps I'm not tokoyami
ps I'm not tokoyami
Re: Fortress map for three teams: code buggy?
Hmm you may have to disregard my above post. try it anyway, but when I loaded it with 1 spawnpoint and 3 zones, it worked for me (but I have tweaked the dtd to "AATeam/map-0.2.8.0.dtd")
But yeah, the map still has 2 zones to one team, 1 to another and 1 team without a zone
But yeah, the map still has 2 zones to one team, 1 to another and 1 team without a zone
The Halley's comet of Armagetron.
ps I'm not tokoyami
ps I'm not tokoyami
Re: Fortress map for three teams: code buggy?
Maybe you forgot to correct the settings? There's a fortress_max_per_team supposed to be in there, which works for me.
But yeah, it probably is the team assignment code that deletes the zones. It's not designed to work out an assignment for every possible situation, you do have to design your map so that each zone can be assigned to the team closest to it. Piling all teams into a single spawn point is not very robust in that regard since the spawn order can change any time.
But yeah, it probably is the team assignment code that deletes the zones. It's not designed to work out an assignment for every possible situation, you do have to design your map so that each zone can be assigned to the team closest to it. Piling all teams into a single spawn point is not very robust in that regard since the spawn order can change any time.
Re: Fortress map for three teams: code buggy?
oh, some of the command lines have spaces in them for me :S
I just corrected them and the map works fine (although middle team's gonna be screwed).
This leads me to believe its the dtd.
I just corrected them and the map works fine (although middle team's gonna be screwed).
This leads me to believe its the dtd.
The Halley's comet of Armagetron.
ps I'm not tokoyami
ps I'm not tokoyami
Re: Fortress map for three teams: code buggy?
Nono, it is the fortress->team assignment code. It's not meant to do magic. It's strictly for maps designed so that each team spawn point has fortress_max_per_team fortress zones strictly closest to that spawnpoint (with a good margin of error for zones behind spawn points as it will be the individual team member positions that determine which team a zone will be assigned to, so if you place one zone in the middle of the map and let four teams around it spawn to the outside, the middle zone will fall to the largest team). The fortress_max_per_team setting is only there to kill the zones that would belong to teams that don't actually spawn. There would be a better automatic assignment algorithm possible, it's not like it's an NP hard problem. But linking zones explicitly to spawn points/teams in the maps is the better system anyway, and zones v2 *should* support that. I should probably take a look at it sometime.
So, yeah. Fix the map. Let the teams spawn close to their fortress.
So, yeah. Fix the map. Let the teams spawn close to their fortress.
Re: Fortress map for three teams: code buggy?
Thank you both, didn't know of the approximation issue.
The map's now working, research can continue :)
The map's now working, research can continue :)