PDA

View Full Version : 1.1 and 2.0 Progress


Akz
18-09-2004, 22:02
Arr!

Had nothing else to do, so I decided to tell you about my evil plans. 8D

GrogBot 1.1
EDIT: Has been released and can be downloaded from the filebase.

GrogBot 2.0

"The next generation of grogbot" :P


A longer scale project than the first one was. The bot will be written from scratch, and it will not be based on any of the bot templates/sources available.
It will be an open-source project.
I'm mostly doing it because the code in the first GrogBot was *erm...* sort of badly designed, and the bot will also be more "mine" than the original, which was based on the HPB bot 3.0 source.
The first GrogBot 2.0 spawned into the game. Sitting there, doing nothing. WOW!
http://koti.mbnet.fi/grogbot/crossfire0000.jpg

Tell me what you think. Suggestions are always welcome. ;)

AzShadow
18-09-2004, 22:07
I don't really understand the features in 1.1 but they're probably good. :D

Still waiting for 2.0 which allows to do so many good things...

Pierre-Marie Baty
19-09-2004, 17:57
good luck ! =)

Ailean
20-09-2004, 18:03
You're in the pvk2 team, so could you, eh :o , ... sneak a bot in the core? :D Or at least try to make one that's *tightly* integrated with pvk2?

yes, yes, I know the hl2 sdk isn't released yet, but asking doesn't hurt :D

And, I haven't paid attention to it yet, but some people told me all those grogbots speedhack ...

Akz
20-09-2004, 19:16
You're in the pvk2 team, so could you, eh :o , ... sneak a bot in the core? :D Or at least try to make one that's *tightly* integrated with pvk2? It's very possible that I'm going to make a bot for PVK2 too, but I've been thinking about releasing it as a third-party product. Nothing has been decided though. ;)

Zeta
24-09-2004, 03:41
I like the feature to command the bots :D and er what's a booty Tag mode?

Akz
24-09-2004, 19:00
pvk_temple for example. There's one treasure chest in the map placed somewhere. The objective is to grab the chest, and hold it to gain points. You get scored every 10 seconds or something while holding the chest.

Akz
26-09-2004, 20:29
Whoa!

I've been working on the A* pathfinder for GrogBot 2.0 lately. I never thought that I could be able to understand such a big thing as A* is, but when I finally started gathering information about it and writing my own implementation, I began to understand how A* actually works.

I got it working pretty fast, but it was really SLOW at first. Unusable... It took half a minute to calculate a path in a map with ~200 nodes. After some little optimizations, I got it to calculate the path in 1-2 seconds. More faster than before, but still far too slow.

It took me two days to understand what the problem was :|. I was logging every GetItemCount() call to an external file, which slowed it down A LOT. After removing those two little lines of code, it's working a lot better. Sure it isn't the most optimized one, but it works!


void CPathfinder::FindPath( CNode *start, CNode *end )
{
m_bSearching = true;

SAFE_DELETE( m_pResult );
SAFE_DELETE( m_pOpenList );

m_pOpenList = new CList<astar_t>;

// Store the indexes of the start and end nodes
m_iStartNodeIndex = g_NodeManager.GetNodeIndex( start );
m_iEndNodeIndex = g_NodeManager.GetNodeIndex( end );

for ( int i = 0; i < g_NodeManager.GetNodeCount(); i++ )
{
// Initialize the values.
m_Nodes[i].open = false;
m_Nodes[i].closed = false;

m_Nodes[i].f = 0.0;
m_Nodes[i].cost = 0.0;
m_Nodes[i].heuristic = 0.0;
m_Nodes[i].parent = -1;

m_Nodes[i].index = i;

m_Nodes[i].pNode = g_NodeManager.GetNodeByIndex( i );
}

// Mark the start node as open
m_Nodes[m_iStartNodeIndex].open = true;
m_pOpenList->Insert( &m_Nodes[m_iStartNodeIndex] );

Advance();
}

void CPathfinder::Advance( )
{
int i;

if (!m_bSearching)
return;

int loops = 0;

while ((m_bSearching) && (loops < 100))
{
loops++;

float smallest_f = -1.0;
astar_t *pChosen = NULL;

// Find the node with the smallest f from the open list.
for ( i = 0; i < m_pOpenList->GetItemCount(); i++ )
{
astar_t *pCurrent = m_pOpenList->Get(i);

if (!pCurrent)
continue;

if ( (pCurrent->f < smallest_f) || (smallest_f == -1.0) )
{
smallest_f = pCurrent->f;
pChosen = pCurrent;
}
}

if ( !pChosen )
{
m_bSearching = false;
return;
}

// Check if this node is the goal
if (pChosen->index == m_iEndNodeIndex)
{
// The path has been found!

astar_t *pCurrNode = pChosen;

m_pResult = new CList<CNode>;

while ( pCurrNode )
{
m_pResult->InsertAtTail( pCurrNode->pNode );

if ( pCurrNode->parent != -1 )
pCurrNode = &m_Nodes[pCurrNode->parent];
else
pCurrNode = NULL;
}

m_bSearching = false;
return;
}

CList<CNode> *pPaths = NULL;

if (pChosen->pNode)
pPaths = pChosen->pNode->GetPaths();
else
continue;

if (!pPaths)
continue;

// Mark this node as closed
pChosen->closed = true;

// Remove from open list
m_pOpenList->Remove( pChosen );
pChosen->open = false;

// Loop through the possible successors
for ( i = 0; i < pPaths->GetItemCount(); i++ )
{
CNode *pNode = pPaths->Get(i);
astar_t *pCurr = &m_Nodes[pNode->GetIndex()];

if (!pNode)
continue;

// If this node is linked to itself for some unknown reason, skip it.
if ( pNode == pChosen->pNode )
continue;

// Calculate the new cost.
int new_cost = pChosen->cost + g_Util.GetDistanceBetween( pChosen->pNode->GetOrigin(), pNode->GetOrigin() );

// If this node is not touched yet OR if a better route has been found...
if (((!pCurr->closed) && (!pCurr->open)) ||
(((pCurr->open) || (pCurr->closed)) && (new_cost < pCurr->cost)))
{
m_pOpenList->Remove( pCurr );

pCurr->cost = new_cost;
pCurr->heuristic = g_Util.GetDistanceBetween( m_Nodes[m_iEndNodeIndex].pNode->GetOrigin(), pNode->GetOrigin() );

pCurr->f = pCurr->cost + pCurr->heuristic;

pCurr->parent = pChosen->index;

pCurr->open = true;
m_pOpenList->Insert( pCurr );
}
}
}
}

CList<CNode>* CPathfinder::GetResult( )
{
if (m_bSearching)
{
g_Output.Log( LOG_DEV, "CPathfinder::GetResult(): ERROR: Search in progress." );
return NULL;
}

return m_pResult;
}
EDIT: Code tags are back.

Pierre-Marie Baty
27-09-2004, 15:30
The code tags are broken... I know... this seriously sucks! There's nothing I can do cause Onno hasn't opened any SSH account on the server for me yet!!!

elitejavi
22-10-2004, 21:55
soo, can you give us a date?
if not, can you tell us the progress of the progress(or you edit the frist post every time you progress:D )

seeya

Akz
22-10-2004, 23:35
There haven't been much progress on GrogBot lately, because I've been busy with other projects. Can't give any release dates at the moment.

raaste
14-12-2004, 00:03
Other projects, indeed. 9_9

stefanhendriks
22-12-2004, 23:07
other projects, like what? ;)

Akz
22-12-2004, 23:46
Other projects, indeed. 9_9 other projects, like what? ;) Hey, you're making fun out of me, huh? :|
No, seriously, GrogBot was sort of frozen for months, had no motivation to continue. Mostly because I'm fed up with this old 1.x code (it's crap).
But now, I started working on 1.1 again and I can promise a release in january. After it's finished, I can start working hard on 2.0 (no more 1.x bullshit).

Some important information regarding GrogBot 2.0 tomorrow.

Pierre-Marie Baty
23-12-2004, 04:21
w00t man, I missed their parrot attack from some time now :D
Will there be a parrot in PVK 2 ?

stefanhendriks
23-12-2004, 10:59
rofl. I just thought of other projects... erm, well it was probably me, being tired, having odd thoughts ahum...
:D

anyway, w00t. Just start over and rewrite from scratch, is done quicker anyway then bugfixing old code imo...

Akz
23-12-2004, 12:49
Some GrogBot 2.0 info




GBot 2.0 will most probably be a HL2 bot. Let's just hope that the server plugin interface will get a richer entity handling API soon.
It will be a multi-mod bot (PVK2, HL2DM...)
It may even become engine-independent, that would mean it could support a few HL1 mods too, for example. This is very questionable though.
I'm trying to make it much more realistic in movement and aiming than the old GrogBot was. The A* pathfinder allows some tactical pathfinding to be done. (The safest route for example)
This project will surely eat a lot of time and as I'm in the PVK2 team... Well, just don't expect any 2.0 releases soon. ;)

And yes, there surely will be a parrot in PVK2. 8D

Pierre-Marie Baty
23-12-2004, 15:51
Yarrrrrrrrrrr! 8D

raaste
23-12-2004, 21:04
Good luck with the grogbot2 (or what it is called?)! I hope you still have some time for other stuff. :) (plz don't get this wrong)