.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#1)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Loading other bot wayponts (standard format?) & Standardized directory structure? - 28-12-2003

Perhaps worth considering; while our bots getting united, it would be cool to have them share the same data files. As well using a shared directory structure.

My bot uses:

counter-strike\realbot

as folder. I see pod/pox etc does:

counter-strike\cstrike\podbot

although that is logical, i prefer my structure because this way i centralize and i am able to run multiple mods without changing from 'cstrike' to 'dod', thus having only 1 realbot directory. Makes it easy for me and for users.

within my realbot directory i have:
data\<mod name>

here in theory could be:
data\cstrike
data\dod
data\firearms
data\valve

etc.

And in every mod dir:
cstrike\maps
cstrike\bots
cstrike\exp

i use a dir 'bots' for personalities, and i do this per mod because each mod has different properties. Perhaps its better to have a global bot personality and 'refined' personality info per mod in these directories. This way you don't have so much redundancy as now.

Waypoints/Nodes storage
Perhaps its a good idea to use INI files (as i have), my INI parser is easy to use, but there are many other INI parsers on the web and it is plain-text (thus easy compressable with ZIP and such). Plain-Text formats also allow easy importing, this way we bot authors do not need to share code specific variables which we do not need.

Ie, my code for loading nodes:
Code:
// Load
void cNodeMachine::load()
{
  char dirname[256];
  char filename[256];
  int i, n;

  // Set Directory name
  strcpy(dirname, "data/cstrike/maps/");

  strcat(dirname, STRING(gpGlobals->mapname));
  strcat(dirname, ".rbn"); // nodes file

  // writes whole path into "filename", Linux compatible
  UTIL_BuildFileNameRB(dirname, filename);

  FILE *rbl;
  rbl = fopen(filename, "rb");

  if (rbl != NULL)
  {
    int iVersion=FILE_NODE_VER1;
    fread(&iVersion, sizeof(int), 1, rbl);

    // Version 1.0
    if (iVersion == FILE_NODE_VER1)
    {
        for (i=0; i < MAX_NODES; i++)
        {		
            fread(&Nodes[i].origin, sizeof(Vector), 1, rbl);
            for (n=0; n < MAX_NEIGHBOURS; n++)
            {                
                fread(&Nodes[i].iNeighbour[n], sizeof(int), 1, rbl);	
            }

            // save bit flags
            fread(&Nodes[i].iNodeBits, sizeof(int), 1, rbl);

            if (Nodes[i].origin != Vector(9999,9999,9999))
                iMaxUsedNodes = i;
        }
    }

	// Add nodes to meredians
	for (i=0; i < MAX_NODES; i++)
		if (Nodes[i].origin != Vector(9999,9999,9999))
		{
			int iX, iY;
			VectorToMeredian(Nodes[i].origin, &iX, &iY);
			if (iX > -1 && iY > -1)
				AddToMeredian(iX, iY, i);
		}

      
        fclose(rbl);
  }
}
as you can see, i do 'read binary'. I use max values so my files do never grow for Nodes. The experience though (vis-table which is calculated by experience, etc) does grow. The above could probably be done in text, we could simply share our piece of code then and all you need to do is change the variable names to get my RBN files loaded in your bot.

Standardized Waypoint format
Perhaps we should agree on a standardized waypoint format. This will be a lot harder though because i use nodes and only use vectors & neighbours. All other stuff is detached because not all info applies on all nodes. Etc. Perhaps we should use files which only contains vectors + bit flags about what kind of 'waypoint' it is. Of course, we have trouble with amounts (i use ~ 2000 nodes, at max 4500).

Anyway, another 'start' about a cool subject.
  
Reply With Quote
Re: Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Loading other bot wayponts (standard format?) & Standardized directory structure? - 29-12-2003

Yes... unfortunately I won't assist you much there, my bots use a navmesh, which is not exactly assimilable to waypoints

But great idea indeed, if some of you can hammer out a standard!



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#3)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Loading other bot wayponts (standard format?) & Standardized directory structure? - 29-12-2003

i bet even you pierre can give me a list of walkable vectors? Every 'mesh' center perhaps? You also know if they are connected so you can give a 'neighbour' list as well. In theory my bot can walk using your mesh files.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Loading other bot wayponts (standard format?) & Standardized directory structure? - 29-12-2003

Yes... but MY bot can't walk using YOURS, you horrible egoistic boy



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#5)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Loading other bot wayponts (standard format?) & Standardized directory structure? - 29-12-2003

aww, come on pierre you could do better then that! I bet you can write some code to check where my nodes are and confirm the meshes they are on that they are 100% connectable. Perhaps your bot does not even need to know anything because it already knows where it can walk and where not (or does it uses some sort of 'remembering what went good/bad' code, like Micheal Boot does with his 'official cs bot'?)


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#6)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Loading other bot wayponts (standard format?) & Standardized directory structure? - 10-01-2004

*Bumbed* (?)

I suggest we do agree on a standard format which only provides navigation information. Perhaps not even connection data!

As a suggestion i'd like to propose we have a "WVF" format. This file only contains Vectors which are walkable. THey should represent points (nodes, waypoints, whatever) where you can walk to.

I take 4096 as a max, the format should be simple:

Code:
while (file is not empty)
 fread(file, vector);
 
// and saving the same:
for (every waypoint that is valid, etc)
 fwrite(file, vector of waypoint)
the bot should interpet the information itself. THis means the way I connect nodes will be different then other bots.

Looking at JOE and RACC i think we can agree on such a format. Even RACC can give me the vectors? (You need to know where to move the vBody angle so you NEED to know atleast SOME vectors).

Perhaps pierre can tell me what his max amount of vectors will be?

thoughts? comments?!


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#7)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: Loading other bot wayponts (standard format?) & Standardized directory structure? - 10-01-2004

I have not worked on my own navigation yet, so I'm not best to comment, however I wonder if it would be best to make the standard file format in text form, rather than binary? Sort of like a high level language for defining the nodes.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#8)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Re: Loading other bot wayponts (standard format?) & Standardized directory structure? - 10-01-2004

Quote:
Originally Posted by botmeister
I have not worked on my own navigation yet, so I'm not best to comment, however I wonder if it would be best to make the standard file format in text form, rather than binary? Sort of like a high level language for defining the nodes.
That sounds nice. Maybe it would be good if you can specify at the beginning of the file for which game these waypoints so that other bots for other mods can use it to savely to
  
Reply With Quote
Re: Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#9)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Loading other bot wayponts (standard format?) & Standardized directory structure? - 10-01-2004

Binary format is much easier and smaller than text.
However, if you want to go down that road I suggest using XML...

Code:
  
<?xml version="1.0"?>
<rootnode>
 <waypoint>
  <origin>-64 1055 -231</origin>
  <team>1</team>
  
  <mod_specific game="tfc">
   <class>scout</class>
  </mod_specific>
 </waypoint>
</rootnode>
  
Reply With Quote
Re: Loading other bot wayponts (standard format?) & Standardized directory structure?
Old
  (#10)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Loading other bot wayponts (standard format?) & Standardized directory structure? - 11-01-2004

Omg, no XML! I find that sooooooo uber bloatware!

i rather use ini files:

Code:
[NODES]
1=xxxx,yyyy,zzzz
2=xxxx,yyyy,zzzz
A text format is fine with me, i will try to write an 'export' thingy asap. Without even the [NODES] part, so EVERY program can read it. Remember it is only for basic information about the nodes. They only represent walkable dots/points, nothing more, nothing less. Everything else (danger, goals, etc) should be saved in your own waypoint file.

For me, i can do this with the WVF format:

Code:
for (every vector i read in the file && is valid)
{
// create node
// check if any goal is near this, and assign 'goal' to this node
// check any near 'nodes' and connect them (using a special function this also makes sure it happens vice-versa)
// check any special stuff (in water? on ladder? etc)
}
thats all Then i got my RBN file and i can tweak it. When using WVF files we can distribute these files only, especially with our downloads section being under construction we can have 2 sections:

- general World Vector Files
- bot specified files

the general wvf files will do the above, while the bot specific files are 'tweaked' ones (more optimal).


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com