Opened 8 years ago

Last modified 7 years ago

#4082 closed task

[PATCH] Team Bonuses (from design doc) — at Version 6

Reported by: Stan Owned by:
Priority: Must Have Milestone: Alpha 22
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description (last modified by fatherbushido)

Since r18115 we now have team bonuses thanks to fatherbushido, it would be nice that all civs may benefit from it. All of the following is taken directly from http://trac.wildfiregames.com/wiki/Civ%3A_

Gauls: Name: Druides History: The Druids of the Celts maintained an organized religion that advanced the technology of their people even during wartime. Effect: Bonus to tech speed.

Brits: Name: Druides History: The Druids of the Celts maintained an organized religion that advanced the technology of their people even during wartime. Effect: Bonus to tech speed.

Carth: Name: Trademasters History: The Phoenicians and Carthaginians were broadly known as the greatest trading civilization of the ancient and classical world. Effect: +33% trade profit ‘international’ routes for allies.

Macedonians: Name: Standardized Currency. History: The Macedonians and their successors (Diadochoi) minted coins of very high quality. On their currency the Diadochoi in particular frequently depicted themselves as the rightful successor to Alexander the Great, attempting to legitimize their rule. Effect: Tribute and trade between allies of the metal resource is bonused ~ 15%.

Mauryans: Name: Evangelism. History: Ashoka the Great sent embassies West to spread knowledge of the Buddha. Effect: All allied Temple technologies -50% cost and research time.

Persians: Name: The Royal Road. History: Coinage was invented by the Lydians in 7th Century BC, but it was not very common until the Persian period. Darius the Great standardised coined money and his golden coins (known as "darics") became commonplace not only throughout his empire, but as far to the west as Central Europe. Effect: Higher income (+25%) from land trade routes, for the player's traders and his ally's traders.

Ptolemies:

Name: Breadbasket of the Mediterranean. History: Egypt was a net exporter of grain, so much so that large cities such as Athens, Antioch, and Rome came to rely upon Egyptian grain in order to feed their masses. Effect: All allies automatically gain a slow trickle of food income.

Romans: Name: Socii. History: Being allied with Rome came with great benefits (as well as great peril). Effect: Allied citizen-soldiers gain a +10% attack when in Roman territory.

Spartans: Name: Peloponnesian League. History: Much of the Peloponnese was subject to Sparta in one way or another. This loose confederation, with Sparta as its leader, was later dubbed the Peloponnesian League by historians, but in ancient times was called 'The Lacedaemonians and their allies.' Effect: Allied team members can train Spartiates.

Iber: Name: Saripeko History: The Iberians were long known to provide mercenary soldiers to other nations to serve as auxiliaries to their armies in foreign wars. Carthage is the most well known example, and we have evidence of them serving in such a capacity in Aquitania. Effect: For allies, infantry and cavalry citizen-soldier skirmishers -50% cost (does not apply to champions also armed with the javelin).

Athen: Name: Delian League. History: Shortly after the great naval victories at Salamis and Mykale, the Greek city-states instituted the so-called Delian League in 478 BC, whose purpose was to push the Persians out of the Aegean region. The allied states contributed ships and money, while the Athenians offered their entire navy. Effect: Ships construct +25% faster.

Seleucid: Name: Syrian Tetrapolis. History: The political core of the Seleucid Empire consisted of four 'sister' cities: Antioch (the capital), Seleucia Pieria, Apamea, and Laodicea. Effect: Allied Civic Centers are 20% cheaper.

Change History (7)

comment:1 by Stan, 8 years ago

Description: modified (diff)

comment:2 by elexis, 8 years ago

Keywords: simple added

comment:3 by mimo, 8 years ago

Keywords: simple removed

Auras are based on a rangeManager query to find the entities on range, but the range manager only works for entities with a position and inWorld. So currently most team bonuses (using global auras) are broken as the player entity has no position: auras are correctly applied to templates, but not to entities. A possible solution would be that CCmpRangeManager still performs the query (using 0-0 as position) for such special entities.

There are also some side-effects for this: for example hero auras are not applied to entities created while the hero is garrisoned, it is only when we ungarrison it that the aura is applied. Here, when querying a garrisoned entity, we could take (recursively as a garrisonHolder may be garrisoned) the position of its garrisonHolder.

Finally, once team bonuses works, they should be disabled when the allied at the root of the aura is defeated.

comment:4 by mimo, 8 years ago

Keywords: rfc patch added
Milestone: BacklogAlpha 21
Summary: Design Docs : Team Bonuses[PATCH] Team Bonuses (from design doc)

Some global auras, affecting only the templates and potentially the player entities, make a useless rangeQuery (as player entities have no position). Here is a patch to avoid this rangeQuery. As an example of such use, the patch also implements the ptol team bonus. (As the ResourceTrickle component was used, it also contains some optimization for it, recomputing the rates only when modified and not on each iteration). Finally, there is a TODO in the patch which is here for discussion, about defining a new "player" type for such auras, instead of using the "global" one.

by mimo, 8 years ago

Attachment: ptol-teambonus.patch added

comment:5 by sanderd17, 8 years ago

Something like this would get rid of the range query, though it still needs extra code for when the receiver is the player entity directly: http://pastebin.com/9460Khhn

It's also completely untested and most likely broken. It serves mostly as an example to start from (f.e. it minimises the global message listeners by letting the AuraManager listen to it (most aura entities don't have a global aura so wouldn't need the listener anyway)).

Last edited 8 years ago by sanderd17 (previous) (diff)

comment:6 by fatherbushido, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.