Page 1 of 1

shared income (like for example in Company of Heroes)

Posted: 04 Apr 2007, 15:23
by chlue
Currently there a two ways to distribute energy and metal.

1. autosharing
distributes exess metal and enery even to you teammates
--> hard to controll, basically only makes sure nothing is wasted

2. share via share dialog
--> is good controllable, but require to much effort

I want to see a third optional option. The income of each unit is shared even over the whole team. So If I build a mexx, that extract 3Metal and I have 2 Teammates, then everyone will get 1 Metal.

This would be very usefull for Teamgames, where one player focus only on economy. Currently it is very hard to controll this, because of this problems:
- if the economyplayer start building to much, the other teammates are left with nothing
- it its hard to find a ballance, because the 'attack'-players have no overview over the recources. If you have a certain garanted income it is much easier to plan your moves.
- Metalmakers are very hard to controll.

Additionall you get the advantage in an normal random teamgame, that you can build/upgrade recourse spots whenever you have a bored constructionunit in the area, without risking discussion like 'thats my mexx', 'why are you reclaiming my geo',...

From my understanding this would requiere only some methods in the file unip.cpp to be changed and the 'infrastructure' to set this option starting from the lobby client to this class. (Like it is done for 'Disminishing metal makers return')

The methods
CUnit::AddMetal(float metal)
CUnit::AddEnergy(float energy)
needs to be changed from :

Code: Select all

gs->Team(team)->AddMetal(metal);
to 'pseudo'

Code: Select all

for n=1..num(teams)
  gs->Team(n)->AddMetal(metal)/num(teams);
end
Additionall this methods needs to be changed, too (for negative income like the solar collectors in BA.)
CUnit::UseMetal(float metal)
CUnit::UseEnergy(float energy)

Posted: 04 Apr 2007, 16:23
by Machiosabre
why not just share coms and get it over with? :|

Posted: 04 Apr 2007, 16:38
by Guessmyname
Because then you start with just the one commander, and players will have to wait to be able to do their thing / fight over the commander at the start

Posted: 04 Apr 2007, 18:27
by Dragon45
Why not just set sharing at 100%??

Posted: 04 Apr 2007, 18:33
by rattle
While this distributes the resources equally it doesn't prevent the other players from using your reserves.

Posted: 04 Apr 2007, 18:51
by Pxtl
rattle wrote:While this distributes the resources equally it doesn't prevent the other players from using your reserves.
If you're worride about selfishness, then forget any kind of sharing - the "share income" problem means that a lazy player will avoid building resource buildings.

I think the current approaches cover it just fine.

Posted: 04 Apr 2007, 20:05
by chlue
Ok to make this request a bit clearer:

- why not just share coms?
This is completely different than share coms, everyone start with his own com (a 5x5 with 5 people sharing one com would sure be useless)

- Why not just set sharing at 100%?? / If you're worride about selfishness, then forget any kind of sharing
The point is to make it easier for one player to concentrate only on economy. This currently does not work well for the reasons I stated in the first post.

So this proposal would make a certain way of teamplaying, difficult with the abilities allready implemented, easier.
Of course such a thing would not be usefull everytime and some players would not like playing with automatic ressource distribution. It has to be either configurable ingame or the simplier approch: Even distribution, toggleable in the lobby. (Like limit d-gun, or 'Disminishing metal makers return')

Can someone with some insight in the source tell me, if my assumption is correct, that this require only to change the unit.cpp and pass one variable to this class. And if their are any potential sideeffects.

Posted: 04 Apr 2007, 20:32
by trepan
You could do it in LuaRules.

Code: Select all

for _,team in ipairs(Spring.GetTeamList()) do
  Spring.SetTeamShareLevel(team, "metal", 0)
  Spring.SetTeamShareLevel(team, "energy", 0)
end

Posted: 04 Apr 2007, 20:48
by rattle
for n=1..num(teams)
gs->Team(n)->AddMetal(metal)/num(teams);
end
No this reduces the metal each player gets.

You need to sum the resources all players of a team have up, then divide it by the amount of players on that team and set each player's resources (not the income) to that value.

Player 1 earns 40 M/s, player 2 earns 11 M/s, player 3 earns nothing and they're on the same team. They all have nothing in their reserve.
(40+11+0) / 3 = 51 / 3 = 17
Each players resources are 17 then, 34 the next second and so forth... this should be floor()ed or round()ed at least (dunno how it is at the moment).

Posted: 04 Apr 2007, 21:16
by manored
I agree with this idea of a new resource sharing system since the current one doesnt allows you to share resources if you have negative income.

Posted: 04 Apr 2007, 21:50
by Guessmyname
trepan wrote:You could do it in LuaRules.

Code: Select all

for _,team in ipairs(Spring.GetTeamList()) do
  Spring.SetTeamShareLevel(team, "metal", 0)
  Spring.SetTeamShareLevel(team, "energy", 0)
end
Everything's bloody possible in LUA...