Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:55 25 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 : Picomite VGA Gems 'n' Rocks

     Page 1 of 3    
Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 03:44pm 13 May 2024
Copy link to clipboard 
Print this post

  Martin H. said  Right now I'm digging in the dirt.



I'm in the process of optimizing the routines that work. Checking the ones that aren't ready yet to see if they work the way I want them to.
Graphics, maps and self-written music are finished.


This is a Boulder Dash style vintage maze puzzler in which player collect gems before time runs out.

Here is a playable beta-version to test the program flow.
Movement via cursor keys and Game*Mite keys possible.(I prefer GameMite)
"m"-Key (controller "B") switches the music on and off.
ESC /Select to end the Program.

It lacks
a proper GUI,
the functions for water, butterflies and fireflies,
NES Controller support.
But the basic game-routines works.
GemsNRocks_beta.zip
Thanks and suggestions for improvement are welcome.
Have fun
Martin
Edited 2024-05-14 02:11 by Martin H.
'no comment
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 05:23pm 13 May 2024
Copy link to clipboard 
Print this post

Thanks Martin. Once I've taught MMB4L how to run it I'll let you know what I think.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 06:55pm 13 May 2024
Copy link to clipboard 
Print this post

Hi Tom,
thanks for your reply.
I haven't tested it on MMB4W, I'm not sure if the "sprite memory" command works on it, or the Linux version.
You can use the tileset instead on a 2nd page , and copy the Tiles to the screen, which works fast enough on the PC.





Cheers
Martin
Edited 2024-05-14 04:57 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4225
Posted: 07:30pm 13 May 2024
Copy link to clipboard 
Print this post

Nice Martin,

Have been playing it on VGA. There are some rules I do not understand yet (sometimes a boulder falls in a pit to the side, sometimes it does not).

And when a level starts you see it build up (very fast, but never the less).

Is this all running on N layer ? Is it the intention that the flies and butterflies move in the grid, or pixel based (sprites) on L ?

But it looks nice. Reminds me a lot of Supaplex, I played a lot in the 90's.

Volhout
Edited 2024-05-14 06:15 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 03:47am 14 May 2024
Copy link to clipboard 
Print this post

  Volhout said  Nice Martin,

Have been playing it on VGA. There are some rules I do not understand yet (sometimes a boulder falls in a pit to the side, sometimes it does not).

Simple rules apply to gravity.
A stone/gem falls logically if there is air underneath it.
If it lies on another stone or gem, the system checks whether there is air next to it and diagonally below it; if this is the case, it falls one space diagonally.
As the scanning process is always carried out from bottom to top, stone avalanches can occur.
It also makes a difference whether the object lies on the player or falls, so I set a bit (128) for the next scan, which remembers that this object was in motion.
The advantage of this method is that the objects manage themselves and I don't need any additional fields or time consuming routines to manage them.

  Volhout said  
Is this all running on N layer ? Is it the intention that the flies and butterflies move in the grid, or pixel based (sprites) on L ?

The plan for fireflies and butterfliesis,
that will move clockwise and anticlockwise also just in the grid, so they just can move in "Air".(A layer is not required on VGA Version, Framebuffer is just used for faster LCD support). Here, the two upper bits should indicate the current direction of movement.
Both are deadly but if an object falls on a butterfly, the field it is on and those around it turn into gems.(one butterfly = 9 gems)
So one task in the game will be to drop objects so that they land on a butterfly.
Shouldn't be too difficult to integrate into the scan routine,but I still have some work to do. I still have to find out how the water should act
Edited 2024-05-14 15:00 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4225
Posted: 05:14am 14 May 2024
Copy link to clipboard 
Print this post

What I can find, boulderdash does not have water, but it has walls.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 08:17am 14 May 2024
Copy link to clipboard 
Print this post

  Volhout said  What I can find, boulderdash does not have water, but it has walls.

Volhout


ChatGPT:
  Quote  
In later versions and expansions of "Boulder Dash," the element of water was introduced, adding extra complexity and challenge to the gameplay. The behavior of water in "Boulder Dash" is unique and significantly influences the gameplay dynamics.

The basic behavior of water in the game can be summarized as follows:

1. Flowing Water: When water encounters an empty space, it spreads horizontally and fills any available space below its current position. This can cause water to spread both vertically and horizontally as long as there's room available. The behavior is somewhat akin to real fluids seeking the path of least resistance.

2. Interaction with Other Elements: Water in "Boulder Dash" can interact with various elements in the game in different ways. For example, water can extinguish fire if such elements exist in the game, or it can affect other movable objects like rocks, diamonds, and enemies by changing their positions when they fall into water.

3. Player Interaction: Players need to carefully plan how they deal with water. Water can serve as both a tool and an obstacle. For instance, releasing streams of water can be used to gain access to previously inaccessible areas or to trap or remove enemies. On the other hand, water can also trap and drown the player if not carefully navigated.

4. Puzzle Aspects: Water adds additional puzzle components to the game. Players often have to find ways to redirect, block, or strategically use water to achieve certain goals or to avoid hazards.

The addition of water and similar elements has made "Boulder Dash" and its successors or variations even more intriguing and challenging. Players must not only navigate obstacles and solve puzzles but also understand and strategically use the properties and behaviors of these new game elements.


I'm still not sure if I should include it in my game or not

Butterflies and fireflies move similarly in the game. Both circle obstacles in their environment in a fixed direction:

The direction of movement of both can be accommodated in 2 bits

- Fireflies always move clockwise around obstacles. If a player gets close enough or clears a path for a firefly, it continues to move in a straight line until it encounters an obstacle, whereupon it continues its movement in a clockwise direction.
The stored array would therefore be
l, u, r, d =-1,-65,1,65
(65 =string len in the map array)

- Butterflies always move in an anti-clockwise direction. Like fireflies, they also move in a straight line until they encounter an obstacle, at which point they continue moving in their predetermined direction.
The stored array would therefore be
r, u, l, d = 1,-65,-1,65
Edited 2024-05-14 18:30 by Martin H.
'no comment
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 12:09pm 14 May 2024
Copy link to clipboard 
Print this post

Hi Martin,

  Martin H. said  I haven't tested it on MMB4W, I'm not sure if the "sprite memory" command works on it, ...


I'm pretty certain it doesn't.

  Martin H. said  ... or the Linux version.


It will when 0.7.0 is released .

  Martin H. said  You can use the tileset instead on a 2nd page , and copy the Tiles to the screen, which works fast enough on the PC.


Sure, and MMB4L will support that, but the intent is to do something more "clever" ...

For my own purposes (and hopefully useful for others) I am implementing MMB4L to act as a sort of Rosetta Stone for MMBasic games development.

Specifically, adding one of these lines to the top of an existing program:

If Mm.Device$ = "MMB4L" Then Option Device "Colour Maximite 2"
If Mm.Device$ = "MMB4L" Then Option Device "PicoMiteVGA"
If Mm.Device$ = "MMB4L" Then Option Device "PicoMite" : Option Platform "Game*Mite"


will put MMB4L into a mode of operation where it will try to *simulate* the graphics / audio / controller / keyboard handling behaviour of the specified device.

e.g. at the moment if MMB4L is configured for "Colour Maximite 2" then any calls to access the CLASSIC Wii controller on I2C3 (the single game port on the CMM2 G1) are instead directed to the first attached USB gamepad. Likewise if configured for the "Game*Mite" then access to the Game*Mite controller ports will be directed to the first attached USB gamepad.

Note that it is *simulation* not *emulation* and it's going to be "good enough" rather than "perfect". It certainly won't work with programs that use code (not data) in CSUBs or directly access the display buffers via PEEK and POKE; all MMB4L surfaces are 32-bit.

Best wishes,

Tom
Edited 2024-05-14 22:16 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 05:56pm 15 May 2024
Copy link to clipboard 
Print this post

Here is the version with working routines for butterflies and fireflies.
The zip file only has the basic program, so the folder structure and files from the first upload are needed.
Now all that is missing is a proper framework( Menus , Gameover etc.)
Then the enemies will also be set to deadly.
GNR-Beta2.zip
have Fun
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4225
Posted: 06:50pm 15 May 2024
Copy link to clipboard 
Print this post

Hi Martin,

I was just studying your code, to add the fireflies and butterflies moves....
you beat me to it ....
Did you ever play the game with water? do the flies fly over it ?

Great work!!

Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 07:13pm 15 May 2024
Copy link to clipboard 
Print this post

Hi guys,

I'm still on Beta 1, here is what MMB4L currently makes of it https://youtu.be/wP7mwUbPs1Q.

I'm assuming the trail when I move the player is some MMB4L bug, not a program bug ?

On a related matter can someone point me at some example data for *uncompressed* memory sprites.

Best wishes,

Tom
Edited 2024-05-16 05:14 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 07:20pm 15 May 2024
Copy link to clipboard 
Print this post

  Volhout said  Hi Martin,

I was just studying your code, to add the fireflies and butterflies moves....
you beat me to it ....
Did you ever play the game with water? do the flies fly over it ?

Great work!!

Volhout

I had some trouble with the movement, because the scans run from bottom to top, from left to right, a fly that is moved up or to the right keeps moving during the scan. I solved this by also giving them a +32 marker when they were moved and ignoring them on the next scan.
I think I'll do without the water, the levels are hard enough as it.
Then a few additional levels and/or a level editor as a bonus.
'no comment
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 07:29pm 15 May 2024
Copy link to clipboard 
Print this post

  thwill said  Hi guys,

I'm still on Beta 1, here is what MMB4L currently makes of it https://youtu.be/wP7mwUbPs1Q.

I'm assuming the trail when I move the player is some MMB4L bug, not a program bug ?

On a related matter can someone point me at some example data for *uncompressed* memory sprites.

Best wishes,

Tom

Hi Tom

Nice but much to fast    
The trail is not on the mites, as I fill the cell of the map array with "0" when the player left the cell. The screen is completely redrawn with each run (like in PetsciiRobots), so only the background should be displayed in the places where the player was.Looks like you dont refresh the whole Screen.
but the MMB4L looks very promising
I have to go to sleep now, I will zip the Spr Files tomorow
Cheers
Martin
Edited 2024-05-16 05:32 by Martin H.
'no comment
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 09:36pm 15 May 2024
Copy link to clipboard 
Print this post

  Martin H. said  The trail is not on the mites, as I fill the cell of the map array with "0" when the player left the cell. The screen is completely redrawn with each run (like in PetsciiRobots), so only the background should be displayed in the places where the player was.Looks like you dont refresh the whole Screen.


Slaps own head.

Well figuring that out was fun ...

... I hadn't noticed that some of the sprites were uncompressed ... and I hadn't written the code to render uncompressed sprites, which is why I was asking for examples.

D'Oh!

Best wishes,

Tom
Edited 2024-05-16 07:41 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 08:37am 16 May 2024
Copy link to clipboard 
Print this post

Tom,
I have adapted the last Version so that it also supports MMB4W, (which should run on MMB4L without any problems).

Since the routines are identical except for the image output, this version is primarily made so that I can continue programming when I don't have a Pico to hand. But you can also have fun playing under MMB4W





To keep it simple I use a 2nd page with the tiles.

GemsNRocks_beta2W.zip

Good luck
Martin
Edited 2024-05-16 18:39 by Martin H.
'no comment
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 09:03am 16 May 2024
Copy link to clipboard 
Print this post

Hi Martin,

I fixed / implemented the missing behaviour, next up for MMB4L will be MOD playback.

  Martin H. said  I have adapted the last Version so that it also supports MMB4W, (which should run on MMB4L without any problems).


Nice, though as I've said before MMB4L will be able to run the PicoMiteVGA and Game*Mite versions by just adding one line to them ... plus adding something to control the "framerate" to the game loop:

Const FRAME_DURATION = 30
Dim next_frame%
Do ' Main loop
 next_frame% = Timer + FRAME_DURATION
 '
 ' Do stuff ...
 '
 Do While Timer < next_frame% : Loop
Loop


Best wishes,

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

Joined: 05/03/2018
Location: Netherlands
Posts: 4225
Posted: 09:40am 16 May 2024
Copy link to clipboard 
Print this post

Sorry Tom, Martin,

I tried the 2W beta release on a standard VGA mite, and had to hack my way around to get it to run. I think you have made it work on MMB4L and Game*Mite, but not on VGA yet. When I get it to run, I will review it.

Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 09:44am 16 May 2024
Copy link to clipboard 
Print this post

  Volhout said  I think you have made it work on MMB4L ...


I don't believe any changes have been made by Martin to accommodate MMB4L, I'm just running the PicoMiteVGA version (beta 1) in (an alpha version of) MMB4L.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 09:48am 16 May 2024
Copy link to clipboard 
Print this post

  Volhout said  Sorry Tom, Martin,

I tried the 2W beta release on a standard VGA mite, and had to hack my way around to get it to run. I think you have made it work on MMB4L and Game*Mite, but not on VGA yet. When I get it to run, I will review it.

Volhout

I have a query in the 2W, if it is the MMB4W system, a different routine (copy of the tiles from a 2nd page) is used to create the image.

the Beta2 (2W not tested) runs on PicoMiteVGA
Edited 2024-05-16 19:56 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4225
Posted: 10:32am 16 May 2024
Copy link to clipboard 
Print this post

Hi Martin,

Exciting code. You used 19 goto's. But also function's. This is a good example of how old-meets-new. MMbasic can do it all.

Volhout
PicomiteVGA PETSCII ROBOTS
 
     Page 1 of 3    
Print this page
© JAQ Software 2024