← Back to team overview

widelands-dev team mailing list archive

Re: Fwd: can find any more resources

 

On 25.07.2014, at 00:04, Tibor Bamhor <tiborb95@xxxxxxxxx> wrote:

> well, after some investigation in code it seems that mine is able to mine some % of resources within some radius. Obviously it does not mine resources evenly across fields, so to check one (even central) field is not enough.

You could randomize the field that resources are taken from, so that this happens evenly. 

> 
> Also it seems that there is no avaiable function to query if mineable resources are mined or not yet. Of course, the mine sends a message ("cant find any more resources") but I am not sure if AI can easily read them. It would help much…

So there must be a method in the mine that does it already. You can pull it out and make it available for the AI to use. Something like void percentage_of_coal_available(field, radius, coal_resource_index, & total_pieces_of_coal_at_start, &total_pieces_of_coal_now);

> 
> 
> 
> ---------- Forwarded message ----------
> From: Tibor Bamhor <tiborb95@xxxxxxxxx>
> Date: 2014-07-24 23:05 GMT+02:00
> Subject: can find any more resources
> To: widelands-dev@xxxxxxxxxxxxxxxxxxx
> 
> 
> Hi,
> 
> Please explain to me:
> 
> I am watching a game (testing AI), there is a mine that shows "can't find any more resources", performance % is 0, it is full of food, yet when I click on it and click DBG it shows coal: 19/20.
> This is coal mine (the first/lowest level of mine).
> 
> Now for AI it is quite relevant question - AI test remaining resource on the field and if 0, the mine is to be dismounted. But if mine is not able to mine all resources on a field, then things are getting more complicated.
> 
> Now I noticed that mines have aihint like mines_percent=30. Does it mean that this mine can mine only 30% of initial amount 20? 30% of 20 is 6 so the mine should stuck on remaining resources 14/20, or not?
> 
> Waiting for explanation, thanks! 
> 
> Tibor
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~widelands-dev
> Post to     : widelands-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~widelands-dev
> More help   : https://help.launchpad.net/ListHelp

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Follow ups

References