Opened 9 years ago

Last modified 3 years ago

#3265 assigned enhancement

[PATCH] Tribute all resources to active allies before resigning

Reported by: elexis Owned by: Vlad Topala
Priority: Nice to Have Milestone: Backlog
Component: Simulation Keywords: patch, simple
Cc: Patch:

Description (last modified by elexis)

Often players resign, while they still have many resources left and teammates feel like they can still win the game.

Once the user has confirmed the resign-question, he could be asked whether or not he wants to send resources to his allies before doing so (maybe at least when he has more than 100 of one resource type).

If he agrees, the diplomacy manager could open, allowing him to easily tribute. If he disagrees, he should be defeated and asked whether to leave.

Attachments (2)

[PATCH] 3265_-_Tribute_all_resources_to_active_allies_before_resigning.patch (4.7 KB ) - added by Vlad Topala 8 years ago.
[PATCH]
3265.2.diff (791 bytes ) - added by fatherbushido 8 years ago.

Download all attachments as: .zip

Change History (25)

comment:1 by Vlad Topala, 8 years ago

comment:2 by Vlad Topala, 8 years ago

Keywords: review patch added
Milestone: BacklogAlpha 19

comment:3 by Vlad Topala, 8 years ago

Summary: Tribute all resources to active allies before resigning[PATCH] Tribute all resources to active allies before resigning

comment:4 by Stan, 8 years ago

Hey thanks for the patch here are some comments

  • the use of for each is deprecated use for(x of y) or for(x in y)
  • Use the let keywords when possible.
  • Could you use Jsdoc on modified functions so we can generate the documentation ?

comment:5 by Stan, 8 years ago

Keywords: simple removed
Milestone: Alpha 19Alpha 20

A19 will not have this featured (Feature and commit freeze) so pushing it to A20

comment:6 by Vlad Topala, 8 years ago

Thanks a lot for the review. I'll do the changes and come back with a new patch.

comment:7 by Stan, 8 years ago

Keywords: review removed

I'm getting this out of the review queue until then. Keep it up :)

comment:8 by Stan, 8 years ago

Nice ! Only thing missing is `for (let x)` instead of `for (var)`. Apart from that it looks nice :)

Feel free to take any other tickets after that one.

Keep it up :) Have you tested it ?

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

comment:9 by Vlad Topala, 8 years ago

Updated the for blocks with let. Yes, I tested it by starting multiple instances of the game, creating a multiplayer game in which the instances were allied and resigning. I already got my eye on another ticket (http://trac.wildfiregames.com/ticket/1912) but if you have any suggestions, as to what might be better, do tell.

comment:10 by Stan, 8 years ago

Well your patch lasr patch here is for #1912 XD I think it should be fine after that add the review keyword and click accept so the ticket is assigned to you

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

comment:11 by Vlad Topala, 8 years ago

Keywords: review added
Owner: set to Vlad Topala
Status: newassigned

comment:12 by Stan, 8 years ago

The patch is not the right one :)

comment:13 by Vlad Topala, 8 years ago

:)) my bad. I didn't get it from your previous comment. I hope it's all good now :D.

comment:14 by leper, 8 years ago

Keywords: review removed

Read the Coding Conventions. Why add IsActive and GetAllies if you still iterate over most players, just iterate over all of them and do the checks there. No to adding that resource array to the prototype. You likely also want mutual allies, and so the team check would be pointless. There also exists a function for tributing resources already, might make sense to reuse that.

comment:15 by fatherbushido, 8 years ago

Keywords: review added
Priority: Nice to HaveMust Have

comment:16 by fatherbushido, 8 years ago

Since it's inactive since 3 months, i made one patch taking accounts of above remarks.

comment:17 by elexis, 8 years ago

In 17813:

Two early returns. Refs #3265.

by fatherbushido, 8 years ago

Attachment: 3265.2.diff added

comment:18 by fatherbushido, 8 years ago

  • if player doesn't want give his ress, we can't force him.
  • if player wants give his ress, he must do it before being defeated. It's more realistic.

comment:19 by elexis, 8 years ago

In 17853:

Defeated players are not supposed to do stuff.
Not sending resources on defeat also gives an incentive to completely defeat players.
Patch by fatherbushido, refs #3265.

comment:20 by elexis, 8 years ago

Description: modified (diff)
Keywords: simple added; review removed
Milestone: Alpha 20Backlog
Priority: Must HaveNice to Have

Rewrote the ticket description.

comment:21 by Imarok, 5 years ago

Component: UI & SimulationSimulation

Move tickets to Simulation as UI & Simulation got some sub components.

comment:22 by Silier, 3 years ago

Keywords: simple removed
severity: simple

comment:23 by Silier, 3 years ago

Keywords: simple added
Note: See TracTickets for help on using tickets.