Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:35 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 20 of 38    
Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4249
Posted: 06:33pm 27 Oct 2023
Copy link to clipboard 
Print this post

@Martin,

Thank you very much for this set. I have incorporated it in this new release.
So there is a new library. The player is far more visible when on the outside paths. GREAT WORK !!

I also (using your sprite editor) have converted the original green background KEY sprites to black background sprites. Also incorporated in this library. The black ones I got from you are indeed corrupt (or became corrupt). All is dandy now..

Since the library changed, I upped the version to 21.
This is development version for VGA only.

So UNZIP
LIBRARY DELETE
LIBRARY DISK LOAD "lib/pet_lib21.bin"
RUN "pet21.bas"

I am open to comments. F3 is the "cheat key" giving you weapons, items and life.

petrobot21.zip

Volhout

P.S. maybe first thing now is start using the FLASH slots. So we can stop the library stuff....
The program reaches 40kbyte in size.... And using 50-60ms each loop (of 120ms). I am beginning to get confidence this can be done. I was always scared of the response time when doing all this in basic. And currently we are updating the whole map (all UNITs) every loop.
Edited 2023-10-28 04:37 by Volhout
PicomiteVGA PETSCII ROBOTS
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 07:39pm 27 Oct 2023
Copy link to clipboard 
Print this post

This is probably a big deal, but Bleep's changes to allow the program to run on either VGA or LCD involved many locations.

I had thought that Peter's suggestion, and Tom's, was to make the loops clock-dependent (as perhaps you have in speaking of 120ms (a little more than 8 frames per second)), so that at the end of each loop, the framebuffer would be copied to the display (VGA or LCD) a single time.

That would mean that each loop would not be a "move-guy" loop, but might be a "open door 1st 3rd" or "open door 2nd 3rd" and then the third loop would complete the door opening and move the guy. (I don't know if there are more than 3 possible sub-moves per "guy-move").

I don't understand your code well enough to know how possible this is while retaining the now-smooth appearance of the play. If this could be done it would be a great example of how to make a smooth-running game which would play well on both the VGA and LCD versions.

Your work in getting this far is very impressive.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4249
Posted: 08:07pm 27 Oct 2023
Copy link to clipboard 
Print this post

  lizby said  This is probably a big deal, but Bleep's changes to allow the program to run on either VGA or LCD involved many locations.

I had thought that Peter's suggestion, and Tom's, was to make the loops clock-dependent (as perhaps you have in speaking of 120ms (a little more than 8 frames per second)), so that at the end of each loop, the framebuffer would be copied to the display (VGA or LCD) a single time.

That would mean that each loop would not be a "move-guy" loop, but might be a "open door 1st 3rd" or "open door 2nd 3rd" and then the third loop would complete the door opening and move the guy. (I don't know if there are more than 3 possible sub-moves per "guy-move").

I don't understand your code well enough to know how possible this is while retaining the now-smooth appearance of the play. If this could be done it would be a great example of how to make a smooth-running game which would play well on both the VGA and LCD versions.

Your work in getting this far is very impressive.


Hi Lizby,

The architecture under water has changed quite a lot. At this moment the writing to screen is limitted to few sub's. And this is in a 120ms loop. So 8 fps. Based on this loop, every time the player can do something, but other animations only activate once every 2,3 or 4 loops using counters. In the future this can be a way to implement difficulty level. But since player can shoot every loop, the damage handling (robot activities) need to be processed every loop.

With RC12 (using a string in the FRAMEBUFFER WRITE) we could start with a


IF Game_Mite then
 buffer$="F"
else
 buffer$="N"
end if

'And every instance of FRAMEBUFFER WRITE N would change to FRAMEBUFFER WRITE buffer$


This would make the program easily work on Game Mite / LCD. Martin already added the control keys (Game Mite compatible) to the program.

At the moment it is hard for me to keep pace with Martins improvements, to add more to my TODO list. That is why I did not actively persue the LCD version. Told Kevin the same. But if one of you makes above modifications to pet21.bas, and publishes that here I will that that as a new basis, and continue from there. That will allow LCD users to also play each update of the game from here.

So please make a LCD playable version of the pet21.bas running RC12 with above suggested modification (or similar), and I will accept that version as a new platform, and continue from there. (If I can make it work on VGA.....after the modifications).

Again, it should not be hard on pet21.bas. Only the SUB "writesprites"  uses framebuffer L. The rest of the game is framebuffer N. There should be only few locations where changes are needed. Appart from the intro.. I have not looked at that code. Just used it as is.

Volhout
Edited 2023-10-28 06:14 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

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

  Volhout said  

At the moment it is hard for me to keep pace with Martins improvements, to add more to my TODO list.
Volhout

one more improvement  
Function contr_input$()
 If Not gamemite Then Contr_input$="":Exit Function
 Local  n,ix% = Port(GP8, 8) Xor &h7FFF,cs$="",bit
 Local m$(7)=("DOWN","LEFT","UP","RIGHT","SELECT","START","BUT-B","BUT-A")
 ' which buttons are currently pressed
 For n=0 To 7
   bit=2^n:If ix% And bit Then Inc cs$,m$(n)+" "
 Next
 Contr_input$=cs$
End Function
'Controller to Keyboard translation
Function c2k$()
   Local c$=contr_input$()
   If c$<>"" Then
        select case c§
           case "DOWN ": c2k$=Chr$(129)
           case "UP "  : c2k$=Chr$(128)
           case "LEFT ": c2k$=Chr$(130)
           case "RIGHT ":c2k$=Chr$(131)
           case "BUT-A ":c2k$="m"
           case "BUT-B ":c2k$="z"
           case "START ":c2k$=" "
           case "BUT-B BUT-A ":c2k$=Chr$(9)
           case "DOWN BUT-A " : c2k$="s"
           case "UP BUT-A "   : c2k$="w"
           case "LEFT BUT-A " : c2k$="a"
           case "RIGHT BUT-A ": c2k$="d"
       end select
   EndIf
End Function

I think, this covers all Keys that are used by now.
So pressing A and Direction on Gamemite will return the Fire keys

You can call the c2k$() function after you read the Keyboard and it returns nothing
like :
k$=inkey$:if k$="" then k$=c2k$()
so you dont have to worry about and just work with your Keyboard codes as usual.

I try to keep it as simple and universal as possible in order to possibly support additional controllers later.
I also think about addapting the Function contr_input$ for NES Controller on Mixtel90s  Pico Game Board, where I run my Picomite VGA on. (Wasn't there an expansion for SNES controllers?)

As I seyed, it should not need any changes in your Program,
just add the function call if no keypress is detected ..
and you can carry on with the evaluation of the keys.
Edited 2023-10-28 07:26 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4249
Posted: 09:45pm 27 Oct 2023
Copy link to clipboard 
Print this post

Hi Martin, I will adopt, but see problems. You can use a key as a modifier key, but only as modifier key. Not with a second function (i.e. move).
If you do, you need to check if the key is used as modifier, or as function.
This can only be done in timing loops, and that hinders the game. 10ms is not enough to distinguis, and more time hinders the main loop. You can also use the main loop as timer, but for accurate press and release check you would need 3 tests, equal 360ms. Resulting in ... the robots can shoot faster than you....

I suggest you assign 1 button as modifier, that assign a second function to the remaning 7.

Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 10:48pm 27 Oct 2023
Copy link to clipboard 
Print this post

There is a whole swathe of library code transparently covering Keyboard, Game*Mite, NES, SNES, Atari, and for the CMM2 the Wii Classic and Nunchuck controllers here:

https://github.com/thwill1000/mmbasic-sptools/blob/master/src/splib/ctrl.inc

However it works by converting user input into a bitmap (that used by the Wii Classic controller in the CMM2 documentation), not keycodes.

YMMV,

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

Joined: 05/03/2018
Location: Netherlands
Posts: 4249
Posted: 08:54am 28 Oct 2023
Copy link to clipboard 
Print this post

@Tom,

thanks!

@Martin

I am looking into implementing the time bomb, and I am missing a sprite. The arrow cluster sprite. I used the hand(move), and the looking glass(search), but cannot find the arrow cluster(used for drop bomb, drop EMP, drop magnet). I can create one using your sprite editor, but if there is an official one that would be better.

And .. when you are home .. check the sfx sounds #16 and #31 (have the same name). I guess something went wrong. I can imagine there is an SFX sound for the large explosion (screen shaking), maybe that should be #31.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 09:52am 28 Oct 2023
Copy link to clipboard 
Print this post

Duplicate samplename
As I wrote before, delete the Entry for sample 31

arrow cluster Sprite?
I took the PSP Sprites for reference. As you might see, there is no arrow cluster sprite, so it isn't in our Spriteset ...
But there are two kinds of the Hand, filled and Outlined.

I looked at the dos shareware version and I fond it there ..
Not as File but in the game,
I took a Snapshot and edited the Sprite (its an easy one) using a Text editor  

24,1,24
555555555557555555555555
555555555577755555555555
555555555777775555555555
555555557757577555555555
555555555557555555555555
555555555557555555555555
555555555557555555555555
555755555557555555575555
557755555555555555577555
577555555555555555557755
777777775555557777777775
577555555555555555557755
557755555555555555577555
555755555557555555575555
555555555557555555555555
555555555557555555555555
555555555557555555555555
555555555557555555555555
555555555557555555555555
555555557757577555555555
555555555777775555555555
555555555577755555555555
555555555557555555555555
555555555555555555555555

Edited 2023-10-28 19:53 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4249
Posted: 05:43pm 28 Oct 2023
Copy link to clipboard 
Print this post

Hi Martin,

Nice sprite. I already used it (added it as SP3056.SPR in the sprite list).
I have another request, something that needs change.

TILES &h82(bomb) and &h86(magnet) would need a magenta background, so you can use black as a color in the sprite. Maybe they should transfer from tile library to sprite library.

Especially for the bomb, you need black (try using it on a blue floor as indoor in the building.), maybe even a fringe.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 06:50pm 28 Oct 2023
Copy link to clipboard 
Print this post

  Volhout said  Hi Martin,

Nice sprite. I already used it (added it as SP3056.SPR in the sprite list).
I have another request, something that needs change.

TILES &h82(bomb) and &h86(magnet) would need a magenta background, so you can use black as a color in the sprite. Maybe they should transfer from tile library to sprite library.

Especially for the bomb, you need black (try using it on a blue floor as indoor in the building.), maybe even a fringe.

Volhout

will, see and yes, the sould be moved to the Sprite_lib, as you use them as Sprites not Tiles ..
I will create a Sprite for both with Magenta Background...
If you are interested, I just uploaded the version CMM2 / MMB4W.
Looksnearlylike the Dos Version.  (some little bugs are still there, Magnifing glass is not shown and the Map Mode doesnt work correct by now)
you can test it on mmb4windows
W-PET20_2.zip
Maybe a CMM2 Expert will continue converting it
Edited 2023-10-29 04:57 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4249
Posted: 07:11pm 28 Oct 2023
Copy link to clipboard 
Print this post

I already made the required changes to the library and sprites. Don't worry.
Have nice magnet and bomb now.

Will look at it tomorrow. Now I am too tired...

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4249
Posted: 10:34am 29 Oct 2023
Copy link to clipboard 
Print this post

Still VGA only: additional functionality:

- you can place a bomb, and have 3 seconds to run (at least 5 tiles) away.
- the bomb does 11 damage radius 5, so all hoverbots within 5 tiles will die.
- when too close, you get damage also... so make sure you have a medkit.

this version has a new library, with sprites for arrow cluster, bomb and magnet.

The bomb functionality is "almost" complete. In next version I target to add:
- walls block the bomb blast
- tiles can also get damage (bridge/canister) from the bomb

There is a new library, so
LIBRARY DELETE
LIBRARY DISK LOAD "lib/pet_lib21b.bin"
RUN "pet21b.bas"

The ZIP is quite large since I included all actual artwork also So Martin can copy the new sprites I created into his MMB4W game.

petrobot21b.zip

Have fun walking around in the worlds ....

Volhout
Edited 2023-10-29 20:35 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

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

  Volhout said  Still VGA only: additional functionality:

- you can place a bomb, and have 3 seconds to run (at least 5 tiles) away.
- the bomb does 11 damage radius 5, so all hoverbots within 5 tiles will die.
- when too close, you get damage also... so make sure you have a medkit.

Have fun walking around in the worlds ....

Volhout

Volhout
Iwil test it as soon as I am home again.

The Screenshake while the Bomb explosion can be done somehow like this
Draw first stage of explosion
pause 20:Sprite Scroll -4,0:pause 30:Sprite Scroll 8,0:pause 30:Sprite Scroll -4,0
Draw next stage of explosion
pause 20:Sprite Scroll -4,0:pause 30:Sprite Scroll 8,0:pause 30:Sprite Scroll -4,0
etc..
so that every Time you have to draw, the Tiles are on the correct position and you dont need to calculate an offset  

I will try the challenge of replacing non-existent colors with dithering next.
compare:

If you're unlucky you'll get a new, revised tileset
Dithering causes details to be lost, so it can only be used on larger areas.




Cheers
Martin
Edited 2023-10-29 23:57 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4249
Posted: 02:02pm 29 Oct 2023
Copy link to clipboard 
Print this post

Screen shake is already implemented.
It shakes at 4fps.
See if you find it acceptable.
This was only 1 line of code, offsetting the screen centre 2 pixels left. Since the screen is redrawn 8 fps, the shaking is 4 fps.

Volhout
PicomiteVGA PETSCII ROBOTS
 
al18
Senior Member

Joined: 06/07/2019
Location: United States
Posts: 205
Posted: 05:30pm 29 Oct 2023
Copy link to clipboard 
Print this post

I’m amazed at the progress. Is the plan to forward the completed game to David Murray, so he can sell it in his store? I reviewed the GitHub for the C64 source code and it looks like Dave has provided this for porting purposes, but he retains control of the finished game https://github.com/zeropolis79/PETSCIIRobots-C64REU
 
Martin H.

Guru

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

Petscii  Robots - The FINAL Update Timecode 24:06
youtube
I think that is not a problem, as he published the Source, had no work on this Version and also offers, for example, the Oric Version for free on his website.
We use the c++ source of the SDL on Github as a Guideline for the mm-basic version.
so that will be not a clone but a real PicoMite Version (just in basic).

btw:I would find it something of an accolade if he later offered this via his website
cheers
Martin
Edited 2023-10-30 04:51 by Martin H.
'no comment
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 11:29am 30 Oct 2023
Copy link to clipboard 
Print this post

Volhout,
as I announced yesterday, I replaced non-existent colors with dithering, as you can see, I partly replaced the Tiles which match better to the PSP Version, also the outdoor Tiles are a little darker so the Sprites will be easier to recognize:



The goal was to keep the details
You can try out whether you like the new version better.

Voltaire: "the Better is the enemy of the Good"

Cheers
Martin

alt-Tiles.zip
Edited 2023-10-31 00:44 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4249
Posted: 03:31pm 30 Oct 2023
Copy link to clipboard 
Print this post

Hi Martin,

Added the new tileset. But RLE compression is becomming inefficient.
The library grew to 97kbyte. Old library was 94k. Do not dither more tiles, since we run out of space (100k = limit).

petrobot22.zip

Only adaptation is the support for the new library and the 4'th tile index file.
No new functionality.

Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1114
Posted: 03:50pm 30 Oct 2023
Copy link to clipboard 
Print this post

  Volhout said  Hi Martin,

Added the new tileset. But RLE compression is becomming inefficient.
The library grew to 97kbyte. Old library was 94k. Do not dither more tiles, since we run out of space (100k = limit).

Regards,

Volhout


I'm not sure which one looks better. The new tiles are closer in color to the original but the dithering is clearly visible on some tiles.
It was a suggestion
'no comment
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 396
Posted: 07:35pm 30 Oct 2023
Copy link to clipboard 
Print this post

Maybe there is some compromise, I think dithering looks great...

Greetings
Daniel
 
     Page 20 of 38    
Print this page
© JAQ Software 2024