How to restrict a cell or make it unique.
=== === === === === === === === === ===
I was thinking about the option for a bar fight in a tavern, then I thought how to prevent NPCs from killing each other outright, then I thought about a way to restrict the actions in a cell, then I generalized the idea, and looked at the bigger vista and came to a more general conclusion that can do a lot of functions including restricting actions in a cell.
Different cells could restrict specific action types, and/or restrict usage of specific weapons and spells, so for instance in a bar, the usage of lethal weapons and spells would be restricted and NPCs would not initially try to use them, so when a fight starts, they would use non-lethal weapons and spells on each other.
But for instance, if the player joins the fight and start hacking at them with a blade, then other NPCs, especially guards would start using the more serious weapons and try to attack the offender.
Those restricted cells can be implemented in other ways, so for instance when you are in a shop, cathedral, or an NPC's house, if you draw out your weapon, because that place is marked as restricted cell, you will be reminded to sheath the offender, or else, and after a while, if not heeded, the shop owner, or the host, or the priest would call for a guard to take care of the situation.
Unless you are a true friend with the shop owner or the house host, which would only result in voicing a remark on the quality of the weapon or some such response.
=== === === === === === === === === ===
But those restrictions can be a part of a greater system, like this:
We can have a system in which we can define a series of conditional checks to perform actions based on the conditions, and gather those conditional actions under a group or template and apply those templates to cells.
So a Template can be called "No weapon should be drawn.", or "Non-lethal fights." and so on...
Then we can apply any number of those templates to any cell, and modders could design their own cell command templates and add them to any cell they like to add new effects to an aspect of the game-play in those cells.
Effects like prohibiting fast travel, or making an upward current to make it hard for a person to reach to bottom of a water well, or applying the rules of an arena and its fighting styles, or changing the behavior of the population in a specific place, and so on...
Cell command templates are made of some predefined flags that would have some specific meaning to the game engine, and optionally some rules that add more variation to the cell's change of behavior.
Flags are like this:
- Cell type: Dungeon, city, wilderness, and the like...
- Cannot fast travel from here or to here.
- Peaceful place, so no weapon should be equipped.
- Non-lethal fights, like in bars.
- Zero health means unconscious, not dead.
- Outland, so gradually force the players to retreat to the inland places.
- ...
Rules are like this:
- For each NPC, if the fight target of the NPC has equipped lethal weapons or spells, then negate the non-lethal place flag for the current NPC.
- For each NPC, if the cell owner's disposition is friendly with the NPC, then negate the peaceful place flag for that NPC, once.
- For each Object, if the Object is sank below water surface more than "D" units then give it a force upwards in proportion to the depth.
- For the first NPC that is not in the player group and has seen the player, first run to the big cathedral bell and ring it, then continue with normal behavior of the situation.
- For the first NPC that sees a dragon approaching, run to the big cathedral bell and ring it and warn the gathering folk about the dragon.
- For each guard who sees the Overseer passing in front of him, stand still, and hail the Overseer, and stand in attendance until he passes, before reverting to normal behavior.
- For each NPC in the fight, if the health percentage goes below a specified value, then surrender and run out of the place.
- ...
Each rule has a target and a condition to be fulfilled, and then a block of scripts that gets executed any time a target is found for the rule and the conditions are fulfilled.
Just think about the possibilities.