shared income (like for example in Company of Heroes)

shared income (like for example in Company of Heroes)

Requests for features in the spring code.

Moderator: Moderators

Post Reply
chlue
Posts: 101
Joined: 28 Dec 2005, 20:48

shared income (like for example in Company of Heroes)

Post 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)
User avatar
Machiosabre
Posts: 1474
Joined: 25 Dec 2005, 22:56

Post by Machiosabre »

why not just share coms and get it over with? :|
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post 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
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Why not just set sharing at 100%??
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

While this distributes the resources equally it doesn't prevent the other players from using your reserves.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Post 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.
chlue
Posts: 101
Joined: 28 Dec 2005, 20:48

Post 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.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post 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
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post 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).
manored
Posts: 3179
Joined: 15 Nov 2006, 00:37

Post 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.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post 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...
Post Reply

Return to “Feature Requests”