I've been a huge fan of SCP:CB since I first laid eyes on it back in Halloween, and just last night I started delving into the source code with this grand idea that I should find something to try to improve, then release here to see if it's worth any salt. So anyway, I decided to look into improving the AI of the MTF and guards, and in doing so learned that it'll be hard to make any headway with the way all the NPC logic is stuffed into NPCs.bb, and how the entire logic for each character is a series of flow controls called on every tick of the game engine inside a massive foreach.
So, I'd like to take on a bigger task, and rebuild each of the SCPs so that they can target each other (and the player), as well as switch targets at any time if it becomes more opportune to chase one entity rather than another. In doing so, it would also be possible to implement some complex, fuzzy logic in order to determine under what conditions an NPC will switch targets, which brings us full circle to improving the AI of the MFT and guards.
Anyway, I'm posting here to gather warnings or thoughts from anyone who might have any experience implementing more conventional AI in Blitz3D? Does anyone forsee any pitfalls in doing what I hope to do, or are there any big reasons why this method was avoided in the design of current NPCs? This is also my first time using Basic, though I'm not unfamiliar to programming (suffice to say, the language looks really simple).
To sum up, my goals are as follows:
- Make each NPC aware of every other NPC.
- Allow NPCs to focus on a single hostile target, or no hostile target at any time.
- Allow NPCs to switch targets according to some sort of fuzzy logic, so that they don't immediately focus on the most opportune target 100% of the time, and so they don't switch immediately.
- Put an end to having everything face the player all the time and lay the foundation for populating the game world with other characters, and have them get hunted down in adjacent rooms to the player in the early stages of the game.
- Refactor the code so that each NPC gets it's own .bb file, or else NPCs.bb will just continue to get redonculously big as more content gets added to the game.
- Add more stats to modify abstract things like how quickly NPCs can become aware of others.
- Possibly add a system for scheduling events on a per-creature basis, rather than "calculating a number each tick between 0 and 500 and checking to see if it = 1 to see if I should make a sound" -sort of design
- Implement different behaviours for attacking and reading targets depending on whether they are a player or another NPC (dragging an NPC into the pocket dimension should just kill things that aren't the player)
- [**Edit**] Removing camera zoom behaviour from individual NPCs, and making it a universal behaviour of all NPCs (using data stored in .ini to determine strength and style of effect for each)