.:: 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
HL1 entities list?
Old
  (#1)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default HL1 entities list? - 22-12-2004

I wonder how the entities are stored in HL. Why? Because i need to be sure for a traceline function i am writing.

In HL1, i see for looping through clients, to know player index + entity, we use INDEXENT(index).

I see in the RACC code, the EXACT SAME THING, happens. So that means, we copy players too in the index. Though i am not interested in those!

My traceline function, is taking either an iPlayer index, OR an iEntity index. Since MY entities list starts with 0, i want to keep it this way. So you mean, ENTITY 10 in MY list, it must translate this index into the proper index of HL1 and then find the correct pEdict for it...

So far i have this:

Code:
 
	// when iEntityFires is set, so this entity should be ignored 
	if (iEntityFires)
	{
		// FIXME: Is this true or not?
		// The entity in half-life is indexed , 0 = worldspawn, 1 to > max players is the player
		// so , in order to know the correct entity compared to our list, we should somehow
		// compensate.
		//
		// so, in ITM_, the real entity list starts at 0
		// in Half-Life it starts at 1
		// , in ITM we have a SEPERATED clients list
		// , in HL its integrated in the entity list
		//
		//
		// so, to be sure ITM Index 0 equals HL1 entity 1 (cause 0 is worldspawn) we have to do
		//
		// entity_index = iITMEntityIndex+MaxPlayersInServer
//		pEntIgnore = INDEXENT (entity_index); // attempt to bind this entity's structure
	}
as you can see, only comments. My question is, is the theory correct?

And yes, i know, i could just copy the entire freaking list, what is 32 entities anyway at max? But even then...


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: HL1 entities list?
Old
  (#2)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: HL1 entities list? - 23-12-2004

Try looking through Quake code.


sfx1999.postcount++
  
Reply With Quote
Re: HL1 entities list?
Old
  (#3)
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: HL1 entities list? - 23-12-2004

The way you intend to do things would work, however I don't think it's a smart way to do things. To me players should also be represented as entities. Players should be represented as players to hold what the player knows about himself, and also as entity to hold what others know about him.

If you look in my code you'll see the player_t structure encapsulates a pointer to a corresponding entity_t structure.



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: HL1 entities list?
Old
  (#4)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: HL1 entities list? - 23-12-2004

my player is an entity itself too, but in my list. I could probably code it that way, like HL1 does. I need to rethink about my class hierarchial stuff then; either just add pointers... or keep it seperated

the reason to keep it seperated is, well, there is no need for encapsulated stuff. The bot just needs all info, and i retrieve all info. Nuff said? If any other bot would run (a different plugin, ie POD_MM) then it would not care about how i treat my data, as it just asks HL for data. So i don't see a reason. The only change is just the 'list' of data. Ie, in your case PMB, you would still look through your entities list, and i just look into the players list.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: HL1 entities list?
Old
  (#5)
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: HL1 entities list? - 23-12-2004

No, you haven't understood.
I *do* have two separate lists. The entity list and the player list. But the player list also features pointers to their respective entities.
This way, the entity structure holds data that is common to players and entities (render model, angles, speed, etc.), while the player structure holds data that is typical to players only.



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: HL1 entities list?
Old
  (#6)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: HL1 entities list? - 24-12-2004

Ah, oh well, thats not a bad idea at all

Its stupid though, in my case, i have a player class, derived from the entity class heh... so in a way, it has the same props as an entity, but it just aint in the same list. I could probably make a pointer to the list, but i still don't see a reason , since i can have the same props anyway.

Too tired to think clearly now and to make more sense...


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)
 

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