Is there any chance of raising the hard cap on maxseedist?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
malon3
Posts: 103
Joined: Fri Dec 26, 2008 4:41 pm

Is there any chance of raising the hard cap on maxseedist?

Post by malon3 »

This is in regards to A_LookEx for friendly monsters only, as the hard cap does not exist for enemies.

On the wiki it states:
maxseedist: the maximum sight distance of the monster, in map units. It will not see any players farther away than this. 0 means unlimited (as in Doom). Note that friendly monsters have a hard cap of 1280 map units for performance reasons.

I have long wanted a sniper companion. Is there a chance we can raise this flag or at least give a warning letting the programmer that there may be performance issues with setting it higher instead of outright banning the option altogether? I just prefer the choice with the realization that performance might be an issue.

Thank you for your time.
User avatar
Rachael
Posts: 13965
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Is there any chance of raising the hard cap on maxseedis

Post by Rachael »

This is what you will want to submit a feature suggestion for. Although, with the state of ZDoom development presently being uncertain, you will probably want to submit that on Github to the GZDoom repository as a suggestion on the issue tracker.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Is there any chance of raising the hard cap on maxseedis

Post by Graf Zahl »

I think that 'hard cap for performance reasons' is clear enough why it is there. It's simply that the farther away a monster can look for potential targets the more data it needs to process, and friendly target acquisition logic is not particularly cheap. For a range of 1280 it already has to check 20*20 = 400 blockmap blocks (= 128*10 in both directions) and with increasing distance it only gets worse.
malon3
Posts: 103
Joined: Fri Dec 26, 2008 4:41 pm

Re: Is there any chance of raising the hard cap on maxseedis

Post by malon3 »

Graf Zahl wrote:I think that 'hard cap for performance reasons' is clear enough why it is there. It's simply that the farther away a monster can look for potential targets the more data it needs to process, and friendly target acquisition logic is not particularly cheap. For a range of 1280 it already has to check 20*20 = 400 blockmap blocks (= 128*10 in both directions) and with increasing distance it only gets worse.
I mean no disrespect but, why can't the decision be made by the programmer and not the programming language? I understand your concern, but I feel it's unfair when I don't even have a choice in the matter of how well my map runs for performance, that it's mandatory I don't do something. I just wish it to be my choice, not a choice made without my consent.
User avatar
Rachael
Posts: 13965
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Is there any chance of raising the hard cap on maxseedis

Post by Rachael »

In theory I see nothing wrong with your suggestion. In practicality it is not my place to say how I think things should be in this regard, because in doing so I am speaking against the support that ZDoom has gracefully offered to older systems for so many years. Another thing going against me in my belief is the fact that DECORATE/ZScript is already cluttered from one end of the universe to the other with properties and flags, with an ever nonchalant attitude of "why not one more?" so many times over the years.

In this case, I defer to Graf's judgment on this - because as capable as I may be with changing it myself, I am sure he has his reasons for holding to it.

But that being said, Graf has already said at some point that he plans on enabling an "advanced" mode for ZScript - which doesn't hold your hand, allows you to access even deeper parts of the engine, and has a much greater potential to crash if you mess something up. This could very well wind up being one of those features that makes it in, at that point, but I cannot tell you if that will be the case because I do not know, and right now probably neither does Graf until he has the time and actually does it.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Is there any chance of raising the hard cap on maxseedis

Post by Graf Zahl »

The entire thing is a this '10':

Code: Select all

	other = P_BlockmapSearch (actor, 10, LookForEnemiesInBlock, params);
But like I said: P_BlockmapSearch is a relatively expensive call, it has to check every single actor in every single block, until it finds something suitable, that includes a P_CheckSight call for every single potential target in every block, it simply becomes too much if this gets increased. A 10 block distance already means checking 20x20 blocks. The main problem here is that it doesn't really matter if a block is out of sight completely, that cannot be checked, it still has to go through every single one of them, check everything in there and then reach further outward if no target can be found.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: Is there any chance of raising the hard cap on maxseedis

Post by Arctangent »

As a side note, I just realized that, because of this topic, we should be able to crack open the code on how friendly monsters actually work and write our own logic for it, at least unless I'm misunderstanding something.

Woo.
Locked

Return to “Editing (Archive)”