Mining tweak

A place to post suggestions for new features, new bugs, and comments about the existing code.
Spunkmeyer
Posts: 2013
Joined: Fri Jun 27, 2003 7:00 am
Location: Contact me regarding: CC, Slayer and AllegWiki.

Post by Spunkmeyer »

Evan wrote:QUOTE (Evan @ Feb 23 2012, 04:59 PM) I wish there were a way to designate non-automatic mining though, to allow comms to mine strategically without the miner being dumb and going back once a sector he was remote mining being occupied by a new enemy base.
I need to test more but I think the problem was, if the miner was full it was going back to the same damn rock.

Right now what I'm doing is having the miner forget the specific rock, but remember the sector. So it picks the best rock in the sector. The question now is, will it still pick a rock there if the sector is occupied by the enemy (base)? I don't think so - if it doesn't then the issue is fixed. If it does, I can have it check first.


Want bigger games? Log on to play at the official game time: 9pmET/8pmCT/7pmMT/6pmPT every day of the week. Also Saturdays 8pm UTC.

Evan
Posts: 67
Joined: Wed Jul 02, 2003 7:00 am
Location: Boston

Post by Evan »

Spunkmeyer wrote:QUOTE (Spunkmeyer @ Feb 23 2012, 06:20 PM) I need to test more but I think the problem was, if the miner was full it was going back to the same damn rock.

Right now what I'm doing is having the miner forget the specific rock, but remember the sector. So it picks the best rock in the sector. The question now is, will it still pick a rock there if the sector is occupied by the enemy (base)? I don't think so - if it doesn't then the issue is fixed. If it does, I can have it check first.
If a miner heads to a sector it just mined (lets say aleph is 3k away) and in that timeframe an enemy base builds and is spotted, it keeps going to that sector to mine.
"I remember Evan more for his almost-british levels of abuse" - Agricola
BillyBishop
Posts: 476
Joined: Thu Sep 02, 2010 7:52 pm
Location: Calgary Montreal Vancouver (depending heh)

Post by BillyBishop »

Spunkmeyer wrote:QUOTE (Spunkmeyer @ Feb 20 2012, 02:25 PM) Turkey: http://trac.alleg.net/ticket/267
Can you elaborate, if I rip a miner to garr SECTOR it may still abort rip, but if I rip miner to a specific base (regardless of traveling from tele to that base), miner wont abort rip ?
Last edited by BillyBishop on Fri Feb 24, 2012 1:06 am, edited 1 time in total.
Spunkmeyer
Posts: 2013
Joined: Fri Jun 27, 2003 7:00 am
Location: Contact me regarding: CC, Slayer and AllegWiki.

Post by Spunkmeyer »

RoyBrown wrote:QUOTE (RoyBrown @ Feb 23 2012, 07:04 PM) Can you elaborate, if I rip a miner to garr SECTOR it may still abort rip, but if I rip miner to a specific base (regardless of traveling from tele to that base), miner wont abort rip ?
That would be the case if miners/drones aborted ripping in R6, but they do not =)

But yes, that's the basic idea. If you sent the miner to a base, which includes teles or refs, it will never run. If you sent it to a sector, it may still run and try to retreat to the closest base.

This is specific to miners right now - I haven't really thought about if it's appropriate for drones in general but it could be extended to the drones too if nobody sees any issues with it.

By the way, to be clear, I'm working on these for the next release, none of these will be in R6.
Last edited by Spunkmeyer on Fri Feb 24, 2012 1:14 am, edited 1 time in total.


Want bigger games? Log on to play at the official game time: 9pmET/8pmCT/7pmMT/6pmPT every day of the week. Also Saturdays 8pm UTC.

BillyBishop
Posts: 476
Joined: Thu Sep 02, 2010 7:52 pm
Location: Calgary Montreal Vancouver (depending heh)

Post by BillyBishop »

Kewl. Beer and hookers on me. :)


As for drones, I think those too, I've lost a ton of cons that abort rips, so annoying. Heh
Spunkmeyer
Posts: 2013
Joined: Fri Jun 27, 2003 7:00 am
Location: Contact me regarding: CC, Slayer and AllegWiki.

Post by Spunkmeyer »

*I've made the "don't run if headed to station" rule general, so it applies for all drones.
*Miners no longer head back to the designated mining sector if there is an enemy base there.

Questions:

1-Is it reasonable to have the miners to try to GTFO if they launch in a contested sector (two bases) unless explicitly ordered to a rock?

2-If yes, if ordered to a rock in the contested sector instead, when they finish mining, should they return to the base in the contested sector, or should they try to GTFO right away?

3-Should miners NOT stop running once they start running (so they'd head all the way to the base unless ordered otherwise)
OR
Should they stop running but instead of blindly going back to the last rock, they pick a new default order as if they've freshly launched?


Want bigger games? Log on to play at the official game time: 9pmET/8pmCT/7pmMT/6pmPT every day of the week. Also Saturdays 8pm UTC.

DonKarnage
Posts: 545
Joined: Mon Nov 01, 2010 7:18 pm

Post by DonKarnage »

A couple times we've had unattended miners try and take a path through an enemy sector to get home. Any way to prevent that?

erm... besides having a commander that doesn't suck :P
Last edited by DonKarnage on Sat Feb 25, 2012 6:51 am, edited 1 time in total.
It is Karnage! Don Karnage! Roll the r!
Spunkmeyer
Posts: 2013
Joined: Fri Jun 27, 2003 7:00 am
Location: Contact me regarding: CC, Slayer and AllegWiki.

Post by Spunkmeyer »

DonKarnage wrote:QUOTE (DonKarnage @ Feb 25 2012, 12:41 AM) A couple times we've had unattended miners try and take a path through an enemy sector to get home. Any way to prevent that?
Yes, pretty easy. The problem is they try to go through your sectors first, and if they can't find a path they say "$#@! it".

The second attempt should be to include neutral sectors but not enemy sectors. I'll add that.


Want bigger games? Log on to play at the official game time: 9pmET/8pmCT/7pmMT/6pmPT every day of the week. Also Saturdays 8pm UTC.

Dorjan
Posts: 5024
Joined: Sun Oct 07, 2007 9:56 am
Location: England

Post by Dorjan »

Keep going Spunky.

Miners should have a few more checks to be more human.

You've prob already considered all of this but I'll just point it out to make sure all bases are covered.

1) Been ordered to dock, won't relaunch unless a new order is given to it. (Maybe some sort of message to the commander if a miner has been docked for a while?)
2) Attacked! Panic mode! (Reset last panic mode timestamp after docking / unloading 1 minute.)
2.a) Am I in panic mode? if so continue doing what I'm doing
2.b) Since panic mode was first engaged, have I received an order, if so continue doing that order.
2.c) If no order received, head to nearest base which includes (if ripcord enabled) using ripcord.
3) I was ordered to mine a rock in a sector, keep order mining that sector. Each time I've finished mining at a rock, docking or offloading check:
3.a) Is that sector not hostile (with usual checks, make sure the sector is friendly and there is a path through known non-hostile space to sector and use the route for distance)?
3.b) Is there enough HE in that sector?
3.b.1) What was the last rock in that sector and how full is it? If more HE than 50% of my hull capacity mine there otherwise add to stack of possible HE rocks and do 3.b.2.
3.b.2) Find nearest HE rock in that sector to last mined rock and check if will give me more than 50%, if so mine there otherwise add to stack of possible HE rocks and do 3.b.3.
3.b.3) Check to see if stack of HE rocks will give me 50%, if not check the next nearest to last mined roid and continue looping until no more HE rocks in that sector. if the whole sector will give less than 50% find new sector to mine.
4) Finding new sector (with usual checks, make sure the sector is friendly and there is a path through known non-hostile space to sector and use the route for distance), check nearest friendly sector from last HE rock mined location for HE using the rules from 3.b if invalid sector, add sector to a stack then continue through sectors in distance from last HE rock mined location. If no sector found, check stack (in reverse order ofc) for any two sectors to start mining (using the rules from 3.b but using known sector HE totals).



I think that's everything covered and I hope it makes sense.
Last edited by Dorjan on Thu Mar 15, 2012 3:36 pm, edited 1 time in total.
I decided to relive the days gone by in my new blog.
---
Remember, what I say is IMO always. If I say that something sucks, it actually means "I think it sucks" OK?
Cookie Monster wrote:QUOTE (Cookie Monster @ Jan 31 2012, 03:09 PM) True story.

Except the big about dorjan being jelly, that's just spidey's ego.
ImageImage
Spunkmeyer
Posts: 2013
Joined: Fri Jun 27, 2003 7:00 am
Location: Contact me regarding: CC, Slayer and AllegWiki.

Post by Spunkmeyer »

Thank you Dorjan, appreciate the comments.

Definitely need to be careful here and consider each change carefully. For some stuff there is really no "ideal" and you need to make a choice.
Dorjan wrote:QUOTE (Dorjan @ Mar 15 2012, 08:52 AM) 1) Been ordered to dock, won't relaunch unless a new order is given to it. (Maybe some sort of message to the commander if a miner has been docked for a while?)
That's in R6.
QUOTE 2) Attacked! Panic mode! (Reset last panic mode timestamp after docking / unloading 1 minute.)[/quote]
Original behavior is to reset panic mode (stop running) once sufficiently healed, which results in the stupidity of a miner returning back to the sector it's just been raped in. One option is not to stop running till docked, another is to pick a new rock instead of going back to mining the previous one, which is what I'm doing now.
QUOTE 3) I was ordered to mine a rock in a sector, keep order mining that sector. Each time I've finished mining at a rock, docking or offloading check:[/quote]
Yes, it now works like this - instead of a "return to the same (potentially suboptimal) rock" or "pick an entirely new order" (based on whether there is leftover capacity) logic of before, miners now remember the mining sector and prioritize that.
QUOTE 3.a) Is that sector not hostile (with usual checks, make sure the sector is friendly and there is a path through known non-hostile space to sector and use the route for distance)?[/quote]
The default logic considers a sector friendly if you have a base in it without enemy bases, and not otherwise. Since there is now the definition of a mining sector, you can override this manually and miners will return to neutral sectors properly (and not just beeline to the last mined rock only if they were full before). To this I have added an attempt to GTFO contested sectors after the mining is done and also not treat any sectors with an enemy carrier in it as friendly.

An idea that's been thrown around is to include # of friendly vs enemy in the sector in the definition of friendly sector, and currently experimental mode turns this on. But I don't know if it's smart enough to be beneficial or annoying enough to cause problems simply because of random enemy scout presence. As coded, it's the exact same logic that decides whether to run or not when damaged. See "threat level detection" below.

QUOTE 3.b) Is there enough HE in that sector?
3.b.1) What was the last rock in that sector and how full is it? If more HE than 50% of my hull capacity mine there otherwise add to stack of possible HE rocks and do 3.b.2.
3.b.2) Find nearest HE rock in that sector to last mined rock and check if will give me more than 50%, if so mine there otherwise add to stack of possible HE rocks and do 3.b.3.
3.b.3) Check to see if stack of HE rocks will give me 50%, if not check the next nearest to last mined roid and continue looping until no more HE rocks in that sector. if the whole sector will give less than 50% find new sector to mine.[/quote]
Right now any rock with >25% He3 is considered a target and the closest one to the miner is picked, not the closest one to the last mined asteroid. In practice though these tend to be the same.
QUOTE 4) Finding new sector (with usual checks, make sure the sector is friendly and there is a path through known non-hostile space to sector and use the route for distance), check nearest friendly sector from last HE rock mined location for HE using the rules from 3.b if invalid sector, add sector to a stack then continue through sectors in distance from last HE rock mined location. If no sector found, check stack (in reverse order ofc) for any two sectors to start mining (using the rules from 3.b but using known sector HE totals).[/quote]
Mostly works that way if you keep in mind the distinctions above. The improvement there is previously path-finding would revert to going through "any sector" if there were no path through friendly sectors. Now it tries friendly sectors, then neutral sectors, and only then considers any other sector. This could definitely be improved by making a distinction between "any" and "contested" as well (I skipped over it for now since it needs more 'plumbing')

I think all this currently adds up to significant improvement and the next big improvement would be intelligent threat level detection.
1) Total DPS of enemy closing in (ignore enemies not closing in)
2) Total DPS of friendly closing in (use a factor here, for example 0.5 to calculate effective DPS) (ignore friendlies not closing in)
3) Total DPS of friendly capable of healing closing in
4) Calculate TTL(me) based on #1 and #3
5) Calculate TTL(enemy) based on #2
6) TTL(me)<TTL(enemy) = run
Last edited by Spunkmeyer on Fri Mar 16, 2012 12:11 am, edited 1 time in total.


Want bigger games? Log on to play at the official game time: 9pmET/8pmCT/7pmMT/6pmPT every day of the week. Also Saturdays 8pm UTC.

Post Reply