ACK bug discussion thread

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

Moderators: Ice Cream Jonsey, joltcountry

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

I'll check out the transparency thing, it's not intentional but should be fixable.

For room edges: yes, generally those should either be impassable or something that transports you elsewhere (portal or a space overlapping the next room) Throwback to ACS, I guess. I should probably prevent setting portal destinations to edges like that.

Standing idle on a portal -- I'll test that out, I have a guess what that might be. (Worldmaps used to be like that too)

Thanks for finding those!

I've found another bug: it seems like weapons set to use "ammo" don't consume it as you'd expect if you set the usage to something other than 100%. So I'll check that out for next patch too.

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

I spoke too soon on that transparency issue -- I think you may either have to use a black mask or not use empty map space. Transparency only works if a thing is on top of something else, if it sees "nothing" below then it assumes that a thing shouldn't be transparent and it shows it as-is.

I'll see if I can improve this later. Most likely I'll handle this by making the transparency mask color be a "reserved" color, and have the tile editor always show that color as purple, but have the rest of the modules always show it as the standard background color (generally black, but configurable). This would mean that whatever you use as your mask color can't be used as a regular color in any other tiles. On the plus side, it will mean you don't have to see the mask color in the map editor either.

I did manage to fix the portal thing you mentioned though, I'm uploading a patch now.

Reiver
Posts: 5
Joined: Mon Jan 12, 2009 5:32 pm
Location: Garland, TX

Map-killing bug?

Post by Reiver »

There is apparently a bug that freaks maps out if you delete an object in the object editor but remains in the map. I had an object "Floor" in the walkable areas of a map, but eventually I did not need it so I deleted the object from the object editor. However, the object remained on the map, which was a little annoying, but for a bit it was fine, until I created some more objects, and then somehow each space of my floor that is supposed to be empty floor now comprises of a few layers of objects (and this is an overworld style map) that are a pain to delete because if I try, it randomly kicks me to the top of my map. What is even weirder is that in-game, the floor cycles between different object until it cycles into a solid wall, eventually trapping the player forever. Bizarre.
-Reiver

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

I'll see if I can add a utility that can scrub the maps of an object you want removed. (It will probably act as a search and replace, so that stacks wouldn't have to be resequenced)

And bad things definitely happen if you replace a terrain object with a moveable item like that... you end up with items on the map with (as you saw) invalid records of what's under them.

This is probably the least reassuring response, but I would recommend making frequent backups of your game in progress, as protection against things like these. It's generally fairly straightforward to restore just a part of a backup (I'm constantly doing things like making changes and then deciding "no, I like the old version of region 7 better...")

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

Post by rld »

Playing around with the step macro function, I encountered something a bit odd. Basically, all I did (this is on the latest version 3.250) is create a new adventure, import the ULTIMA kit, create a new region with one room, draw a wall around the room, and set the player to start in that room.

Then, I enabled the step macro for that region and tried out a simple macro (set as macro #50) to test:

SET HP=HP-1

So that works as expected. When the player moves, or attacks, or does much of anything, the step macro decrements HP by 1. After a bit, the player dies, of course, when HP reaches 0.

Then, I tried adding in a MAPADD to the macro:

SET HP=HP-1
MAPADD 4 4 24

Object #24 is the standard grey brick wall. When I play the adventure with this version of the macro, the step macro immediately fires over and over, and HP spirals down to zero and the player dies without having a chance to do anything.

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

Interesting -- I think I know what might be going on there,

1. Stepping triggers the step macro.
2. Editing the map triggers a screen refresh (as if you had stepped)
3. That screen refresh triggers another step macro...

etc. :)

I'll check it out. I like your approach :) In practice of course, macros that edit the map should either be something that only runs once, or something that does a check of that map spot to see if it's already done. (Which is probably why I haven't run into this bug before)

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

Post by rld »

Chris H wrote:Interesting -- I think I know what might be going on there,

1. Stepping triggers the step macro.
2. Editing the map triggers a screen refresh (as if you had stepped)
3. That screen refresh triggers another step macro...
So every time you make a map change in a macro, it refreshes the screen? I was wondering if it was possible to display an animation (for example, moving an object across the screen) by adding and deleting an object repeatedly.

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

More accurately, when a macro does something like change the map or change the player's location, it tells the engine to do a refresh when the macro ends. So no, you couldn't animate something this way.

Mosaics were originally intended for this sort of animation, although (and I'd like to fix this, thanks for reminding me) they only really properly line up on certain room sizes.

I think I'll add another mosaic macro command that will align the upper-left corner of the mosaic with the upper-left corner of the current view area. This will allow the kinds of effects you're talking about.

You can also (as I did in U4PART2) use the TBMP command to overlay anything you want. I used that for things like the "Zzzz" speech bubble that happens when you go to sleep.

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

Post by rld »

Chris H wrote:More accurately, when a macro does something like change the map or change the player's location, it tells the engine to do a refresh when the macro ends. So no, you couldn't animate something this way.
Hmmm. So what if I had the step macro do a sequence of events by having it perform a different action each time it was called? Something like

if var=1 {
put object at 1 1
var=2
endmacro
}
if var=2 {
put object at 1 2
var=3
endmacro
}

and so on. As long as you don't change the feature that allows this to work (performing a map edit in any macro including the step macro causes another run of the step macro after the macro exits), I might be able to hack this to perform animations.

The only thing I'm not sure of is if the code that runs the step macro as part of a screen refresh is being called recursively or not. I couldn't tell by looking at the source code. Maybe you can tell me if what I am considering is a Bad Thing that is likely to crash the ACK engine, or if I should limit it to a certain number of iterations, or what.

Chris H wrote: I think I'll add another mosaic macro command that will align the upper-left corner of the mosaic with the upper-left corner of the current view area. This will allow the kinds of effects you're talking about.
Maybe you could also add an 'offset' parameter to allow the mosaic to be shifted? This would allow for things like a animation centered on the player, no matter where the player was in the room.

Something like

RMOSAIC <num> <ofsx> <ofsy>

where <num> is the mosaic number and <ofsx> and <ofsy> are the positive X and Y offsets. So this would operate like TMOSAIC with empty squares ignored, but with the upper left corner of the mosaic aligned to the upper left corner of the current view area plus <ofsx>, <ofsy>. Any tiles falling outside the current view area would be clipped.

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

Post by rld »

Oh, also... is there any good way for a macro to determine the X and Y size of the room that the player is currently in? (for non-worldmap regions)

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

Not currently, but it would be an easy addition. I'm also looking at adding FOR loops.

jjsonick
Posts: 145
Joined: Tue Apr 10, 2007 2:49 pm

Post by jjsonick »

rld wrote:As long as you don't change the feature that allows this to work (performing a map edit in any macro including the step macro causes another run of the step macro after the macro exits), I might be able to hack this to perform animations...
.

Just a quick vote that I'm much rather see animations supported by some official method instead of through this refresh-with-step-macro-mapadd bug, because currently this bug makes several things I want to do (through more expected uses of mapadd) impossible.

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

Post by rld »

jjsonick wrote:
rld wrote:As long as you don't change the feature that allows this to work (performing a map edit in any macro including the step macro causes another run of the step macro after the macro exits), I might be able to hack this to perform animations...
.

Just a quick vote that I'm much rather see animations supported by some official method instead of through this refresh-with-step-macro-mapadd bug, because currently this bug makes several things I want to do (through more expected uses of mapadd) impossible.
Well, obviously it would be easier to do animations with a less convoluted method - I was just trying to think of a way to do it without bugging Chris for more features yet again... :)

Something that would make non-mosaic animations (i.e. generated on-the-fly) much easier would be one of these two possibilities:

1) Add a REFRESH macro command (to redraw the entire screen), or a REDRAW <x> <y> command to just refresh a single tile.

2) Add a TILE <gtile> <x> <y> command which would explicitly draw a specified graphics tile anywhere in the current room/worldmap viewport. Like BMP and TBMP, it would be the macro's responsibility to save and restore the screen before and after the animation had completed.

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

I like the idea of the TILE command. Getting it to respect transparency rules might be tricky though. The REFRESH and REDRAW commands wouldn't easily be possible, as the macro engine has no real direct access to the map display routines.

In practice I found it easier just to do a mosaic sequence to get the point across. If you're in a 16x11 room (or any other even x odd room size) mosaics do line up, so TMOSAIC is an option.

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

Post by rld »

Chris H wrote:I like the idea of the TILE command. Getting it to respect transparency rules might be tricky though.
What do MOSAIC and TMOSAIC do when they draw tiles? Do they try to handle transparency? I had assumed that the TILE command would basically work like a single-tile mosaic and just overwrite whatever was currently on the tile.

Or could you just have the transparent part of the tile let whatever was currently on the screen show through? I haven't played around with the transparency settings much, so I don't have a good feel for how that part of the ACK engine works yet.

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

Bug update: it looks like I've found out the true cause of the sound skipping issue (most pronounced in the U4PART2 game intro) and this should get fixed in the next patch, in about a week or so.

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 »

Chris H wrote:You can also (as I did in U4PART2) use the TBMP command to overlay anything you want. I used that for things like the "Zzzz" speech bubble that happens when you go to sleep.
hi Chris, I've been using the TBMP method for speech bubbles as you did in U4P2. It is tricky getting the speech bubbles to line up where I want them in variously sized rooms. What I'd really like to be able to do is have speech bubbles pop over a PC or NPC wherever that icon is on the map. Is something like that possible with a macro? So far I've had to restrict the speech bubbles to immobile npcs.

BTW Chris: I've been making sets for ACK ripped from the Amiga version of ACS. They are the best looking ACS icons and would be a great addition to your Rivers of Light conversion project.
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:
Chris H wrote:You can also (as I did in U4PART2) use the TBMP command to overlay anything you want. I used that for things like the "Zzzz" speech bubble that happens when you go to sleep.
hi Chris, I've been using the TBMP method for speech bubbles as you did in U4P2. It is tricky getting the speech bubbles to line up where I want them in variously sized rooms. What I'd really like to be able to do is have speech bubbles pop over a PC or NPC wherever that icon is on the map. Is something like that possible with a macro? So far I've had to restrict the speech bubbles to immobile npcs.
I would like to see a version of TBMP that could utilize bitmaps which are smaller than the 320x200 screen size, with an 'offset' parameter which would allow the macro to draw the bitmap starting at a given location. So if you had:

SBMP 5 100 100

it would draw bitmap 5 (using the same transparency method as TBMP) on the screen with its upper left corner at pixel position 100, 100. This would allow you to have a small bitmap that you could draw near or on a given NPC or PC for speech bubbles, magic spell animations, etc.

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

Post by rld »

In ACK 3.251, I can't seem to edit the MP regen rate on page 5 of the configuration editor. I can change the HP regen rate by pressing 'H', but when I press 'M' nothing happens.

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

Post by rld »

Trying out transparency for the first time in the project I am working on (the auto-edge function is excellent, BTW), and noticed two things.

1) I think this has been reported before, but if you have a transparency mask on your player, you can see the transparency color (I'm using color 255 in the standard palette) if you walk over a blank map space.

2) If I make a 'floor' object and place a transparency-enabled object (or the player) over it, it displays fine. However, when I have a transparency-enabled item on top of a floor tile, and then I walk the player on top of that, the player's transparency mask displays in color. I would expect to see the player, and then the item under that, and then the terrain under that.

UPDATE ON #2:

Ok, I think I have a better handle on what's going on now. The transparency of the *player* is working correctly, but if you move the player (w/transparency) on top of an item (w/transparency) which is on top of a terrain, the player icon displays correctly, but the *item* underneath the player displays incorrectly, with its transparency color shown, and the terrain beneath the item can no longer be seen. I also see this in the U4PART2 adventure, but it is a bit less noticeable there because the transparency color is black.

Additional, semi-related item:

In the item selection screens (Use, Ready, Drop) as well as the inventory screen, the transparency mask color of items displays as its actual color, not as black.

Post Reply