NPCs

General debates and discussion about the Guild of Writers and Age creation

Re: NPCs

Postby D'Lanor » Mon Jun 21, 2010 7:36 am

That depends on what you call "work". I have played with NPC spawners and they are not very hard to create for the existing avatar types. I can also make NPCs do existing animations. This requires Python script.

However, the method Cyan uses for Yeesha and Zandi in the Cleft is horribly broken in a multiplayer environment as was found out long ago in UU/Alcugs. When you turn autospawn on each player spawns its own NPC at link in :o and also removes that same NPC from the age on link out. That means you'll have twice the amount of avatars in the age with all the lag that comes with it. But the main problem is sorting out which of those NPCs to animate and make the event look the same to each person. And that requires a LOT of Python scripting.

It would probably be better to study the quabs since they do work in a multiplayer environment.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: NPCs

Postby diafero » Mon Jun 21, 2010 8:57 am

The POTS quabs do not, however. They are just as horribly broken: A full set of quabs is spawned for each avatar, and if I work around that via Python, there is no way for me to control (i.e. drive into the water) the quabs someone else spawned. Earlier Alcugs versions blacklisted the quab LoadClone messages and dropped them (leading to other weird issues), I changed the Ahnonay Python source to simply spawn no quabs online.
So, looking at the MOUL quabs my be helpful, but the POTS quabs are useless.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: NPCs

Postby Branan » Mon Jun 21, 2010 9:29 am

I think the MOUL quabs have the same problem - it would explain why there always seem to be extra quabs when you bring a friend to Ahnonay
Image
Your friendly neighborhood shard admin
User avatar
Branan
Gehn Shard Admin
 
Posts: 694
Joined: Fri Nov 16, 2007 9:45 pm
Location: Portland, OR

Re: NPCs

Postby D'Lanor » Mon Jun 21, 2010 9:31 am

That is strange. I don't expect POTS to be fully multiplayer compatible but just like MOUL it has autospawn turned off for the quabs. They are spawned through the Python code by PtLoadAvatarModel() (which probably doesn't exist in UU) . Of course POTS still executes this automatically as the age loads but it should be fixable... Edit: or at least it should be useful for the purpose discussed here.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: NPCs

Postby Egon » Mon Jun 21, 2010 11:25 am

D'Lanor wrote:I have played with NPC spawners and they are not very hard to create for the existing avatar types. I can also make NPCs do existing animations. This requires Python script.


Hmm, I was tempted to do studdings on my own of the topic, but I see no point in breaking open door.
Can You extract a simple example (in blender I presume :) ) of simple age which spawn NPC, and makes him do some animation after, I don't know, pressing a button?

I assume you talking about quickshot animations like "sit", "wave", "talk" etc. Or are You able to turn "walk" animation on and make spawned avatar move?
Combined with with ability to make avatar "talk", like in "send messages to KI" - I don't know if that is possible but assume that it should be - and we might have some ground for building ages with NPC.

BTW: Broken NPC system in multiplayer environment. Adlest now I know why Cyan made Cleft singleplayer-only, and why only in Cleft there are any NPCs.
Image
Egon #2052375
Who You gonna call? Guild of Doorcallers! #5356672
Eder Tsogal/Delin Marathon
Image
User avatar
Egon
 
Posts: 284
Joined: Fri Nov 16, 2007 9:45 pm

Re: NPCs

Postby D'Lanor » Mon Jun 21, 2010 3:19 pm

Here you go.

NPC Demo.zip
(61.66 KiB) Downloaded 210 times


The zip contains the blend file, but PyPRP 1.6 cannot create NPC Spawn mods.

So I modified the exported prp with libHSPlasma. To be specific with the command line tools prcc and prcdc (because PrpShop's editing functions are still rather limited). I added one Plasma object and edited two objects. They are also included in the zip. As far as prp editing goes this is a pretty simple one... just 3 objects.. ;)

The included Python code is still based on Cyan's Cleft version with the multiplayer bugs.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: NPCs

Postby Lontahv » Mon Jun 21, 2010 3:54 pm

Nice work D'Lanor. The last time I messed with NPC Spawner I had the Quabs spawn as Sutherland. :P I was hoping you had done something with the AI creature brains. It seems like coding avatar attack-zandis from Python would be possible, but only in MOUL. :cry:
Currently getting some ink on my hands over at the Guild Of Ink-Makers (PyPRP2).
User avatar
Lontahv
Councilor of Artistic Direction
 
Posts: 1331
Joined: Wed Oct 03, 2007 2:09 pm

Re: NPCs

Postby Agenotfound » Mon Jun 21, 2010 4:23 pm

I want them to run and jump in the water so badly ....

Image

but aren't the Quabs in Moul partially dependent of some code in the client itself ?
Image
User avatar
Agenotfound
 
Posts: 189
Joined: Mon Jun 29, 2009 7:15 am

Re: NPCs

Postby diafero » Tue Jun 22, 2010 5:52 am

Yes, I could change the Python to only call PtLoadAvatarModel() if nobody else is in the age - and IIRC I then even see the quabs spawned by the person linking in first. However, when I get close to them, they don't run away - my client has no knowledge about them, at least not in Python, it can not observe them (to update the clock) or anything. MOUL got new Python events for that (some new On* function).
And when the spawner leaves, it will take the quabs with it, even though other players are left in the age.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: NPCs

Postby D'Lanor » Tue Jun 22, 2010 6:30 am

The quabs will probably remain a problem in CC but for "normal" NPC interaction the multiplayer issues can be fixed. You'll just have to make each client work with its own NPC instance while at the same time making it invisible for other players.

That means you should not netforce or netpropagate NPC actions, except for A. hiding the NPC at its initial spawn, and B. if you use a trigger to activate the NPC event it should be sent to all clients in order to make them play the event locally.

In my Python code example you can add this when Zandi has spawned, immediately after the line "Zandi = PtFindAvatar(events)":

Code: Select all
            Zandi.netForce(1)
            Zandi.draw.disable()
            Zandi.netForce(0)
            Zandi.draw.enable()


What this does is hide him from all players and then make him visible again only for the local player. The rest of my Python script is good to go since it is already netforce and netpropagation free. I attributed the oneshot to a behavior which does not netpropagate (or netforce) by default. Note that if I had placed the oneshot into a responder I would have needed to add "netPropagate=0" just like I did with that sound responder.

Confused? Welcome to the world of multiplayer Python programming. :D
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests