Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > Advanced MUD Concepts
Click here to Register

Reply
 
Thread Tools
Old 12-11-2003, 01:59 AM   #1
Jherlen
Member
 
Join Date: Jul 2002
Posts: 47
Jherlen is on a distinguished road
Eventually, I'd like to put a system in on my MUD that can measure the population of VNPCs at a certain place at a certain time. An example situation where this might be handy to have is for law enforcement. Suppose that a player decides to kill someone in the middle of a populated city. Although there might be no players or mobs except the player and his victim in the room, and perhaps even the rooms nearby, since the area is a city it makes sense that some VNPCs might have seen him.

I've seen some games without this system in, meaning it's possible to commit murder in Town Square without anyone even knowing it was you who did it. I've also seen the reverse, where any lawbreaking done in a city or populated area gets you wanted for the crime, no matter where the crime took place. I don't like either approach - I'd like players who try and kill someone on a busy street in broad daylight get caught for it, but dragging someone into a dark alley at midnight should still be plausible.

I'm still considering the best ways to implement this. Adding a "population" field to rooms seems too simple, since there would be more people outside during daytime hours than evening, and less people outside during rain, snow, etc. I can't think of any better way for builders to set populations in their areas without it becoming a lot more complicated, though. Should I go ahead with having them set a general value, and let checks in the code account for external factors, or is there a better way? Has anyone implemented anything like this before, or seen it done?

Any help or ideas would be greatly appreciated. Thanks a lot.

Jherlen
Jherlen is offline   Reply With Quote
Old 12-11-2003, 09:52 AM   #2
Quicksilver
New Member
 
Join Date: Apr 2002
Location: Toronto, ONT, Canada
Posts: 23
Quicksilver is on a distinguished road
Send a message via Yahoo to Quicksilver
Unhappy

This might not help your question, as I don't code, but imho having a room check isn't bad. For instance have the code check the room itself and the surrounding rooms for the base population and use that as a basis for a percentage check on whether the person is seen.  You can even tie your weather code and daylight code into this by making them influence the percentage one way or the other.  (A bright, sunny day would increase any percentage of being caught. Dark, moonless night during a blizzard would certainly decrease the chances.) The simple approach is usually the best. (On an unrelated note, I've never seen the term Vnpc, so I'm very curious what the V stands for.)

Your post did give me an idea, though. Dark alleys also tend to have their share of the criminal element. You might want to have a seperate mob flag which can influence your population count in those rooms. Have one which has a 50% chance of affecting the player getting caught, and a flag which keeps the mob out of the equation entirely.
Some people would turn you in if they thought they could get something out of it, but they might have other reasons for not turning you in as well. But, there are always going to be people who won't turn you in, no matter what, because they wish to avoid the law entirely.  (An assassin stalking a victim near where you did your muder would be loathe to advertise his killing ground.  A sneak thief, otoh, might turn you in, hoping his crimes my get pinned on you.)

--QS
(Whose coder HATES when she, or someone around her, gets and idea, because she starts free-associating.)
Quicksilver is offline   Reply With Quote
Old 12-11-2003, 10:15 AM   #3
tresspassor
Member
 
Join Date: Jun 2002
Location: Minneapolis
Posts: 45
tresspassor is on a distinguished road
I'd add three flags to a room:

populationType
populationTotal
populationTimeSequence

populationType

1) middle class consumers, average people, like what you would expect at a mall

2) upper class business, more what you would expect with people going to work in a corporate building

3) lower class consumer, the type of people that would be found at salvation army, thrift stores, dollar stores etc

4) lower class urban, your average slums, ghettos

5) middle class urban, suburbia

etc

populationTotal
An average number of people that could be in the room, you could even use a fuzzy logic value then an actual number.

0.0 it is empty, 0.5 the area is pretty crowded, 1.0 the place is packed (nightclub)

populationTimeSequence
Just a list of generic times that you could use to determine how many people should be there when:

1) General day workers: People usually only show up around here from 8:00am to 10:00am, and then it drops down to almost no-one, and they show up again around 4:00pm to - 6:00pm

2) General nightclub: The place is completly empty and starts getting a few people around 7:00pm, then it gets really packed from 10:00pm till 3:00am

3) Shopping Mall, from 8:00am till 5:00pm it is fairly empty and then picks up from 5:00pm till 9:00pm.

I'd then use these time outlines to change the population when someone enters the room. You could also have some pre-coded messages:

Example:
8:00am
Shopping Mall
A very typical shopping mall.
There are a few groups of people walking around.

6:00pm
Shopping Mall
A very typical shopping mall.
The area is crowded with people.

You could then use the populationType to determine what would happen during a specific event.

You could extend on the populationTimeSequence to allow builders to choose during what time what type of people will be there and how large the group will get.

If you want weather to be a factor you could put a general modifier on outside rooms: Calculate total population as normal, subtract 10% if weather is stormy, 40% if weather is snowy, 90% if it is raining fire etc.
tresspassor is offline   Reply With Quote
Old 12-11-2003, 10:34 AM   #4
Jazuela
Senior Member
 
Join Date: Apr 2002
Location: New England
Posts: 843
Jazuela will become famous soon enoughJazuela will become famous soon enough
Why not just have a crim-flag for rooms? If the flag is set on, then it's a room where people can get auto-arrested for commiting crimes. If it's set off, then they can't.

Either a room is populated enough that someone will notice a crime being committed, or it isn't, or maybe it's a place where everyone's a criminal and no one cares, or maybe it's a place that is sparsely populated, but the only VNPCs around are soldiers who are looking for criminals.

No matter "why" the person can or can't get arrested, it seems that flagging the room as either "arrestable" or "not arrestable" looks like it would solve the problem. Plus it can easily be toggled the other way if you decide to rewrite the room to reflect a plotline change in the area. Or even turn the flag off to allow for a plotline that would be ruined if it was turned on. Like a total exodus of soldiers to a neighboring area to combat the bad-guys.. in which case that area is now free of soldiers, allowing criminals to do their worst.

And then toggle it back on when the bad guys are dealt with and the soldiers return to their usual post.
Jazuela is offline   Reply With Quote
Old 12-11-2003, 12:12 PM   #5
Spazmatic
Member
 
Join Date: Mar 2003
Posts: 103
Spazmatic is on a distinguished road
You'll still want some sort of "populationType" (probably not that exactly). The reasoning is that, as you said, stuff changes with time... Unless you want to manually set flag change times for each room, it may be easier to simply set what population types are considered, so a simple greedy alg can go through and flop 'em all as appropriate when time passes.

Possibly easier would be a list per room of all "arresting" elements... That way, you could classify criminals, blind men, etc, into one group, and just be stuck with a list for, say, soldiers, private guards, upper class, middle class, and tourists. Simply checking through at each tick if one of these is "active" at that time would give a fair approximation.
Spazmatic is offline   Reply With Quote
Old 12-11-2003, 03:38 PM   #6
Fharron
New Member
 
Join Date: Jun 2003
Posts: 26
Fharron is on a distinguished road
Why limit it to rooms? I’m not sure what zone system you are using, whether each zone is allocated 100 rooms or whether variable room allocations are an attribute of your codebase.

Wouldn’t it be simpler and cleaner to assign populations to zones and then use Boolean functions to draw from these total figures? You could even add a series of zone specific population flags, say

Small  Population  001 – 1001
Medium Population 1001 – 5000
Large  Population 5001 – 10000 and so on

For example town A has a small population flag giving it 1000 people.

If room sector = street then present population = 20 (totalpop/50) (1000/50)

If room sector = indoors then present population = 5
(total pop/200) (1000/200)

If room sector = street & time = night then present population = 2
((total pop/20)/10) (1000/20)/10)

You could even spice up the system by embellishing the information associated with the zone flags. Perhaps change the base population from a simple fixed number and add a random element, or develop it further and link NPC type breakdowns to it.

Small city encounters suffix

00-50  Peasant
50-60  Artisan
70-90  Soldier
90-100 Noble

Two people see the player in the street during the nighttime hours. One of them is a peasant and the other a soldier of the watch.

Moving further along why not tie the present population representatives to different motivational forces, perhaps the zone has an alignment and there is less chance of PPR’s bothering if they see a PK attempt in evil zones. My personal preference would be to parse the generated PPR’s through a character/motivation function giving them attributes from a list – scoundrel, justicar, timid, screamer, and so on. In this way the villainous character could be spotted by a scoundrel who simply ignores them, a justicar that takes them to task, or a drunken justicar who cant be bothered making a fuss, whatever degree of complexity floats your boat.

You could call the creation of PPR’s in response to specific acts performed or in line with room entry passing write over variables to the room. These could be used to pop mobiles, provide data for a look/scan assessment, activate emotes or whatever.

The system could also provide the opportunity to cross-reference the population data with other city systems, if there is a drought lower population, if shop trade is high increase frequency of traders, if town monetary supply is low then reduce frequency of guards and so on.

Hard coding it and linking it to an internal system would remove the need for builders to think about every individual room, the parameters you set would do the work for them, thereby reducing the possibility of errant allocations and the potential for game balance deficits between areas.
Fharron is offline   Reply With Quote
Old 12-11-2003, 04:07 PM   #7
tresspassor
Member
 
Join Date: Jun 2002
Location: Minneapolis
Posts: 45
tresspassor is on a distinguished road
All of these sound great

IMO I don't know if Soldiers and Guards should be part of the VNPC population. They should be real walking-interacting NPCs (because if you kill someone with a Guard in the room he should attack you)

From what I gather the VNPC population isn't about specific roles like that (guard, soldier, fireman etc). It is just a summary of people so typical they don't deserve to be real NPCs.
tresspassor is offline   Reply With Quote
Old 12-11-2003, 08:42 PM   #8
Spazmatic
Member
 
Join Date: Mar 2003
Posts: 103
Spazmatic is on a distinguished road
Quote:
Originally Posted by
From what I gather the VNPC population isn't about specific roles like that (guard, soldier, fireman etc). It is just a summary of people so typical they don't deserve to be real NPCs.
Even typical people have lives. For example, the mercantile center of the city may well be a hot spot for "get caught, get shackled" during weekdays, but on Sunday, it could be quiter than a graveyard. How would you model that without some sort of roles? It seems to me that roles, at least in a very vague sense, would help with realism.

And, the reason I suggested guards and soldiers is that, well... I've yet to see a mud garrison with the appropriate number of soldier mobs hanging around, and it'd be nice to model how many are where when, or so I imagine. That way you can't walk in and kill the one sleeping soldier in the barracks just because no one bothered to build the other five.

Then again, it adds bloat, complexity, and confusion to an otherwise simple system... Oh, the tradeoffs that make life so utterly confusing.
Spazmatic is offline   Reply With Quote
Old 12-12-2003, 12:16 AM   #9
tresspassor
Member
 
Join Date: Jun 2002
Location: Minneapolis
Posts: 45
tresspassor is on a distinguished road
I know what you mean about a limited number of real guards.

some thoughts:

A crime happens

The number of people in the room will determine the % chance that someone will alert the guards

The type of people in the room will determine the % chance that someone will alert the guards

The type/number of people in the room determines how much useful evidence is recorded (person's description, clothing, weapon etc).

If the guards are alerted automatically they then proceed from their current position to the room. If the player gets away then decide (with the above information) if the guards have enough information to spot the person the next time he/she goes by one.

If they don't have enough information determine how long it will take (if ever) for the guards to have enough information. This could simply be a time-counter, estimate X hours before the guards figure out whodunit based off eye-witness-accounts and descriptions.

So if the person tries to shoplift in merchant square noon on Sunday the guards get alerted immediately. If the player runs off then there will probably be enough eye-witness accounts for the guards to send out a warrant and find the person next time he walks by.

If the person does the same thing at 7:00am and gets away it may take the police 48 hours before they "gather" enough evidence to find this person.

If the person does the same thing at midnight then they may never catch the person.
tresspassor is offline   Reply With Quote
Old 12-12-2003, 08:15 PM   #10
Spazmatic
Member
 
Join Date: Mar 2003
Posts: 103
Spazmatic is on a distinguished road
That's a nice algorithm, greedy and simple, yet effective. However, I think the main problem still exists... Storage? It seems a pain to store a dozen NPC population archetypes and their respective levels for each semi-busy room. Anyone have any ingenious solutions?
Spazmatic is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 12:15 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014