News:

Welcome to the new Sinister Design forums!

Main Menu

Ask the developer a question!

Started by CraigStern, February 07, 2010, 11:01:17 AM

Previous topic - Next topic

bugfartboy

A couple unrelated questions:

    1.  How did you start learning to develop AI processes?

    2.  What do you think of placing script names inside Atk tags to run them when that attack is executed, similar to items?

    3.  How do you handle storing custom variables?  I've been puzzling this over for a while now, and haven't come up with an
         answer that makes sense.  Are you using a two-dimensional array to pair variable names and values together?

CraigStern

Quote from: bugfartboy on May 27, 2015, 07:24:09 PM1.  How did you start learning to develop AI processes?

It was a natural outgrowth of the kinds of games I was making. When I started making TRPG Chapter 1, I knew less than nothing about programming, and so I took the shortcut of making enemy choices in battle 100% random. In Chapter 2, I suddenly had a spatial battlefield to consider, which meant figuring out decision trees to govern character movement and attacks based on the relative positions of various characters. (I did a terrible job of actually programming this at the time, but I at least had the general concept worked out by this point.)

TRPG:SoG and the Psy Arena games introduced backstabbing, and I really wanted a more sophisticated enemy AI for these, so I figured out a simple heuristic to make the AI choose targets more intelligently based upon whether the attack would backstab, whether the attack would kill anyone, whether it would hit multiple targets, and whether a healer was included in the attack.

By the time I got to Telepath Tactics, combat mechanics had become quite complex, but the basic structure of the heuristic from past games remained helpful, needing only a few tweaks (a simple penalty to each potential move's "score" based on energy cost relative to the damage it would do, watching out for friendly fire, being aware of the opportunity to drop enemies into environmental hazards, etc.)

The main AI snag in TT's AI was figuring out how to code pathfinding from scratch, which took me weeks of hard work with a pen and graph paper to work out. I ultimately gave away my pathfinding solution in the $125 tier for the game's Kickstarter. ;)

Quote from: bugfartboy on May 27, 2015, 07:24:09 PM2.  What do you think of placing script names inside Atk tags to run them when that attack is executed, similar to items?

I've been thinking about implementing that for quite some time--and I'd have stuck this feature in long ago were it not for the fact that this will be somewhat laborious to implement. It's just a matter of priorities at this point; getting the game stable and running without slowdown remains top priority.

Quote from: bugfartboy on May 27, 2015, 07:24:09 PM3.  How do you handle storing custom variables?  I've been puzzling this over for a while now, and haven't come up with an
         answer that makes sense.  Are you using a two-dimensional array to pair variable names and values together?

You guess correctly. ;)

bugfartboy

Quote from: CraigStern on May 29, 2015, 11:17:53 AM
You guess correctly. ;)
I guess it wouldn't be a literal two-dimensional array, seeing as one would hold strings and the other integers, but it's still an interesting idea. How many unique variables can be constructed with this setup? Do you assign the arrays a very large size to begin with and just run with it? Or do you reconstruct the array to fit any time a new custom variable is assigned?

CraigStern

There is no size limit to these arrays; I simply use the push() function in AS3 to add new variables as they're created. Consequently, there is theoretically no limit to how many variables you can create (though if you created thousands of them, I imagine it might start to impact game performance).

bugfartboy

Quote from: Manual
typing R[x-y] in a script action will tell the game to randomly select a whole number
between x and y. Both x and y must be non-negative integers.
Is this an inclusive between or an exclusive between?  Are x and y both a possibility?

CraigStern

When using R[x-y], both x and y are included in the range of possible numbers.

bugfartboy

Are there plans for Tiles to be loaded from Campaign Date files?

CraigStern

I'd like for that to be supported eventually.

bugfartboy

Is there any way to summon a character not explicitly defined in CharClasses.xml, such as ones on a roster instead, with a Create attack? I've got a few ideas that I could theoretically make work with some playing around, but would ultimately be made easier if this was the case.

How many of each card are there in the average Psy War deck?

CraigStern

Characters that are on the battlefield, belong to Army 0, and are still alive at a battle's conclusion will be saved in the player's save game file--any changes to their stats should then carry over to when they next appear. Characters are loaded directly out of CharClasses.xml under all other circumstances.

I don't 100% remember, but I believe that there are 2 of each card type in a Psy War deck.

bugfartboy

And after a card is played, it gets shuffled back into the deck correct?

CraigStern

Nope--it remains discarded until the deck runs out of cards, at which point the discard pile is reshuffled into a new deck.

bugfartboy

Is there any in-universe explanation as to why the cards bear the likeness of people that wouldn't be known otherwise? I mean, surely not every deck has Guy, Anya, and Grotius.

CraigStern

If you like, you can explain that as the player mentally assigning familiar identities to unfamiliar designs on the cards. ;)

LightningLord2

Will you make it possible for multiplayer maps that players can rearrange their troop positions? I don't want to have to write down and memorize which position is occupied by which slot.