Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Apr 2013
journeyman
OP Offline
journeyman
Joined: Apr 2013
It looks easy to understand, but there are tons of AND between PROC and THEN, I understand there might be a place for OR, but for state machine like process you guys have, might as well assume all lines are AND by default between PROC/THEN.
So from what I manual copy/paste from the video, it could look like this.

PROC
ProcessTheft( (CHARACTER)_Character, _Spotter, _Owner )
NOT InvolvmentAsserted(_Character, 1 )
Relation(_Spotter, _Owner,( INTEGER)_R )
IntegerDivide( _R, 2, _I )
THEN
InvolvmentTheft( _Character, _I );
InvolvmentAsserted( _Character,1 );

Or use some simple C like symbol & |.
Reason being after long hour of typing those, it could easily doing typo for AND(ie. ANDD, ADN, ANS), missed one, and hard to follow. In above example, experienced coder can more easily spot those 4 conditions then have all the AND line separated them in last update video.

And from the script, do you guys checked if people can just keep move/throw stuff away from the owner, or just out of sight of the owner, and another player pick it up right before chat box showed up? Or if you can throw it far enough, you can just pick it up when no one can saw you. That might be kinda easy exploit for any outdoor, or rooms connected to outdoor environment.

And I wonder under what condition the script runs, is it per thread for each event happened? Or is it a world pause sequence check? I wonder if you have say like 50 NPCs in a market, and then steal something, does it affect performance?

my 2 cents.

Joined: Aug 2012
addict
Offline
addict
Joined: Aug 2012
It sounds to be a high level of coding (like fuckin' C#, C++ or others) but it seems to be more a "functionnal" language than an object oriented language and that is greaaaaaaaaaaaaaaaaaat laugh laugh


"-Oh that's fullmoon, cuttie cuttie sheep
-baaaaaaOOOOORGH"
***Sprotch***

Weresheeps will rule the world (At least one night every 29 days)
Joined: Sep 2011
enthusiast
Offline
enthusiast
Joined: Sep 2011
Are you speaking alien? I'll learn the language when it is released!


"There is no such thing as absolute freedom because we are still prisoners of society"
Joined: Apr 2013
journeyman
OP Offline
journeyman
Joined: Apr 2013
Yeah, it's more like a straight forward easy parsing language(like basic) rather than those that provide complex data structure( CHARACTER might just being a pointer to a special structure or just a global ID indicate the character. )

It will be easy to learn for not programming savvy people, but it might be hard to compile a more advanced behavior feature. It was essentially a bare bone state machine with rules, and evidence is that really complicate node graph we see in the video and in the snipped of script.

In above section it could be explained like this.
Everything after // is commnet, 1) and the rest number are added for explanation purpose.

PROC // this is essentially a IF expression here following are conditions
1)ProcessTheft( (CHARACTER)_Character, _Spotter, _Owner ) //parties involved in transaction of item
AND
2)NOT InvolvmentAsserted(_Character, 1 ) // early check to see if player are already asserted to be stealing, if not getting called by previous check, do the following.
AND
3)Relation(_Spotter, _Owner,( INTEGER)_R ) // get the relation value between spotter and object owner
AND
4)IntegerDivide( _R, 2, _I ) // get relation/2 and save value to _I
THEN // if all above condition returns true.
InvolvmentTheft( _Character, _I ); // _I is the "confidence level" owner have in spotter, this value might be used to drive dialog
InvolvmentAsserted( _Character,1 );// since all condition passed, player is now involved in a theft event

So, in a run down, 1) will always return true if spotted by owner or spotter, 2) will be true if any detections before this entire section failed, 3) and 4) sets value for following purpose, so they alwasy returns true unless relationship is really bad( _R=0 will make 3 return false, and _R=1 should make 4 return false since 1/2 == 0 in integer divide. )

If all condition are true, then player is being accused of theft, and the level of confidence is determined by _I, which could drive different dialog from owner/spotter. Later in the video has a steal from best friend part, where it might mean if _I is high enough, spotter could actually call guards directly, and owner would trust him entirely even if owner didn't see you do the theft.


Joined: Apr 2013
member
Offline
member
Joined: Apr 2013
PenguinTD, I really appreciate your posts on the script already and that is just based on a tidbit.
I'm looking forward to a modding subforum, where script discussions will be very helpful indeed, and I got a strong feeling you have much support to spoil us with. Are you perhaps a programmer by trade?


I got Comment 33,333 at the legendary Larian KS for D:OS
Joined: Sep 2011
enthusiast
Offline
enthusiast
Joined: Sep 2011
I also appreciate the script teaching Penguin. What do you think do I need to study to be able to know the Osiris script because the terminologies are pretty hard without guidance such as yours. I only know excel formula function haha.

It is good to know that you won't be suspected of stealing if you stole in front of a criminal whose relationship value I'm assuming to the owner is 0. The owner might probably accuse the criminal instead if the scripting language was added for it!

Isn't it better if the script changed to check if the spotter will ignore such instance of thievery first then either report such instance to the owner or proper authorities second. In modern times, we instantly call 911 if we saw a criminal activity because we wouldn't dare associate w/ such, we also have a choice whether or not to report such criminal activities to proper authorities.

I'm beginning to see TES AI whenever you're stealing inclined to be realistic. It's always the guards that converse w/ you when you do such acts although them having an almighty sight and instant teleportation to your side destroys the realism.


"There is no such thing as absolute freedom because we are still prisoners of society"
Joined: Aug 2012
addict
Offline
addict
Joined: Aug 2012
Originally Posted by henryv
What do you think do I need to study to be able to know the Osiris script because the terminologies are pretty hard without guidance such as yours. I only know excel formula function haha.


If you have some basis in Clanguage understanding, and you know how tu use a library (I hope Larian will provide one with the descriptions of the functions and arguments) or you know how to re-use pre-made example, that should not be a problem. As Penguin TD said, it sounds to be basic (with a good library of function IMO). So, as discovering a new language, our first script will take some time and research and tries but after few program it might become quite easy.

Of course if it is true that it is a very basic language, making complicated behavior will require a lot and a lot of code lines...

Just something that I thought about, it could be nice if we could include our own module and library, in this way we could reuse previous part of code without copying and past everytime


"-Oh that's fullmoon, cuttie cuttie sheep
-baaaaaaOOOOORGH"
***Sprotch***

Weresheeps will rule the world (At least one night every 29 days)
Joined: Apr 2013
journeyman
OP Offline
journeyman
Joined: Apr 2013
@Indira yes, I'm programmer by trade, specialized in computer graphics on those movie visual effects, and some knowledge on real-time rendering. But I've being programming for so long, basically any programming languages look similar to me.(I started programming from maybe grad 7~8? around that age, with BASICA that came with a weird DOS equivalent, now I'm 35.)

@henryv, yes, what you said is totally doable, but you might have to check both relation between spotter/owner, and player/owner, and let the owner state to decide to trust your claim or some one he hates(ex. relation=0) When doing things like this must be careful that your script and condition should not be specific to a player or a npc, but a generalized condition checking for the owner character.

Like Chaotica said, more complicate behavior would require a lot more blocks of those condition check, which would be quite tricky to design with. ie, say if you accidentally put the function InvolvmentAsserted(_Character, 1 ) in your script block before game engine call the general base character routine, then it would not do anything there(almost all the block have this check from the video). Safer way is to make it bare minimum for one specific event/condition. For example, in that video's script snippet, you have several block that basically check the same thing, but does different things, like if owner is spotter, it does different thing. And this check happen BEFORE checking if there are other spotter other than owner itself. If owner spot it, there is no denying or trust evaluation.

That's why I also asked for stress test if there are many NPCs around, would it cause any problem when player try to move/throw something. We'll see when alpha/beta happens.


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5