[WIPz] NPC ACE - NPC Advanced Control Engine

Post » Wed Mar 30, 2011 9:02 am

No feedback since I uploaded, a week ago.

As it is in a group with a big headline: "THESE ARE NOT PLAYABLE MODS", I don't expect any downloads or feedback from the general public.

I suppose it will take a while until some modder gets interested enough to try it, dig into the code and use it to do something else.
Didn't notice it until now. Grabbing it.

As I mentioned in the first post, I did not removethe log system I have in place to track scripts. Very useful for debugging. Designed to work with shadeMe's Conscribe, it spits hundreds (thousands?) of lines per second to the console. It is originally turned off. To turn it on, go to the user function zzzInitializeMod and change the line "let g.bDesvMode := 0" to "let g.bDesvMode := 1" and restart the game from a clean save. I must write a Wiki article about it someday.
Have any plans to switch over to ConScribe's actual log functions ? Just curious.
User avatar
Ella Loapaga
 
Posts: 3376
Joined: Fri Mar 09, 2007 2:45 pm

Post » Wed Mar 30, 2011 12:41 am

Have any plans to switch over to ConScribe's actual log functions ? Just curious.

Well . . . I am so happy with Conscribe 20 that [I am embarrassed to admit] I did not follow the improvements you've been adding to the tool.

Just downloaded it and will check very soon.

But I must add that I use it all the time. Maybe 1/3 of the times, I setup the tests and just enter the game, wait a few seconds, exit and work based on the Conscribe log (which is usually more than 100k lines long) .
User avatar
Philip Rua
 
Posts: 3348
Joined: Sun May 06, 2007 11:53 am

Post » Wed Mar 30, 2011 11:27 am

No feedback since I uploaded, a week ago.

As it is in a group with a big headline: "THESE ARE NOT PLAYABLE MODS", I don't expect any downloads or feedback from the general public.

I suppose it will take a while until some modder gets interested enough to try it, dig into the code and use it to do something else.


Didn't notice until now. I've actually started early work on an NPC related mod and have been looking into way to make their behavior more interesting.
I was starting to do some scripting myself, but if your already developing an elaborate framework...wow Awesome!
I am VERY interested in this project.
User avatar
Trista Jim
 
Posts: 3308
Joined: Sat Aug 25, 2007 10:39 pm

Post » Wed Mar 30, 2011 5:23 am

Didn't notice until now. I've actually started early work on an NPC related mod and have been looking into way to make their behavior more interesting.
I was starting to do some scripting myself, but if your already developing an elaborate framework...wow Awesome!
I am VERY interested in this project.

When you look at the code, feel free to post any questions you may have and I will be glad to elaborate.
User avatar
JESSE
 
Posts: 3404
Joined: Mon Jul 16, 2007 4:55 am

Post » Wed Mar 30, 2011 4:53 am

My thoughts on this:
"WOW"
now, if skycaptain, Reneer and you mix to make a nice "all around" framework for AI, this would be as groundbreaking to the general public as Godrays, SSAO and DoF. If not, it will remind as a local feature, something not many mod users like to use, we have nearly all Tamriel, right now, making a small island is nice to test a POC, but this could be EPIC if used on all vainilla guys.
If the framework is done, very complex intercations could be made, such as reviving the Goblin Wars mod, or even finally making a good Daedric Invasion one. If I was you, I'd aim for the fremework, so it was sort of an AI-COBL.
((Don't know if I have expressed myself well... in any case, your work is INCREDIBLE. Keep it up, I'll be looking at your advances with my HDD ready for your releases :D. I have red light district on, but my PC is not in anvil, and I have fastravel disabled))
User avatar
Bambi
 
Posts: 3380
Joined: Tue Jan 30, 2007 1:20 pm

Post » Wed Mar 30, 2011 7:21 am

Thanks!

The Anvil Red Light District was the test case I used to create and exercise the concept (how did you get it, btw?). It got quite complex in order to deal with the requirements of the mod.

This NPC ACE is a more elegant and synthetic version of the first. I adjusted and simplified it to be used as a framework.
This is still a first version and further development will depend on the demand, either my own, when I apply it to The Evolving Society or from any of you that may be interested in using it.
User avatar
Honey Suckle
 
Posts: 3425
Joined: Wed Sep 27, 2006 4:22 pm

Post » Wed Mar 30, 2011 1:50 am

It would be awesome if someone made a mod that used this system to bit-by-bit replace almost all of the NPCs in Cyrodiil.


Should take only 20 years or so. ;)

No offense meant! But Oblivion uses over 1000 NPCs. I agree, the effect would be startling, but for one person or even a team to do it, in their spare time, without achieving anymore than more decisions from NPCs you watch wouldn't begin to match up to the pride one gets out of actually designing a quest system that includes a few NPC ACE-created people. Or imagine what could be done with only two companion NPCs, with much more elaborate dialog, using NPC ACE? Much more opportunity for a modder to concentrate. And to get something done in a reasonable length of time, too.

This really looks exciting. We've needed a more drilled-down rules applying system for NPCs since the game first came out.
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Wed Mar 30, 2011 2:25 am

I dl'd this earlier today but I haven't had a chance to test it yet. I did crack open the .esp and, by the Nine Divines, there are a lot of scripts in there! It's probably going to take me weeks to dissect it and figure out how it all hangs together. I've actually been working on expanding NPC interactions with the player and other NPCs for my own mod and this looks like a great complement to it. Since my mod is a custom world mod with all new NPCs and locations I think it will be a great opportunity to test it on a large scale. Very excited about this, if you can't tell. :)
User avatar
Scared humanity
 
Posts: 3470
Joined: Tue Oct 16, 2007 3:41 am

Post » Wed Mar 30, 2011 2:48 pm

Yes, there are a lot of scripts, but only a few you have to look at first:

The engine control is composed of 5 scripts that handle moving the NPCs from activity to activity and from stage to stage within an activity. There is a short description in the script: aaaaqqacDocsSCRIPT (along with the naming convention).

Then there are the zzActionXXX functions: one event driven function for every action (stage).
These are the ones you will need to write to handle actions you want to add to the NPC. This is where his 'personality' lies, as you may insert code that will make decide on their next line of action. For example, at arriving at a bar, you may have an "Acquire" action, were the NPC will anolyze the other NPCs at the bar and decide what to do, like chatting or fighting.

Most of the remaining functions are auxiliary and their names should help you to figure them out.

Please, feel free to post any questions you may have.

Oh . . . I must mention that I am not the most disciplined guy in the world. If you find a comment that seems out of place, it probably IS !! (most likely a leftover from copy-paste)
User avatar
CArla HOlbert
 
Posts: 3342
Joined: Wed Feb 21, 2007 11:35 pm

Post » Wed Mar 30, 2011 3:05 am

A large size and/or large quantity of scripts don't, necessarily, mean that they will drag CPU resources.
It really depends on what they do and how frequently they run.

In general, scripts don't affect performance enough to be noticeable, unless of course they do some heavy stuff every single frame. But, even doing just a little, they add up, therefore it is always good practice for scripters to try to reduce processing as much as one can.

In this particular engine, although there are dozens of scripts, they only run from every few seconds (for NPCs going from one place to another) to every few minutes (for NPCs doing things like eating, wandering or sleeping) per NPC.

Therefore, even with 100 NPCs, I still would not have one NPC processed per frame, which, I believe, is pretty light on CPU.

All right, thanks. Therefore if I create two quest scripts (each consisting of 10,000 lines) which control the activity of, let's say 200 NPCs, shouldn't cause trouble for performances. But when you mentioned
...heavy stuff every single frame...

what are the examples of these?
User avatar
Reanan-Marie Olsen
 
Posts: 3386
Joined: Thu Mar 01, 2007 6:12 am

Post » Wed Mar 30, 2011 6:17 am

All right, thanks. Therefore if I create two quest scripts (each consisting of 10,000 lines) which control the activity of, let's say 200 NPCs, shouldn't cause trouble for performances. But when you mentioned
Only if you're speaking hypothetically - The interpreter places a hard-coded limit on the size of a script (~30.4 kb). Which should translate to say, a thousand lines of code.

I couldn't resist ...
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Wed Mar 30, 2011 5:10 am

All right, thanks. Therefore if I create two quest scripts (each consisting of 10,000 lines) which control the activity of, let's say 200 NPCs, shouldn't cause trouble for performances. But when you mentioned
what are the examples of these?

That quest of yours may be either a disaster or not bother at all. Depends on how you built it.

If you are checking each and every one of those 200 NPCs every single frame, it may well lead to a very bad game performance.

Conceptual examples (don't take them to the letter):

Example 1 - Suppose your zillion lines of code are surrounded by "if gamehour < 0.1". They will only run at midnight and may give the game a hiccup once a day, probably nobody would notice it.

Example 2 - Or if you do like I did on this engine: NPCs are processed only at certain moments of their daily activities, averaging, maybe, once or twice per game hour. 200 NPCs, each processed once per half-hour (30 game minutes = 1 real minute ~= 1800-2400 frames), is still one NPC every 10 frames or so. Even at one-NPC-per-frame, it would not be heavy (I guess). So there is a lot of room to add new activities here.

Example 3 - As shademe noted, scripts have a size limit. I've just had to split a 1000 line script in my ship rocking mod because it exceeded the size limit. While the mod has these two very large scripts, their function is to recover from a very unlikely situation and only if the player clicks on a certain object. So, although large in number of lines, they don't affect performance at all, as they are, actually, never executed.

Hope it helped clarifying things for you.
User avatar
Neil
 
Posts: 3357
Joined: Sat Jul 14, 2007 5:08 am

Post » Wed Mar 30, 2011 5:27 am

What is the exact nature of the tokens that control npcs in certain situations. Are they rings? Playable or unplayable ( seen or invisible )? Are they equipped?
User avatar
jason worrell
 
Posts: 3345
Joined: Sat May 19, 2007 12:26 am

Post » Wed Mar 30, 2011 4:32 am

What is the exact nature of the tokens that control npcs in certain situations. Are they rings? Playable or unplayable ( seen or invisible )? Are they equipped?

MMMMMGFFFFPPPHHHHHWUAHHAHAHAHAHAHAHAHA!!!!!!! :biglaugh:
Ok, seriously. It's a programming reference no "physical" tokens. you can't play them, or wear them, in fact, you'll never see them. They're just code.
Now, why did I think of a Bimbo cheerleader when reading your post? and why do I feel it lacks "Can you eat them?"
User avatar
saharen beauty
 
Posts: 3456
Joined: Wed Nov 22, 2006 12:54 am

Post » Wed Mar 30, 2011 8:08 am

What is the exact nature of the tokens that control npcs in certain situations. Are they rings? Playable or unplayable ( seen or invisible )? Are they equipped?

There are no tokens added to the NPCs whatsoever.
At first, I thought I would use tokens, but I found a way without them. Token scripts typically run all the time (when in scope) and, as I mentioned earlier, I am trying to avoid those kinds of scripts.

NPC activities are controlled 'from the outside', so to speak.

The system keeps track of what the NPCs are doing and sets them to new activities (and new AI packages) whenever necessary. As a timer, the system (or engine, as I call it) runs all the time, mostly doing nothing, but taking action when needed. This way, the system controls NPCs even when they are not in scope/loaded.


@ jhondidfool - I don't see anything wrong with nenina's question or phrasing. It is a legitimate question. Tokens were considered as an option, as discussed earlier.
User avatar
Emily Shackleton
 
Posts: 3535
Joined: Sun Feb 11, 2007 12:36 am

Post » Wed Mar 30, 2011 1:40 pm

Any updates?
User avatar
Emily Jones
 
Posts: 3425
Joined: Mon Jul 17, 2006 3:33 pm

Post » Wed Mar 30, 2011 10:10 am

You know, I just realized something, and MAYBE this is the right place to mention it... during inclement weather, I want NPCs to try and find shelter! I mean, come on! It's a frakking thunderstorm, and you're prancing around like it's the middle of May? Guards, I get. Guards have to be there. But regular guys and beggars should do their best to get indoors.
User avatar
Austin Suggs
 
Posts: 3358
Joined: Sun Oct 07, 2007 5:35 pm

Post » Wed Mar 30, 2011 11:43 am

Already in place, if I recall correctly.
User avatar
Victor Oropeza
 
Posts: 3362
Joined: Sun Aug 12, 2007 4:23 pm

Post » Wed Mar 30, 2011 7:23 am

You know, I just realized something, and MAYBE this is the right place to mention it... during inclement weather, I want NPCs to try and find shelter! I mean, come on! It's a frakking thunderstorm, and you're prancing around like it's the middle of May? Guards, I get. Guards have to be there. But regular guys and beggars should do their best to get indoors.



Yeah like Shademe said it's already taken care of. Refer to the page before this one.


Any progress?
User avatar
Shae Munro
 
Posts: 3443
Joined: Fri Feb 23, 2007 11:32 am

Post » Wed Mar 30, 2011 11:13 am

Any updates?

Any progress?

Well . . . as I see it, this version of the NPC ACE is done and I have no plans to work on it, at the moment.

I mean, I consider this first version of the 'engine' as finished.
It provides the necessary infrastructure to control NPCs, and is ready to be used by modders that may need it.

So, I am in a 'wait state', waiting for any modder that chooses to use it and I am willing to work together to support the use of the engine in whatever new situations that may arise.

Only by applying it to 'real' mods, we will be able to determine new requirements for the engine core and, being the case, release new versions.


You know, I just realized something, and MAYBE this is the right place to mention it... during inclement weather, I want NPCs to try and find shelter! I mean, come on! It's a frakking thunderstorm, and you're prancing around like it's the middle of May? Guards, I get. Guards have to be there. But regular guys and beggars should do their best to get indoors.

Yes, this is what I used NPC ACE for (as a demo kind of thing): selected NPCs from the Anvil dock area (1) will not wander outdoors if it is raining, (2) will run to their destination if it starts raining and (3) will wear some raincoat if they are home and have to go to some other building.

Now it is a matter of somebody considering it worth taking the time and patience to do the work of applying it to other NPCs. It is kind of time consuming as each NPC AI has to be anolyzed and converted to NPC ACE activities (by filling arrays with data in selected initialization scripts)

Considering the cost-benefit ratio, I am not sure this particular use of NPC ACE will ever happen.
User avatar
ZzZz
 
Posts: 3396
Joined: Sat Jul 08, 2006 9:56 pm

Post » Wed Mar 30, 2011 12:17 pm

Considering the cost-benefit ratio, I am not sure this particular use of NPC ACE will ever happen.

I am actually looking into it, but my workload is pretty intense so progress on this has been pretty slow. I've been developing my own AI 'overhaul' which replaces the Vanilla persuasion system with a role-playing persuasion system which takes into account the NPC's personality (defined by a series of type flags) and the NPC's opinion of the player (defined by a combination of type flags and multiple disposition indexes). I would like the systems to work in synergy and complement one another, with NPC ACE handling the schedules and my own system handling disposition and persuasion but it's too early in the development phase to form any kind of opinion on the feasibility. That and I'm still learning a lot about scripting, which is definitely my weak area. Decoding the NPC ACE scripts is going to take me a while.
User avatar
Heather Stewart
 
Posts: 3525
Joined: Thu Aug 10, 2006 11:04 pm

Post » Wed Mar 30, 2011 7:58 am

Oh . . . I meant it is unlikely someone will go thru all 2000+ vanilla NPCs and convert their schedules to NPC ACE activities (high cost in time and patience) just to make them run from the rain (small benefit, in my opinion).

- - - - -

I suppose it should work well together with your persuasion and disposition system. Even more so if you intend to handle NPC disposition toward each other and the disposition would alter their schedules or behavior.
User avatar
Robert
 
Posts: 3394
Joined: Sun Sep 02, 2007 5:58 am

Post » Wed Mar 30, 2011 4:01 am

Well . . . as I see it, this version of the NPC ACE is done and I have no plans to work on it, at the moment.

I mean, I consider this first version of the 'engine' as finished.
It provides the necessary infrastructure to control NPCs, and is ready to be used by modders that may need it.

So, I am in a 'wait state', waiting for any modder that chooses to use it and I am willing to work together to support the use of the engine in whatever new situations that may arise.


You might consider putting the download link in the first post, then. It took me a bit of searching to find it. :)
User avatar
City Swagga
 
Posts: 3498
Joined: Sat May 12, 2007 1:04 am

Post » Wed Mar 30, 2011 2:29 pm

You might consider putting the download link in the first post, then. It took me a bit of searching to find it. :)

Done! Thanks.
User avatar
Code Affinity
 
Posts: 3325
Joined: Wed Jun 13, 2007 11:11 am

Post » Wed Mar 30, 2011 11:47 am

It'd be pretty sweet if there was a project to get this system working for NPCs in Oblivion.
User avatar
Stephy Beck
 
Posts: 3492
Joined: Mon Apr 16, 2007 12:33 pm

PreviousNext

Return to IV - Oblivion