Author Topic: Master Sword v1.2  (Read 5225 times)

0 Members and 1 Guest are viewing this topic.

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
Master Sword v1.2
« on: December 13, 2021, 12:58:44 am »
Has some bug fixes and the open source version now has access to the score sever for you speed runners.

Just as a note, this was built in QB64 v1.5 as this was the current version when development started. v2.0 does not seem to work right with this game.

EDIT:
Based on the comments I redid the controller code. This should work better now.
* Master Sword v1.2.zip (Filesize: 3.83 MB, Downloads: 159)
« Last Edit: December 19, 2021, 07:11:15 pm by Craz1000 »

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Master Sword v1.1
« Reply #1 on: December 13, 2021, 01:22:50 pm »
"Grrrrr....." to quote from the game.
Some things to consider....

Your controller setup needs some work, for starters my controller has no "stick" just a Dpad.
second, my controller uses buttons 1,2,9,10 and your code only looks for 0,4,8.
this leaves an issue with the Select button used to pause the game?
And one thing I ran into with Dragon Warrior, some peoples controllers use buttons for directions not axis. I see no support for those.

No Keyboard customization that I could find...
No instructions on what keys are default... took me a while to get anything to happen randomly hitting buttons...
Screen is too big for my desktop...
You might consider re-encoding Battle Theme 1. Wasting several megs at that 320k encoding.

Would love to play, if I can figure out how to do anything, even better if I could use my controller.
Granted after becoming radioactive I only have a half-life!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Master Sword v1.1
« Reply #2 on: December 13, 2021, 02:20:07 pm »
My controller has a Dpad, but as Cobalt mentioned, those are 4 buttons and not 2 axis inputs. 
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
Re: Master Sword v1.1
« Reply #3 on: December 15, 2021, 03:22:28 pm »
all I had is a ps4 controller laying around so the controller code was built around that. it shouldn't be too difficult to change it around. so the dpad itself falls under an STRIG event i presume?

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
Re: Master Sword v1.1
« Reply #4 on: December 15, 2021, 03:35:24 pm »
Cobalt

Battle Theme 1 was supposed to be removed. That track is not used which is why I never took down the 320k encoding.

Keyboard is the normal W,A,S,D with Q=B and E=A, TAB=Select, Enter=Start on the NES controller..
As far as the screen, everything is built around that specific resolution. I can put in a _FULLSCREEN if that will help maybe?

I would love to support more that a PS4 controller but that is all i had available to me to test and play with. Not sure how the others work but I can def add support for them
if i can get an idea how the D-Pad is translated. On the PS4 controller the DPad is not picked up at all so I ignored it.


« Last Edit: December 15, 2021, 03:55:46 pm by Craz1000 »

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
Re: Master Sword v1.1
« Reply #5 on: December 15, 2021, 04:04:56 pm »
I believe this will work, maybe lol?  Sorry I really wish I had more than one controller available to me.
* Controller.bi (Filesize: 3.17 KB, Downloads: 162)
* Controller.h (Filesize: 0.31 KB, Downloads: 173)
* MasterSword.bas (Filesize: 5.92 KB, Downloads: 160)

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Master Sword v1.1
« Reply #6 on: December 15, 2021, 10:11:05 pm »
you could allow controllers with various button counts by using this to select what button to use for what:
Code: QB64: [Select]
  1.    
  2. FOR i%% = 1 TO _LASTBUTTON(C.Control_Pad)
  3.  IF _BUTTON(i%%) THEN Bselect%% = i%%: i%% = _LASTBUTTON(C.Control_Pad) + 1
  4. NEXT i%%
  5.  

then you assign that button to the control, and it wont matter if they have 4 buttons or 24 buttons.
say you picked the controller button to be used for 'A' assign:Controller.A = Bselect%%

and I'm not sure if STRIG() will pull it off anyway looking at the WIKI page. based on the following line from the WIKI
"Odd devices use 0, 1, 4, 5, 8 and 9 and Even devices use 2, 3, 6, 7, 10 and 11 as first parameters with device number following."
(you were using 0,4,8; all inline with an Odd device number)

So I don't know if my button 2 or 10 would even work with STRIG() as my controller is an odd device number(reported as 3)
I would have recommended using _BUTTON() instead.
And I don't think you can assign the Dpad buttons correctly for the same reason.
Even though my Dpad returns as 2 axis, it only returns 3 values for each axis -1,0,1 that is it.

And custom keyboard controls could be done in a similar manor, you have a menu where the player selects what button they want to customize then you get what they pressed and assign it for that button.

Looking at the code it doesn't appear that it would be too terribly hard to swap out STRIG for _BUTTON, and probably STICK for _AXIS, but then I haven't looked through that much.

Now I know the keyboard controls I will see about giving it a run though!

how my computer registers the 4 buttons on the controller.
Controller.jpg
* Controller.jpg (Filesize: 250.84 KB, Dimensions: 1360x768, Views: 162)
Granted after becoming radioactive I only have a half-life!

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
Re: Master Sword v1.1
« Reply #7 on: December 17, 2021, 02:34:36 pm »
you could allow controllers with various button counts by using this to select what button to use for what:
Code: QB64: [Select]
  1.    
  2. FOR i%% = 1 TO _LASTBUTTON(C.Control_Pad)
  3.  IF _BUTTON(i%%) THEN Bselect%% = i%%: i%% = _LASTBUTTON(C.Control_Pad) + 1
  4. NEXT i%%
  5.  

then you assign that button to the control, and it wont matter if they have 4 buttons or 24 buttons.
say you picked the controller button to be used for 'A' assign:Controller.A = Bselect%%

and I'm not sure if STRIG() will pull it off anyway looking at the WIKI page. based on the following line from the WIKI
"Odd devices use 0, 1, 4, 5, 8 and 9 and Even devices use 2, 3, 6, 7, 10 and 11 as first parameters with device number following."
(you were using 0,4,8; all inline with an Odd device number)

So I don't know if my button 2 or 10 would even work with STRIG() as my controller is an odd device number(reported as 3)
I would have recommended using _BUTTON() instead.
And I don't think you can assign the Dpad buttons correctly for the same reason.
Even though my Dpad returns as 2 axis, it only returns 3 values for each axis -1,0,1 that is it.

And custom keyboard controls could be done in a similar manor, you have a menu where the player selects what button they want to customize then you get what they pressed and assign it for that button.

Looking at the code it doesn't appear that it would be too terribly hard to swap out STRIG for _BUTTON, and probably STICK for _AXIS, but then I haven't looked through that much.

Now I know the keyboard controls I will see about giving it a run though!

how my computer registers the 4 buttons on the controller.

Gotcha. Good luck. The game is crazy hard using the keyboard. ill see if i can pick up a cheap controller at the store and play with it.

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
Re: Master Sword v1.1
« Reply #8 on: December 19, 2021, 01:12:11 pm »
Cobalt. Just curious set your dead zone to -128 see if that works.

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
Re: Master Sword v1.2
« Reply #9 on: December 19, 2021, 07:12:01 pm »
I completely redid the controller code. This should work better.
* Master Sword v1.2.zip (Filesize: 3.83 MB, Downloads: 149)