Thread history

From User talk:Cbrowne
Viewing a history listing
Jump to navigation Jump to search
Time User Activity Comment
18:39, 12 October 2011 Cbrowne (talk | contribs) New reply created (Reply to another "does it make sense to...?" question)
15:28, 12 October 2011 Voidious (talk | contribs) New reply created (Reply to another "does it make sense to...?" question)
15:26, 12 October 2011 Voidious (talk | contribs) New reply created (Reply to another "does it make sense to...?" question)
14:50, 12 October 2011 Cbrowne (talk | contribs) New reply created (Reply to another "does it make sense to...?" question)
01:37, 12 October 2011 Voidious (talk | contribs) New reply created (Reply to another "does it make sense to...?" question)
23:33, 11 October 2011 GrubbmGait (talk | contribs) New reply created (Reply to another "does it make sense to...?" question)
22:28, 11 October 2011 Cbrowne (talk | contribs) New thread created  

another "does it make sense to...?" question

I've currently got the bot tracking nicely, and have worked out how to collect and store as much data as I can get from the scanner (x,y,heading,velocity,energy). I know I can also get distance, but if I've understood Pattern Matching correctly I have no real need to store the distance to the bot at the time of scanning.

Anyway, does it make sense to do this for my fire power?

onBulletHit(BulletHitEvent e) {
  increaseFirePower();
}
onBulletMissed(BulletMissedEvent e) {
  decreaseFirePower();
}

My motivation is that the bot should conserve energy if it keeps missing, but ramp up the firepower as it scores consecutive hits. Increase and Decrease functions can be pretty much anything (I've currently got them behaving linearly, but there's probably a more optimal equation for the increase/decrease functions).

I think this function is moderately better than simply firing 3.0 all the time, but I haven't looked into the alternatives used by other bots. I'm probably doing a lot of wheel reinvention, but hopefully that's to be expected from a newbie bot author, heh. *wipes sweat from brow*

Cbrowne22:28, 11 October 2011

Yes, it does make sense, although mostly it is dependent on hitrate instead of hit/miss. The are some more things to keep in mind regarding bulletpower. First of all, heavier bullets travel slower. Next to that, you do not want to disable yourself, you'll be a Sitting Duck with 0.0 energy. You can choose your bulletpower depending on distance, when you are close, fire full power as the chance of hitting is bigger. There has been grown a consensus to have the default bulletpower somewhere between 1.7 and 2.4, mostly due to a (theoretical) discussion years ago (somewhere on the old wiki). This number would be an optimum to minimize the energyloss while still be able to punch hard enough. The best way is to pick an opponent and try different (extreme?) powerschemes, so you can see what is happening and come up with something you like. And it gives much more satisfaction that you create by yourself even out of ideas of others, than just to copy some things from others you don't understand.

GrubbmGait23:33, 11 October 2011
 

That makes some sense to me, too, though I'd also advise experimenting with different schemes to find out what works best.

I think everyone has to find their own balance of reinventing wheels and learning from other bots and the wiki. There are lots of trade-offs either way. But yes, certainly some of that is expected. =)

Voidious01:37, 12 October 2011
 

Yes, my current calculations for targeting messed up a bit so I discovered on my own that heavier bullets travel slower. They're still messed up, but that was just one facet of their messing up that is now (hopefully) less messed up.

If the consensus is to always fire between 1.7 and 2.4, might it be sensible to "cap" my firepower within those numbers? And instead fire less often if I keep missing past 1.7 (I was planning on implementing a "fire less often" extension anyway, since I'm firing a heck of a lot of shots with minimum power at the moment, mostly because my implementation of pattern matching is both incomplete and horribly broken).

I'm still not 100% sure how you get disabled. Is it purely from trying to do too much in a single turn, or are there other things that cause it?

Cbrowne14:50, 12 October 2011
 

Particularly when low on energy, firing very low power bullets makes sense because they're faster (easier to hit with) and give you more chances to land some shots and stage a comeback. The opponent could be firing higher power bullets, miss a few shots, and you're right back in it. So I wouldn't completely restrict myself from going below 1.7, but that sounds like a reasonable setup until you get low on energy.

Voidious15:26, 12 October 2011
 

Oh, and you can disable yourself by firing yourself down to 0 energy, or by taking a ridiculously long time on a turn. If it's the latter, it should say something in the console about stopping your bot for not doing anything in a "reasonable amount of time".

Voidious15:28, 12 October 2011
 

Yeah, I've had a few disables from infinite loops before, but I didn't realise you also got disabled if you fired down to 0 energy. although that makes sense, since if it didn't disable you at that point you could either commit suicide or fire bullets for free.

I'm currently working on a deltas-based GF system, where I store the "deltas" of previous guesses and attempt to smooth the deltas to be as close to each other as possible (I don't much care if they're close to zero yet, but ultimately if I can determine with some degree of accuracy that the deltas are always offset by a constant or linear amount from zero, I can adjust the function using that offset, so I just want to get the delta function as close to flat as I can, currently). This should give me a fairly accurate gun, unless I'm very much mistaken? The only "magic" being the smoothing function, which would attempt to compensate for over/under guesses by increasing or decreasing the guess offset from the enemy's current position. Taking into account things like bullet velocity (which is a non-linear function, thanks to my "firepower" calculations, eugh) and distance from self to guess to then compute an optimal firing angle.

Thing is, with this system I'm not sure which is a better delta to use. You get more information from a delta that is the distance between your guess and the robot's actual position on that turn (provided you can get both pieces of information, and heaven help us if we can't) but a delta between the gun angle you used and the gun angle you -should've- used might provide more information to the next step (trying to get that delta as low as possible).

Of course, all of this could be surplus to requirement, but any help would be appreciated.

Cbrowne18:39, 12 October 2011