Get GetShots()

Come in here to talk about your sky-net style world-destroying super bots!

Moderator: Defcon moderators

User avatar
trickser
level5
level5
Posts: 1823
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Get GetShots()

Postby trickser » Fri Jul 02, 2010 8:24 am

The API documentation names it, but it does not exists.
This is a major drawback, because shots tell you something about things you cant see, like if your are seen by someone else.
And I bet there are people who would like to model a bot from their experience as a player, but without knowledge about shots, its only half the fun.

I think it might be possible to simulate the games behavior regarding shots inside a bot (if you can ask for state and state timer of enemy units, havent checked this yet). Maybe not 100% accurate, but good enough for most purposes.

But it would have to be done in full information mode, why care about shots when everything is visible?

What do you think?
User avatar
smc
level1
level1
Posts: 21
Joined: Sun Jun 13, 2010 2:18 am

Postby smc » Fri Jul 02, 2010 6:45 pm

Yes, it would be good to be able to access the shots.

A partial solution is the Hit event - you can at least tell that your units are getting shot. I don't know any way to access the data behind each shot though - shots don't seem to appear in the data returned by GetAllUnitData().

cheers
User avatar
smc
level1
level1
Posts: 21
Joined: Sun Jun 13, 2010 2:18 am

Triangulation

Postby smc » Mon Jul 05, 2010 10:36 pm

Hi guys,

I've been thinking about this... I think it is possible to 'triangulate' silo locations using the hit event. Imagine a fighter flying along and a silo shooting at it. The silo has a certain shot frequency and the hit event tells you how often a shot impacts the fighter. But... the hit frequency on the fighter depends on the relative motion of the fighter and the silo. For any given hit frequency there are two possible vectors (one at an angle to the left, one to the right) that the source of the shots could be on.

It's just like the Doppler effect for a passing ambulance - the motion of the fighter changes the frequency of the shot impacts (the shots are equivalent to the peaks of the sounds waves... except that in this example the ambulance is parked and you are driving past it).

Perhaps one algorithm would be that when a fighter detects silo shot frequency hits it turns until the frequency is maximised at a known frequency. Then the fighter would know that it is 'flying down the line' of shots and the silo lies on extension of its movement vector. Do this from two different angles and X marks the spot...

Lots of practical difficulties in this of course: in many cases you'll be getting hits from multiple silos, a fighter might not last more than a couple of hits, and silos often switch targets away from fighters. But it is possible in principle.

Of course if this becomes a standard method the silos could start spoofing their targets and rhythms to throw the fighters frequency detection off 8)

[Edit] Hmmm. Do friendly nukes give hit events? If so you could in principle map the enemy silo location from the first half of the barrage, and take out the silos with the second...
User avatar
tllotpfkamvpe
level5
level5
Posts: 1768
Joined: Fri Aug 31, 2007 12:04 am
Contact:

Postby tllotpfkamvpe » Mon Jul 05, 2010 10:53 pm

But silo AA fire doesnt travel in straight lines. I assume dopler effect works because light/sounds does travel in straight lines.

Silo fire tends to bend towards the incoming planes. Since we dont know how this bending occurs, it would introduce an unkown variable into the prediction formula. It's almost like the planes and nukes have different amounts of gravity into which the silo fire bends towards. When the fire gets really close to its target it even tends to fall into orbit around it, circling around it a few times before it hits.

Your bot sounds awesome anyway. When will it be finished?
Last edited by tllotpfkamvpe on Mon Jul 05, 2010 11:03 pm, edited 1 time in total.
User avatar
smc
level1
level1
Posts: 21
Joined: Sun Jun 13, 2010 2:18 am

Postby smc » Mon Jul 05, 2010 11:01 pm

You're right - but that's not necessarily a deal-breaker, and of course it does if you are flying right at it.
User avatar
rus|Mike
level5
level5
Posts: 2750
Joined: Thu Jun 28, 2007 5:52 pm
Location: Russia, St. Petersburg

Postby rus|Mike » Mon Jul 05, 2010 11:29 pm

I dont't know if it can be implemented in the bot, but silos can be triangulated by a human. All you have to do to escape non-straight-aa-fire is to take into the consideration only first part of shot travel path (~30-60%), they are not affected by that problem. "Leaning" of shots towards the target only occurs when the shot comes close to it.
User avatar
trickser
level5
level5
Posts: 1823
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Tue Jul 06, 2010 6:33 am

Nice Idea. Would be funny if it works so well, BOTs would send fighters at nukes to prevent silo detection.
User avatar
martin
level5
level5
Posts: 3210
Joined: Fri Nov 19, 2004 8:37 pm
Location: ::1
Contact:

Postby martin » Tue Jul 06, 2010 1:52 pm

rus|Mike wrote:I dont't know if it can be implemented in the bot, but silos can be triangulated by a human. All you have to do to escape non-straight-aa-fire is to take into the consideration only first part of shot travel path (~30-60%), they are not affected by that problem. "Leaning" of shots towards the target only occurs when the shot comes close to it.


Uhm, how can you do that? SInce GetShots() isn't available, your bot cannot see shots until they hit a unit. THey's the only information you have about shots!
GENERATION 22:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
User avatar
rus|Mike
level5
level5
Posts: 2750
Joined: Thu Jun 28, 2007 5:52 pm
Location: Russia, St. Petersburg

Postby rus|Mike » Tue Jul 06, 2010 10:23 pm

As I said, I was only talking about how it is possible to triangulate in-game, I have no idea about programming bots.
User avatar
smc
level1
level1
Posts: 21
Joined: Sun Jun 13, 2010 2:18 am

Postby smc » Fri Jul 09, 2010 1:24 am

Trickser - come to think of it you could just tell silos to fire at different nukes alternately...

MVPE - Thanks. Finished? Hmmm, I expect Grace will be beating the CPU in 2-3 months, and might give an intermediate player a run for their money by the end of the year.
User avatar
Ace Rimmer
level5
level5
Posts: 10803
Joined: Thu Dec 07, 2006 9:46 pm
Location: The Multiverse

Postby Ace Rimmer » Fri Jul 09, 2010 2:03 am

Don't change the silo's targeting; when you do that, you lose a gunshot (the silo won't fire the next round of AA).
Smoke me a kipper, I'll be back for breakfast...
User avatar
trickser
level5
level5
Posts: 1823
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Fri Jul 09, 2010 5:10 am

Additionally they will pick the closest nuke/bomber/fighter for the next shot. There is no way to make a silo accept a manual order.

EDIT: Except all stuff in range is from the same alliance you are in.
Barbarossa
level2
level2
Posts: 105
Joined: Sun Jul 11, 2010 8:04 am
Contact:

Postby Barbarossa » Mon Jul 19, 2010 12:55 am

Well the original API is in C++, can't someone just code the getshots? Robin never finished it but that doesn't mean someone can't finish it for him.

Return to “AI Bots”

Who is online

Users browsing this forum: No registered users and 3 guests