Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 14:14 29 Apr 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 : New game to CMM: Gauntlet port

     Page 5 of 6    
Author Message
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 04:08am 25 Aug 2019
Copy link to clipboard 
Print this post

There are 106 sprites, but when using ASCII table to make the map, I used starting in 32 (space, jumping to sprite 104), then the rest starting in 33 (sprite 1) and beyond until 106+32.

But in the case of the bug that you showed, I made a mistake, the comparison should be cef<=sprmax-32, because the "cef" variable is receiving a direct sprite number, not a ASCII table.

Thanks for your test!
 
SimpleSafeName

Senior Member

Joined: 28/07/2019
Location: United States
Posts: 286
Posted: 04:42am 25 Aug 2019
Copy link to clipboard 
Print this post

You're welcome!

And "If tt Mod 2=1 And cef+32<=sprmax Then Sprite paste cef,xt,yt" fixed it. Six to one, half dozen to the other (in other words, either way is good).


I added in the code around line 882 for selecting a room upon program launch.

This is how it looks now:

RESTART:
a$=mm.cmdline$
room=val(a$)
if room=0 then room=1
sprmax=106+32

I tried out that old Commodore trick of replacing the "And" in a If...Then statement with "Then If" but MMBasic didn't like it.

I've noticed that if you let an enemy get too close, you have a hard time firing, and fleeing. Is this by design?

And in the case of Elf at least, you don't have to hit the generator to destroy it. Getting close is good enough (I'm in favor of this one).
 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 04:58am 25 Aug 2019
Copy link to clipboard 
Print this post

  SimpleSafeName said  Set your NumLock key to on, and then it's 1,3,7, and 9.

Thanx.
Now I see why couldn't I find this. My keyboard have no numpad and no numlock.

Is it possible to detect multiple key presses?
I searched through the MMBasic manual and this forum, but couldn't find a clear answer.
It would be nice to treat two simultaneously pressed arrow keys as a diagonal movement.
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 06:07am 25 Aug 2019
Copy link to clipboard 
Print this post

  SimpleSafeName said  I've noticed that if you let an enemy get too close, you have a hard time firing, and fleeing. Is this by design?

And in the case of Elf at least, you don't have to hit the generator to destroy it. Getting close is good enough (I'm in favour of this one).

No, it's not by design but isn't a bug too. At the moment I will consider it a limitation of the engine and limitation of MMBasic keyboard read routine.

The collision I changed to the Euclidean algorithm and this caused a bug in the range of some situations but is my fault. I will fix it soon.

  Cyber said  Is it possible to detect multiple key presses?
I searched through the MMBasic manual and this forum, but couldn't find a clear answer.
It would be nice to treat two simultaneously pressed arrow keys as a diagonal movement.

At the moment I couldn't make the CMM read simultaneous keypresses in the current version of MMBasic (4.5c). This brings a huge difficulty to make some types of games, and for me, it's the biggest limitation of the CMM until someone discovers a new manner to read keys or Geoff update the MMBasic with other feature.
 
Cyber

Senior Member

Joined: 13/01/2019
Location: Ukraine
Posts: 161
Posted: 09:44am 25 Aug 2019
Copy link to clipboard 
Print this post

  MauroXavier said  GAUNTLET_ALPHA_004.zip
The main change is the speed gain and little smoother scrolling.

Yeah, scrolling is smoother indeed.

First levels are much more playable now.

The only bug I was able to notice so far, is sometimes one sprite leave half of itself frozen on screen when it should've disappear totally. For example, picked up item or killed enemy. The sprite actually disappeared, and what is left seen is just a visual artifact in form of half sprite's image.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 02:36pm 25 Aug 2019
Copy link to clipboard 
Print this post

The artefacts left by sprites disappearing or moving may be explained by this quote from the manual:

"When the sprite is displayed MMBasic will automatically save the background text and graphics under the sprite and when the sprite is turned off or moved MMBasic will restore the background."

This is fine if the background doesn't change, but if the background changes colour while the sprite is still on the screen, then the previous background (the background that was there when the sprite was positioned) is restored when the sprite moves or disappears. This leaves an artefact of the previous background where the sprite was.

I haven't yet played the game so I haven't seen the effect but I have seen it elsewhere.

Bill
Keep safe. Live long and prosper.
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 05:54pm 25 Aug 2019
Copy link to clipboard 
Print this post

Turbo46, this isn't the case in Gauntlet. I only use "SPRITE PASTE", if I used the "SPRITE MOVE" on every scroll the screen would be altered after the sprite store routine, causing after a background bad restore.

How all the movements are in 8x8 pixels, I write the background images default to 8x8 tiles repeated inside a 16x16 sprite, this way I can simply show in sequence the sprite background and sprite required. This conserves RAM because the sprites routines don't store any background screen.

With this algorith, I have the disadvantage in cannot use any movement that does not be a multiple of 8,  but how the CPU is very taxed in the main game, I believe that CMM cannot push Gauntlet in a smoother movement than this. Another disadvantage is that I must restore parts of the map on screen after getting objects or killing enemies, and is this routine that has a bug that is still causing corruption.
 
SimpleSafeName

Senior Member

Joined: 28/07/2019
Location: United States
Posts: 286
Posted: 07:17pm 25 Aug 2019
Copy link to clipboard 
Print this post

  Cyber said  
  SimpleSafeName said  Set your NumLock key to on, and then it's 1,3,7, and 9.

Thanx.
Now I see why couldn't I find this. My keyboard have no numpad and no numlock.

Is it possible to detect multiple key presses?
I searched through the MMBasic manual and this forum, but couldn't find a clear answer.
It would be nice to treat two simultaneously pressed arrow keys as a diagonal movement.


What 'Mite are you using? Are you using a PS/2 keyboard?

The good news is that there is nothing stopping you from changing these values to something better suited for you.

Here are the key codes as defined in the game::

K_ESC=27
K_SPC=32
K_N0=48
K_N1=49
K_N2=50
K_N3=51
K_N4=52
K_N5=53
K_N6=54
K_N7=55
K_N8=56
K_N9=57
K_P= 80
K_U=128
K_D=129
K_L=130
K_R=131

The "K_Nx" variables define keys 0 - 9, those will be the ones that I recommend changing.

You could assign them to:

K_N0=48      'Not used in the game, don't bother
K_N1=109     'm key
K_N2=44      ', (comma key)
K_N3=46      '. (period key)
K_N4=107     'k key
K_N5=53      'Not used in the game, don't bother
K_N6=108     'l key
K_N7=105     'i key
K_N8=111     'o key
K_N9=112     'p key

Notice that I specified lowercase letter keys. Having your caps-lock on will return a different key code and this won't work.
Edited 2019-08-26 05:19 by SimpleSafeName
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 08:07pm 25 Aug 2019
Copy link to clipboard 
Print this post

This makes me think about put an option in the menu to redefine keys like a ZX Spectrum game, this solves almost any type of problem-related to the keyboard layout.
 
ceptimus
Senior Member

Joined: 05/07/2019
Location: United Kingdom
Posts: 130
Posted: 10:47pm 25 Aug 2019
Copy link to clipboard 
Print this post

One way to do it (the method I'm using in my Manic Miner port) is to have a small launcher/configuration program that defines the key codes, whether a joystick is connected, and if so which pins are used for left,right,fire,...  Users can edit that program to suit their hardware and preference.

The launcher program just has a few defines, with comments, and then chains the main game program - it doesn't need to do anything else.
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 01:52am 30 Aug 2019
Copy link to clipboard 
Print this post

GAUNTLET_ALPHA_005.zip

New alpha 005 version with some tests:

* Choose the sound type in the first screen (but you can change after in the options)

* Divided source code (just run GAUNTLET.BAS)

* Options menu with:
- Sound type selection
- Sound test
- Credits

* What DOESN'T WORK YET but appears on the options menu:
- Number of Players
- Control type

In the other things doesn't have so many changes from alpha 004, only minor optimizations on fire demon. In some aspects, it's even a little slower, but I will fix it soon.

If you have patience, please, see the full credits, maybe you like it ;)

If anyone here that appeared in the special thanks wants to show your name with the nickname, just tell me.
 
SimpleSafeName

Senior Member

Joined: 28/07/2019
Location: United States
Posts: 286
Posted: 04:29am 30 Aug 2019
Copy link to clipboard 
Print this post

Hi Mauro,

So I tried it, and the credits works. So I'm good... :)

Although on line 254 you spell it "BACKSHEED" :)

I did have one grunt that was playing "Peek-a-boo" with me, I'd shoot him, he'd disappear as the shot passed through him, and then reappear. :)

There are some other issues, but I've got work in the morning. So I'm off to bed.

But I like this version better, the baddies seem smarter and aren't as easy to pick off.

Nice job! :)
 
ceptimus
Senior Member

Joined: 05/07/2019
Location: United Kingdom
Posts: 130
Posted: 10:45am 30 Aug 2019
Copy link to clipboard 
Print this post

Hi Mauro.  All the opening and credit screens look fantastic, and the music is very good, using just basic CMM hardware.  

I got the error:

[877] Sprite Load ".\spr\ingame2.spr"
Error: Corrupt sprite file

...on the LOADING MAIN GAME (ENTERING THE DUNGEON) screen

The sprite file begins:

'Player
16,106

...so you'd expect it to be 106*16 + 2 lines long (maybe more with comment lines), but my file only has 1561 lines.  I didn't notice any other comment lines apart from the first line, so that seems to be enough data for 97 whole sprites plus 7/16 of a 98th sprite?

By the way, you can get a slight speed improvement (I think) by putting an:

Option USB Off

...in your program - this stops the CMM attempting to echo all the print statements to the (probably not connected) terminal.
.
Edited 2019-08-30 20:52 by ceptimus
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 11:19am 30 Aug 2019
Copy link to clipboard 
Print this post

  SimpleSafeName said  Although on line 254 you spell it "BACKSHEED" :)

I did have one grunt that was playing "Peek-a-boo" with me, I'd shoot him, he'd disappear as the shot passed through him, and then reappear. :)

Ops...  I will fix it (BACK SHED).

This is a bug in the collision routine related to the speed changes on the player shot. It's in my next bug list to fix.

  ceptimus said  I got the error:

[877] Sprite Load ".\spr\ingame2.spr"
Error: Corrupt sprite file

...on the LOADING MAIN GAME (ENTERING THE DUNGEON) screen

The sprite file begins:

'Player
16,106

...so you'd expect it to be 106*16 + 2 lines long (maybe more with comment lines), but my file only has 1561 lines.  I didn't notice any other comment lines apart from the first line, so that seems to be enough data for 97 whole sprites plus 7/16 of a 98th sprite?

By the way, you can get a slight speed improvement (I think) by putting an:

Option USB Off

...in your program - this stops the CMM attempting to echo all the print statements to the (probably not connected) terminal.

I have to merge the sprites files because CMM doesn't support loading sprites on specific numbers with various files.

The merging file order is:
1 - The chosen player;
2 - Fixed tiles (enemies, generators, objects);
3 - The wall tiles.

I create a file called INGAME1.TMP merging the chosen player and fixed tiles. In the header yet appears as 106 sprites because the final count will be it.

After this, I merge the wall tiles, and then it turns in a 106 sprites file exactly. The only manner that here can occur an error is if when loading I stop with Ctrl+C and try to load the MAINGAME.BAS. To fix it you must restart from the first file (GAUNTLET.BAS) to rebuild all things again.

By the way, I believe that this is not your error (because the things that I explained I sure you already know), maybe it's something related to SD card incompatibilities or SD card fragmentation?

And thanks for "Option USB Off", I will try it!


PS.: Did someone have the same error with sprite loadings like the ceptimus or the game was run right?
 
ceptimus
Senior Member

Joined: 05/07/2019
Location: United Kingdom
Posts: 130
Posted: 03:46pm 30 Aug 2019
Copy link to clipboard 
Print this post

I reformatted my SD card, then put just the gauntlet folder from your most recent .zip on it and tried again:

chdir gauntlet
gauntlet
N (I don't have the extra sound hardware)
Waited for the Animated Gauntlet screen (with the treasure chest) to finish playing the music.
Pressed space bar
Waited a while listening to music on Options page SD card activity LED pulsing
Pressed space bar
Waited a while on the Thor/Questor/Thyra/Merlin page - LED still pulsing
Pressed space bar
Waited for the LOADING messages.  At the LOADING MAIN GAME message I get the error I reported before:

[877] ...


Am I doing something wrong?  It's the first time I've tried playing rather than just watching the YouTube videos.
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 04:43pm 30 Aug 2019
Copy link to clipboard 
Print this post

No, you are doing the things right!

The LEDs pulsing it's because the VGM file is loading in the realtime meanwhile the music is playing to not use RAM, this is the PSGLib default. You can stop the intro, options and player selection anytime, this would not be a problem when loading the main game.

Try this... Decompress the folder again, then load the MAINGAME.BAS and try two things:

1) Change to MODE 4 and run the program.

2) Change the variable TEST=-1 to TEST=2, and then run the program.

See if it at least runs the game in the default config only for testing and tell me the results.
Edited 2019-08-31 02:45 by MauroXavier
 
ceptimus
Senior Member

Joined: 05/07/2019
Location: United Kingdom
Posts: 130
Posted: 08:07pm 30 Aug 2019
Copy link to clipboard 
Print this post

When you say Decompress - you just mean unzip the zip archive?  I've unzipped it to my Windows desktop and then just drag the Gauntlet folder from there to the SD card.

1) exits almost immediately with this error:
[877] Sprite Load ".\spr\ingame2.spr"
Error: Corrupt sprite file

Deleted folder from SD card, re-installed edited to test=2, then
2) exactly the same error.

That ingame2.spr file from the zip archive is showing as 28061 bytes, both in Windows and in a Files listing on the Maximite.

Have you tried running it on a clean SD card installed from the .zip file you uploaded here?  Perhaps the zip file is corrupted somehow - though Windows unzips it without complaining.
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 08:24pm 30 Aug 2019
Copy link to clipboard 
Print this post

Yes, I mean unzip  

I will test the zip file when I finish my job and back to the house.

But I'm curious because SimpleSafeName tested it and appears that played nice.
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 11:43pm 30 Aug 2019
Copy link to clipboard 
Print this post

  ceptimus said  Have you tried running it on a clean SD card installed from the .zip file you uploaded here?  Perhaps the zip file is corrupted somehow - though Windows unzips it without complaining.

Yesterday was close to midnight and I have not slept well... And made a big mistake.

Here is a fixed version:

GAUNTLET_ALPHA_007.zip

The file corruption was my fault, sorry!

Please, ceptimus, can you download and test again?

(edit: changed file to alpha 007)
Edited 2019-08-31 10:03 by MauroXavier
 
SimpleSafeName

Senior Member

Joined: 28/07/2019
Location: United States
Posts: 286
Posted: 01:22am 31 Aug 2019
Copy link to clipboard 
Print this post

Ceptimus and I had the same problems as Ceptimus, but you are aware of them.

A couple of oddities (that I think are MMbasic issues) is:

The first problem was the sprite issue, and the second one was that it reported not being able to find "LoadConfig" while running "Introsel.bas". Since "LoadConfig" doesn't reside in "Introsel.bas", that hardly comes as a surprise...

The error that it reported was no "LoadConfig" and gave the line number as the last line number in "Introsel.bas". I think that this is one for Geoffg.

-------------

On to Gauntlet 7

One thing that I noticed that could be considered a bug is when you finish level 6 and it crashes on the missing level 7. Typing in "run" at this point takes you back to level 1 with your previous player. Hardly a bug, since the program exited abnormally, just reload "Gauntlet" and restart the program.

I see that you have made the hidden wall on level 5 visible and it can be destroyed. But there is still a wall there after it's gone. Is this intentional?

On level 5 there is one demon who flashes to death and then back again. :)
 
     Page 5 of 6    
Print this page
© JAQ Software 2024