[WIP] ACK Mega-Patch

Chris H.'s Ultima / ACS-style game development system!

Moderators: Ice Cream Jonsey, joltcountry

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

[WIP] ACK Mega-Patch

Post by rld »

After playing around with various tweaks and additions to the ACK player module using the source code that Chris so generously made available, I am planning to roll a number of items into a 'mega-patch' that will be used in upcoming projects I am working on.

Once I have it working, I will release it (along with the source code modifications) so that anyone else who is interested can use it in their projects as well.

Here are the features that I am planning at this point. Note that the changes will be to the player module only (not the editor modules) and so the data files will remain 100% compatible between the patched and standard versions.

In general, the use of features will be variable controlled so that someone using the patch has a choice whether to use some or all of the modifications in their game.

1) If a certain bit is set in the Z variable, silently block the Look command.

2) If a certain bit is set in the Z variable, silently block the Get/Drop commands.

3) If a certain bit is set in the Z variable, silently block the Talk command.

4) If a certain bit is set in the Z variable, when the 'I' (Info) key is pressed, skip the Info screen and go directly to the inventory display.

5) If a certain bit is set in the Z variable, when the player attempts to move in a direction, immediately (before any conditions are tested or an actual attempt is made to move) set the D variable to a value corresponding to the direction of the move (north=1, south=2, west=3, east=4). This is a replacement for the LASTMOV mechanism which has some issues, and also (because variable D is testable by terrain conditions) will allow things like 'one-way' spaces and terrain that can only be travelled through in a certain direction. (Or a portal that can only be entered from one side, etc, etc.)

6) If a certain bit is set in the Z variable, check the S variable when the player attempts to save. If S is non-zero, then block the save and display the short message (BMSG) whose number is contained in S.

7) Allow the option for weapons to do damage based on a 'die roll' formula (like 3d6+2) instead of a linear random range. Implement a similar option for the amount of damage blocked by armor.

8) Fix the touch macro, and allow both melee and ranged weapon hits to trigger it. (This allows the implementation of creatures that cast line of sight 'spells' on the player.) Pass the following variables to the touch macro:
V - Number of points of damage inflicted. This can be changed to a different value by the macro; if it is reduced to zero by the macro, no hit message will be displayed.
W - Type of weapon that triggered macro (obj number)
X, Y - Location of creature whose attack triggered the macro.

9) Additions to death macro. Pass the following variables to the creature death macro.
V - Set to zero before calling the macro; represents the creature's current hit points. If the macro sets this variable back to a nonzero value, the creature's hit points will be set to this value and the creature will not die. This allows the implementation of creatures that regenerate, change form or run away after taking a certain amount of damage.
W - Weapon type that killed the creature.
X, Y - Location of creature.

10) Fix the check for maximum range when creatures use distance weapons.

11) If a certain bit is set in variable Z, ignore encumberance calculations and instead use the 'weight' field of weapon objects to hold 'type' flags. Similarly, the EXP field in creatures will hold 'invulnerable to type' flags. If only a few of these flags are used, however, the EXP field can still be used to grant experience to the player.

For example, if a weapon had weight 4 (bit 2 set), and a creature had experience of 12 (bits 2 and 3 set), the creature would take no damage from that weapon. A special message ("YOUR ATTACK HAS NO EFFECT" or something similar) would be displayed to let the player know what is going on.

However, a creature that had experience 3 (bits 0 and 1 set), or 0, or any other value where bit 2 was not set, would take damage from the weapon normally.

12) Implement the following expansions to the DRAW macro command (as detailed in a previous post):

- Get or set the HP of a nearby creature.
- Get or set the type of a nearby creature.
- Draw a single tile (not using transparency) at a specified location.
- Get the EXP field of a nearby creature.
- Draw an SMSG and return immediately without waiting for a keypress.

If anyone has any feedback, or any other ideas that would not be too complicated to implement, let me know.

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Wow. This will certainly make things more intersting! Hey rld, I recall a while back some complaints that activate all underneath wasnt working so I have basically been avoiding it. In what sorts of cases will or will it not work at the moment? As for other ideas for tweaks you might look into. I'm sure I can think of few [ill get back to ya when ive compiled a list].

Of course you know I am always the first to ask for more tiles per game but I know that is probably asking for too much. It would be cool if say the mechanism used by the importer to grab tiles from other ACK games could be somehow used by the map editor to effectively double the number of tiles that could be choosen by set later.

Also if npcs could ignore their main icon setting and only use icons set for animation which are taken from the secondary set that would free up an extra primary tile slot per npc.
Which of you is interested in my fine wares?

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld »

Based on some quick experimentation, this is what appears to be working and not working when using the ACTIVATE ALL action for spaces and obstacles. Of course, this only applies to room-style regions as worldmap-style regions do not let you stack terrain.

Code: Select all

ACTIVATE ALL (Room Regions only)

SPACES

Triggered By:
   PASSING                         -> Yes
   DROPPING ITEM HERE      -> No
   PASSING, HOLDING                -> Yes
   PASSING, REDEEMING      -> No
   PASSING, WITHOUT                -> Yes
   EXAMINING, FAR                  -> Yes
   BUMPING                         -> Yes
   BUMPING, HOLDING                -> Yes
   BUMPING, REDEEMING      -> No
   BUMPING, WITHOUT                -> Yes
   IF ATTACKED             -> No
   TAKING ITEM FROM HERE   -> No
   EXAMINING, NEAR                 -> Yes
   GATHERING FROM HERE     -> No

OBSTACLES

   BUMPING                 -> No
   BUMPING, HOLDING        -> No
   BUMPING, REDEEMING      -> No
   BUMPING, WITHOUT        -> No
   IF ATTACKED             -> No
   TAKING ITEM FROM HERE   -> No
   EXAMINING, NEAR                 -> Yes   
   GATHERING FROM HERE     -> No
   EXAMINING, FAR                  -> Yes

I might be able to fix the DROPPING ITEM HERE trigger for spaces, as I found where it is handled in the code. PASSING/REDEEMING and BUMPING/REDEEMING have simple workarounds because you can always just code them as PASSING/HOLDING or BUMPING/HOLDING and add a 'TAKE ONE <x> FROM PLAYER' to the stack.

The IF ATTACKED and TAKING ITEM FROM HERE triggers would also be nice to fix for Spaces, but I haven't looked into those yet.

Heather Harrison
Posts: 44
Joined: Fri May 21, 2010 8:40 pm

Post by Heather Harrison »

I'll be waiting for this big patch. It would solve some of the problems I've been having with the Ultima II remake.

Thanks for going to the effort to provide this.

Heather

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Hey thanks rld that little chart will get a lot of mileage.

I just thought of what I most want to be able to do with an ACK design. I'd like to turn off combat completely! lol. Yep, you heard right. Being the hard core Wasteland [not to mention Bard's Tale which used the same combat] fan that I am, I'd really like to make an ACK adventure with a more dialog style combat system so you see a nice pic of the monster or monsters your fighting and can read a bunch of colorful descriptions of each attack that is made by you and your opponents. And be able to deal dmg out to both the player and the enemies as needed on a round by round basis after the player has chosen what combat options he or she wants for the next round.

I've toyed around with the idea already and experimented a little but didnt get very far with it. Perhaps someone with more programming ability like you or Heather could pull something like that off with the existing macro and dialog commands but I just get lost in a bunch of spagetti code when I try it. So maybe there is something you could addin to make this idea a little easier to impliment. As I said, turning off combat would be a start, although I would still like to use some of the built in combat mechanics if that would be possible while at the same time freezing the map display untill the virtual [verbal?] combat is over.
Which of you is interested in my fine wares?

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld »

Heather Harrison wrote:I'll be waiting for this big patch. It would solve some of the problems I've been having with the Ultima II remake.
If there are any features in particular out of the list that you were interested in, let me know and I will focus on getting those done first.

Otherwise I will probably just do the easiest first. :)

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld »

Garth's Equipment Shop wrote: I just thought of what I most want to be able to do with an ACK design. I'd like to turn off combat completely! lol. Yep, you heard right. Being the hard core Wasteland [not to mention Bard's Tale which used the same combat] fan that I am, I'd really like to make an ACK adventure with a more dialog style combat system so you see a nice pic of the monster or monsters your fighting and can read a bunch of colorful descriptions of each attack that is made by you and your opponents. And be able to deal dmg out to both the player and the enemies as needed on a round by round basis after the player has chosen what combat options he or she wants for the next round.
I had thought before about the possibility of implementing a different combat system as well. I think one way to go about it might be to run it as a dialogue; that would allow for the scrolling messages, and you could show a picture of the opponent as a dialogue skin.

The actual back-and-forth of trading attacks between the player and the creature would have to be handled with macros embedded in the dialogue; I'm not sure how elaborate you could make it without having to copy lots of code over and over for each different creature.

It might be interesting to look into, though. If you think of any feature hacks that would help make this possible, let me know and I will see what I can do.

Heather Harrison
Posts: 44
Joined: Fri May 21, 2010 8:40 pm

Post by Heather Harrison »

Most of your proposed improvements look useful. Probably the ones that would be most helpful now are the fixes to the touch macro, the creature death macro change, the weapon die roll improvement, and (especially) the change to the DRAW command to draw an SMSG. That last improvement would probably be helpful with status/inventory screens, custom merchant menus, and the like.

Some of the other changes in the draw command look useful, especially the way that it will allow more control over creatures. Once this is implemented, I might make a few more spells to take advantage of it.

Ultimately, these improvements will allow the final battle in the game to work properly; it will be possible to make Minax immune to all weapons except the quick sword.

Thanks.

Heather

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

rld wrote:I had thought before about the possibility of implementing a different combat system as well. I think one way to go about it might be to run it as a dialogue; that would allow for the scrolling messages, and you could show a picture of the opponent as a dialogue skin.

The actual back-and-forth of trading attacks between the player and the creature would have to be handled with macros embedded in the dialogue; I'm not sure how elaborate you could make it without having to copy lots of code over and over for each different creature.

It might be interesting to look into, though. If you think of any feature hacks that would help make this possible, let me know and I will see what I can do.
Ok I dug into the source and found this:
780 {sound effect}
781 if damage>0 then
782 begin
783 soundeffect(ack.hitsound,1);
784
785 scrollsay(crc^[attacker_id].n+' HITS YOU FOR '
786 +strnum(damage)+' DAMAGE!');
787 if crc^[rcrc^[who].crcsource].touchm<0>=30 then run_macro(crc^[rcrc^[who].crcsource].touchm);
790
791 if hitpoints<=0 then scrollsay('YOU HAVE BEEN KILLED!');
792
793 end else
794 begin
795 scrollsay(crc^[attacker_id].n+' ATTACKS YOU AND MISSES!');
796 soundeffect(ack.misssound,1);delay2(combatpacing*3);
797 end;
798 if hitpoints<=0 then hitpoints:=0;
799
800 ack.hp[0]:=hitpoints;
801 graphHP;
802 chunksave:=true;
803 hitcreature:=true;
804 end; {target is player}
805 erasebottom:=1;
806 end;

...and then the Player Attack handling further down in same file...

1760 'A':begin
etc etc...

and then the select direction to target part...
1895 begin
etc etc

I got to thinking. You shouldnt have to select direction to attack every time. After the first time or when an enemy initiates the attack on the player, it should be obvious which direction or which enemy the player is attacking and thus the game should just get on with the fighting only pausing to ask if player wishes to keep attacking, or defend, flee, surrender, reload, recharge, parlay, recruit, tame, cast spell, make face at enemy, play bard song, do crazy eyes, or whatever we decide to add in there for encounter options.
Which of you is interested in my fine wares?

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld »

Garth's Equipment Shop wrote: I got to thinking. You shouldnt have to select direction to attack every time. After the first time or when an enemy initiates the attack on the player, it should be obvious which direction or which enemy the player is attacking and thus the game should just get on with the fighting only pausing to ask if player wishes to keep attacking, or defend, flee, surrender, reload, recharge, parlay, recruit, tame, cast spell, make face at enemy, play bard song, do crazy eyes, or whatever we decide to add in there for encounter options.
That would work if the player is only fighting one creature at a time, but would be more problematic if you have more than one enemy creature next to the player.

It would be useful to have an 'Again' command that would repeat the last attack that the player performed, but this would not be trivial to code up since attacks can be either melee or at a distance (which includes targeting). Since creatures targeted at a distance can move in between attacks, attacking 'again' might not necessarily mean hitting the same location over and over; you might want more of a 'lock-on' function to allow a 'target' creature to be specified. Again, not trivial.

Probably what would be easier to do would be to have a battle sub-screen where combat would play out, then when the player wins (or is killed or retreats) the action returns to the main map screen. Sort of the 'random encounter' form of RPG combat, closer to Final Fantasy and similar games than to Ultima's combat model. But of course in this case what you are doing is throwing out the entire combat system and implementing your own from scratch, probably involving a lot of complicated macros. But it could definitely be done....

Post Reply