Those commands I listed weren't actual quotes, but just examples of what "common sense" rules would look like.
In case anyone was wondering, the book I read was "Visions" by Michio Kaku. Very interesting book.
Alrighty, I have a couple of questions for JM or anyone else who would know.
1) When scrolling through the objects list using a for loop like one seen below and I come across an LGM, am I able to use the .info member to tell if an LGM is hostile or friendly to my tank? I know that each LGM is numbered according to player number but I'm looking for a quick and dirty way to see if it needs to be hunted down and killed or not.
2) This again deals with the objects list. When I'm in a for() loop looking for LGMs like so..
[code:1:5662cc42d5]bool cLGMBehavior::is_lgm()
{
for (int objs = 0; objs < info->num_objects; objs++)
{
if (info->objects[objs].object == OBJECT_BUILDMAN)
{
if (info->objects[objs].idnum != 0)
{
return TRUE;
}
}
}
return FALSE;
}
[/code:1:5662cc42d5]
and I come across one, will its number on screen change? Meaning, if I choose to save "objs" and use it in another function like so:
[code:1:5662cc42d5]info->objects[objs].info[/code:1:5662cc42d5]
will I still be accessing info for the LGM even if some other object appears on screen?
3) How is a tank or LGM's speed determined? In the comments of brain.h it states that "64 is top speed on road, 48 on grass, 24 in forest, 12 on rubble, crater, water etc." Are the numbers just arbitrary or do they stand for WORLD coordinates/millisecond or something of that nature?
no quick and dirty way that I'm aware of, you'll have to keep track of who your allies are and their player numbers.
its worldcoordinates per tick, a tick is 1/50th of a second.
Min
Another question here. While making my LGM hunting algorithm I ran into a problem: my tank thought parachutes were LGMs. So I consulted the how-to file and found the enumerated type for objects. When I tested it, however, it didn't work.
[code:1:e9c08f785e]bool cLGMBehavior::is_lgm()
{
if (info->shells < 5)
return FALSE;
for (int objs = 0; objs < info->num_objects; objs++)
{
if (info->objects[objs].object == OBJECT_PARACHUTE)
return FALSE;
if (info->objects[objs].object == OBJECT_BUILDMAN)
{
if (info->objects[objs].idnum != info->player_number)
{
LGM.lgm_now_x = info->objects[objs].x;
LGM.lgm_now_y = info->objects[objs].y;
LGM.objs = objs;
return TRUE;
}
}
}
return FALSE;
}[/code:1:e9c08f785e]
This code scrolls through the object list until it finds either a parachute (returns FALSE) or an LGM (returns TRUE).
The problem comes when the parachute is dropping in on the tank. There are only 3 objects on the whole map: bot tank, player tank, player LGM or parachute. However, when I cycle through the list, it thinks the parachute is a live LGM. This is not supposed to happen, I assume.
I have seen bots with LGM killing capabilities and am starting to wonder how they distinguish between LGMs and parachutes. Is the brain interface fubared or is my code a bit funky?
I'm wondering if this related to the bug where Player 1 (who's lost his LGM) sees his LGM slowly running across the map, while Player 2 sees the parachute moving in the exact same position. Could the coding for Winbolo be that the parachute is just a graphic cover for an LGM that operates under a different ruleset (bee-lines to point of death at reduced speed while ignoring terrain and explosions, then changes back to regular LGM with no parachute cover when it "lands"). That would explain how the bug works (Player 1 doesn't see the parachute graphic that's supposed to cover the LGM).
I have zero experience in programming, so take that under consideration when reading the above.
I've never personally seen that bug before but it seems like a logical explanation. I'm sure Elvis would be able to answer both of our questions, or at least mine since yours is more of a statement of a glitch.
Also, I am interested in how WBN and the client are able to tell when a tank is killed and how you killed that tank. There are no brain pointers that are set when you kill a tank with a shell yet the client and WBN are able to know that you did.
For your own builder:
The man_status field of the BrainInfo structure lets you know his status. The values are:
0 - In tank
1 - Dead, parachuting in.
2 - Out and about in which case the man_direction, man_x and man_y fields will provide more information about where he is.
For other players builders the Object's object type value is set to 5 or OBJECT_PARACHUTE as defined in brain.h.
Yup, your right, after more digging it isn't being set correctly in 1.14. Will be fixed in 1.15.