🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.games.rpg
Article #363

Re: Ultima 9 - What Do >You< Want to See?

#363
From: ja... JANG HIN LANG
Date: Sun, 13 Nov 1994 06:33
169 lines
7852 bytes
In article <Cz3u...@cs.ruu.nl>, Wishnu Prasetya <wis...@cs.ruu.nl> wrote:
>Now, it will be a revolution if you can give us ability to program
>party members action. Something like:
>
>   Iolo:
>   INIT no_init_spell = TRUE
>
>   IF HP_critical critical /\ HAS_Heal_Potion Iolo THEN
>      DO WITH PRIORITY 5 Use_Heal_Potion Iolo friend ;
>   
>   IF round < 1 /\ no_init_spell /\
>      DO WITH PRIORITY 1 
>         BEGIN
>         spell := pick {Prayer, Invisibility, Strengh} ;
>         Cast Iolo Iolo spell ;
>         no_init_spell := FALSE ;
>         END ;

[article clipped here]

The above technique of sequential branching to build a strategy for
real-time combat may not be appropriate; it would not allow
for Iolo to "learn from past mistakes".  Instead of the player
offering a static list of options for Iolo to choose from, organising
strategy options in the following manner might be more appropriate.



						   success[+]
						 /
						/
				     | cast spell [23]
				  /  | use melee weapon [31]
				 /              \
				/                \
						  failure[-]        flee[61]
	enemy	     | 	attack[7]				    /		
	range < 10m  |  heal[11] 				   /
	[3]						     check health
      /				\			  /	   \
     /				 \			 /          \
    /				  \  | self [37:7]   ---|          remain[67]  
   /				     | other [41:11] ---|
  /
 /
/						   
Iolo					  	   success [+]
\						 /
 \						/
  \				     | cast spell [43]
   \				  /  | use missile weapon [51]
    \				 /              \
     \				/		 \
      \						   failure[-]	      flee[71]
       \                                                            /
        enemy 	      |	attack[13]				   /
	range > 10m   | heal[17]			     check health
	[5]			\		 	  /        \
				 \		         /          \ 
			          \  | self [53:53]  ---|           remain[73]
				     | other [57:57] ---|



This binary tree structure of strategy options provides a much faster
searching scheme than a linear sequence of options.  A linear representation
requires you to explicitly indicate virtually *every* possible outcome for
a particular situation -- not difficult, but rather time consuming.  A binary
tree representation, however, allows rapid searches, compares and even
additions of new strategy options.  Operations on a binary tree often
require a simple "yes-or-no" comparison and you are able to exclude a
large portion of possibilities.

Consider the advantages of the above scheme by the following example: 

---

Suppose Iolo spots a troll 15m away, attacks with a spell but it
has *no* affect for some reason.  By following the path that led to
this conclusion we add the option numbers (OP) along the way to 
calculate the strategy combination value (SC).  We also note the parity
for success or failure.  From this we get 61 (5+13+43) with a single
negative parity.  Notice how the OP for one of the flee options is also 61.
Iolo now has the option of retreating available to him.  We can stall Iolo's
attempt to flee by setting some condition that states that a single negative
parity result is no reason to run away.  If this is the case, Iolo can now
choose *any* strategy -- even a retreat!  He could advance, prepare a First
Circle spell and attack (SC = 33) or even step back a few metres to a safe
distance and heal himself with a potion before entering hand-to-hand combat
(SC = 75).  An already injured Iolo will more likely choose a strategy
with a high SC. 


*Note that the OP values are prime numbers and are arranged in a specific
 order.  This numbering scheme prevents unlikely "counter-strategies"
 to arise. 


Now let us suppose that Iolo advances forward to within 5m of the enemy.
He already knows that a strategy combination (SC) that totaled 61 had no
effect so it would be unlikely that he will try again.  Iolo, instead,
decides to unsheath his sword and attack.  Luckily, the blade strikes
the creature and inflicts a grevious wound.  Iolo's current SC value
for his decision is now 51 (3+7+31) with a single positive parity.  Iolo
now has a choice of *two* options, continue with his sword attack
(because of the single positive parity) or withdraw and opt for his
crossbow since the missile attack option (OP) from beyond 10m is also
assigned a value of 51. :-)

Iolo notices that the troll is now running towards Shamino.  Iolo then
decides to fire at the creature with a magic crossbow bolt.  Although
the bolt struck the creature, the attack did little to deter the troll
from attacking his trusted ally.  Iolo is now aware that any SC value
of 69 (5+13+51) with a single negative parity has little chance for
success.  Realising that giving up after one try is the trademark of
wimps ... Iolo decides to remain in battle because the average of the
"remain" options [(67+73) / 2] is greater than Iolo's current SC of 69. :-)

Iolo will seriously reconsider the situation if he tries many times
with his missile attack with no affect (this can be represented with
many negative parity results and the fact that the "flee average" of 66
is less than Iolo's current SC of 69).

In the third round of battle, Iolo notices that Shamino is lying
on the ground clutching at his side in obvious pain.   Suddenly
Iolo himself is set upon once again by the hungry troll.  Iolo must now decide
if he should help his fallen comrade or defend himself!  Because the
troll is just within arm's reach of Iolo and Shamino, the SC value for
helping the injured fellow is 55 (3+11+41) while the OP value for attacking
is either 23 or 31.  Being a true friend, Iolo decides to forego his attack
and assist his long-time friend (since a SC of 55 is greater than the average 
attack OP value for an enemy within 10m).  Now you are wondering, won't
this make Iolo *and* Shamino vulnerable to the troll attack?  This is true,
but notice the number after the colon.  This number is used to determine the
"risk" of the action.

A second strategy combination (SC2) has a value of only 25 (3+11+11).
SC2 is now less than the average attack OP value of 27 [(23+31) / 2].
This result will deter Iolo's initial choice using a healing potion on
Shamino.  Instead, Iolo will assist Shamino by *defending* his friend in
combat (remember the troll is now close enough to strike at both of them).
If however, the troll was more than 10m away (a much safer distance), Iolo
will certainly cast a spell or use a potion to heal Shamino since SC2 will
be 79 (5+17+57), a much larger value than the average attack OP value of 47
[(43+51) / 2].

----

Modifiers to the OP numbers can be attributed to the current health
of the character.  A critically wounded Iolo, for example, may have an
initial OP of more that 65.  As such, Iolo is more likely to flee from a
creature that is very close to him; whereas he may decide to fire a
crossbow bolt at the creature more than 30m away before reassessing his
situation.  He may even decide to heal himself!


This development of strategies is not only logical but also very easy
to program and maintain.

 
.Hin.




 


       
Technical Details
Message-ID: <Cz70v7.5Ks@ecf.toronto.edu>
Path: mbox-mo1.pugleaf.net!nntp.gmd.de!xlink.net!howland.reston.ans.net!swrinde!cs.utexas.edu!utnut!cannon.ecf!jang
References: <bmartin.22.008C1B19@origin.ea.com> <39v5ri$2a5@sandra.teleport.com> <Cz3uqp.GG@cs.ruu.nl>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.ibm.pc.games.rpg
Path: mbox-mo1.pugleaf.net!nntp.gmd.de!xlink.net!howland.reston.ans.net!swrinde!cs.utexas.edu!utnut!cannon.ecf!jang
From: ja...@ecf.toronto.edu (JANG  HIN LANG)
Subject: Re: Ultima 9 - What Do >You< Want to See?
Message-ID: <Cz70v7.5Ks@ecf.toronto.edu>
Sender: ne...@ecf.toronto.edu (News Administrator)
Organization: University of Toronto, Engineering Computing Facility
References: <bmartin.22.008C1B19@origin.ea.com> <39v5ri$2a5@sandra.teleport.com> <Cz3uqp.GG@cs.ruu.nl>
Date: Sun, 13 Nov 1994 06:33:05 GMT
Lines: 226
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit