RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[Old] Harvest System 1.4

Status
Not open for further replies.
yes

your right i cant add [add wheat 2 in game so that might be causing it to crash well is there a way to chaneg the wheat script to onlyhgive one instead of two because it would be better :)
 

David

Moderate
You can try changing[code:1]Wheat crop = new Wheat( pick );[/code:1]to this[code:1]Wheat crop = new Wheat();[/code:1]
That should add one item each sucessful harvest. The yield count will still go down by the pick amount though.
 

DeepFreez

Wanderer
Been toying around with this scropt. Very nice.

There are a few suggstions I would like to make tho.

  • The properties that are available to GMs need a bit fleshing out I think. For seedlings, you only have read access tot he sower. It would be nice to be able to set this, so that a GM could plant seedlings and transfer ownership
  • There is no way to advance the growing time for a seedling or a tree (or crops for that matter) I understand that the reason for this is because you start up a timer when the seedling is planted or deserialized and replace the seedling with a crop plant when the timer expires. This means you cant change the timer afterwards.
    If you change the timing mechanism to something like this, it would behave the same and add the ability to change the timer:
    The timer periodicaly checks a property: GrowTime. If the current time is bigger or equal to this time, the sapling, seedling, crop etc does its growing.
    Now you can give the GMs access to the GrowTime property to allow them to edit it. The price you pay for this is that you have timers that generate events every now and then, instead of only one timer that does the job. If you give your timers a realy low priority and make it only check, say every minute, this impact should be minimal.
  • You could save a lot of code duplication by making a BaseSeed, BaseSeedling and BaseHarvestable that all derive from BaseCrop. Each of these would then implement the all methods that seem to be duplicated for every crop. The differences between WheatCrop and FlaxCrop then become parameters that only need to be set in the constructor. Save you some debugging in the end and make it more extensible. Also the UpRootGump will only need to know about BaseCrop and not every single crop type.
  • It would seem that it is possible to get an infinate harvest from one seed. Perhaps add an absolute maximum amount that can be harvested over time, based on the skill of the planter? As it is now, one will quickly find that the market is flooded with carrots because every one has access to an infinate amount by planting one seed.
  • For the sake of balance, make a requirement for planting or harvesting crops that the farmer has a tool, like a shovel or a pitchfork. Make it so that this tool has a limited number of uses (like other tools) so that the farmer has some running costs aswell :)
  • It would be nice to use the BeginAction and EndAction mechanism on harvesting, to preven people from farming AND practicing something else at the same time. (lots of macro abuse potential otherwise)
  • The fact that you have random chance of planting something with 4 crops close by, means that you can stil plant solid blocks of crops if you have a bit of patience. Not sure if this was your intention, but it makes that check rather redundent.
  • Lastly, it might be nice if you allowed for some one to get some seeds off their crops. Perhaps do a check based on skill when they uproot the crop. If the skill is over 80% they have a 10% chance of getting a seed. up to 100 skill where they have 30% chance of getting a seed. Imortant principle here is to not give more seeds than was planted originaly unless they have VERY high skill. Otherwise you will have the market flooded with seeds again :)
    [/list:u]

    Ok, I'll end my rather longwinded post now :twisted:
 

David

Moderate
Thanks for the input, where were you when I was asking for suggestions in the 1.3 thread? ;)

Some of the points are good and are easy enough, like making Sower not read-only. They may make it into a maintenance release I already see coming. Frankly though, this script has already grown far past what I origionaly intended and I don't see myself restructuring the classes even though that would surely clean up the code. This script has been evolutionary and the code reflects it, but I am happy with the results it gives.

I thought a good bit about a max yield on the crops and in the end didn't add it. If it were to make it in, what would you suggest the count be?

And, a tile has 6 neighbors so planting a solid block of crops will still be a bit tough. The best someone can do is a crosshatch.
 
I am not sure exactly what you are talking about with the wheat, but I would like to share with you all, that I did fix it so on doubleClick of the wheat you get a wheat bundle in which the wheat can be turned into flour.
If you all would like it I'll post it. I was having alot of crashing but I believe i fixed it, havent had a crash in more than 2 months.
 

DeepFreez

Wanderer
David said:
Frankly though, this script has already grown far past what I origionaly intended and I don't see myself restructuring the classes even though that would surely clean up the code.
Fair enoug hehehehe. I know what a pain refactoring can be some times.

David said:
If it were to make it in, what would you suggest the count be?
Thats a tough one because it ties in with game balance issues.
I would think something like 5+(Skill/10) (giving a yield between 5 and 15). To flood the market you will have to farm like mad... which is good.

David said:
And, a tile has 6 neighbors so planting a solid block of crops will still be a bit tough. The best someone can do is a crosshatch.
The densest pattern I can think of would be a swath 3 wide one row open and then another swath of 3.

On a 10x10 square area, this means you get 90% coverage

[code:1]
qqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqq

qqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqq

qqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqq
90%


qqqqqqqqqq
q q q q q
qqqqqqqqqq
q q q q q
qqqqqqqqqq
q q q q q
qqqqqqqqqq
q q q q q
qqqqqqqqqq
q q q q q
75%
[/code:1]

By changing the requirement to 2 neighbors with a 50% chance of allowing 3 neighbors, you allow 70% coverage for double rows or 50% coverage for single rows.
I guess it depends on what you want to achieve.

Here is another little suggestion :twisted:
Why not make the crop ield depend on the number of neighbours. The more neighbours it has, the more the yield. Then the shape of your field becomes important.
 

David

Moderate
I'm thinking move the density check into the timer on the seedling. If the crops are too thick, more and more become weeds instead of healthy crops. Although reducing the yield would work too...
 
Status
Not open for further replies.
Top