News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Axelay

Elevator Action - A speed patch

Started by Axelay, 08:08, 04 November 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Axelay

Hi All

I recently found myself looking at Elevator Action and discovered it had quite a bit of unused memory, a little over 4kb.  My brother bought the game back in the day, and the most disappointing thing I remember about it had been the slow speed.  With that amount of unused memory, I thought it would be interesting to see if I could make an optimisation or two for the game and speed it up a bit, without making substantial rewrites of code or taking too much time from other projects.

So at the end of that exercise, I was able to increase the game speed by a couple of screen refreshes.  It doesn't really look much different, but to me it feels a little nicer to play, so I thought I'd share it in case anyone is interested.

I should add I haven't tested this extensively, only playing through the first few levels.  It's always possible I have inadvertently broken something that only happens later, but I get the impression from youtube videos that the game doesn't add much in later levels beyond a different wall colour and those enemies laying on the ground which you see as early as level 2, so I think it is probably fine.

On the attached dsk image you can play the game with the patch using run"ea".  You can still play the game in it's original form by using run"disc" or run"disk".

ervin

Nice work!
To me that feels a lot better - it's significantly faster, and looks a lot smoother as a result.

roudoudou

Great job, the game is really moaaaarrr enjoyable!

Xyphoe

Oh great work!!

It is most definitely better and far more enjoyable!

I wish I had this version before I did my longplay video last year!



I just did 3 or 4 levels and didn't encounter any bugs or crashes - yup so far so good!

Also the coder Jas C Brooke is in the comments on my video, I'll post there and let him know about this - he might be interested in it :)

rexbeng

@Xyphoe perhaps it would be interesting to make a side by side comparison video between the two versions. I'm not sure how possible it would be to repeat the exact steps when playing both versions but, hey, you are the expert gamer around this place. :D

Anthony Flack

This is quite an improvement. I'm curious; what were the main optimisations?

Axelay

Quote from: Xyphoe on 19:00, 04 November 23I just did 3 or 4 levels and didn't encounter any bugs or crashes - yup so far so good!

Also the coder Jas C Brooke is in the comments on my video, I'll post there and let him know about this - he might be interested in it :)
Thanks.  I did see your video when I was trying to find examples of stages from later in the game and saw that Jas C Brooke had left a comment with some interesting background info.  I had never actually seen the C64 version before, that was a bit of an eye opener!

Quote from: Anthony Flack on 11:36, 05 November 23This is quite an improvement. I'm curious; what were the main optimisations?
There were only 4 optimisations in total so I will just list them all.

1. Stored the background character data in a way more consistent with the video memory to reduce calculations involved in both printing them to screen and referencing them, so that set/res can be used to traverse video memory, and character data is split and page aligned across 8 sets of 256 byte blocks.  This improved speed by about 1 screen refresh.

2. Converted the most commonly used background characters in to 'compiled' tiles (or inline or direct addressed), which saved about 2/3 of another screen refresh.

3. Changed sprites from using a bit mask that tested each pixel of a sprite byte individually to using a lookup table to find the mask for the byte.  This saved about 20% of time on the sprite routine but provided little discernable improvement to overall performance.

4. The majority of sprite frames were 4 bytes wide and the sprite code processes each byte in a loop, so I added in a check for 4 byte wide sprite frames and diverted to an unrolled routine for those frames that was almost twice as fast as the original sprite print routine. That allowed the game to run at a more consistent frame rate regardless of enemy count, though I expect if there's a lot of sprites on screen that aren't 4 bytes wide it will push out to an extra refresh.

mahlemiut

One little issue I have with this, is that the vertical scrolling in elevators is a bit too fast, making it really difficult to accurately aim while moving an elevator.  Could it possibly be smoothed out and/or slowed a bit.  Otherwise, it feels much nicer to play.
- Barry Rodewald

Anthony Flack

#8
The elevators move WAY too fast, the jump is all wrong and there's weird gore, but that's just how the CPC version of Elevator Action is. I was always disappointed it didn't play more like the arcade game in terms of feel, and it still doesn't, but it's a better game now than it was.

Reading the comment left by Jas Cooke in Xyphoe's video, apparently the 8 bit ports were all based on the MSX version (which is actually pretty accurate to the arcade, although very choppy) and they never even got to play the arcade game! Which surprised me as it was a popular game and down here you'd still run into an Elevator Action cabinet here and there, well into the 90s.

We shouldn't be surprised that games turned out different from the original when the people porting the games didn't even get to play the original...

Xyphoe

Yea Jas is in the comments on my vid again and he's seen the topic/remake!

His first comment is definitely fascinating, they weren't given the arcade or PCB - but rather the Japanese MSX to work from! :doh:

The story about the C64 version was funny though! You see a small bit of the C64 footage at the 19:45min mark on my vid, it's a truly dreadful port!

Anthony Flack

It's remarkable that the animated title screen from the arcade game still made its way over to the CPC so faithfully. I always thought that was cool. It wasn't often you saw so much effort put into a title screen on the CPC. It does explain why the elevator cables are missing, since they aren't present on the MSX version either.

Axelay

Quote from: mahlemiut on 22:10, 05 November 23One little issue I have with this, is that the vertical scrolling in elevators is a bit too fast, making it really difficult to accurately aim while moving an elevator.  Could it possibly be smoothed out and/or slowed a bit.  Otherwise, it feels much nicer to play.
Sorry, but no, or at least not by me.  I don't really have the time to spare for a deeper look in to it.  All I have really looked at is the display code, not the game logic, which is where you'd need to look to reduce the elevator speed without reducing the game speed.

Anthony Flack

#12
What you've done is fantastic.

This inspired me to fire up the arcade version last night, and it is still a great game. I was idly thinking about what a Plus port could look like, but it's a pretty complex game for 1983. All those moving elevators, and a fairly sophisticated AI. I love those little spy guys! It's not something that I would like to be tasked to convert over a few weekends.

They were slavedrivers over at Binary Design; the Pickfords' stories of working there were similarly grim. It sounds like there was a lot of worker exploitation going on in those days. Boss drives a Ferrari while their dungeon full of 20-year-old coders are working 100 hours a week on minimum wage, seemed to be the way of things.

Like the fact that Jas had written his own music for the game and had to take out again because they didn't want to have to pay him a composer's fee. So typical.

redbox

#13
Quote from: Anthony Flack on 22:55, 06 November 23I was idly thinking about what a Plus port could look like, but it's a pretty complex game for 1983. All those moving elevators, and a fairly sophisticated AI.

But it was written on a Z80 based system...  :D

And even the classic CPC can do a 1 pixel vertical scroll using R5 (especially using a 256 pixel wide screen).

Anthony Flack

#14
I guess you could try lifting the entire logic part of the arcade code. Probably the only way you'd get the enemy spy guys' behaviour to work right.

There's only a maximum of five sprites on screen as far as I can tell (usually four) and at most maybe six bullets so yeah you could do something on a regular CPC, and the 256 pixel wide screen makes hardware scrolling extra convenient. The only reason I was thinking of the Plus was because a 128 pixel wide Mode 0 screen doesn't leave the character sprites looking too good.

Axelay

Quote from: Anthony Flack on 22:55, 06 November 23What you've done is fantastic.

This inspired me to fire up the arcade version last night, and it is still a great game. I was idly thinking about what a Plus port could look like, but it's a pretty complex game for 1983. All those moving elevators, and a fairly sophisticated AI. I love those little spy guys! It's not something that I would like to be tasked to convert over a few weekends.


Thanks.  In turn you inspired me to give the arcade a go, as I don't think I've actually played it before.  I can see how those much slower lifts make for a quite different game to how it plays on CPC, you have to be much more alert.  Brings every floor in to the game by comparison, no casually flying past floors you don't care about like you can on the CPC version!

Anthony Flack

Yeah, the initial descent down the long elevator shaft becomes much more of a gauntlet, especially when the AI starts getting more aggressive. They absolutely will shoot you on the way down if you try to just sail though.

I've made it as far as the fifth building so far, at which point the wall colour cycles back to the first building again, the red doors appear in increasingly inconvenient places, and the spy guys are behaving like hyperactive little ninjas, and start doing their lying flat on the floor move which evades your crouching shot.

Powered by SMFPacks Menu Editor Mod