Monday 5 September 2011

More on the NPC as a cloud in opensim vanilla

K so i tinkered around and it turns out that it wasn't the server at all, it was imprudence.

When I went to LBSA plaza nobody could see me. I was a cloud to them. So it would seem that although I could see myself in imprudence, everyone else saw me as a cloud. Stands to reason then that if I loaded my current appearance (a cloud) into an NPC then I would also see the NPC as a cloud.

Turns out the simple fix (from Qandy Saw at LBSA plaza) is this:

Go to Preferences > Graphics and click Anisotropic filtering on then save settings.
Everyone else will then be able to see you.

At that point you can rezz the NPCs.

Sunday 4 September 2011

Update to Opensim NPCs

Looks like Justin Clark Casey did some work on the vanilla opensim end.
From my reading of it, it doesn't look like it's as far along as the aurora code. That said if it can be gotten to work, most of the aurora code could theoretically be ported.

The advantage of getting it to work with Opensim is of course that most of the open metaverse servers run on OpenSim instead of Aurora and you can connect it to OSGrid.

Unfortunately, when I tried it by bringing up my own region on osgrid, the NPCs while they do appear, remain as clouds. I must be doing something wrong but don't have time right now to go figure out what.

That said, a few days ago I got a demo from Haplo Voss and the NPC on his region did load the appearance so I'm probably just doing something stupid.

Justin Clark Casey's wiki for OpenSim NPCs is here: http://opensimulator.org/wiki/OSSLNPC

Also: An interesting rumor is that the big grid i.e. Linden grid is going to implement server side NPCs at some point.

Saturday 18 June 2011

Nearly there

So I think I have basically all the pieces for a basic zombie game. Right now it works on my local so I've been looking for a place that will give me a full grid with root access. Looks like opensimhosting is the guy. Darren Williams was super helpful and got me up and running quickly.

Next piece is to re-hack my spawn-follow-attack code so that it works with aurora-master. Revolution Smythe moves so fast that it's hard to keep up lol. I move at a snails pace.

Anyways, I have a gun script that works as long as you have osCauseDamage set to true wherever that is in the .ini files (looking now) and also have damage set for your region.

Also I'm playing with zbrush so I can make my own meshes/sculpties. So far I've been able to make an ugle-assed set of wooden hair that is about as bad as the worst freebies and likewise I've been able to make a pretty clunky looking rifle but it's early days and a lot of fun.

Monday 30 May 2011

Update

So I got the NPC code up to the point where it can follow you pretty successfully and then kill you. Additionally I wrote a piece of code that reads a ZHAO II formatted notecard out of the template avatar's inventory and uses the UUIDs it finds there for such animations as MeleeAttack, ProjectileAttack, Die etc etc. That way it makes it much easier for someone inworld to customize the appearance and animation behavior of NPCs without the need to get access to the code-base. It just makes things easier, really.

Anyways, then...Revolution Smythe who is a complete and total genius, extended Christy's Astar pathfinding code so that the follow code is better, the NPCs can follow you up stairs, round walls, over walls, fly after you etc etc.

Outstanding are getting the avatars to die (right now they won't die and mercilessly kill you over and over lol) and also some client side weapons/gun scripts.

The piece I'm working on currently is trying to get the avatars to play a "dying" animation once their health points go to zero or below. It's not working yet and it's been especially entertaining trying to get a chance to run a "kill" script while being relentlessly pursued by NPCs intent on your gory death. Fun times were had by all LOL.

Also: I borked my branch on github somehow when I tried to merge the code from the main branch over the weekend. Not being a github expert I don't know how to clean it up and it's just a big hassle really so I took the easy way out and just created a new repository with just the NPC project (i.e. aurora/botmanager). Since my code should just be a drag and drop replacement for the aurora/botmanager in the main branch that should make things much easier. Especially for those who have been unable to get my branch to compile (nod of the head to Enrico).

Saturday 28 May 2011

How to add 32 bit launcher into the project

If you get a fresh virgin copy of aurora from the github master branch it will compile just fine in VS2008 but depending on the machine you have it might not run. This is the case on my machine so I spoke to Rev and he said I need to add the 32 bit launcher to be able to debug it in vs2008.
So on the right hand side in the solution explorer panel, right click on "solution 'Aurora'" right at the top and choose "add reference" then go looking for OpenSim/Tools/32bitlauncher and find the project.

You might also have problems with SmarthThreadPool, which is found in openSim/tools/smartthreadpool.

Tuesday 10 May 2011

k so proof of concept of killer NPC attack bot

After struggling with the animation code and non-active damage code I eventually code a proof of concept attack bot to work.

It's hard-coded at the minute and basically what it does is it follows the prey avatar and when it gets close enough if it's in attack mode (which it is) it proceeds to play the hardcoded attack animation. It also reduces the prey avatar's health points by 10 each time until the prey avatar's health points reach zero. It will continue to dog the avatar even if the avatar moves away until it kills them. At the point at which it kills them the predator NPC goes out of attack mode and just sits there.

Obviously some more complicated AI would be good. For example, it would be good if an idle bot also attacked. So maybe what needs to happen is that the sensor prim makes all not attacking bots attack the nearest avatar. Anyways, the proof of concept works so now I need to think about how to improve on it and especially remove the hardcoded animations to make it easier for others. Probably the next step is to get it to be able to use ZHAO cards or a modified version for attacking animations et cetera.

Anyways the code is here:
https://github.com/x8ball/Aurora-Sim/commit/4d9ef599515a770be20602c934854ad51d9309ed#diff-1

Wednesday 4 May 2011

Server side AO on the bot

Additionally on the to-do list is a server side AO for the bot using a standard ZHAO notecard.
The plan is to create a fixed directory called aurora/bin/ao whereby each bot's AO animation list will be inside a notecard formatted in standard ZHAO format and called the name of the seeding avie used to seed the bot. i.e. a bot called "test bot" seeded from avie John Doe would have a notecard called JohnDoe.txt (for example) inside aurora/bin/ao.

This code is lower down the priority list in the to-do's but it's in there. Before I do this I'm going to finish the detect-spawn-follow-attack code which will also involve digging into the LSL collision or sensor stuff. The scripting engine seems to be a little flaky in that scripts sometimes don't work (I tried the collision code last night and it didn't work very well so as a backup I could write something into the botmanager code but I digress).

So returning to the Server side AO, we will need code to pick up directories and code to read files etc. Clues to that code should be in the following code snippet:

private void FindDefaultLSLScript()
{
if (!Directory.Exists(ScriptEnginesPath))
{
try
{
Directory.CreateDirectory(ScriptEnginesPath);
}
catch (Exception)
{
}
}
string Dir = Path.Combine(Path.Combine(Environment.CurrentDirectory, ScriptEnginesPath), "default.lsl");
if (File.Exists(Dir))
{
string defaultScript = File.ReadAllText(Dir);
foreach (Scene scene in m_Scenes)
{
ILLClientInventory inventoryModule = scene.RequestModuleInterface();
if (inventoryModule != null)
inventoryModule.DefaultLSLScript = defaultScript;
}
}
}