Maximum Number of NPC

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Maximum Number of NPC

Post by Donfrow »

I may not be remembering correctly, but I seem to recall there being a limit to the number of NPC's that can be created but I am having difficulty finding a reference to it. I think there is a limit as I have likely run into it as I am up to NPC 355 and when I try to create a new one it looks like it's going back to hard coded usecode 0x400 (Avatar) and crashes the game when trying to create a new NPC. This makes me think 356 (including 0 for Avatar) is the limit.

Is this something that is hard coded/set in the engine that will not be changed? I'm guessing since the Avatar constant is -356 if it were possible it would be quite a bit of work that is unlikely to be done, or is simply not possible?

Luckily I'm not at a dead end as I can still snag quite a few NPC's from the original game that are currently performing their original Serpent Isle business in the original (though somehow completely broken map/world) world of Serpent Isle, but knowing that I'm hard capped at 355 will help me plan how I move forward with Glimmerscape2.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Number of NPC

Post by Dominus »

from irc:
@Dominus: Marzo: Donfrow on the forum is wondering about the maximum number of NPCs. He can't add more than 355 - I thought we'd allow more, but never thought about it...
@Dominus http://exult.info/forum/viewtopic.php?f ... 7f0f4f6885
@Marzo It ought to be possible
@Marzo I remember having to special case a few to avoid issues with -356 (whole party) and -357 (avatar) constants used in usecode
@Marzo So the fact that going above 355 is giving issues is not entirely unexpected, but it should have been possible
@Dominus " I think there is a limit as I have likely run into it as I am up to NPC 355 and when I try to create a new one it looks like it's going back to hard coded usecode 0x400 (Avatar) and crashes the game when trying to create a new NPC. This makes me think 356 (including 0 for Avatar) is the limit."
@Dominus so probably more an issue of being able to jump over 356 and 357?
@Marzo Yes
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Number of NPC

Post by Donfrow »

It would seem I am not remembering correctly about a limit then... that could explain why I could not find any references to it.

I will putt in a bug on the github for it. Trying to get better at using the various/proper channels for these things. I didn't realize there was an irc channel for Exult.

Thanks as usual Dominus.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Number of NPC

Post by Colourless »

Origin ran out of NPCs when developing The Silver Seed and used something of a hack to get around the problem using temporary npcs (monsters). I can't remember the exact details and how it worked with usecode.
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Re: Maximum Number of NPC

Post by Donfrow »

Perhaps that is what I am remembering. Wasn't the ranger that allows entrance into the Furnace one of these as well?

The method I've been using for some egg spawns are like this. I spawn via egg and set the usecode function on that spawned object which has the usecode for whatever they need to do/talk about. Currently doing this to make certain areas busier but for a lot of scripted sequences I find it much easier to use NPC's even if they are one time use. I tend to use quite a bit of them for that reason.
Locked