Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:32 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICO PETSCII

     Page 26 of 38    
Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 06:44am 13 Nov 2023
Copy link to clipboard 
Print this post

  MarkF said  Game keyboard control request please ...

I went to play the game, and for some reason I was unable to do a search or move objects.

I discovered I had the caps lock on.

After viewing the game code, most of the keyboard controls work with lowercase only.

I see that capital [M] toggles the music, and lowercase [m] is to move objects.

A suggestion...

1) Could the toggle music key be changed to something else (any unused key) e.g. [p] ?

and then...

2) Can the game control code be altered so that it operates with either lower/upper case?  e.g.  [Z] or [z] for game object search.


Case insensitive controlls are no big deal by using Ucase$ or Lcase$, which doesn't affect the Cursor Keys.
Changing the "toggle music" key also.

A great suggestion, I'm sure Volhout can incorporate that in the next version.
Edited 2023-11-13 16:45 by Martin H.
'no comment
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 07:44am 13 Nov 2023
Copy link to clipboard 
Print this post

@Volhout

liitle change for Sub game_end

 Play stop
 If left_bots Then
    Play modfile "music/lose.mod"
 Else
    Play modfile "music/win.mod"
 EndIf

so if no bot is left, you win  
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 11:16am 13 Nov 2023
Copy link to clipboard 
Print this post

  MarkF said  Game keyboard control request please ...

I went to play the game, and for some reason I was unable to do a search or move objects.

I discovered I had the caps lock on.

After viewing the game code, most of the keyboard controls work with lowercase only.

I see that capital [M] toggles the music, and lowercase [m] is to move objects.

A suggestion...

1) Could the toggle music key be changed to something else (any unused key) e.g. [p] ?

and then...

2) Can the game control code be altered so that it operates with either lower/upper case?  e.g.  [Z] or [z] for game object search.


Hi Mark,

Yes, that can be done. Both 1/ and 2/. That would be an individual version for you personally then. The intend of this development was to make a game true to the original, but... written in basic, not C++ and compiled, or assembly. And the controls are described in the original games user manual.

Best regards,

Volhout
Edited 2023-11-13 21:16 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 11:20am 13 Nov 2023
Copy link to clipboard 
Print this post

Here is a version with a working trash compactor, and some other bug fixes.
Also the rollerbot walks (rolls) faster (as true to the original) and fires faster.

Known bugs: when attacked by 2 or more robots at the same time, you can walk away from your death.... OOOPS ...

pet24a.zip

Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 11:40am 13 Nov 2023
Copy link to clipboard 
Print this post

  Volhout said  Here is a version with a working trash compactor, and some other bug fixes.
Also the rollerbot walks (rolls) faster (as true to the original) and fires faster.

Known bugs: when attacked by 2 or more robots at the same time, you can walk away from your death.... OOOPS ...

pet24a.zip

Volhout

hmm
How do I get the TC to work?
If I pull a chair, a crate or myself into it, it does nothing.
I noticed that things , that you are moving disapear when they stand in the doorway and the Door closes..
in Dos Version the Door is blocked

Edited 2023-11-13 22:11 by Martin H.
'no comment
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 03:31pm 13 Nov 2023
Copy link to clipboard 
Print this post

I added NES Style Controller on port A (the Left port) of Mixtel90s PicoGAME VGA Board

pet24an.zip

Controlls are translated like on Game*Mite


But         Returns Key  Action
------------------------------------
"DOWN "         Chr$(129) 'down
"UP "           Chr$(128) 'up
"LEFT "         Chr$(130) 'left
"RIGHT "        Chr$(131) 'right
"BUT-A "        "m"       'Move
"BUT-B "        "z"       'Search
"START "        " "       'Start
"BUT-A & BUT-B" Chr$(9)   'Tab
"BUT-A & DOWN   "s"       'Fire Down
"BUT-A & UP "   "w"       'Fire Up
"BUT-A & LEFT"  "a"       'Fire Left
"BUT-A & RIGHT" "d"       'Fire Right
"BUT-B & UP"    Chr$(145) 'F1
"BUT-B & DOWN"  Chr$(146) 'F2
"SELECT"        Chr$(27)  'ESC


FOR GAME*MITE SET
Const nesPG1=0 'Nes Controller on Port1 Pico Game Board

at the Start of the Program

Have Fun
Edited 2023-11-14 02:54 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 06:03pm 13 Nov 2023
Copy link to clipboard 
Print this post

@Martin,

- chair in door: fixed

- game_end music: fixed

- trash compactor: only sprites (overlay) implemented now, and atm player is excluded. (easy change, but I though this was a nice twist.. you can outrun a chasing hoverbot into the TC, run to the end, you will not be harmed, but the bot is crushed..

I will investigate changes. Problem: chair=tile showing chair with floor element (blue). hard to use as sprite to overlay. May need chair with magenta background. Same for each other moveable item (chair (4 rotations), canister, box open, box closed, small box open, small box closed, hocker) or we need to accept that floor element is also copied into the trash compactor.

I will look into the NES controller changes.
Looks good, will try with controller soon on PicoGameVGA

Volhout
Edited 2023-11-14 04:22 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 06:09pm 13 Nov 2023
Copy link to clipboard 
Print this post

  Volhout said  

I will look into the NES controler changes..

Volhout

The movement in the Startmenu is still a bit tricky, but that's also the case with Game*Mite at the moment.(Something on my ToDo-List)

While you're at it, change the flash slot from 4 to 3.
With the new RC17 that has just been released,flash slot 4 no longer exists.
Edited 2023-11-14 04:20 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 06:23pm 13 Nov 2023
Copy link to clipboard 
Print this post

F*CK !!!


  Martin H. said  
  Volhout said  

I will look into the NES controler changes..

Volhout

The movement in the Startmenu is still a bit tricky, but that's also the case with Game*Mite at the moment.(Something on my ToDo-List)

While you're at it, change the flash slot from 4 to 3.
With the new RC17 that has just been released,flash slot 4 no longer exists.

PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 06:29pm 13 Nov 2023
Copy link to clipboard 
Print this post



Just tested on GameMite, it runs fine with Flashslot 3
'no comment
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 511
Posted: 06:30pm 13 Nov 2023
Copy link to clipboard 
Print this post

Hi Harm,
I have made a couple of small changes, that gets the time taken, just below 100mS on my device, if they are of any use.
Diff of pet24a.bas
66a67
>   spn=0
547,548c548,549
<       x=xs+xn*24
<       y=ys+yn*24
---
> '      x=xs+xn*24
> '      y=ys+yn*24
550,551c551,556
<       spn=Asc(Mid$(lv$(yp+yn),xp+xn+1,1))
<       Blit memory tile_index(spn),x,y
---
>       spn=Peek(byte(lva+(yp+yn)*129)+xp+xn+1)
> '      Print spn,
>       Blit memory tile_index(spn),xs+xn*24,ys+yn*24
> '      spn=Asc(Mid$(lv$(yp+yn),xp+xn+1,1))
> '      Print spn
> '      Blit memory tile_index(spn),x,y
1282,1284c1287,1293
<   Local til
<   til=Asc(Mid$(lv$(y),x+1,1))
<   get_ta = Asc(Mid$(ta$,til+1,1))
---
> '  Local til
>   spn=Peek(byte lva+y*129+x+1)+1
>   get_ta=Peek(byte taa+spn)
> '  Print get_ta,
> '  til=Asc(Mid$(lv$(y),x+1,1))
> '  get_ta = Asc(Mid$(ta$,til+1,1))
> '  Print get_ta
1412a1422,1423
>   lva=Peek(varaddr LV$())
>   taa=Peek(varaddr TA$)

Basically I have pre calculated the memory offset for the two arrays LV$ and TA$ into laa and taa, then modified the two subroutines writeworld_n and get_ta to use these memory addresses directly, rather than using string routines. It does make the code less readable, which is why I have left the original code commented out as a reference.

pet24amod.bas.zip
Hope this is useful.
Regards Kevin.
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 07:24pm 13 Nov 2023
Copy link to clipboard 
Print this post

to make the logo more consistent with the Robots theme



Of course in 121 RGB
Edited 2023-11-14 05:43 by Martin H.
'no comment
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 08:29pm 13 Nov 2023
Copy link to clipboard 
Print this post

Hey folks,

Loaded it onto my Game*Mite for the first time (I've been busy), WOW! Looks great and sounds great.

I assume it is correct that there is "tearing" between the tiles when moving; it seems unlikely I would get tearing and others wouldn't ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 08:34pm 13 Nov 2023
Copy link to clipboard 
Print this post

All this complexity gives me a pain in the diodes all the way down my left hand side. :(

Life. Don't talk to me about life....

(The film was pretty rubbish)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 09:10pm 13 Nov 2023
Copy link to clipboard 
Print this post

Hi Martin,

OK, I hope I combined all good changes....
I am not overly impressed by the speed advance, there may be some 5ms improvement. Incidentally I hit over 100ms. But I implemented them never the less. I know from earlier experiments, when the loop time was around 20ms....it made a difference.

Hi Tom,

I do not run on the Game_Mite myself, so I have no conclusion on the tearing.


I may start playing on the game mite soon, a little more to add to the game play. 1 Robot (evilbot), and the magnet. And then it is cleaning up....
And maybe can add shifting chairs in the trash compacter... just for fun...

On pet24b the NES controller on my PicoGameVGA does not work.
In the startup menu I can press UP/DOWN and START, but in the game it does not work.


Volhout


pet24b.zip


P.S. Martin , maybe the parts that deal with GPIO (i.e. NES controller) could be changed to use GPIO pins, not pin numbers. Since some may run this on different RP2040 boards.
Edited 2023-11-14 07:24 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 07:10am 14 Nov 2023
Copy link to clipboard 
Print this post

  Volhout said  Hi Martin,

OK, I hope I combined all good changes....
I am not overly impressed by the speed advance, there may be some 5ms improvement. Incidentally I hit over 100ms. But I implemented them never the less. I know from earlier experiments, when the loop time was around 20ms....it made a difference.


It wasn't me, it was Kevin  


  Volhout said  On pet24b the NES controller on my PicoGameVGA does not work.
In the startup menu I can press UP/DOWN and START, but in the game it does not work.


You just missed one of my changes  

change
Do
   'player input through keyboard, clearing buffer, check loop time
   k$="":Text 290,0,Right$("00"+Str$(Timer,3,0),3)
   Do
     tmp$=Inkey$
     If tmp$<>"" Then k$=tmp$  'keep last valid key
   Loop Until Timer>h_beat
   Timer =0
   If Game_Mite And k$="" Then k$=c2k$()


to
Do
   'player input through keyboard, clearing buffer, check loop time
   k$="":Text 290,0,Right$("00"+Str$(Timer,3,0),3)
   Do
     tmp$=Inkey$
     If tmp$<>"" Then k$=tmp$  'keep last valid key
   Loop Until Timer>h_beat
   Timer =0
   If k$="" Then k$=c2k$()


Function "c2k$()" (the translation of Controller Input to Keypress) should now allways be called, if there is no Keypress.

Cheers
Mart!n
Edited 2023-11-14 17:18 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 08:40am 14 Nov 2023
Copy link to clipboard 
Print this post

Thank, got it...

Volhout

P.S. Martin, would it be possible to move the key check (either Game_Mite or nesPG1) inside the h_beat key check loop. In that case it would not burden the game loop time.
Edited 2023-11-14 18:46 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 09:08am 14 Nov 2023
Copy link to clipboard 
Print this post

  Volhout said  , would it be possible to move the key check (either Game_Mite or nesPG1) inside the h_beat key check loop. In that case it would not burden the game loop time.

sure,
should be something like

Do
    tmp$=Inkey$
    If tmp$<>"" Then k$=tmp$  'keep last valid key
    If k$="" Then k$=c2k$()
  Loop Until Timer>h_beat
  Timer =0


I will check it this afternoon.
Wouldn't it be more clever if we not reset the (Hardware)Timer, but store its value and calculate with it, so you can Display the overall Playtime at the End of the Game?
Edited 2023-11-14 19:20 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 09:32am 14 Nov 2023
Copy link to clipboard 
Print this post

Hi Martin,

Not reset the timer... Agreed, I had the same idea, just did not implement it.
Currently high distraction from work... a day should have 26 hours, not 24....

Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 09:41am 14 Nov 2023
Copy link to clipboard 
Print this post

Martin/Kevin,

  thwill said  I assume it is correct that there is "tearing" between the tiles when moving; it seems unlikely I would get tearing and others wouldn't ?


If you aren't seeing tearing then what CPUSPEED are you using ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 26 of 38    
Print this page
© JAQ Software 2024