Sockets and AI scripting

Post » Wed Jun 20, 2012 9:28 am

Hello everyone,

Even though I'm a beginner in modding, I'm an experienced programmer and I want to create a better AI for some of the followers in the game. My aim is to retrieve some external information for deeper decision making using Bayesian networks. I just started getting familiar with Papyrus, however so far I haven't been able to find anything in the scripting reference that may allow me to connect to a socket and send/retrieve data from it.

The tutorials on the creation kit webpage are very limited, if someone could be kind enough to direct me to some tutorials about follower AI behaviour scripting, I would really appreciate it.

Thank you in advance.

TL;DR:
Can I use socket connection in Papyrus? How?
Are there follower AI scripting tutorials? Where?
User avatar
Jonathan Windmon
 
Posts: 3410
Joined: Wed Oct 10, 2007 12:23 pm

Post » Wed Jun 20, 2012 12:26 pm

as far as i know there is no way to get data in or out of skyrim in terms of papyrus.
User avatar
Jah Allen
 
Posts: 3444
Joined: Wed Jan 24, 2007 2:09 am

Post » Wed Jun 20, 2012 7:16 pm

If there is no way using Papyrus, I guess there's got to be a way using an external application. I saw this mod in Nexus
"RSS Reader for Skyrim"


It reads an RSS source and displays it in the game. But how?

[EDIT] Maybe if Papyrus can read a text file and another external application is updating this text file... but it doesn't look very elegant...
User avatar
SexyPimpAss
 
Posts: 3416
Joined: Wed Nov 15, 2006 9:24 am

Post » Wed Jun 20, 2012 9:16 am

Papyrus doesn't fit the bill for you. But you can use it as a thin layer to call into some C++ routines.
The easiest way to manipulate the game's internal structures, safely and with compatibility in mind, is http://skse.silverlock.org/. Though you probably have to decode those structures yourself.

And no papyrus doesn't provide any access to sockets.
Don't know of any tutorials, though I didn't look.

Edit #1: The RSS reader thing, I didn't know about it 'till just now, but it would only have to (apart from the obvious) display something that can be atop of a Direct3D surface, like another Direct3D surface.
Maybe it hijacks Skyrim's D3D device, and issues some custom draw calls?

Edit #2: Your main option is to add whatever you need yourself by writing a SKSE plugin in C++.
User avatar
SUck MYdIck
 
Posts: 3378
Joined: Fri Nov 30, 2007 6:43 am

Post » Wed Jun 20, 2012 6:05 pm

Thank you very much for the information Xetrill, I will definately check on that :)
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Wed Jun 20, 2012 10:16 am

Also, the interface layer of Skyrim is done in Flash. That may be how the RSS reader works. So depending on what precisely you want to do, you might be able to do your external communications in that Flash UI layer, and then communicate information down to the game engine.
User avatar
Cody Banks
 
Posts: 3393
Joined: Thu Nov 22, 2007 9:30 am

Post » Wed Jun 20, 2012 2:52 pm

Follower AI, aside from the Follow package that actually makes them follow you around is hardcoded. The teammate aspect is what determines whether they should enter combat when you do, combat styles and classes determine how they fight. There isn't a whole lot you can do with the games AI through script.

3D hook, or a UI mod, I think the former is more likely, though the latter would be the safer approach.
User avatar
Alada Vaginah
 
Posts: 3368
Joined: Sun Jun 25, 2006 8:31 pm

Post » Wed Jun 20, 2012 3:27 pm

You could create a series of aliases in a quest object with stacked AI packages that define given behaviors, then assign the follower to those aliases at runtime using Clear() and ForceRefTo(), picking which one to use with branching information nodes implemented as a kind of linked list.
User avatar
The Time Car
 
Posts: 3435
Joined: Sat Oct 27, 2007 7:13 pm

Post » Wed Jun 20, 2012 5:15 pm

Lot of work, and it would only apply to one alias at a time. I think they'd all have to be combat overrides as well, you can whip up some pretty complex combat based templates.
User avatar
Unstoppable Judge
 
Posts: 3337
Joined: Sat Jul 29, 2006 11:22 pm

Post » Thu Jun 21, 2012 12:41 am

Well if he is savvy in C++ he should be able to create his own packages. Either way it would be a lot of work, the native implementation would be natural though, a papyrus one would be a hack.

The UI is a very specific flash implementation - well known in game-dev - called http://gameware.autodesk.com/scaleform.
User avatar
Danny Warner
 
Posts: 3400
Joined: Fri Jun 01, 2007 3:26 am

Post » Wed Jun 20, 2012 1:37 pm

Thank you all very much guys, I appreciate all the advice and tips. I'll get started on this next week probably, will get back to you with some feedback on my research.
User avatar
kat no x
 
Posts: 3247
Joined: Mon Apr 16, 2007 5:39 pm

Post » Wed Jun 20, 2012 9:17 pm

By the way I contacted the guy from the RSS mod, and here's his response:

"Hi.

Might be you have not read the faq of my personal notebook mod (the rss tool is something like a external tool, which is reading the rss feed,
droping the text to a richtext form and render this form as a PNG image), the skynotebook.esp (from my personal notebook journal mod) is
looking for png images 0001.png to 0020.png inside the specified path (data\textures\extraimages2) here is the rss "image" droped as 0020.png
this way also the personal notebook editor can open / change the file AND the esp can read it to display it inside the book in game. to make it
simple - i dont use papyrus and i dont use in game functions, its a tool wich is also theoreticaly working if you dont have the game, its ONLY
looking for the tesv.exe because many people put the tool into the wrong folder. The only function in game i use is the engine abillity to load a
transparent png image and display it inside a "book" thats all the magic... simple but working..

greetinx, triplex2011"
User avatar
Melung Chan
 
Posts: 3340
Joined: Sun Jun 24, 2007 4:15 am

Post » Wed Jun 20, 2012 10:26 am

Does anyone know a tutorial such as:
http://www.gamesas.com/topic/1207389-obse-plugin-tutorial/
for SKSE?

I am willing to create my own plugin in C++ with SKSE (I am familiar with C++, but not an expert), however I find diffcult to understand the process from the creation of the plugin to the integration with the game. There is no class reference whatsoever, so it's kinda diffuclt do the reverse engineering process. I know my way around in C++ but I must understand the architecture of the SKSE and how it communicates with Scaleform. At the same time I need to find a way to communicate Scaleform with the game. I guess there is no way of calling my functions from Papyrus using the Creation Kit, right?

And just to make sure: Scaleform is a platform on top of the game to create the whole UI right? Therefore it HAS to communicate with the rest of the game somehow.

God I have been programming for years but I feel so lost with this!
User avatar
Cagla Cali
 
Posts: 3431
Joined: Tue Apr 10, 2007 8:36 am

Post » Wed Jun 20, 2012 9:16 am

You right there is no documentation of SKSE but there is the source code shipping with it. Also you can just ask the authors ian and behippo (http://www.gamesas.com/topic/1362188-wipz-skyrim-script-extender-skse/).

For communicating with Scaleform, you can look at the source and generally learn about it. It's used in many games and engines.
For communicating with Papyrus, you probably want to wait until ian has that figured out.

Don't expect to get running with this soon, take your time.
User avatar
maria Dwyer
 
Posts: 3422
Joined: Sat Jan 27, 2007 11:24 am

Post » Wed Jun 20, 2012 7:14 pm

Thank you again Xetrill, I'll check on that thread :)
User avatar
laila hassan
 
Posts: 3476
Joined: Mon Oct 09, 2006 2:53 pm

Post » Wed Jun 20, 2012 5:54 pm

i dont know how much it is related to skyrim but for obseplugins there is another tutorial.

http://www.gamesas.com/obse-plugin-tutorial-t120320.html
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm


Return to V - Skyrim