More Blades of Avernum Script Samples. Fun!

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).

Pages

AuthorTopic: More Blades of Avernum Script Samples. Fun!
Board Administrator
Member # 1
Profile Homepage #0
Here are examples of 2 Blades of Avernum creature scripts. These are pre-beta, of course, so the logic may not be flawless. But they should give an idea of the possibilities.

One: ftp://ftp.spiderwebsoftware.com/temp/patrolguard.txt

This is a standard AI script. This creature goes from where it starts to a waypoint (a predefined point you set in the editor) and then back. If it sees a foe, it fights for 2 rounds and then runs back home. If it gets there, it shouts an alarm, and all its friends immediately hunt down the party.

Two: ftp://ftp.spiderwebsoftware.com/temp/t6beast.txt

This one is a hoot. It is for the goblin eater creature in the second floor of the School of Magery. Before, this was just a big dumb monster which waited for someone to stumble into it. Now it stalks the party when they enter its area, but returns home if they flee his hunting grounds. If the party fights it, it can haste itself once and, if damaged enough, return to its lair and try to regenerate itself.

Of course, we are still early in the process, and these scripts will get much refining. But it will give you an idea of the sort of things that are going on.

- Jeff Vogel
Spiderweb Software
http://www.spiderwebsoftware.com
Posts: 960 | Registered: Tuesday, September 18 2001 07:00
Infiltrator
Member # 2104
Profile Homepage #1
Erm, from looking at them, it looks like Scripting is Not For Me (SiNFM)

--------------------
—Zxquez Zolohahni
Xerch'de/Rate.
Posts: 549 | Registered: Thursday, October 17 2002 07:00
Law Bringer
Member # 335
Profile Homepage #2
Looks impressive, and not just because of the volume of code. I foresee many evil scenarios with monsters leading the party into traps, monsters suddenly becoming much tougher, and monsters doing all kinds of really nasty things.

—Alorael, who just doesn't want to see the Dark Wyrms that sneak behind the party, waiting for the doomguards to provide a distraction, then breathe on the weakest characters first.
Posts: 14579 | Registered: Saturday, December 1 2001 08:00
Board Administrator
Member # 1
Profile Homepage #3
"Looks impressive, and not just because of the volume of code. I foresee many evil scenarios with monsters leading the party into traps, monsters suddenly becoming much tougher, and monsters doing all kinds of really nasty things."

Yeah. One of the ways I plan to spice up Za-Khazi Run is by paying real attention to the bosses. When you mean a big dude with a fancy name, it is going to do some really wild stuff. The lich at the end of the dungeon shouldn't just be a lump of hit points. It should be an event.

"—Alorael, who just doesn't want to see the Dark Wyrms that sneak behind the party, waiting for the doomguards to provide a distraction, then breathe on the weakest characters first. "

Note to self. Test setting a character's hostile target to make sure targeting the weakest character works properly.

Scripting will not be for everyone. But it works infinitely better than that thrown together, clunky node system which was the best I was able to do for Blades of Exile. I've learned a lot about coding since then.

And finally, bear in mind that adapting to script is not as difficult as it looks. I will provide a set of base scripts which will handle most everything you would want. When you want to make more complex creatures, you can just adapt an existing script. With practice, this is faster than you might think.

- Jeff Vogel
Spiderweb Software
http://www.spiderwebsoftware.com

[ Tuesday, October 14, 2003 17:38: Message edited by: Spidweb ]
Posts: 960 | Registered: Tuesday, September 18 2001 07:00
Shake Before Using
Member # 75
Profile #4
Targeting the weakest member of the party is annoying, but I suppose I shall have to put up with it, since the BoE AI seems to like doing the same thing if at all possible.
Posts: 3234 | Registered: Thursday, October 4 2001 07:00
Warrior
Member # 246
Profile #5
quote:
Originally written by Spidweb:

[QB]And finally, bear in mind that adapting to script is not as difficult as it looks.[QB]
I would hope it's not as difficult as those nodes were. Of course... it'd be even easier if your scripting engine resembled BASIC. :D

Exactly why did you even go with nodes?
Posts: 117 | Registered: Friday, November 2 2001 08:00
Board Administrator
Member # 1
Profile Homepage #6
"Exactly why did you even go with nodes? "

I'm not a great programmer. And, in 1998, I was worse. Even coming up with the system I did took me an enormous amount of thought and effort. I simply was not capable of generating a scripting engine (or something comparable) with the brain I had at that point.

- Jeff Vogel
Spiderweb Software
http://www.spiderwebsoftware.com
Posts: 960 | Registered: Tuesday, September 18 2001 07:00
BoE Posse
Member # 15
Profile Homepage #7
Couple this with a scripting contest, and soon we'll have MANY scripts to adapt.

Suggestion to Jeff: Your sample scripts should have (nearly) every line commented - it's the only way people not familiar with this style of coding will ever learn it.

The more that learn, the more you profit.

--------------------
All that we see, or seem, is but a dream within a dream.

Visit the Louvre, the BoA Graphics Database at http://www.personal.psu.edu/bxb11/boa/louvre/
Visit Alexandria, the BoE Scenario Database at http://www.personal.psu.edu/bxb11/boe/alexandriajs/
Posts: 653 | Registered: Thursday, September 27 2001 07:00
Guardian
Member # 2238
Profile Homepage #8
That would help. I've been taking programming classes, but it's all C++ and the such, so I'm afraid it won't help me much here.

Hopefully my friend Motekye will pick up on this, considering I ask him questions about everything anyway.

I'd also like to request some more pictures of the design phase if at all possible. Maybe some of monster creation, item creation, or similar stages.

--------------------
DEMON PLAY,
DEMON OUT!
Posts: 1582 | Registered: Wednesday, November 13 2002 08:00
Apprentice
Member # 3556
Profile #9
I saw the announcement of Blades of Avernum on Usenet. The avernum series is among my favourite all time games, so this is one I'm really looking forward to! I hope the scenario editor and scripting capabilities are as powerful as they look. The combat AI is inept in certain situations, so it will be great if all the modders out there could build AI scripts like the ones in your examples to spruce things up a bit.

>Targeting the weakest member of the party is
>annoying

I agree. In the ambush battles where your party of 4 lines up against 10+ enemies it would be a nasty shock for them to all target your healer/mage. I guess this is why the AI in Avernum games generally targets the closest character.

>I've been taking programming classes, but it's
>all C++ and the such, so I'm afraid it won't
>help me much here.

These scripting language syntax appears to be very much like C, so if you're learning C++ it shouldn't be too hard to pick up on it.
Posts: 1 | Registered: Wednesday, October 15 2003 07:00
Infiltrator
Member # 2104
Profile Homepage #10
Are you saying Motekye might know this language? Eh, what language is it in, anyway?

Motekye knowing something other that asp and such will make me even more jealous of him... :(

Meh, maybe I'll SOMEHOW learn to script...

[ Wednesday, October 15, 2003 11:41: Message edited by: Jonnie ]

--------------------
—Zxquez Zolohahni
Xerch'de/Rate.
Posts: 549 | Registered: Thursday, October 17 2002 07:00
Post Navel Trauma ^_^
Member # 67
Profile Homepage #11
It looks very good in general, but there seems to be a few things that are a bit awkward. Mainly, things like set_state() and set_flag().

Putting numbers in there things makes the code hard to read. It would be nicer if you could do something like:
set_state(attacking) or set_flag(party_has_gem, 1)
(or even party_has_gem = 1 and avoid using stuff done flags at all)

A simple preprocessor might help readability a lot here:
#define attacking 2
#define party_has_gem 4,3

And if not, and if the scripts are stored in text files like in Geneforge, there's always cpp, but that would just spew complications. I'd rather not make a scenario with a makefile.

Dynamic memory allocation would be nice... well, ignore that one :) (unless it turns out to be very useful)

[ Wednesday, October 15, 2003 12:27: Message edited by: Khoth ]

--------------------
Barcoorah: I even did it to a big dorset ram.

desperance.net - Don't follow this link
Posts: 1798 | Registered: Thursday, October 4 2001 07:00
Babelicious
Member # 3149
Profile Homepage #12
A few suggestions from someone dealing with the same issues:

* When dealing with non-programmers, verbosity is generally preferable to conciseness. Example:
print_str_color("The beast roars furiously. It doubles the intensity of its attacks.",2);would be better as:
PrintColoredString("The beast roars furiously. It doubles the intensity of its attacks.", Red)I know you might not like the CapitalizedWordsMethod, but I've found that nonprogrammers can distinguish words better with capitalization than with underscores.
* Allow preprocessing, like Khoth suggested.
* Cover up the state machine -- something like
state DEAD_STATE {
// ...
}
is much easier on the eyes than
beginstate DEAD_STATE;
// ..
break;
http://forums.desperance.net/index.php?act=ST&f=3&t=68
This is how my Pygmalion would implement basically similar functionality.

It's really hard to get out of a programmer's mindset when designing the scripting interface. I'm still not there yet after over a year.

[ Wednesday, October 15, 2003 13:16: Message edited by: Djur ]

--------------------
I've got a pyg in a poke.
Posts: 999 | Registered: Friday, June 27 2003 07:00
Shaper
Member # 73
Profile #13
It looks good to me. It looks like it will be far easier to do what I plan with scripts. It ma also give me a bit more experience with coding. Or it may confuse me, so I put BoA script into my own games, creating horrible bugs and glitches. But I'll try to be careful not to do that when I learn to program.
It looks really good though. I can't wait until the release.
Oh, by the way, as a suggestion to improve Za-Khazi Run: I recommend you decrease the time limit, to make it a bit more challenging. I believe that was Alcritas's idea.
And could you PLEASE PLEASE PLEASE include the bashing weapon graphics?

--------------------
My Myspace, with some of my audial and visual art
The Lyceum - The Headquarters of the Blades designing community
The Louvre - The Blades of Avernum graphics database
Alexandria - The Blades of Exile Scenario database
BoE Webring - Self explanatory
Polaris - Free porn here
Odd Todd - Fun for the unemployed (and everyone else too)
They Might Be Giants - Four websites for one of the greatest bands in existance
--------------------
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Posts: 2957 | Registered: Thursday, October 4 2001 07:00
Law Bringer
Member # 335
Profile Homepage #14
quote:
Originally written by Imban:

Targeting the weakest member of the party is annoying, but I suppose I shall have to put up with it, since the BoE AI seems to like doing the same thing if at all possible.
My problem with the Avernum AI is that it always seems to attack the front ranks. As long as you maneuver your party carefully, ranged attacks are not a threat, melee is certainly not much of a threat, and spells only chip away at your fighters' ridiculous health. Archers that actually aimed usefully and let the melee monsters deal with melee fighters would make fights actually challenging.

—Alorael, who could see all kinds of new strategies needing to be developed if, for instance, gazers and mung demons targetted the spellcasters instead of the nearest fighter with a single point of priest skill.
Posts: 14579 | Registered: Saturday, December 1 2001 08:00
Agent
Member # 2820
Profile #15
This is going to be great, at least compared with the BoE system. I could never understand why there weren't a few more boxes to put information into. Can you have a creature perform a specific kind of attack? Or cast a certain spell under special circumstances?

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Warrior
Member # 246
Profile #16
I would think you'd be able to. Probably something like this for the spell:

cast_spell([spellnumber], [pc/npc]);

And for the special attack, just have it display a message/put a message in the status and then damage the pc. ;)

[ Wednesday, October 15, 2003 21:27: Message edited by: Frobozz ]
Posts: 117 | Registered: Friday, November 2 2001 08:00
BoE Posse
Member # 15
Profile Homepage #17
quote:
Originally written by Kill Yourself:

[QB]A few suggestions from someone dealing with the same issues:

(snip)]I know you might not like the CapitalizedWordsMethod, but I've found that nonprogrammers can distinguish words better with capitalization than with underscores.(snip)/QB]
You are dead on here. My research with low-literate adults years ago indicated that people tend to notice the shapes of words, and capitals help them chunk letters into words. So DoThis is easier to read than dothis. Also, avoid all caps, like DOTHIS - actually the hardest to read of all, because you have no ascenders or decenders to hook on to.

--------------------
All that we see, or seem, is but a dream within a dream.

Visit the Louvre, the BoA Graphics Database at http://www.personal.psu.edu/bxb11/boa/louvre/
Visit Alexandria, the BoE Scenario Database at http://www.personal.psu.edu/bxb11/boe/alexandriajs/
Posts: 653 | Registered: Thursday, September 27 2001 07:00
BANNED
Member # 3121
Profile Homepage #18
I think Djur meant that DoThis is better than do_this

Anyway, sounds cool, and though I know nothing about coding, I'm eagerly waiting to get my hands around the muscular neck of BoA.. :)

--------------------
The Great Mister

kommari@gmail.com[/url]
Posts: 761 | Registered: Thursday, June 19 2003 07:00
Warrior
Member # 246
Profile #19
quote:
Originally written by Void Master:

You are dead on here. My research with low-literate adults years ago indicated that people tend to notice the shapes of words, and capitals help them chunk letters into words. So DoThis is easier to read than dothis. Also, avoid all caps, like DOTHIS - actually the hardest to read of all, because you have no ascenders or decenders to hook on to.
Sounds like somebody would do well to learn Java since it's functions look like that.

But more seriously, I would remove those underscores. They'll just be one more thing to forget (like semicolons are often forgotten).
Posts: 117 | Registered: Friday, November 2 2001 08:00
Infiltrator
Member # 154
Profile #20
quote:
Originally written by Kill Yourself:

A few suggestions from someone dealing with the same issues:

* When dealing with non-programmers, verbosity is generally preferable to conciseness. Example:
print_str_color("The beast roars furiously. It doubles the intensity of its attacks.",2);would be better as:
PrintColoredString("The beast roars furiously. It doubles the intensity of its attacks.", Red)I know you might not like the CapitalizedWordsMethod, but I've found that nonprogrammers can distinguish words better with capitalization than with underscores.
* Allow preprocessing, like Khoth suggested.
* Cover up the state machine -- something like
state DEAD_STATE {
// ...
}
is much easier on the eyes than
beginstate DEAD_STATE;
// ..
break;
http://forums.desperance.net/index.php?act=ST&f=3&t=68
This is how my Pygmalion would implement basically similar functionality.

It's really hard to get out of a programmer's mindset when designing the scripting interface. I'm still not there yet after over a year.

Even better, strecho("Blah Blah","Whatever",COL_BLUE);
The last parameter would be optional, supplied with a constant which describes the color, if you dont' supply one, no color. And do an alias (same function, different name).. print_string();
And do state(DEAD_STATE) {
whatever
}.. nicer.

--------------------
Apparently still annoying.
Posts: 612 | Registered: Saturday, October 13 2001 07:00
Infiltrator
Member # 2104
Profile Homepage #21
Wow, this is confuzzling!

--Jonnie,
Yay! Hugo!

--------------------
—Zxquez Zolohahni
Xerch'de/Rate.
Posts: 549 | Registered: Thursday, October 17 2002 07:00
Warrior
Member # 246
Profile #22
Or you could always implement a natural-language style script such as...

BeginFunction Named "Test"
DisplayMessage "Hello World" Colored White
EndFunction
For that matter... you could write a translator that converts the above into Jeff's scripting language.

[ Sunday, October 19, 2003 14:44: Message edited by: Frobozz ]
Posts: 117 | Registered: Friday, November 2 2001 08:00
Shock Trooper
Member # 1207
Profile #23
What I'd like is a visual editor like "click to show whereabouts the monster will go etc." or a simple one at least which then converts it to a simple script which can then be refined to your heart's content. I hope someone knows what I'm talking about...
Posts: 316 | Registered: Saturday, May 25 2002 07:00
Warrior
Member # 246
Profile #24
quote:
Originally written by Automator 4000:

What I'd like is a visual editor like "click to show whereabouts the monster will go etc." or a simple one at least which then converts it to a simple script which can then be refined to your heart's content. I hope someone knows what I'm talking about...
Sounds like you want a way to create the path visually instead of using a whole lot of commands.

It wouldn't be hard to create one. You just need to have C use SDL to draw a copy of the grid and then use SDL again to control the mouse. Simple no? :D
Posts: 117 | Registered: Friday, November 2 2001 08:00

Pages