English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. General (https://eab.abime.net/forumdisplay.php?f=37)
-   -   Ms Pacman (https://eab.abime.net/showthread.php?t=88183)

pink^abyss 13 April 2021 17:10

Quote:

Originally Posted by VladR (Post 1476638)
68060/Vampire will just give you an option to code it comfortably in high-level language, like C. Probably even using something like SDL or some other gfx layer.


Already an A500 with OCS can handle the game in C or C++. :agree

jotd 13 April 2021 19:22

never use SDL in action games. It crawls.

Pyromania 13 April 2021 19:40

@Vlad

Footman is debatably a better version of Pac-Man and it’s been on Amiga for many many years. Ms Pac-Man should be doable too.

Havie 13 April 2021 19:41

Had a look at the arcade sprites and put them into Dpaint - only use 12 colours for all graphics including mazes and sprites are only 3 colours as far as I can see so would be perfect for Amiga; it would seem that you could do all the moving graphics in sprites so probably any language would be good enough?

As mentioned previously, getting the ghost movement right is the biggie but if it's like the original then there are just three different ghost states and very simple AI which again would not be beyond any langauge.

Can we expect a Tiny Ms Pacman next...

Pyromania 13 April 2021 19:48

I’m hopeful for a Tiny Ms. Pac-Man.

:)

VladR 13 April 2021 21:03

Quote:

Originally Posted by pink^abyss (Post 1476657)
Already an A500 with OCS can handle the game in C or C++. :agree

Really ? What kind of C compiler was used ? And it's running at 50/60 fps ? Huh:shocked

You got me curious. The AI logic is about 1,200 lines of ASM code from my brief check earlier this morning. The C logic would easily expand to 3x-4x that (unless the compiler is really good).

Perhaps just the outer layer was written in C and innards were ASM ?

VladR 13 April 2021 21:06

Quote:

Originally Posted by jotd (Post 1476697)
never use SDL in action games. It crawls.

That's why I said 68060/Vampire :)

But, for some quick prototyping and experimenting SDL is great, unless one has an established ASM codebase already...

Still, experimenting with AI in ASM is lunacy. Best to try it all out quickly in higher level language and only when it works port it to ASM...

VladR 13 April 2021 21:21

Quote:

Originally Posted by Havie (Post 1476710)
Had a look at the arcade sprites and put them into Dpaint - only use 12 colours for all graphics including mazes and sprites are only 3 colours as far as I can see so would be perfect for Amiga;

Cool. That's about 0.0001% of work involved. Now, we just need the remaining 99.9999 % :)

Quote:

Originally Posted by Havie (Post 1476710)
...there are just three different ghost states and very simple AI which again would not be beyond any langauge.

Very simple, eh ? Huh. Last I looked it was around ~1,200 lines of code. Probably the same logic is repeated for each color of enemy (so, perhaps just 300 lines are unique), but that's just a guess as I certainly don't want to switch my brain to Z80 syntax right now...

Why don't you go translate the Z80 logic into something readable by everybody ? You don't even have to translate it to C, just some pseudocode that lists all FSM states, end conditions and all decision spots with exact behavior description (if.then.else).


If you do that, I promise I will rewrite it in my Higgs language in one day, ok :great ?

Havie 13 April 2021 21:59

This is quite interesting - you don't necessarily need to dissemble 1200 lines of code?

VladR 13 April 2021 22:11

Quote:

Originally Posted by Havie (Post 1476753)
This is quite interesting - you don't necessarily need to dissemble 1200 lines of code?

Well, you actually don't even need to disassemble anything - just read the comments in the source. I just can't read the comments without looking at ASM at the same time and because I am currently writing 68080 ASM code I most certainly don't desire to infect my brain with the Z80 malarkey...

Go to https://github.com/BleuLlama/GameDoc...mble/mspac.asm

And the first portion of AI starts at Line 5503 and continues for roughly ~700 lines.

I suspect the identical behavior is repeated for all 4 colors (red,orange,pink,inky) so in theory once you document behavior of one color, it should be the same for others. I certainly don't recall different behavior per enemy color, but it's been few decades since I played it...

Second portion starts at 6353 (ghost house release).
I forgot where is the third part now, but should be pretty obvious from the comments, if you scroll a bit further down.

Havie 14 April 2021 08:43

Whoops forgot to add the link:

https://www.youtube.com/watch?v=sQK7...l=DavidManning

Thorham 14 April 2021 13:19

Quote:

Originally Posted by VladR (Post 1476738)
Really ? What kind of C compiler was used ?

Dungeon Master for the Amiga and Atari ST was written in C using an old 80's C compiler, and Dungeon Master is a much more complex game than MS Pacman.

Quote:

Originally Posted by VladR (Post 1476758)
I suspect the identical behavior is repeated for all 4 colors (red,orange,pink,inky) so in theory once you document behavior of one color, it should be the same for others. I certainly don't recall different behavior per enemy color, but it's been few decades since I played it...

In Pacman each ghost has it's own behavior. Probably applies to Ms Pacman as well.

VladR 14 April 2021 15:29

Quote:

Originally Posted by Thorham (Post 1476877)
Dungeon Master for the Amiga and Atari ST was written in C using an old 80's C compiler, and Dungeon Master is a much more complex game than MS Pacman.

Yeah, but Dungeon Master isn't a 60-fps action game with tight controls. 90% of the time you are just wandering around an empty maze with basically ~nothing happening.

Even during combat, if some more complex logic caused overflow to next frame and fps dropped (and is it even VSYNC'ed in the first place?), you wouldn't be able to notice it. If the fps halved from 60 to 30 (or 30 to 15, whichever it is) in pac-man, you sure would notice.

But, clearly, this proves that Amiga must have had some amazing C compilers back in the day!
Now contrast that with Jaguar :laughing
Quote:

Originally Posted by Thorham (Post 1476877)
In Pacman each ghost has it's own behavior. Probably applies to Ms Pacman as well.

Thanks, I did not know that.
I might have noticed that quarter century ago, just didn't remember that today.

Havie 14 April 2021 20:41

Quote:

Originally Posted by VladR (Post 1476906)
Thanks, I did not know that.
I might have noticed that quarter century ago, just didn't remember that today.

If you watch the Youtube video - all is explained. :D

VladR 14 April 2021 21:43

Quote:

Originally Posted by Havie (Post 1476835)

Thanks, I somehow missed your response earlier today!

Great video!

BigD 03 August 2021 01:00

@Havie

Thanks for the video! Can anyone use this to programme the behaviour in an Amiga port? I could give it a go in Blitz Basic. Seems a bit of a challenge.


All times are GMT +2. The time now is 16:55.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04886 seconds with 10 queries