Jump to content
IGNORED

A New twist on Pac Man?


1980gamer

Recommended Posts

Tried starting from the ground up in each routine.

 

How do you like the maze? Take that Atarisoft!

 

Okay, I have added a second control method.

 

Original ESDX for up/left/right/down then reversing in MIRROR Mode the Left and Right.

ADDED: IJKM where J is always left and K is always right.

The second control has a catch... if you go through a tunnel, you must switch directions on you own when the mode flips.

I use the S and D keys to get out of the tunnels. You'll get it when you try it!

 

The red ghost is pretty agressive. The others are not. I may add a forth ghost. But I will have to think about the flickering....

 

This is not where I wanted it to be, I counted dots wrong, you finish the maze with 10 dots left.

It is fixed in the text version.

 

I spent a lot of time on cornering, but I am not having any luck.

 

I will make a smaller demo to to try to figure out how to ignore invalid input until it is valid......

 

Can anyone lend a hand with a sample or some logic? I think my logic is sound, but it clearly is not!

I may be looking at it to closely, it is most likely a simple fix that I am over thinking?

 

Good night,

Gene

DSK2.zip

Link to comment
Share on other sites

Hmmm, hopes this makes sense. Not my usual 2 liner. :)

 

Y and X are Pac-Man position. JY and JX are joystick direction. PY and PX are Pac-Man direction. The idea is that JY and JX tries and overwrite PY and PX if possible (legal move).

 

Joystick 1 usual becomes arrow keys in emulation.

 

! DRAW THE MAZE
100 GOSUB 1000

! SET PAC-MAN VARIABLES
110 GOSUB 2000

! DRAW PAC-MAN
120 GOSUB 3000

! READ JOYSTICK AND ADJUST VALUES
130 GOSUB 4000

! FIND DIRECTION OF PAC-MAN
140 GOSUB 5000

! LOOP
150 GOTO 120


! ROUTINE: DRAW THE MAZE
! 111 EQUALS ROAD
1000 CALL CLEAR
1010 CALL HCHAR( 2, 3,111,20)
1020 CALL HCHAR(10, 3,111,20)
1030 CALL HCHAR(18, 3,111,12)
1040 CALL VCHAR( 2, 2,111,17)
1050 CALL VCHAR( 3,14,111,15)
1060 CALL VCHAR( 3,22,111, 7)
1070 RETURN

! ROUTINE: SET PAC-MAN VARIABLES
! CURRENT PAC-MAN POSITION
2000 Y=2
2010 X=6
! CURRENT PAC-MAN DIRECTION
2020 PY=0
2030 PX=0
2040 RETURN

! ROUTINE: DRAW PAC-MAN
! NO DIRECTION THEN JUST DRAW
3000 IF PY=0 AND PX=0 THEN 3040
! REMOVE CURRENT POSITION
3010 CALL HCHAR(Y,X,111)
! CALCULATE NEW POSITION AND MAKE IT CURRENT
3020 Y=Y+PY
3030 X=X+PX
! DRAW IN NEW POSITION
3040 CALL HCHAR(Y,X,30)
3050 RETURN

! ROUTINE: READ JOYSTICK AND ADJUST VALUES
4000 CALL JOYST(1,JX,JY)
4010 JX=JX/4
4020 JY=-JY/4
! AVOID BIDIRECTIONAL MOVE
4030 IF JX<>0 THEN JY=0
4040 RETURN

! ROUTINE: FIND DIRECTION OF PAC-MAN
! TEST JOYSTICK DIRECTION, IF NONE TEST CURRENT PAC-MAN DIRECTION
5000 IF JY=0 AND JX=0 THEN 5060
! JOYSTICK WANTS TO DIRECT
5010 CALL GCHAR(Y+JY,X+JX,G)
5020 IF G<>111 THEN 5060
! JOYSTICK DIRECTION OKAY, MAKE IT CURRENT PAC-MAN DIRECTION
5030 PY=JY
5040 PX=JX
5050 RETURN
! TEST PAC-MAN DIRECTION
5060 IF PY=0 AND PX=0 THEN 5110
5070 CALL GCHAR(Y+PY,X+PX,G)
5080 IF G=111 THEN 5110
! NEW PAC-MAN DIRECTION NOT VALID, RESET CURRENT PAC-MAN DIRECTION
5090 PY=0
5100 PX=0
5110 RETURN

 

And the compact version ...

 

1 CALL CLEAR::CALL HCHAR(2,3,111,20)::CALL HCHAR(10,3,111,20)::CALL HCHAR(18,3,111,12)
2 CALL VCHAR(2,2,111,17)::CALL VCHAR(3,14,111,15)::CALL VCHAR(3,22,111,7)::Y=2:=6
3 IF PY=0 AND PX=0 THEN 4 ELSE CALL HCHAR(Y,X,111)::Y=Y+PY:=X+PX
4 CALL HCHAR(Y,X,30)::CALL JOYST(1,JX,JY)::JX=JX/4::JY=-JY/4::IF JX<>0 THEN JY=0
5 IF JY=0 AND JX=0 THEN 6 ELSE CALL GCHAR(Y+JY,X+JX,G)::IF G<>111 THEN 6 ELSE PY=JY::PX=JX::GOTO 3
6 IF PY=0 AND PX=0 THEN 3 ELSE CALL GCHAR(Y+PY,X+PX,G)::IF G=111 THEN 3 ELSE PY=0::PX=0::GOTO 3

Edited by sometimes99er
Link to comment
Share on other sites

Thanks for the samples sometimes99er!

 

I'll have a chance to play with this tonight. Looking at the logic. I was thinking along the same lines....

 

I obviously have something wrong, I'll compare this to my mess later.

 

Also looking at this sample, it is the start to a NEW game... Mabye a train switching game, or Amidar type game.

 

Well, I'll get a chance to run it later.

Thanks again,

Gene

Link to comment
Share on other sites

Also looking at this sample, it is the start to a NEW game... Mabye a train switching game, or Amidar type game.

 

That’s funny. My thoughts too. I even went and looked up graphics, references and videos of exactly Amidar (1981).

 

Both a train game and Amidar has been on my “list” for long. Only minor research and ideas scratched.

 

I’m pretty sure I won’t make Amidar as a port, but some sort of variant may be possible. Next I’ll have to check out the 2600 version (1982), which hasn’t received too good reviews (also there’s two hacks with more speed). Amidar is, as they say, a bit like a combination of Pac-Man (1980) and Rally-X (1980). And maybe actually more like Pepper II (1980), which plays like a dream on the Colecovision. Very frantic, almost frustrating and yet rewarding, so you just have to spend another quarter. Well, I do.

 

:)

 

Karsten

Link to comment
Share on other sites

" like Pepper II (1980), which plays like a dream on the Colecovision"

 

I have never played Pepper II, but the the TI should be very capable of reproducing it! Well graphicly anyway.

I had a friend that had Amidar on the 2600 30+ years ago. He showed me the game but we never played it.

 

I'll check it out and see if it is playable... If so, maybe I'll try this next.

 

I have pacman working pretty well now. 4 ghost and better control with pre-cornering.

However, I am getting errors when I try to compile. ( one error -- 82 I think )

 

It may be disk space? I didn't have time to try again. I also had very large line numbers.

I know that was a problem early on. I resequenced but it take about 20-30 mins now to compile.

 

Wish I could do that in Classic99 with the overclocking!

 

Thanks for the sample code. It took me a long time to figure out where my logic was different from yours..

Then... It hit me like a brick! My control code is embedded trougout the main game loop.

I was not using my direction pre-check variable as I thought.

Then realized I was using the value for other functions as well and could not touch the logic. BAD coding!

So I added a new check value and put it closer to the rest of the KEY input code.

And it works!

 

I am certain I have some other bugs. I haven't had a chance to play test at all. Only in classic99, not compiled.

 

I will say, JOYST would have been a better choice and KEY though!

 

Thank for the help.

Gene

Link to comment
Share on other sites

... but it take about 20-30 mins now to compile.

 

Wish I could do that in Classic99 with the overclocking!

 

Eh, you can. I have 2 instances of Classic99 at the same time, one with XB and the other with EA, both CPU Overdrive. Beware of the option "Pause When Window Inactive", good to have if your system is a bit slow, but also nice to continue compiling in the background (doing something else).

 

classic99cpuoverdrive.jpg

 

I timed it, and the results for my Shooting Stars are:

 

XB merge file, 8K, compiling, less than 28 seconds, Assembler source, 22K, assembling, less than 15 seconds, Object file, 38K, loader, less than 28 seconds, 11K.

 

:)

  • Like 1
Link to comment
Share on other sites

That sound awesome..... But I get errors in Classic99. I copy to win99 and I do not get the errors?

 

I thought it may have to do with how it writes to DSK. But I guess it should work.

 

Can you compile the DSK's or TEXT files I have put on here using Classic99?

 

What I have been doing is: Classic99 for dev/debug with textpad and CLIP and Paste.

Then TiDIR to copy to disk images on Win994a.

Then compile and test.

Copy back, zip and ship!

 

Gene

Link to comment
Share on other sites

Any I/O error always has a corresponding explanation in the debug menu. After you get any kind of a disk error, just open the debugger and read the debug text. You can also copy/paste it here if you want help understanding what it means. :)

 

For instance, when I save on a disk image from BASIC, I see * I/O ERROR 63

 

Go to Edit->Debugger, and the text says:

 

Saving from VDP >37C8 DSK2.TEST on drive type Image

Setting file error 3 on file buffer 54

 

Not exactly in-your-face, but we can see that it's saving to an Image type drive, and we know that is not supported, so that explains the file error.

Link to comment
Share on other sites

OK, It is not an I/O issue.

I tried to compile A-Z.

save dsk2.pacm-m,merge OK

compile step. pacm-s OK

assembler 14 errors invalid labels FAIL

 

Copied pacm-s to Win994a

assembler created pacm-o OK

loader created pacm-c OK

 

Don't know what to say? I will attach the files:

 

Actual names are ARC4, ARC4-M, ARC4-S, ARC4-O

 

On a better note, I have cornering working perfect in MOD=1 that is Normal Screen. MOD=-1 The backside of the maze, the left right keys are not working correctly?

I don't know why this would be effected? but, I am looking at it now.

 

Gene

Link to comment
Share on other sites

Okay.

 

OLD DSK1.ARC-4 works fine.

 

SAVE "DSK1.ARC-4M2",MERGE works fine. Your ARC-4M and my ARC-4M2 are exactly the same.

 

Compiles fine to DSK1.ARC-4S2. Exactly the same as yours. Looking at the file however reveals this ...

 

...
L80
 BYTE 3,49,48,56,16,50,52,50,52,50
 BYTE 52,50,52,50,52,50,52,49,56,48
 BYTE 48,3,49,48,57,16,50,52,50,52
 BYTE 67,52,48,52,48,52,67,52,50,52
 BYTE 50,52,3,49,49,48,16,50,52,50
 BYTE 52,50,51,50,48,50,48,50,51,50
 BYTE 52,50,52,3,49,49,49,16,50,52
 BYTE 50,
(truncated to 60Kb)

 

I guess this doesn't happened with Win994a. Tursi ? :)

Edited by sometimes99er
Link to comment
Share on other sites

Okay.

 

OLD DSK1.ARC-4 works fine.

 

SAVE "DSK1.ARC-4M2" works fine. Your ARC-4M and my ARC-4M2 are exactly the same.

 

Compiles fine to DSK1.ARC-4S2. Exactly the same as yours. Looking at the file however reveals this ...

 

...
L80
 BYTE 3,49,48,56,16,50,52,50,52,50
 BYTE 52,50,52,50,52,50,52,49,56,48
 BYTE 48,3,49,48,57,16,50,52,50,52
 BYTE 67,52,48,52,48,52,67,52,50,52
 BYTE 50,52,3,49,49,48,16,50,52,50
 BYTE 52,50,51,50,48,50,48,50,51,50
 BYTE 52,50,52,3,49,49,49,16,50,52
 BYTE 50,
(truncated to 60Kb)

 

I guess this doesn't happened with Win994a. Tursi ? :)

 

This looks like the "View File" option of Ti99dir. You can view only the first 60KB this way as the display indicates. If you want to see the whole file, you will need to copy the file as a PC text file with "Tools"-->"Convert TI file to PC file" (Ctrl+F6) and view the resulting file with a text editor/viewer like Notepad++.

 

...lee

Link to comment
Share on other sites

Ah, thanks.

 

Assembling ARC4-S produces a bigger file, 81K, than yours, 74K. At least insure that your have the latest version of both Compiler and Classic99 installed.

 

Looking at your ARC4-O, I see it's not a TIFILES file. Obviously Classic99 did not produce it ?

 

Using the Loader with ARC4-O2 produces a playable game. Very nice by the way.

Edited by sometimes99er
Link to comment
Share on other sites

I created the -M and-S files in Classic99

I then moved them to Win994a to produce the -O and -C files.

 

At least I can create the -S file much faster in Classic99. Just wish I could create the Object file too.

 

Pacman MIRROR version has gone way beyond where it started! I figure I'll keep going until I run out of room!

Would love to do theme music and a better siren, Game Over / Play Again also Hi-Score for the session.

 

I am torn on chasing the ghosts... It should be very easy to add, just reverse the relative position stuff and change initial direction of each ghost.

But, it is not a big part of pacman after a couple of rounds. ( or I am not very good at the game maybe...lol )

That will be last on the list ( for now ) I have changed my mind a dozen times on this project already....

 

Thanks for your help!

Gene

Link to comment
Share on other sites

Getting close to the end...

 

Added:

Hi Score

Game Over handling... press a key to start over

added end off round maze blink like the arcade.

Cornering is PERFECT thanks to sometimes99er's help with the logic.

 

Sill thinking about power pellet's..

 

Pretty complete game at this point.

Gene

DSK2.zip

Link to comment
Share on other sites

I'm a little confused.. is there actually a problem with Classic99 here? It looks like it worked for Sometimes99er?

 

I attempted to do the steps too... starting with ARC4 from post 39, and Classic99 365:

 

-I stored ARC4 on DSK1 (FIAD)

-I mounted Extended BASIC Compiler v2.1.dsk (renamed from .TIDISK) as DSK9 (image) and made sure that 'Automap DSK1' was enabled (because the compiler disk expects to be in DSK1 - the XB compiler was the reason I added this feature! ;) )

-in XB, "OLD DSK1.ARC4" - RUN, loads and works fine (looks sharp!)

-break out with Fctn-4

-Save as merge format: "SAVE DSK1.ARC4-M,MERGE"

-Load the compiler: NEW, then RUN "DSK9.LOAD"

-Press 1 for compiler

-Fill in the information to compile (remember the compiler disk is in DSK9): Compile DSK1.ARC4-M, output DSK1.ARC4-S, load runtime from DSK9, and proceed.

-wait :)

-Press 2 for assembler, then 2 again for Edit/Assm, then 2 again for Assembler

-Enter the file names for assembly: Source DSK1.ARC4-S, Object DSK1.ARC4-O (I notice this one does not auto-update by itself), no list, options R (no C, XB can't load compressed object files), Fctn-6 to proceed

-Wait

-Press Enter on 0000 Errors, then quit (fctn-=) on the funnelweb menu

-Go back into Extended BASIC, and again, RUN "DSK9.LOAD" to bring up the compiler disk

-Press 3 for the loader

-Fill in the filename to create the final image: load DSK1.ARC4-O

-Save as XB or follow the on-screen instructions for EA5

-However, be careful not to do both! At least not with default filenames. I made this mistake. I first saved as XB with SAVE DSK1.ARC4-C, then I saved the EA#5 version using the suggested name of ARC4-A. This also saved ARC4-B and ARC4-C, overwriting the XB version.

 

The XB version seems to work fine, but the EA#5 version actually crashes right after the READY screen, for me. The problem seems to be that low memory is not initialized - I see this in the debug trace:

 

   F6B4  C016  mov  *R6,R0                 (26)
  F6B6  0600  dec  R0                     (14)
  F6B8  0220  ai   R0,>0710               (22)
        0710
  F6BC  0420  blwp @>2030                 (50)
        2030
  0000  83E0  c    @>0024,R15             (22)

 

Low memory is completely zeroed, so the BLWP can't succeed. >2030 in XB is VWTR, is it expecting to find the XB utilities loaded there? (Compiler bug, not PacMan bug, I think. ;) ) Easiest fix is to make the EA5 save code save off the low memory as a separate PROGRAM file and chain load it. :)

 

 

 

Link to comment
Share on other sites

Yep, it's a compiler bug. The routines VMBW, VSBW, VWTR, etc. are all included in the runtime routines. Somehow SCREEN fell through the cracks and does a BLWP @>2030 (normally the address when using XB) instead of BLWP @VWTR. I do most of the testing in XB and never found it.

 

Easy to fix this - in the runtime routines find BLWP @>2030 and change it to BLWP @VWTR

Edited by senior_falcon
  • Like 1
Link to comment
Share on other sites

Here is a pretty final version of pacman.

It really only needs play testing at this point.

 

The game get progressively faster with each cleared maze.

For every 6 cleared screens, the siren sound speeds up. Because the siren is made up of several notes, this speeds up at 1/6th the rate.

 

When pacman gets caught, the animation and sound is now very accurate.

 

I would still like the opening theme. I have been working on it...but I just cannot get it to sound right.

 

I currently release the ghost on a dot count, but I do have a cycle count going on, I could change the release to count levels.

 

Gene

ARCA-C.zip

Link to comment
Share on other sites

Here is the latest with TEXT file included.

 

Sorry to say, you can not pass through fast moving ghost anymore....

I also release the ghost on both a time and/or dots eaten. Whatever comes first.

thought about power pellets. But ran our of memory pretty quickly.

 

It looks like I have 1k left, but as soon as I run, I run out of memory.

 

I have done some squeezing of space. Char def's are shrunk for the most part.

Removed my remaining test var's.

Removed rem's and shortend the ones I really want.

Removed some redundent call screen's and goto's that goto goto's.... hmmm? lol.

Changed some counters to 1 less digit where possible.

 

I am certain I can squeeze a bit more, but don't know about getting power pellets in?

DSK2.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...