Sign in to follow this  
Followers 0
gudo

Renewable Resources

50 posts in this topic

i think the only resource that should be readily renewable should be forage patches: berry bushes and such

Share this post


Link to post
Share on other sites

Real Time Stratagy games are about working with what resources are available, renewable resources would alow players to sit around and would limit action and the need for players to stratagise about how to improve their current situation.

Share this post


Link to post
Share on other sites

Real Time Stratagy games are about working with what resources are available, renewable resources would alow players to sit around and would limit action and the need for players to stratagise about how to improve their current situation.

no i dont agree with this. and in the end if you dont like the idea play faster .no one forces you to play slowly

Share this post


Link to post
Share on other sites

i think that renewable resources are useless, since alpha 8 has introduced a bartering system

Share this post


Link to post
Share on other sites

One of the main aspects of the game will be to compete over dwindling resources. Markets and Traders circumvent this, but can also be raided and attacked, adding another interesting tactical and strategic aspect. Trees and Metal Mines popping up randomly? Notsogood.

Share this post


Link to post
Share on other sites

Have you considered units planting trees ? With a food cost and a long wait before reward.

Share this post


Link to post
Share on other sites

We definitely need some infinite mines and trees in campaigns or some special scenarios. But I'm not in favor of implementing them in normal games. We have some ways (Although a little hard) to continue the game even after all of the resources on the map are depleted (Bartering/Trading).

Share this post


Link to post
Share on other sites

Yeah, I could definitely see some "Infinite" mines being added to the scenario editor for specific custom situations.

As far as regular games go, the only thing I'd want to see be "infinite" are Farms* and animals garrisoned in the Corral.

Specifically farms:

Do not limit the number of gatherers, but include a "diminishing returns" aspect to where anything over 3 gatherers on a farm would be less efficient than just planting another farm.

*My opinion has evolved over the months to see the utility in infinite farms.

Share this post


Link to post
Share on other sites

If you folks don't mind, I would like to give my input on this semi-old topic.:)

As much as I would like to deprive the enemy A,I from even harvesting renewable resources, it certainly would make the game a bit too long even for me (5 days playing same match thanks to save). :P The thing I think that should be implemented is resource stealing though.

Basically, if I destroyed an enemy building I should get at least half the resources that were used to build it.

It annoys me sometimes to spend resources on heavy units, only to find out it was an abandoned enemy base (*facepalm* if they started a heavy assault on your base while you were away).

I think there should be some kind of benefit for this type of situation described above.

Summary: It encourages players to take better care of their spent resources, and to attack more often as well. In other words, a balance of defense and offense.

Edited by Tutle

Share this post


Link to post
Share on other sites

If you folks don't mind, I would like to give my input on this semi-old topic.:)

As much as I would like to deprive the enemy A,I from even harvesting renewable resources, it certainly would make the game a bit too long even for me (5 days playing same match thanks to save). :P The thing I think that should be implemented is resource stealing though.

Basically, if I destroyed an enemy building I should get at least half the resources that were used to build it.

It annoys me sometimes to spend resources on heavy units, only to find out it was an abandoned enemy base (*facepalm* if they started a heavy assault on your base while you were away).

I think there should be some kind of benefit for this type of situation described above.

Summary: It encourages players to take better care of their resources, and to attack more often as well. In other words, a balance of defense and offense.

We have a working "Loot" attribute for this already. :D We just need a way of displaying this to the player when they get the loot. Right now it's difficult to notice.

Share this post


Link to post
Share on other sites

We have a working "Loot" attribute for this already. :D We just need a way of displaying this to the player when they get the loot. Right now it's difficult to notice.

It's not technically resource stealing though as the resources doesn't get removed from the enemy. At least not in the direct sense, they did after all spend resources when training the units/constructing the buildings :)

Share this post


Link to post
Share on other sites

It's not technically resource stealing though as the resources doesn't get removed from the enemy. At least not in the direct sense, they did after all spend resources when training the units/constructing the buildings :)

It sounds like he just means you get some of the resources used to create the unit. We already have this in the <Loot> element, it's just not obvious when it happens in-game. He's not talking about resources the unit is carrying, although that would be a good feature too. :)

Share this post


Link to post
Share on other sites

I don't really like infinite resources. In aoe3 you have those games where the enemy makes 4 walls, creates 2 forts and relies on his wood income (the only non-infinite resource through his 2 shipped factorys). Those games are definetly not my cup of tea and can take up to over 3 hours. he simply creates a lot of cannons and puts some ranged units behind his walls only to see your units beeing crushed on his defence.

He has no reason whatsoever to attack you and keeps working on his economy.

There should be a reason to expand and to come out your own little base. These games are much more interesting as one has to balance military and economy.

Share this post


Link to post
Share on other sites

Here is just my 2 cents on this - I am all for renewable resources in a limited extent.

I have played allot of Rise of Nations and Age of Empires back in my day. I always felt that these games could be improved upon.

So here I go -

Forests can grow back with given time using a custom brush volume.

Within that brush volume any tree objects can "re spawn" after a certain amount of time.

However just trees that are being harvested cannot re spawn untill they are completely harvested.

This would be great for large forest areas that have been deforested and watching them grow back slowly.

Share this post


Link to post
Share on other sites

I don't think anything I read hits the point.

If you really feel like needing regrowing resources, it could (AFAIK there is no possibility yet but it's really REALLY needed to make awesome scenarios) be implemented map by map (or in future libraries) by enabling triggers and functions during game time.

I really think if that would be possible, users will start to build maps with regrowing resources (I surely would)!

So... implement "easy" to use (as the random map generator scripts) "script during game time" functionality.

I don't think that 0ad will ever have (or need) the huge implementation of in-game triggers in the map editor like in Warcraft III and a full support of adding scripts in JASS (similar to 0ad random map generator functionality)

But... EXACTLY THIS led to a huge community, a vast variety of maps feeling like totally different games and a long lasting popularity!

And I don't think anyone inside Wildfire Games or the community around 0ad would say that is a bad thing ;)

In-game triggers are important!

Can't say it to often and in to many different font-types :D

Edited by FeXoR

Share this post


Link to post
Share on other sites

No death animation for children in 0 A.D. They shall be immortal. Or just magically disappear at 0 HP. :P

(And I, for one, really would rather not integrate them into gameplay)

Or do like Braveheart, when horses were killed the ran off the field, rather than fall in a heap.

Share this post


Link to post
Share on other sites

Well perhaps there could be a 50% chance of the horse getting killed or not. If it is not, then you may eventually find it and herd it into your corral.

Share this post


Link to post
Share on other sites

Lions should team up to rip people apart, alive. Ripping off each limb. Blood should be everywhere. One civilization should castrate (or worse) every captured enemy and them have them serve in the temples, this should be graphically depicted onscreen as the battle occurs, rivers should turn red, so on and so forth.

There should be temples that sacrifice 1000s every day..

Share this post


Link to post
Share on other sites

Lions should team up to rip people apart, alive. Ripping off each limb. Blood should be everywhere. One civilization should castrate (or worse) every captured enemy and them have them serve in the temples, this should be graphically depicted onscreen as the battle occurs, rivers should turn red, so on and so forth.

There should be temples that sacrifice 1000s every day..

I like the cut of your jib.

Share this post


Link to post
Share on other sites

I have been studying realistic tree growth patterns for implementation in a different game, and it is possible to have a single kernel which runs over the whole of the domain to generate realistic forests. You don't need different methods for different tree types, and with a bin-lattice optimisation I have managed to get an algorithm that runs in O(n) time in MATLAB. It exhibits competition, regrowth dependant on the locations and types of the trees remaining, and the tree age and location distributions of mature forests.

In your case, the algorithm would need to do the following for each 'tick':

  • Each tree would grow a seed over a period of about 1 minute. I use a test on the tree's parametric size to determine if it is old enough to release seeds, and this seems to work fairly well.
  • The trees with ripe seeds would scatter them to locations within a parameterised distance (by picking a random point in R-theta space in my implementation, then doing a coordinate transform that includes an offset from the current tree to avoid it being placed too close. The exact reason for this will become apparent later).
  • There are two cases to consider once the seed's location is known:
  1. The seed lands some place it cant germinate, ie sand, rock, water, very high terrain, a building, a road, fields that are being tended, etc. In this case it is simply forgotten about, the tree starts growing a new seed and the next 'ripe' tree is considered.
  2. The seed lands some place it can germinate. This is more complex, as you need to determine if that location is currently being 'smothered' by an existing tree (I will call the area around a tree within which seeds cannot germinate the 'exclusion radius'). This is done by comparing the distance to each nearby tree (this is where the bin-lattice optimisation helps) with some function of that tree's parametric size. If they are too close, the seed cannot germinate and will be ignored. If the seed can germinate, it will become a sapling and will begin to grow. I have avoided the test for the exclusion radii at this stage by always placing a sapling at this stage, and checking all the exclusion radii in a single place once per tick.

  • Every tree grows some amount each tick, I suspect it will be simplest to just store the age of a tree and then map that to the 3d model and exclusion radius. It is best if this is clipped to a reasonable value to avoid having extremely large trees with nothing around them (asymptotic growth might be worth investigating here). The amount of growth could depend on the trees nearby: those of the same species will help growth but those of other species will hider it, enforcing stands of similar trees instead of randomly interspersed tree species.
  • At some point the exclusion radii of two trees will overlap due to their growth. There are many ways to deal with this, I have tried two: the growth rate can be reduced for each tree depending on their relative sizes, and the first to have its location be within the exclusion zone of another will die at that time; the smaller tree dies immediately and there is no reduction in growth rate. The simplest is immediately killing the smaller tree, and it seems to work very well at thinning out all the saplings that develop in holes in the canopy, just like a real forest. This is where the bin-lattice optimisation helps.
  • At each tick, there is a non-zero probability that any given tree will die. This is small and simulates random lightning strikes and death from old age. It also has the effect of changing how the forest looks by producing holes which new trees can grow into, producing clearings which then develop into dense growth and finally mature and fill in the canopy.

It may be possible to optimise out much of the exclusion radius testing by enforcing constant growth rates, computing a time of intersection and dealing with each case when it occurs. This would bring the costs down to around constant time for the exclusion tests for each tree, but would not allow any dynamically changing growth rates due to factors such as interaction with other trees, animals eating the foliage or a lack of water.

This method has the added benefit of allowing you to replant a previously cleared area by collecting saplings and transplanting them before they grow too big, all it would require is some method of moving a sapling. It can also be hooked into a shallow water simulation to stop trees growing in a marsh or in a dry dust bowl, but I have not yet got my lax-wendroff shallow water simulation to work with very shallow fluids and dry areas.

There have been some concerns in this thread about renewable resources producing masses of usable materials for a player. With this algorithm the amount of wood that would grow could be rather small, and depends entirely on the parameters chosen to model the growth of the forests. It would mainly effect late game economics and areas with very limited land, such as small islands. The impact it has on islands is that you get a very slow trickle of resources from the territory throughout the game, instead of getting absolutely nothing.

Moving on from trees: I would like to see renewable fish stocks; grass that actually grows (so a farm wouldn't be a 'building' but would instead be an area of land that is tended to by a villager to enhance the amount of food that can be harvested) and interacts with the trees; herbivores that feed on the grass, seeds and some saplings to allow the environment to reach a dynamic equilibrium between forests, grasslands and fauna; animals that show flocking behaviour and realistic life cycles; a realistic water simulation with dynamically formed rivers, streams, marshes, wetlands and deserts. I want to be able to watch a wild bear go into a river and snatch one of the salmon out of a passing shoal, then eat it. I also want to be able to attack an island by building a causeway and then getting some siege equipment to roll up to the walls and open them up.

Share this post


Link to post
Share on other sites

Thanks for the detailed post. It sounds like a good system for tree growth should we want one. One little point is that when you say O(n) it is key to know what n is, in this case I assume it is the number of trees.

I think it is still unlikely to be put into 0 A.D. however for the following reasons.

The primary reason is that 0 A.D. is primarily an RTS warfare game. When you play a game the objective is to destroy your opponent, which is done by building a large army killing their soldiers and razing their base. Everything else is a means to that goal, so we have resources in order to provide more depth to the strategy. Now players can concentrate different amounts of their focus to different things, I personally concentrate on gathering resources so I can train more soldiers to overwhelm the enemy. Other players like to spend more time managing their troops, so fewer of their soldiers die in fight etc.

So for regrowing forests we need to ask the question; how do they make the game more interesting to play. Infinite resources certainly add something since it allows for players to play defensively, building a strong base which means any enemy must attack while under arrow fire, putting them at a disadvantage. We already have infinite resources in the game, namely farms and trade routes. In order to keep the game balanced though there must be disadvantages to these infinite resources. We do this by making trade routes more profitable if they are longer so having a small defensive base means trade income is slow, and by making farm gather rates slower.

Regrowing forests must therefore be slow, as you say, to keep the game balanced. This means if you wish to use them you must control a large amount of forested land. But if you control a large amount of forested land there are a lot of trees to cut down so in a typical game you probably won't run out anyway. So I would claim that regrowing forests don't actually change very much about strategy for a normal length game. They do have some effects of course but the effects need to be significant enough to outweigh the costs of having them in the game which I will discuss next.

Regrowing forests add complexity to the game. There is bound to be some kind of performance cost, I have no idea how big this is likely to be though, so lets assume it is minor. There is additional code which has associated bugs and maintenance as well as requiring more art assets for saplings.

The UnitAI, which controls unit behavior, is one of the most tricky bits of the game to get right, a good chunk of bugs are due to this and a lot of feature end up changing the UnitAI code. We want units to act intelligently but they must obey the player, this gives priority balancing issues. Having forests regrowing adds complexity to this. Since trees only regrow next to other trees to keep a good supply of wood units need to selectively harvest trees rather than just gather the closest. However this may not always be what the player wants. Early in the game I want wood fast or my enemy can kill me before I even get to the late game stage where regrowth is significant, so it would be better not t selectively harvest. Or I want more space to build and the pesky trees are in the way and I want them removed. Adding more controls to allow for this makes the players life harder which isn't a good thing in general. As an example Globulation built an entire gameplay mechanic around regrowing resources, 0 A.D. isn't trying to do that. Allowing for sapling transport makes this even more complex.

You also make life harder for the AI developers who have yet another thing to teach the AI. The spread of forest will need to be limited so bases don't become wooded and paths don't become obscured, this could be done fairly simply by never allowing a forest to grow beyond the boundaries at the start of the game.

Infinite fish stocks sound reasonable to me, they give a reason to control the sea later in the game on non island maps while not adding much complexity. You other suggestions are basically eye candy so are low priority and must not hurt performance very much. If someone came up with a really nice fast implementation it might be included.

Causeways interest me more, being able to bridge a river sounds pretty fun. Maybe a deployable pontoon bridge could be trained from the dock as well. This is going slightly off topic though, maybe start a new thread.

Share this post


Link to post
Share on other sites

Thanks for the detailed post. It sounds like a good system for tree growth should we want one. One little point is that when you say O(n) it is key to know what n is, in this case I assume it is the number of trees.

Yes, n is the number of trees on the entire map.

I think it is still unlikely to be put into 0 A.D. however for the following reasons.

The primary reason is that 0 A.D. is primarily an RTS warfare game. When you play a game the objective is to destroy your opponent, which is done by building a large army killing their soldiers and razing their base. Everything else is a means to that goal, so we have resources in order to provide more depth to the strategy. Now players can concentrate different amounts of their focus to different things, I personally concentrate on gathering resources so I can train more soldiers to overwhelm the enemy. Other players like to spend more time managing their troops, so fewer of their soldiers die in fight etc.

So for regrowing forests we need to ask the question; how do they make the game more interesting to play. Infinite resources certainly add something since it allows for players to play defensively, building a strong base which means any enemy must attack while under arrow fire, putting them at a disadvantage. We already have infinite resources in the game, namely farms and trade routes. In order to keep the game balanced though there must be disadvantages to these infinite resources. We do this by making trade routes more profitable if they are longer so having a small defensive base means trade income is slow, and by making farm gather rates slower.

Regrowing forests must therefore be slow, as you say, to keep the game balanced. This means if you wish to use them you must control a large amount of forested land. But if you control a large amount of forested land there are a lot of trees to cut down so in a typical game you probably won't run out anyway. So I would claim that regrowing forests don't actually change very much about strategy for a normal length game. They do have some effects of course but the effects need to be significant enough to outweigh the costs of having them in the game which I will discuss next.

I wouldn't expect it to change much about the strategies used, either. It's benefits are limited to a small number of scenarios during the game, but I see a possible benefit in that a map designer (or a random map script) could set various parameters (rainfall intensity, the heightmap, type of ground, etc) which change over the map and mark which regions of the map are seeded with which kinds of trees, then this algorithm would use those parameters to automatically generate an old growth forest that looks more interesting than a forest generated by randomly placing trees or by 'painting' each tile by hand. The key part of this is that the forest would automatically stop advancing over the map once it reaches terrain which it cannot grow on, allowing you to quickly set deciduous trees to be seeded over the entire map and then producing a forest which follows rivers and streams but doesn't grow in the middle of a desert and which has a very complex appearance and non-linear boundaries.

Regrowing forests add complexity to the game. There is bound to be some kind of performance cost, I have no idea how big this is likely to be though, so lets assume it is minor. There is additional code which has associated bugs and maintenance as well as requiring more art assets for saplings.

The UnitAI, which controls unit behavior, is one of the most tricky bits of the game to get right, a good chunk of bugs are due to this and a lot of feature end up changing the UnitAI code. We want units to act intelligently but they must obey the player, this gives priority balancing issues. Having forests regrowing adds complexity to this. Since trees only regrow next to other trees to keep a good supply of wood units need to selectively harvest trees rather than just gather the closest. However this may not always be what the player wants. Early in the game I want wood fast or my enemy can kill me before I even get to the late game stage where regrowth is significant, so it would be better not t selectively harvest. Or I want more space to build and the pesky trees are in the way and I want them removed. Adding more controls to allow for this makes the players life harder which isn't a good thing in general. As an example Globulation built an entire gameplay mechanic around regrowing resources, 0 A.D. isn't trying to do that. Allowing for sapling transport makes this even more complex.

Personally, I would like to see a default behaviour that maximises immediate gather rates (which is pretty much what the game does now), but allow that to be selectively changed to be more sustainable after researching some kind of technology that would unlock that option. I could see the more sustainable method being applied only near a few lumber camps (possibly allow areas to be chosen by painting sustainable forestry indicators from a lumber camp based interface?), to ensure that the land you control is being used productively after being clear cut instead of being left devoid of life. This would give players the option, but not require a decision to be explicitly selected to begin playing.

You also make life harder for the AI developers who have yet another thing to teach the AI. The spread of forest will need to be limited so bases don't become wooded and paths don't become obscured, this could be done fairly simply by never allowing a forest to grow beyond the boundaries at the start of the game.

I would like to see buildings 'repel' trees by having the building produce an exclusion radius around it that is based on the cut off value of a sum of potential fields generated by each nearby building. This would allow units to walk around the buildings quite easily and would simulate the forest being cut back regularly. Roads and paths would be terrain types with the same effect.

Infinite fish stocks sound reasonable to me, they give a reason to control the sea later in the game on non island maps while not adding much complexity. You other suggestions are basically eye candy so are low priority and must not hurt performance very much. If someone came up with a really nice fast implementation it might be included.

Causeways interest me more, being able to bridge a river sounds pretty fun. Maybe a deployable pontoon bridge could be trained from the dock as well. This is going slightly off topic though, maybe start a new thread.

I could see fish being modelled as small shoals of 10 to 20 fish that must eat plankton to survive and will grow to a maximum size if they eat enough of it, at which point they would split into separate shoals and go their own way. Each shoal would flock (under a small wandering behavioural influence to avoid them going in straight lines) with nearby shoals to produce much larger groups representing shoals of hundreds of fish with only tens of objects. The plankton they eat should be generated by deep enough waters and stored as an array of densities, the gradient of plankton densities would feed into the fish flocking behaviour to drive them to locate better feeding grounds. Fish stocks need considerable time to recover IRL, so the same should be expected in the game. Whales would essentially be finite resources.

This page: http://www.red3d.com/cwr/steer/gdc99/ explains the steering behaviours quite nicely, but I am sure you already know about it. Fishing would be done either by sitting in one place and causing the plankton gradient to guide nearby fish towards you, or could be done with a seek behaviour that has boats chasing down and catching fish with large nets in another instance where the behaviour could be changed to allow more sustainable use of resources later in the game.

Share this post


Link to post
Share on other sites

I like it though I don't think it should be the default. Perhaps you could write a random map supporting that system or, if working well, add a new random map library. So some maps can use it and others may not.

I don't think that the majority of players will accept maps running slower for good 'world simulation' but if it runs smooth...

Edited by FeXoR

Share this post


Link to post
Share on other sites

exactly; it would be like making models so detailed that you can see individual soldiers blink. thats great for games like Call of Duty or Grand Theft Auto, but not for RTSs; even with its super-detailed cinematic models, AOM didn't have such detail as lip movement for when the characters talk

Edited by oshron

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0