Change font size
It is currently Wed May 22, 2013 4:37 pm

Forum rules


Image



Post a new topicPost a reply Page 1 of 3   [ 23 posts ]
Go to page 1, 2, 3  Next
Author Message
 Post subject: NPC Suggestion
PostPosted: Mon May 28, 2012 11:57 pm 
Furious Typer

Joined: Mon Apr 25, 2011 6:48 pm
Posts: 70
Hello,

For lack of better place to begin this discussion...

I'd like to look into implementing a new function, osNpcTouch(key_npc, key_target).

The function would allow an NPC to 'touch' an object. I am a developer, but my C# skills may not be enough.

I'm posting here because OSGRID is a great place to get feedback on whether this project is worth undertaking, and an easy way to get other developers interested. :D

I've got scripts for NPCs that allow pathfinding, chat, sensor, sitting, and am continuously modifying them to add more AI type stuff. Touch is the last real thing I can see an NPC needing in world.

Any ideas, thoughts, suggestions, or other comments?

Shad MOrdre


Top
 Profile  
 
 Post subject: Re: NPC Suggestion
PostPosted: Tue May 29, 2012 9:24 am 
OSG Elite
User avatar

Joined: Thu Dec 11, 2008 7:51 am
Posts: 391
Location: England UK
To be perfectly honest, I can't see any scenarios that would require an NPC to touch anything. What were your thoughts with this?

If an NPC was scripted to run a set of commands such as pathfinding, or interaction with an avatar using some kind of chatbot script or anything else if the NPC was required to touch an object at a specific point in the 'program' (for want of a better expression) then the script controlling the NPC could simply llSay to the object that needed to be touched. Obviously that would require modification of the script in the touched object.

All that said, I am in favour of any new features in opensim regardless of whether I would use or not; someone else may make use of them. The downside is the writing of the code.

_________________
"...And then one day you'll find, ten years have got behind you, no one told you when to run, you missed the starting gun"
~Pink Floyd


Top
 Profile  
 
 Post subject: Re: NPC Suggestion
PostPosted: Tue May 29, 2012 9:45 am 
Furious Typer
User avatar

Joined: Fri Aug 19, 2011 7:10 pm
Posts: 144
Location: Oldham, UK
I agree with Adelle. I'm unsure what a touch option would add that isn't already there. The most common touch actions tend to be:

Sit on = osNpcSit does this
Buy = an NPC doesn't have inventory (or not an accessible one) so a bit pointless
Give = as buy
Teleport = but since an NPC can't leave the region this would have very limited application that can be done with osNpcMove anyway

I'm curious as to what scenario you see touch being useful in?

_________________
50's sim based at Rumbled on OSGrid
happily running on Arch Linux for 1 year +


Top
 Profile  
 
 Post subject: Re: NPC Suggestion
PostPosted: Tue May 29, 2012 12:59 pm 
Furious Typer

Joined: Mon Apr 25, 2011 6:48 pm
Posts: 70
Adelle and Roken,

I began my little NPC project last fall, after noticing that NPCs had finally been created for OpenSim. My interests lie mainly in AI and robotics. As such, NPCs provide a great way to test some of my theories.

Touch, for an NPC, as you've pointed out, is rather pointless...for many inworld actions. But not all. Using the Myriad RPG system or touching a door, or causing some other similar action, would be useful. I understand NPCs do not have inventory and the like, but would certainly appreciate having an NPC commit some action. Using the Myriad RPG system, an NPC cannot participate in combat, as the NPC cannot touch its target, and thus fire their weapon. This is a drawback.

I would prefer not to have to modify scripts to accommodate NPCs. There are SOOO many quality scripts out there, and to think of needing to modify those scripts, IF one has permissions, is quite an undertaking. The scripts I created for NPCs are notecard configurable and scalable. My NPCs are slowly gaining the ability to use objects as they are, without needing to modify the underlying scripts to accommodate NPCs. I've worked hard to ensure that my NPC scripts can use objects as they come, without the need to modify.

Isn't that kinda the point, to minimize reinventing the wheel, just to accommodate some minor change. With each new release of OpenSim, I can see changes on the backend allowing for ever greater abilities inworld. I would hate to think that scripts need to be rewritten when so many are useful the way they are.

I'm certain that myself and others will always find a use for osNpcTouch, as it just makes NPCs seem all that much more lifelike. I've seen several people mention wanting to build or design some RPG here on OSGRID, but I'm sure they've run into quite some limitations when it comes to NPCs. As well, many store owners, I'm sure, would appreciate a more lifelike presence to assist customers when they are away. Unless these people wanted to do some rather specific coding, they would be left wanting.

As a developer, I've always been taught to not reinvent the wheel, unless necessary. I've also been encouraged to write solutions that are configurable, open, scalable, and object oriented. Programmable robots has been a goal of many of my endeavors, and the NPCs have given me the ability to test, and prove, many of my hypotheses about how to successfully pull it off.

Sorry for the long winded reply, but I though a more thorough explanation of why was requested.

Thanks! And please, keep the feedback coming!

Shad MOrdre


Top
 Profile  
 
 Post subject: Re: NPC Suggestion
PostPosted: Tue May 29, 2012 2:25 pm 
Furious Typer
User avatar

Joined: Fri Aug 19, 2011 7:10 pm
Posts: 144
Location: Oldham, UK
OK - I suggest go for it. Maybe if you make a start others will jump on board.

I can't help, I'm afraid. More of a bash/python man myself :)

_________________
50's sim based at Rumbled on OSGrid
happily running on Arch Linux for 1 year +


Top
 Profile  
 
 Post subject: Re: NPC Suggestion
PostPosted: Tue May 29, 2012 3:21 pm 
OSG Elite
User avatar

Joined: Thu Dec 11, 2008 7:51 am
Posts: 391
Location: England UK
Roken, you have valid points. Myself, I would modify the scripts and where I had no permissions I would either re-write them myself (I guess I like pain :twisted:) or contact the author to either provide a full perms script or ask them to mod; the simple reason being any scripter that wants a feature-full script/object should allow for NPC interaction (though that topic probably requires its own thread on this forums).

One thing I have always loved about opensim/scripting in opensim is there are always many ways to accomplish the same goal. :) I'm a believer that this should never be suppressed.

Anyway back to your original point; it is doable. How easy I do not know. It sounds like, though limited, you have way more experience in c# than I, so I wouldn't really be able to help in that respect. You should try and contact Justincc on the opensim dev irc channel (irc://freenode/opensim-dev) as he wrote the NPC code so should probably be able to point you in the direction of the parts of code to modify.

_________________
"...And then one day you'll find, ten years have got behind you, no one told you when to run, you missed the starting gun"
~Pink Floyd


Top
 Profile  
 
 Post subject: Re: NPC Suggestion
PostPosted: Wed May 30, 2012 12:01 am 
OSG Elite
User avatar

Joined: Sat Jun 14, 2008 12:28 am
Posts: 360
Location: Australia
I can see the advantage in NpcTouch, after thinking about it.
Touch is already built into the system,
llSay and the like are prone to tying up threads because so many receiving objects must be set with listen scripts and eventually lead to llLag (pun intentional). setting touch_start() in an object doesnt set up a listen and sits idle until touched.

I think its a great idea and I also believe it wouldnt take a lot to introduce, because so much of the npc is already avatar code, and the touch property already exists in every object.


Top
 Profile  
 
 Post subject: Re: NPC Suggestion
PostPosted: Thu Jun 07, 2012 6:38 am 
OSG Elite
User avatar

Joined: Sat Jun 14, 2008 12:28 am
Posts: 360
Location: Australia
Just found something interesting.

Apparently Aurora Sim, which is a close cousin of Opensim, already has a touch function for their bots, Ive never used Aurora and I dont know how different it is from Opensim. But the code is probably still remarkably similar to Opensim, some of it exactly the same.
I found this line in a piece of Aurora script
Code:
botTouchObject(botID, llGetKey());//Now touch this object

in this github https://github.com/aurora-sim/Aurora-Sim/tree/master/AuroraDocs/BotFunctions apparently posted by RevolutionSmyth, so maybe theres a line to follow for anyone seriously interested in getting this function into OS.


Top
 Profile  
 
 Post subject: Re: NPC Suggestion
PostPosted: Sat Jun 09, 2012 12:30 am 
Furious Typer

Joined: Mon Apr 25, 2011 6:48 pm
Posts: 70
I chatted very briefly with Justincc on IRC the other night, and he even recommended what to look at, but after looking at the code, I'm certain that this is beyond my ability. He suggested that the NPC code would need to trigger the ProcessObjectGrab, ProcessObjectGrabUpdate, ProcessObjectDeGrab methods in Scene.PacketsHandlers.cs.

Problem is, my C# is certainly not up to the code I saw. I couldn't even find the NPC code I would need to edit. Hmmm...

Any devs willing to at least guide a newb, if not take up the task?

Shad MOrdre


Top
 Profile  
 
 Post subject: Re: NPC Suggestion
PostPosted: Wed Jun 13, 2012 12:29 am 
Furious Typer
User avatar

Joined: Mon Aug 10, 2009 11:53 pm
Posts: 171
Well the NPC module has been entirely restructured since I worked with some people on it. Which is fantastic to say the least. I would say your best bet is to head to opensimulator and get on IRC or just try contacting justincc and drop a note to ask about it. Certainly can't hurt to ask and seeing as how NPCs have become more of an interest these days and more options / switches keep getting added regularly, I doubt it would take all that long to implement.

Of course 'not too long' to me is different than regular people probably since I'm used to waiting patiently while devs get around to things cuz I kind of know what it's like having a hundred different items to sort through first :)

Like I said though... sure can't hurt to ask about it.

Take care,
- Hap

_________________
Sorry, I was just thinking upon the immortal words of Socrates who said ... "I drank what?? ... "
- Real Genius


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 3   [ 23 posts ]
Go to page 1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net