Optimum farming methods

Coordinator
Jun 8, 2009 at 4:25 PM

1. standard script based - fake script - with coord list to send scouts / initial guess of troops out

scout report evaluator to pick up remainder

2. bookmark farming

3. hybrid - use a script to help send right amount of troops and create bookmarks.

 

Coordinator
Jun 10, 2009 at 12:26 AM

 

Farming with 700 villages is utterly bonkers - but on these new worlds with big barbs - it does make sense - and this script/external store rationale will make it possible to accomplish. I have over 100 villages on W31 with barbs growing to 3k so this would make my life easier too.
For good reason you are seeing this script as something to be used in later worlds with mature barbs and enough troops/villages to not want to micromanage, but if you track resources then this can be used on more worlds and at different stages.
The way I see it working (from the users perspective)

  1. Scout farms (occasionally scout for new farms)
  2. Run report renamer on scout reports - (adding farms and a send all troops report id to db)
  3. Goto combined overview and run script which returns a page of send-all farming links.
  4. Run 'report archiver script' on overview to update db and archive reports
    (with option to micromanage - if micromanaging, only renamed reports and those with no resources are archived - otherwise all reports are archived)
  5. micromanage: Run report renamer on reports with resources - updating db
  6. micromanage: Archive all renamed reports


Repeat 3-6 whenever you have troops to send farming - do steps 1-2 whenever you take villages in a new area of the map - or if the script in step 3 reports that all farms are empty - or that there are barbs that havent been scouted... as well as the normal farming links, some standard rally point links would be listed and scouts would need to be sent.
If a barb gets nobled the script will take it off the farms list (and report the fact?)
It can be one script - which does different things depending on the screen where it is run.

  • reports overview (archive)
  • report detail (rename)
  • combined overview (create farming list)


I really need to sort myself out a 'link scraper' to populate a bookmarks folder so I can use the open all folder items option.

rams/cats issue :
Why not put a suggestion into the forum for a new linky on reports 'send all farming troops' or similar to send everything but rams and cats.
the other option would be to be a little bright about it and have the script try and figure out which building should be targetted... or just have a little script that you can set to target a particular building, and hit hq on Mondays and barracks on tuesdays etc

Editor
Jun 10, 2009 at 12:46 AM
2009/6/9 Jason Farmer <jason@problemsolver.co.uk>
  1. Farming with 700 villages is utterly bonkers - but on these new worlds with big barbs - it does make sense - and this script/external store rationale will make it possible to accomplish. I have over 100 villages on W31 with barbs growing to 3k so this would make my life easier too.
I agree.  To me the early day barb farming, and then late game barb farming are two completely different things.  Your right farming with 700 villages is a pain in the ass... but there is a flip side.  If I do it (or anyone this size) WELL... it will make my #1 position not only firmer... but I will run away compared to everyone else.

Farming is what got me to #1 (sure I can also play and understand the game mechanics backwards)... and now I am literally finding no motivation to do it the current way (bookmarks) because.

1. It takes an inordinate amount of time to set up bookmarks well (each run goes to different farms).
2. To have multiple runs it means even more work
3. In lots of regions farms are very sparse, and it adds to the complexity when traveling long distances.
4. Most importantly 80% of my offensive troops are often out killing, and 50% of my defensive troops are out supporting... so only about 30% of my villages are able to farm, and most of them have only partial nukes/def to farm with.

For these reasons I would love to farm twice a day only, but right now I find myself only farming well every few days.

As for mature barbs, I do sculpt barbs.  Even those pesky under 2k barbs, can be sculpted over time to 27/28 resources and a 28ish warehouse *evil grin*

 
For good reason you are seeing this script as something to be used in later worlds with mature barbs and enough troops/villages to not want to micromanage, but if you track resources then this can be used on more worlds and at different stages.
The way I see it working (from the users perspective)
  1. Scout farms (occasionally scout for new farms)
  2. Run report renamer on scout reports - (adding farms and a send all troops report id to db)
  3. Goto combined overview and run script which returns a page of send-all farming links.
  4. Run 'report archiver script' on overview to update db and archive reports
    (with option to micromanage - if micromanaging, only renamed reports and those with no resources are archived - otherwise all reports are archived)
  5. micromanage: Run report renamer on reports with resources - updating db
  6. micromanage: Archive all renamed reports
Looks bang on here. 

In step 1 I would probably scout 5 farms for each village... the database would have to have the ability to track multiple farms from one village, as they dry up, move to the next.

Point 2. Exactly.

Point 3. I had always thought of it as two steps, but it could quite easily be one.  My mind had the script running and updating the database, then the user simply opening a definded webpage (offsite) which opens farms links to villages with troops available and to farms with resources.

Point 4 - Yep yep

Point 5 and 6 - happy

 
Repeat 3-6 whenever you have troops to send farming - do steps 1-2 whenever you take villages in a new area of the map - or if the script in step 3 reports that all farms are empty - or that there are barbs that havent been scouted... as well as the normal farming links, some standard rally point links would be listed and scouts would need to be sent.

Agree completely

 
If a barb gets nobled the script will take it off the farms list (and report the fact?)

Ahhh hadnt thought of this, but yes a good idea.

 
I really need to sort myself out a 'link scraper' to populate a bookmarks folder so I can use the open all folder items option.

There are ways around this Ithink.  Opera has a open all links on a page option... so you would only have to open the page, then run that funciton.  Firefox I am sure has a similar addon (I would have to find it).  IE (who uses it) I dont know and dont really care.


 
rams/cats issue :
Why not put a suggestion into the forum for a new linky on reports 'send all farming troops' or similar  to send everything but rams and cats.

I am sure this has been done... they devs cant make it TOO easy for us *evil grin*.  Where do you draw the line.  Just rams/cats, or rams/cats and nobles, what about scouts?  If they did it it would be GREAT but I doubt the dev will.


the other option would be to be a little bright about it and have the script try and figure out which building should be targetted... or just have a little script that you can set to target a particular building, and hit hq on Mondays and barracks on tuesdays etc

Ahhh also a clever idea.  The exact reason I have 20 cats in every village.  Sure it takes 30 runs to knock down a level 30 HQ, but you get there.  If it can be made to change the knockdown side of cats... well... that would be just plain awesome.

 
More work to do...


Zain

Coordinator
Jun 10, 2009 at 2:59 AM

from a user perspective....

  1. Scout farms (occasionally scout for new farms) 
  2. Run report renamer on scout reports - (adding farms and a send all troops report id to db)
  3. Goto combined overview and run script which returns a page of send-all farming links.
  4. Run 'report archiver script' on overview to update db and archive reports
    (with option to micromanage - if micromanaging, only renamed reports and those with no resources are archived - otherwise all reports are archived)
  5. micromanage: Run report renamer on reports with resources - updating db
  6. micromanage: Archive all renamed reports

from a technical perspective....

 

  1. Scout Farms - this will be a function of the main farmng script - identifying and creating rally point links targetting possible farms - ie. run from combined overview.

  2. Report renamer -  I've got something that'll analyse reports and create enough info for farming purposes (the first part of the scout reprt evaluator)
    It will analyse the report and create a link to a script similar to this one : 

    {server}/farming/report.php?password=public&report=12345566|1033006|1244436120000|29347|29347|29346|60805|969|969|2063|729|713|7

    The values returned in the report value are {village id}|{report id}|{timestamp}|{wood}|{clay}|{iron}|{max resources}|{wood production/hour}|{clay production}|{iron production}|{X}|{Y} - the password will be a url encoded value unique to the user (group of users) - and will reference a seperate store of farms...

    it will be in created in either an <img src="" > or in a <script src=""> - so will need to return one or the other...
    In my W31 farming I currently use the img one and return a red or green dot  - denoting success or failure - the javascript approach is however lighter on bandwidth and more flexible.

    The PHP script will take these values and either update the existing record or add a new one
    The php script will also have access to the users IP address/ referer page/ user agent / date of submission etc which could also be added to the record for tracking purposes.

    Their will be a fnStatus(strMessage) function defined to add text to the bottom of the screen - so the javascript returned could be as simple as fnStatus("farm updated"); (added, error message, whatever).

  3. Goto combined overview and run script which returns a page of send-all farming links.
    The script will analyze the page and return a list of farms and their troops - creating and executing a script link :

    {server}/farming/overview.php?password=public&count=2&combined=1234567-123-456-0-0-12000-20-2100-0-0-123-123_1234568-0-0-12000-20-2100-0-0-123-123

    create a lock file for this password - if its already there then exit with a warning... echo this fnStatus("farm data locked");

    split the combined value on underscores to get data for each village
    split the village data on hyphens to get 

     village id,x,y,spear,sword,etc etc

    populate a combined array with these villages

    the troop numbers would need to be matched to their troop types using {world url}\interface.php?func=get_units which returns an xml document detailing unit types, speed and carry capacity

    check the date time the world village data was last downloaded and either apply interface.php?func=get_conquers&since={unix timestamp}  (won't find new abandoneds) to it or download it again.
    ,
    run the farm finder code and get all barbs over certain points within a specified radus of any of the players villages.

    get a list of all the barbs that are not in the farm store (the unfarmed)

    remove from the farm store any farms that have been nobled
    - report the new owner etc echo the following script

    fnFarmDeath({id},{x},{y},{name},{owner},{tag});


    a best cost analysis would then be performed between the farming villages and the farms
     step 1 for each village/farm combo calculate distance and resources (using slowest troop speed and bonus type from world data) and carry capacity
        use these to calculate a cost value
        eg. cost = duration (minutes) * factor + over collection amount (1000's)  - the factor can be adjusted to weight speed over accuracy
    The cost calculation could also be weighted in favour of villages with few troops ensuring they get short runs.
    then run a best cost analysis to find the best way to farm. N.B. taking closest farm first for each village may not be the best. imagine a tight cluster of villages surrounded by a cloud of farms - the best method of farming would probably be to try and equalize the durations - ie. the villages in the center of the cluster would farm the nearest farms, and the villages on the edge of the cluster would travel a similar distance farming the farms further out in the cloud. The best cost analysis will try to reduce the total overall cost. if we are calculating cost on time travelled and  unused collection capacity then these will be reduced as much as possible.

    depending on how well (quickly) this runs it may have to simply take this first analysis and apply it to all farms 
    a better solution would be to remove the best result and process it - then recalculate from step 1 - this would be especially valid where a lot of the farms had more resources than could be collected by one village.

    process each result

    create a farming link (echo the following script)
    fnFarm({village id o},{xo},{yo},{report id},{village id d}{xd},{yd},{distance},{duration mins}.{expected haul},{overhaul %},wall);
    this will add a row to an html table - the last entry being an attack with all troops link

    update the farm store - with reduced resources and a new (estimated) timestamp
    remove the attacking village from the combined array

    (if reiterating. remove the village from the array, and recalculate the cost values for the farm (remove it if cleared)


    if there are any unfarmed then find the closest village to each with scouts and create a rally point link ... echo the following script
    fnScout({village id o},{xo},{yo},{village id d}{xd},{yd},{distance},{duration mins});

  4. Run 'report archiver script' on overview to update db and archive reports

    {to be continuued}