.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   About the VISTABLE (http://forums.bots-united.com/showthread.php?t=3582)

The Storm 14-02-2005 16:05

About the VISTABLE
 
I want to ask is there a way to save somewere this vistable because on the bigger maps while this vistable is initializated the lag of CS is very big. In this way the vistable will be loaded from a file and will not lag CS. And some other question - For what is this vistable? What it actualy do? I still don't understand for what is and how to use it in the E[POD]bot coding.

@$3.1415rin 14-02-2005 16:27

Re: About the VISTABLE
 
hm, just calculate the vistable when adding the waypoints and then store it with your waypoint file ... havnt had lagging problems that way.

you can use the vis table to find cover places, for supressing fire, for guarding locations, etc. pp.

It's quite useful to have a nice bitfield class here, you might wanna look that up in the joebot xp sources.

sfx1999 14-02-2005 23:52

Re: About the VISTABLE
 
Do you mean visdata? Visdata is a bit field that shows what is and is not visible from any given leaf. You need it.

@$3.1415rin 15-02-2005 00:20

Re: About the VISTABLE
 
I think he's not referring the the visdata in the bsp, but to vistables for waypoints

Pierre-Marie Baty 15-02-2005 02:42

Re: About the VISTABLE
 
That's the first thing I changed when I've been working on podbot. I added code to save/load the waypoint vistables inside a separate file (this was not to alter the waypoint format). Maybe Splorygon even improved stuff since. Anyway, look in the pod-bot_mm source code, I'm sure you'll find tons of interesting stuff for you :)

Whistler 15-02-2005 04:42

Re: About the VISTABLE
 
well I changed it to calculate the Vistable at the map start (just when the ServerActivate() is called) at once, not "sliced" like Count Floyd has been doing.

The Storm 15-02-2005 12:40

Re: About the VISTABLE
 
Thanks you guys. I will try to do what I can. But I still don't understand how to use this vistable. Can you give me examples whit C++ code to see how actualy to use the vistable.

@$3.1415rin 15-02-2005 15:08

Re: About the VISTABLE
 
A little code snippet from detecting where supressing fire could be put on. This could of course be done using thousands of traceline, but this'd for sure cause lags.

Code:

// look if we can see some of the nearby waypoints to the enemy
g_Map.m_Waypoints.setDistanceMask(&BFNearEnemy,1,350,p->m_VOrigin);
// dont take the waypoints which are less than 250 units away
g_Map.m_Waypoints.setDistanceMask(&BFNotNearBot,1,250,m_pBot->getOrigin());
BFNotNearBot.negate();
// take only visible waypoints from here
g_Map.m_Waypoints.setVisibleMask(&BFVis,m_pBot->m_iNearestWP);
BFNearEnemy &= BFVis; // everything that's near to the enemy and visible to us
//g_Map.m_Waypoints.broadenMask(&BFNearEnemy);
BFNearEnemy &= BFNotNearBot; // everything that's far enough from me
long lShootAt = BFNearEnemy.getSet(); // get the first suitable waypoint ... randomizing this would be fine too

or to search a waypoint suitable for guarding the bomb

Code:

g_Map.m_Waypoints.setVisibleMask(&BFBVisible,iNearBomb);
g_Map.m_Waypoints.setVisibleMask(&BFPVisible,m_pBot->m_iNearestWP);
g_Map.m_Waypoints.setDistanceMask(&BFBNear,1,450,pGoal->m_pPerceipt->m_VOrigin);
// search only the waypoint which are visible to the bomb and to the bot
// if you would just search the best waypoint in the view of the bomb,
// you would have sometimes more than one bot near a waypoint, this way
// they may guard the bomb from more than one side
BFBVisible &= BFPVisible;
BFBVisible &= BFBNear;
// search the waypoint with the least visible waypoints around
// only those which are marked in the bitfield
iDestination = g_Map.m_Waypoints.getMaximum(&BFBVisible,CWaypointGraph::WG_SEARCH_AVDISTVWP,-1);



All times are GMT +2. The time now is 15:14.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.