Skip to content

Conversation

@ArseniyShestakov
Copy link
Member

Work in progress on all 3 kind of rumors:

  • Random rumors.
  • Stats rumors that depend on thieves guild info + grail.
  • Custom rumors from map.

Original game used "Rumors" and not "Gossips" and we already using rumor in CMap.
Actually information about this week rumor should be stored in gamestate and updated weekly
@ArseniyShestakov
Copy link
Member Author

There is very little details on rumors mechanic and zero reports on bug tracker so here is some info:

  • Game has 3 types kind of rumors as posted above.
  • Rumor changed weekly and shared between all players.
  • Rumors of same type may go in row. Likely there is % change that one of type appear.
  • Same rumor is never repeated twice in a row and this is why we must keep one previous rumor for each type. That is valid even if there was different type of rumor in between (e.g stats rumor -> map rumor -> stats rumor and last one have to be different stats rumor).
  • When multiple players occupy 1st position in thieves guild rating the first one appear in rumor (e.g red).
    I feel this one is a bit unfair so I'll just choose random player instead (from all who's on 1st position).

@ArseniyShestakov
Copy link
Member Author

Income code is really bad for now, but I have some ideas to refactor StatsHLP and reuse it for both client (Kingdom Overview) and server (instead of current income calculation on new turn).

@edeksumo
Copy link
Contributor

edeksumo commented Dec 1, 2015

I'm to start work on this -_- but you made more than me, so i will stop. But you can add rumors for mod just like i want to do in my wip.

@ArseniyShestakov
Copy link
Member Author

@edeksumo
We can merge code if you fixed something else and you can continue work on it. It's clearly not something I want to work on exclusively while both rumors and Thieves Guild require more time if we want to authentic H3 behavior.

Sent you PM on forums with my skype contact if you agree to talk.

@DjWarmonger
BTW also wish I had your contact that isn't just forum/github. :-)

@Alucard648
Copy link

I am hoping there will be an option to get new rumor for gold, like in Heroes 5.

@ArseniyShestakov
Copy link
Member Author

@Alucard648
There is already rumor in H3 for gold income:

%s earns the most gold.

Any example of what rumors you mean?

@ArseniyShestakov
Copy link
Member Author

Just in case I'm not planning any modding support there for now, but I'll need to take it into account to not break rumor serialization formation in future. E.g currently I only store rumor type, rumor ID and additional ID (terrain for grail or player).

Though I suppose some modability may require more complex struct.

@Alucard648
Copy link

I mean buy new rumor in tavern for 100 gold, instead of waiting another week.

@ArseniyShestakov
Copy link
Member Author

Ah, okay. Sadly something like that would require a bit different implementation. In H3 rumors are always shared between all players while mechanics like that may require to make rumors unique per players.

It's not hard at all to implement, but then we need to store rumors differently and actually avoid showing duplicates, etc.

@IvanSavenko
Copy link
Member

Income code is really bad for now, but I have some ideas to refactor StatsHLP and reuse it for both client (Kingdom Overview) and server (instead of current income calculation on new turn).

This looks like one more case where "object roles"/mixins may work. Each object that provides daily income implements "IDailyIncomeRole" and to get all your daily income all you need is to sum daily income of all owned objects with daily income role.

So I'd suggest to keep it as it for now since I've started looking into this - no need to duplicate effords.

@ArseniyShestakov
Copy link
Member Author

Okay then I won't touch it for now and just merge it as it's now with other branches.

@ArseniyShestakov ArseniyShestakov changed the title [WIP] Tavern rumors Tavern rumors and Thieves Guild fixes Dec 4, 2015
We also now check not number of towns, but only towns that has tavern built. Also according to original mechanics all taverns always display information based on your number of taverns and not number of taverns of object owner.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought - what about marking all places for backwards compatibiltiy in some consistent format? Or even static_assert'ing that this version is not less than minimal supported?

This would allow us to remove all compatibility code once save version is increased instead of accumulating it over releases.

ArseniyShestakov added a commit that referenced this pull request Dec 5, 2015
Tavern rumors and Thieves Guild fixes
@ArseniyShestakov ArseniyShestakov merged commit 360ebcc into develop Dec 5, 2015
@ArseniyShestakov ArseniyShestakov deleted the feature/tavernRumors branch December 5, 2015 12:15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before I can't test it because I have't got any time, so now when I test it, this one provides me an error: operator =' is ambiguous

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed. This does not compile in Visual and I don't see how it could.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RumorState(): type(TYPE_NONE), last(){};

Is this works?

@edeksumo
Copy link
Contributor

Probably not: Error 5 error C2440: 'return' : cannot convert from 'CGTownInstance *' to 'CGObjectInstance *' in another file: CommonConstructors.h

@IvanSavenko
Copy link
Member

Yeah, CommonConstructor.h needs some includes.
You need to include CBank.h, CGTownInstance.h and CGHeroInstance.h

@edeksumo
Copy link
Contributor

It's work, if nobody fix it tomorow I will make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants