.:: 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
Best way to detect the maps types ?
Old
  (#1)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Best way to detect the maps types ? - 01-07-2005

Ok I suspect that EPB didn't detect the CS maps correct. So I ask how is the best way to detect the map types? Maybe with the hostage models in the map or with bomb targets in to the DE maps ? Then how to detect the AWP maps and FY maps? Is there a way to read the name of the map and if the name start with cs_ then to set the bots to play for CS maps. And how I must do that? Maybe a code exsamples with a good explain will help.
  
Reply With Quote
Re: Best way to detect the maps types ?
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: Best way to detect the maps types ? - 01-07-2005

For me, hooking the entities spawning is the best way. If you find a func_hostage_rescue then it's a hostage map, if you find a func_bomb_target or info_bomb_target then it's a bomb map. If you have a func_vip_safetyzone, then it's an AS map, if you have a func_escapezone then it's an escape map, etc... If you have nothing of these, then -> deathmatch.

Try to make it so that a map can have several types at once.



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: Best way to detect the maps types ?
Old
  (#3)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Best way to detect the maps types ? - 01-07-2005

Thanks PMB but do you have a idea how to detect FY maps and AWP maps ?

Can you tell me is this way is good :
Code:
strcpy(filename, STRING(gpGlobals->mapname));
   if (filename[0] == 'a') {
	  if (filename[1] == 's')
		 g_iMapType = MAP_AS;
	  else if (filename[1] == 'w')
		 g_iMapType = MAP_AWP;
	  else if (filename[1] == 'i')
		 g_iMapType = MAP_AIM;
   } else if (filename[0] == 'c')
	  g_iMapType = MAP_CS;
   else if (filename[0] == 'd')
	  g_iMapType = MAP_DE;
   else if (filename[0] == 'e')
	  g_iMapType = MAP_ES;
   else if (filename[0] == 'f')
	  g_iMapType = MAP_FY;
The map type is detected by the map name. But I think that still is not correct detected the CS maps. If you can help me.

Last edited by The Storm; 01-07-2005 at 19:39..
  
Reply With Quote
Re: Best way to detect the maps types ?
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: Best way to detect the maps types ? - 01-07-2005

Some maps do not even start with xx_mapname. If I were you, I'd scan until the first underscore. And what if someone named a map "awesome_map" ? That wouldn't make it an AWP map.



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: Best way to detect the maps types ?
Old
  (#5)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Best way to detect the maps types ? - 02-07-2005

Theres a few ways you could do this...

1. Read config files for every map, goto 2 if not found
2. Compare the first 3 letters of the mapname with a table that lists the prefix ( ie. "de_" ) and it's type ( ie. GTYPE_DE )
3. As said by PMB, if all else fails assume deathmatch >
  
Reply With Quote
Re: Best way to detect the maps types ?
Old
  (#6)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Best way to detect the maps types ? - 02-07-2005

Ok I will make two checks. First for func_bomb_target (for DE maps) after that for func_hostage_rescue (CS maps), func_vip_safetyzone(for AS maps) as PMB says. If that fail I will make the checking with the file name of the map. And if that fail then deathmatch. I think that this checks will be enogh for detecting the correct map type.

Thanks a lot guys.
  
Reply With Quote
Re: Best way to detect the maps types ?
Old
  (#7)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Best way to detect the maps types ? - 02-07-2005

Another thing you could check for is if they have say, both a func_hostage_rescue and func_bomb_target.
  
Reply With Quote
Re: Best way to detect the maps types ?
Old
  (#8)
Zacker
Project Leader, Lead Level Designer, Waypointer
 
Status: Offline
Posts: 337
Join Date: Mar 2004
Location: Denmark
Default Re: Best way to detect the maps types ? - 02-07-2005

In SoW2 we do gameplay mode detection in maps solely with entity finding. It works great.


Michael 'Zacker' Schmidt
Level Designer | IO Interactive
Former Game Director | Sands of War
  
Reply With Quote
Reply


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

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