Opened 11 years ago

Closed 9 years ago

Last modified 8 years ago

#2055 closed enhancement (fixed)

[PATCH] Implement: Allies share vision an unlocking technology

Reported by: michael Owned by: Niek
Priority: Nice to Have Milestone: Alpha 19
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

I would like to make Allied shared vision an unlocking technology ("Cartography" or something along these lines).

Basically, allies start the match without shared vision, but then unlock shared vision after researching a technology. This is a standard thing in Age of Empires games.

Attachments (7)

SharedLOSTech.patch (4.0 KB ) - added by Niek 9 years ago.
Implements the Shared LOS technology
shared_los.png (23.5 KB ) - added by Niek 9 years ago.
SharedLOSTechv2.patch (3.9 KB ) - added by Niek 9 years ago.
Patch with style fixes
SharedLOSTechv4.patch (5.9 KB ) - added by Niek 9 years ago.
Different approach
SharedLOSTechv5.patch (5.9 KB ) - added by Niek 9 years ago.
Fix a style issue
SharedLOSTechv6.patch (5.9 KB ) - added by Niek 9 years ago.
Fix typo
SharedLOSTechv7.patch (6.0 KB ) - added by Niek 9 years ago.
Move return up in function and add comment to schema

Download all attachments as: .zip

Change History (22)

comment:1 by leper, 11 years ago

Component: Core engineUI & Simulation
Keywords: simple added; Line of Sight Vision Allies Technologies removed

Do both players have to research this for it to work (I think so but it's been some time since I last played AoE)

in reply to:  1 comment:2 by historic_bruno, 11 years ago

Replying to leper:

Do both players have to research this for it to work (I think so but it's been some time since I last played AoE)

Not in AoK, as soon as you build a market and research cartography, you get LOS of your allies. I'm not sure if I like this more as a technology, or something you get automatically at a certain phase, or as a diplomatic option, or some combination.

comment:3 by Raymond, 11 years ago

I disagree.

Version 0, edited 11 years ago by Raymond (next)

comment:4 by Adrián Chaves, 11 years ago

Note: even if we disagree to implement this for 0 A.D. — Empires Ascendants, it might be useful to be able to have this, modding-wise.

comment:5 by Stan, 9 years ago

Keywords: design added

by Niek, 9 years ago

Attachment: SharedLOSTech.patch added

Implements the Shared LOS technology

comment:6 by Niek, 9 years ago

Keywords: patch review added
Milestone: BacklogAlpha 19
Owner: set to Niek
Status: newassigned
Summary: Implement: Allies share vision an unlocking technology[Patch] Implement: Allies share vision an unlocking technology

by Niek, 9 years ago

Attachment: shared_los.png added

by Niek, 9 years ago

Attachment: SharedLOSTechv2.patch added

Patch with style fixes

comment:7 by sanderd17, 9 years ago

The actual tech is missing from your second patch, but it's in your first, so it doesn't hinder a review (would be nice to get them together in your next patch though).

I have a bit of a bad feeling using ApplyValueModifications for this. The method was meant for numeric template-defined values. Besides, it should always operate on the base value, not on the updated value.

I think it would be better to do something similar to template requirements: Define in the player template how the shared los technology is called, then, when a valuemodification happens, check if that tech is researched, and use that immediately as flag to set the shared los or not.

by Niek, 9 years ago

Attachment: SharedLOSTechv4.patch added

Different approach

comment:8 by sanderd17, 9 years ago

Pretty well done. The only issue I have is, when there's no shared los tech defined for the player, I would assume it keeps the old behaviour (so share los immediately), instead of the current early return.

comment:9 by leper, 9 years ago

Not sharing LoS seems like a nice default IMO.

by Niek, 9 years ago

Attachment: SharedLOSTechv5.patch added

Fix a style issue

comment:10 by mimo, 9 years ago

carthography -> cartography

comment:11 by mimo, 9 years ago

In fact, thinking again to this patch, I'm a bit bothered by the fact that we have to give the name of the tech in the player.xml file and test on this name for applying the tech. That looks a bit as a hack for me

Maybe adding a new propriety in the techs to say that it should apply to the player entity

"playerModifications": [{"value": "Player/SharedLos", "replace": true}],

And add in the player.xml, something like <Player>

<SharedLos>false</SharedLos>

</Player>

would be better, and more flexible for modding.

by Niek, 9 years ago

Attachment: SharedLOSTechv6.patch added

Fix typo

by Niek, 9 years ago

Attachment: SharedLOSTechv7.patch added

Move return up in function and add comment to schema

comment:12 by sanderd17, 9 years ago

Resolution: fixed
Status: assignedclosed

In 16795:

Allies only share vision when researching a tech. Based on patch by niektb. Fixes #2055

comment:13 by sanderd17, 9 years ago

Keywords: simple design review removed

comment:14 by Itms, 9 years ago

In 16842:

Correctly compute the masks for shared visibility updates. The old code was working only because of luck when shared vision was always reciprocal.

Refs #2055, fixes #3327

comment:15 by Palaxin, 8 years ago

Summary: [Patch] Implement: Allies share vision an unlocking technology[PATCH] Implement: Allies share vision an unlocking technology
Note: See TracTickets for help on using tickets.