Jump to content

Trading


Recommended Posts

As some of you already know, I'm currently working on trading. And I think that it is time to report some progress and discuss what should be changed/added.

This is how it currently looks like:

post-9635-0-91407600-1319195002_thumb.pn

post-9635-0-92355700-1319195787_thumb.pn

(1 - 'treasure' icon above market; 2 - carried goods; 3 - goods selection interface; 4 - garrisoned traders)

When you have trader selected and hover cursor above market, there is 'treasure' icon displayed.

When you right-click on market it set as first trading market without any feedback for user.

When you right-click on another market it set as second trading market and trade starts.

Trader move to first market and then with resources move to second market and then back to first market again...

Resource to generate can be selected in interface (see '3' on screenshot) separately for each trader.

Amount of resources generated (called 'gain' in code) depends on distance between markets (ordinary Euclidean distance, not pathfound one, because it is more reliable and simple):

gain = k * distance2,

where k - coefficient, used to adjust gain value to something adequate from playability point of view.

Squad of distance used to encourage trading between remove markets, rather than simpler and safer trading between near markets.

Trade possible with both your and ally markets. When markets belongs to different players (both to you/ally or to ally/different ally) then 'international trading extras' added to gain, currently it is 50% more gain.

Ground traders can trade with both markets and docks, trading ships - only with docks.

Basically trading ship generate the same amount of resources as ground trader, but for each trader garrisoned inside there is 20% more gain generated (gain = gain * (100 + 20 * <number of garrisoned traders>) / 100, to be more precise).

'International trading extras' and 'garrisoned traders extras' affect each other, i.e.

gain = gain * ((100 + <garrisoned traders extras>) / 100) * ((100 + <international trading extras>) / 100)

rather than

gain = gain * (100 + <garrisoned traders extras> + <international trading extras>) / 100

so if you have markets of different players and 10 traders garrisoned you will get ((100 + 20 * 10) / 100) * ((100 + 50) / 100) = 4.5 (i.e 450% of gain) rather than (100 + 20 * 10 + 50) / 100 = 3.5 (350% of gain).

Some comments about design document:

Note: The quantity it can carry and the type of resource is specified by the entity's Traits.Supply attributes.

Currently traders can carry unlimited amount of resources. If we will set some cap to carried goods, then there will be some maximum distance between markets after which gain will be the same. We can set such cap or can do not set.


<Actions>
<Trade>
<Speed>5</Speed>
<Waypoint>Market</Waypoint>
<Resource>
<Food />
<Wood />
<Stone />
<Ore />
</Resource>
</Trade>
</Actions>

Currently trader component don't have any attributes, so it looks like this:


<Trader/>

I don't see reason to disable some goods (resources) for specified traders. But this can be easily implemented if we need.

The same with waypoint - currently ground trading possible with entities with 'Market' class and water trading with entities with 'SeaMarket' class.

As I wrote above, gain calculated depending on distance rather than on travel time, which is easier.

I want to add some argument equivalent to speed to be able make specific traders more effective. Also when we will have technologies they can be able to change this value.

Trading by Sea

A Merchantman vessel must carry at least one Trader. Without Traders aboard, it will not have the ability to trade. The more Traders it carries, the greater the yield from trade.

I like idea about garrisoned traders and implemented it, but in my current version it seems like trading ship have one 'embedded' trader by default. I think it is better to not complicate both code and playability claiming that trading ship should have at least one trader garrisoned. This make sense in case of some general ships, like in case if we will not have trading ships but rather some general transports/nonmilitary ships, but we have special trading ships, so I prefer to allow trading ship to trade even without traders garrisoned. This is only my personal opinion and can be changed though.

Destroying Trade Units

Raiding undefended international or domestic trade units can be lucrative, since destroying a Trader (on land or water) will transfer any resource points he was carrying into the player's Resource Pool.

Nice idea, but not implemented in my patch yet. I think we can just add carried goods to loot, sound simple, will do it later.

Sending Tribute

This is separate task.

I will attach first version of patch to ticked later today or maybe tomorrow.

Edit: Forgot to wrote: I also want to add some tooltips like "Set as first trading market", "Set as second trading market. Gain: 30 metal.", but I'm not sure where they should be displayed, I don't like to encumber display showing tooltip near cursor, but on the other hand tooltip can looks strange if I will try to display it in some corner - I like how they displayed in AOM in left bottom corner above panel, but this will not work with our centered panel layout.

Link to comment
Share on other sites

I disagree with nothing. I agree that the Trading Ship should be able to trade even without a trader on board. Garrisoning more traders gives a bonus. This is consistent with the direction we've gone with other things too. For instance, towers, warships, etc.

Perhaps a simpler way to set a way point for the land trader is that it assumes the 2nd market (the 2nd way point) is your closest market. This happens in AOK/AOM. Removes a "search for my market and click" step. Perhaps your method would only be needed if trading between two of your own markets, while only one click is necessary when trading with allied markets.

Link to comment
Share on other sites

Perhaps a simpler way to set a way point for the land trader is that it assumes the 2nd market (the 2nd way point) is your closest market. This happens in AOK/AOM. Removes a "search for my market and click" step. Perhaps your method would only be needed if trading between two of your own markets, while only one click is necessary when trading with allied markets.

What if you want to trade between two ally markets? Or this should be impossible?

Also you can want to trade with ally market and your most remote market to generate more profit; or with some not nearest and not remotest market, but rather with market which have safer route to ally market.

Link to comment
Share on other sites

What if you want to trade between two ally markets? Or this should be impossible?

Also you can want to trade with ally market and your most remote market to generate more profit; or with some not nearest and not remotest market, but rather with market which have safer route to ally market.

I am content with trying it whatever way you feel best, then we can tweak the behavior later. :)

Will traders eventually automatically go from one market to another to trade? Or is it going to be manual?
Once you set the end points, then the traders will continue going back and forth automatically.
Link to comment
Share on other sites

A mix of major and minor things (mostly minor, I agree with most of the things you've suggested):

I suggest we use an icon similar to: http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/art/textures/ui/session/portraits/structures/market.png rather than a treasure chest. Not a criticism, just a suggestion for how to move forward :) (So actually more a point directed towards the art people than you Alexander :) Anyone is of course free to agree/disagree though.)

(ordinary Euclidean distance, not pathfound one, because it is more reliable and simple)

Sounds good, the player should not benefit from making the trader walk a long and winding path between the two markets. Though, as I think has been suggested elsewhere, the player should be able to shift-left click before choosing the second market to make a more complex path. This would be to make it possible to direct the trader away from threats and take a safer route. (It's fine to leave this out of the initial implementation, I'm just mentioning this so it's something that's being considered for the final implementation.)

I like idea about garrisoned traders and implemented it, but in my current version it seems like trading ship have one 'embedded' trader by default. I think it is better to not complicate both code and playability claiming that trading ship should have at least one trader garrisoned. This make sense in case of some general ships, like in case if we will not have trading ships but rather some general transports/nonmilitary ships, but we have special trading ships, so I prefer to allow trading ship to trade even without traders garrisoned. This is only my personal opinion and can be changed though.

Agree completely. Though just a general thought, I'm not sure about keeping an unlimited/large number of traders on the ship. Not in itself as much as it would limit the number of free pop slots =) So I guess it's up to the player, it just feels a bit frustrating for you as a player if you need to tie up too much of your population in something where you can't control them to get a benefit out of them. The benefit could be diminishing with each new trader garrisoned though, which should lower that :)

Nice idea, but not implemented in my patch yet. I think we can just add carried goods to loot, sound simple, will do it later.

Sounds good.

To make things simple and convenient for players, when you right click a market, the code should work out the route which would make the most profit (profit per trip/distance). This is what AoE online does and it is quite nice.

Would be nice, at least eventually, but there should definitely be the possibility to set it on your own so you can assure you have safer trade routes in times of war etc. (The best trade route in terms of gain might be through enemy territory and right next to an enemy fortress, in which case you might want to choose another one ;) It could on the other hand be worth it in some cases, especially if you'd have some troops guard the trader.)

Link to comment
Share on other sites

When you have trader selected and hover cursor above market, there is 'treasure' icon displayed.

When you right-click on market it set as first trading market without any feedback for user.

When you right-click on another market it set as second trading market and trade starts.

Trader move to first market and then with resources move to second market and then back to first market again...

What happens when someone selects an unreachable market, on a separate island or across a river?

Another case to consider: how should the unit react when attacked along the route? In AoK they just ignored it and got easily slaughtered, but should they break off the route and attempt to flee until danger has passed? This is not really specific to trade, more of a UnitAI concern.

Resource to generate can be selected in interface (see '3' on screenshot) separately for each trader.

The gain from trading is in the form of a fee for performing the service, right? In other words resources are not generated from nothing. Are we assuming each resource has equal value/weight, so that a route that produces 100 food would also produce 100 metal? I wonder how it would be if the gained resource type was random on each journey. Maybe that would be annoying but I'm tossing it out there anyway :) Or each player could start with only e.g. metal as their choice but technologies could add other resource choices.

How does a player change the route and/or resource type, does the UI reset after making the initial selection? Making this intuitive is probably the hardest part of the trading task.

Trade possible with both your and ally markets. When markets belongs to different players (both to you/ally or to ally/different ally) then 'international trading extras' added to gain, currently it is 50% more gain.

So you can trade between two allies? What I wonder is how do the gained resources get returned to you? With other resources you have to return to a dropsite, but in this case markets appear to be a sort of global banking system.

Also what is the benefit for allies letting you trade between them? What if each part of the trade route benefited from the trade, more for the player who owns the trader but still some "fee" assessed for the allies? I think that's closer to how trade really works. This would encourage economic alliances.

Currently traders can carry unlimited amount of resources. If we will set some cap to carried goods, then there will be some maximum distance between markets after which gain will be the same. We can set such cap or can do not set.

I think there should be a maximum practical limit but we likely need to test how the feature works to determine it.

I don't see reason to disable some goods (resources) for specified traders. But this can be easily implemented if we need.

Hmm, me either unless it's a civ specific limitation.

I want to add some argument equivalent to speed to be able make specific traders more effective. Also when we will have technologies they can be able to change this value.

There's even more technologies that could be added, like maximum distance between waypoints, maximum traded goods per trip, speed, increased HP, possibly a fee introduced for the allies' benefit.

Edit: Forgot to wrote: I also want to add some tooltips like "Set as first trading market", "Set as second trading market. Gain: 30 metal.", but I'm not sure where they should be displayed, I don't like to encumber display showing tooltip near cursor, but on the other hand tooltip can looks strange if I will try to display it in some corner - I like how they displayed in AOM in left bottom corner above panel, but this will not work with our centered panel layout.

We could add a dedicated "status" or tooltip area to the UI, a place the user could easily and frequently check for info (different than the scrolling player messages we have now). A cursor tooltip might not be a bad idea, do we want to show the player the benefit of trading with a given market ("Gain 100 gold from trading with this market")?

Link to comment
Share on other sites

Also what is the benefit for allies letting you trade between them?

In a team game, it would behoove all players on a team to allow trade so that the team as a whole is stronger. I envision no team situation where you would "deny" your ally to trade with you unless you planned to stab them in the back. Either way, I see no need for transaction fees or tariffs. ;)

TBH, I see no reason why it shouldn't all just act exactly like in AOK or AOM, except for the fact that you can choose a resource other than just "gold."

Link to comment
Share on other sites

In a team game, it would behoove all players on a team to allow trade so that the team as a whole is stronger. I envision no team situation where you would "deny" your ally to trade with you unless you planned to stab them in the back. Either way, I see no need for transaction fees or tariffs. ;)

I was thinking more in terms of founding an alliance for trade, but I guess since trade could be two-way that is already a benefit :)

Link to comment
Share on other sites

I was thinking more in terms of founding an alliance for trade, but I guess since trade could be two-way that is already a benefit :)

Exactly. But I'm not totally against perhaps some kind of fee or tariff, I just don't think it's necessary for the whole concept to work. :) Just saying there is a benefit to allowing trade between allies that doesn't need a tariff to realize. :)
Link to comment
Share on other sites

I will attach first version of patch to ticked later today or maybe tomorrow.

Done.

I suggest we use an icon similar to: http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/art/textures/ui/session/portraits/structures/market.png rather than a treasure chest. Not a criticism, just a suggestion for how to move forward :) (So actually more a point directed towards the art people than you Alexander :) Anyone is of course free to agree/disagree though.)

I agree, I did not found corresponding cursor, so just copied "action-gather-treasure.png".

Though, as I think has been suggested elsewhere, the player should be able to shift-left click before choosing the second market to make a more complex path. This would be to make it possible to direct the trader away from threats and take a safer route. (It's fine to leave this out of the initial implementation, I'm just mentioning this so it's something that's being considered for the final implementation.)

This was suggested by Jason and Philip here (+3 next posts). Good idea, because player still will be able to just click on markets if he don't want to bother with route planning, and will be able to adjust route if it is make sense/interesting for him. But this can be not so easy to implement (at least for me), so I don't plan to implement this in current patch and it would be good to create ticket when current patch will be finished/committed (or maybe better to create ticket now and note that it needs #30 to be finished?).

Agree completely. Though just a general thought, I'm not sure about keeping an unlimited/large number of traders on the ship. Not in itself as much as it would limit the number of free pop slots =) So I guess it's up to the player, it just feels a bit frustrating for you as a player if you need to tie up too much of your population in something where you can't control them to get a benefit out of them. The benefit could be diminishing with each new trader garrisoned though, which should lower that :)

It is easy to change a bit related logic, so we can adjust this later while playtesting.

To make things simple and convenient for players, when you right click a market, the code should work out the route which would make the most profit (profit per trip/distance). This is what AoE online does and it is quite nice.

Would be nice, at least eventually, but there should definitely be the possibility to set it on your own so you can assure you have safer trade routes in times of war etc. (The best trade route in terms of gain might be through enemy territory and right next to an enemy fortress, in which case you might want to choose another one ;) It could on the other hand be worth it in some cases, especially if you'd have some troops guard the trader.)

We can even add 'do whatever you want' button to trader and he will select both markets automatically :) But I agree with Erik on this: 'but there should definitely be the possibility to set it on your own' and I personally prefer to have this possibility as 'default'. My plan is to finish current 'manual click on both markets' logic and then we can add another alternative as separate patch or even replace with it my implementation. I don't trying to push my opinion, I try to do that what looks like team decision, so we will look what others will say (now or after playtesting current version). In any case, quantumstate, thanks for throwing this in and raising this discussion.

What happens when someone selects an unreachable market, on a separate island or across a river?

I supposed that MoveToTarget (which is used to try to reach market) should return false in this case and unit should not move anywhere, but it looks like it moves as near as possible to target. I will test it more and fix. I think that if after ordering trade one of markets is not reachable there should be just notification, that trading with selected markets is not possible.

Another case to consider: how should the unit react when attacked along the route? In AoK they just ignored it and got easily slaughtered, but should they break off the route and attempt to flee until danger has passed? This is not really specific to trade, more of a UnitAI concern.

I suppose it should ignore attacks, but again, there is some bugs in my current implementation. I tested this quickly and it looks like it discards current order and move back to previous market. Will check this more carefully.

The gain from trading is in the form of a fee for performing the service, right? In other words resources are not generated from nothing.

I'm not sure that this is the same, but I suppose that 'gain' is profit from trading some virtual (not visible for player) goods. And when you select which resource to 'generate', in gameplay terms you select what to buy or something like this.

Are we assuming each resource has equal value/weight, so that a route that produces 100 food would also produce 100 metal?

Yes, but we can use the same 'true prices' as in my barter patch.

I wonder how it would be if the gained resource type was random on each journey. Maybe that would be annoying but I'm tossing it out there anyway :) Or each player could start with only e.g. metal as their choice but technologies could add other resource choices.

We can add random to resource selection (wood/food/stone/metal/random) and make it default and remove all other resources from start, and then unlock them with technology, because it looks like improvement to be able to select specific resource which is more valuable in particular situation.

How does a player change the route and/or resource type, does the UI reset after making the initial selection? Making this intuitive is probably the hardest part of the trading task.

Selected resource stored in 'Trader' component for each trader, so you can see it each time when you select particular trader. Route/selected markets is not displayed anyhow, it would be nice to use vts's rally points lines when they will be committed and show such line between markets when trader selected and performs trade. To change route you need to click on different markets.

So you can trade between two allies?

Yes.

What I wonder is how do the gained resources get returned to you? With other resources you have to return to a dropsite, but in this case markets appear to be a sort of global banking system.

It is transfered virtually, the same as tribute in 'age of' games. We can disable trading between two allies in case if this don't make sense.

Hmm, me either unless it's a civ specific limitation.

With 'random resource' idea this can make sense now :)

There's even more technologies that could be added, like maximum distance between waypoints, maximum traded goods per trip, speed, increased HP, possibly a fee introduced for the allies' benefit.

We can create some 'simple' tickets for these things when both trading and technologies-stats-editing will be done :)

<...> do we want to show the player the benefit of trading with a given market ("Gain 100 gold from trading with this market")?

This is what I want and I don't see why keep this in secret from player.

Link to comment
Share on other sites

We can add random to resource selection (wood/food/stone/metal/random) and make it default and remove all other resources from start, and then unlock them with technology, because it looks like improvement to be able to select specific resource which is more valuable in particular situation.

I don't like the idea of a random resource selection. Added randomness introduces more luck and I think that luck should be made as small as possible, in multiplayer I don't want chance to put me at a disadvantage. I would suggest limiting it to a specific resource (possibly civ specific) and then allowing others to be unlocked.

Everything else sounds pretty good.

Edit: Just thought I would say that I really like your idea of a foreign trading bonus. Encouraging cooperation is good but I didn't like how in AoE2 you couldn't trade in single player so games became gold limited so long games would turn into spearmen/skirmisher/light cavalry slogs.

Edited by quantumstate
Link to comment
Share on other sites

This was suggested by Jason and Philip here (+3 next posts). Good idea, because player still will be able to just click on markets if he don't want to bother with route planning, and will be able to adjust route if it is make sense/interesting for him. But this can be not so easy to implement (at least for me), so I don't plan to implement this in current patch and it would be good to create ticket when current patch will be finished/committed (or maybe better to create ticket now and note that it needs #30 to be finished?).

Either way should work fine, as long as there is a patch for it once you''re done it shouldn't matter too much if it is created now or later :)

I think that if after ordering trade one of markets is not reachable there should be just notification, that trading with selected markets is not possible.

Probably the best way yeah. Could be something the user can do something about as well (like if they have their gates locked and task the trader to a market outside the walls), so not a good idea to just surprise the user at the moment the trader has went as far as he could :) Not sure what's the best way to do it if the trader suddenly can't reach a market he could before :unsure: Let's say an ally builds a wall and gates and keeps his gates locked because an enemy is attacking (or the market is destroyed by an enemy for that matter). Perhaps just stop the trader from moving and give the user a "Trader cannot reach market!" error message or something. I guess the matter is more whether the trader should automatically try and recheck whether it suddenly is possible to reach the market? If done too often it could use up too much resources, if done too seldom could annoy the player. Not sure how resource heavy it would be to recheck "broken" trade routes every 3 seconds or so though, perhaps not so much.

Are we assuming each resource has equal value/weight, so that a route that produces 100 food would also produce 100 metal?

I'd say in the final game the values should vary. Perhaps not as much as in barter though, after all there you get the resources immediately here you have to wait a while for them.

Link to comment
Share on other sites

This is what I want and I don't see why keep this in secret from player.

Yeah, I'm just wondering how to best display that info :) As an FYI, build restrictions also plan to use a tooltip to describe invalid build locations, so I think this could be shared in the UI.

Not sure what's the best way to do it if the trader suddenly can't reach a market he could before :unsure:

Return to a reachable market if possible and go idle? We could even show some "event" indicator on the minimap if the trade route is interrupted.

Link to comment
Share on other sites

  • 1 month later...
there should definitely be the possibility to set it on your own so you can assure you have safer trade routes in times of war etc. (The best trade route in terms of gain might be through enemy territory and right next to an enemy fortress, in which case you might want to choose another one ;) It could on the other hand be worth it in some cases, especially if you'd have some troops guard the trader.)

Strongly agree. Changing routes should be possible.

Route/selected markets is not displayed anyhow, it would be nice to use vts's rally points lines when they will be committed and show such line between markets when trader selected and performs trade. To change route you need to click on different markets.

Yes!!! In AoK/AoM you often totally forgot where your traders were going. vts' rally point lines would be the ideal solution :).

Link to comment
Share on other sites

what about the way civilization II does it?

The farthest place gives you more trade, the biggest cities give more trade, trading with yourself gives only half as much as with other civilizations? no?

currently I don't have the capability to even play this game on a computer, so I don't know the details, trailers and forums were interesting. I've been following 0 A.D. for a while.

Sorta off-topic question: will there be a game mode with neutrals, ie just random towns here and there, that can also do what aoe3 did with trading posts except you dont follow a predefined path?

Edited by Centurion
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...