AtariAge Forums: AtariAge Forums -> EricBall's Tech Projects

Jump to content

Subscribe to EricBall's Tech Projects        RSS Feed

look-ahead bug fixed

Okay, I've fixed the look-ahead bug which was causing the ladder issues vdub_bobby was noticing. I think you'll find the leprechauns to be a little smarter now. Leprechaun Level Editor updates as usual.

Oh, one note. The AI for swinging on ropes is the same as running with the one exception of falling when the player is directly below. (Note - it may be possible to run under a leprechaun and not trigger this behaviour.) So when the player is higher than the leprechaun they will do look-ahead drop-off detection at the end of the rope & automatically reverse direction and go into hunt mode.

One bug fixed, one needs some thought

Thanks to vdub_bobby, I'm making progress.

Okay, I've fixed the problem with the leprechauns getting stuck. (I had a BPL in the en_stop routine where I shoulda had a BMI. So hunt mode wasn't working right. There may have also been an error in the "rotate joystick" lookup tables.) I'll update the Leprechaun Level Editor shortly (check the date).

The problem with the ladders is a little trickier. It has more to do with the lookahead routines and that I'm using the same one for both the run dropoff detection and the ladder exit. This one needs some more thought to work through. I'll probably end up with two routines, though I'd like to avoid it as much as possible.

tweak, tweak, tweak

Minor update from yesterday. The leprechauns now try to go towards the player when they stop before they go into hunt mode. (Which should help vdub_bobby's switchback level.) They also should drop off the ends of ropes when stopped.

I also flip-flopped on the drop-off detection, though I'm not certain whether I like it. The Leprechauns now turn around and go into hunt mode when the player is above them and they encounter a drop-off. Unfortunately, with my built-in level this causes them to go into a loop if the player does nothing at the start, which they only get out of because they bump into one another. (In the previous version there was a chance the leprechaun would walk off the drop-off anyway.)

I also fixed the sprite color debug code so you can tell when the leprechauns are hunting (bright) rather than chasing (dull). I'll update the Leprechaun Level Editor as well. (Mostly so I can test using the various levels which have been created.)

I know these AI...

Hunt and chase returns

Hopefully this will be the last update to the enemy AI routines. I would appreciate if the various level creators can update their levels to the latest code (using the Leprechaun Level Editor, v20061101) and see how well things work. For the attached WIP the leprechauns eventually find the player at the starting position, something I was having great difficulty accomplishing with drop off detection.

The Leprechaun (and player) color indicates the direction their joystick is pointing:
gold	UPorange	DOWNpink	LEFTblue	RIGHTpurple	UP & LEFTviolet	DOWN & LEFTlt blue	UP & RIGHTcyan	DOWN & RIGHT

A lighter color means the leprechaun is in hunt mode, versus chase mode. The AI is mostly based on the last action and hunt versus chase mode. See do_enemy in LEPBANK1.ASM for the gory details.

mischief managed

Last entry I complained that I'd run out of space. Well, I've now managed to free up a whack-o-space, which has (at least for the moment) cured my space issues. I'm now trying to work out what the heck my enemy AI code is doing (along with some code tweaking). I'm hoping I can get a new release out in the next couple of days.

For those curious, I found the space in my kernal (of all places). Since I knew I needed a goodly amount of space (i.e. not just a few bytes), I first looked at the listing and divided the code (and data) into chunks (i.e. enemy AI) along with how big each was. The theory it's easier to find savings in a big chunk of code (or data) than a small routine. For Skeleton+ I removed a color lookup table used as part of the Skeleton dead sequence and replaced it with a random number generator (since the colors looked mostly random anyway). Unfortunately there aren't any similar tables in Leprechaun.

The biggest routine in the first bank...

who let the bytes out?

"Origin Reverse Indexed", i.e. I've run out of space somewhere in the code. My latest AI changes filled bank 1, grump. I managed to squeeze out the few bytes, but I wanted to add some debugging code to help me figure out how well the AI meets my expectations. There's also a couple of TODOs left in the code. I guess I'm going to have to start looking for places to optimize. Un-fun.

Leprechaun AI grumbling

I've attached my current WIP, but no updates to the LLE since this version has obvious issues even with my built-in level.

I've added in the "walking on heads" feature. (It actually wasn't as hard as I thought it might have been as it required changes to only one bit of code.) When I first added it the leprechauns had an amusing habit of walking across the screen on top of one another. The look-ahead code took care of that but causes other quirkyness & problems. Hmm... just realized I need to check to make sure the leprechauns can't walk on the player's head. Yep, used BNE instead of BPL, so that should work.

Anyway, one important note: unlike Lode Runner, the leprechauns don't stop moving when they fall into a hole. Thus, if the hole is two bricks wide they will wander back & forth. This means two brick wide holes will probably not catch two leprechauns since the second walks over the first.

But the big change in this version is...

Leprechaun - more AI updates

I'll also update the Leprechaun Level Editor in a minute.

Updates:
1. enemies on ropes will fall if you pass under them
2. enemies get off ladders before they get to the top
3. simple enemy-enemy collision detection to keep them from getting stuck together (sometimes they pass through each other, sometimes they bounce, but they shouldn't stay in lockstep)
4. code tweaks and a fix so the player doesn't always face left when stopped

I haven't put in the drop-off detection yet. From a code perspective it's an extension of the ladder enhancement, but I'm not sure how it will impact gameplay. I'm concerned it might lead to the enemies getting stuck more easily when the player is higher than them. Even now there are a lot of cases the enemy AI doesn't effectively chase the player. (It's easy enough to put in a kind of "left-wall-follow" logic, the trick is knowing when to stop!)

Hmm.... I wonder if hunting until the enemy is...

Page 1 of 1

March 2010

S M T W T F S
 123456
78910111213
14151617181920
21 222324252627
28293031   

Recent Entries

Recent Comments

Search My Blog