Homebrew [Release] ctrHexenII - Hexen II porting for 3DS

  • Thread starter Thread starter Rinnegatamante
  • Start date Start date
  • Views Views 76,010
  • Replies Replies 243
  • Likes Likes 25
Looks like i finally solved also the audio issues with csnd:SND. Now the only difference between csnd and dsp is that dsp uses native stereo sounds (so also ambiental position for sounds) and csnd uses an "emulated" stereo sounds (just a mono track played on both audiochannels).

I've also increased samplerate from 11025 to 32000 cause, as @mironicurse told me, there are some game sounds in higher frequency.
 
  • Like
Reactions: SLiV3R
About the second analogue support:

Would it be possible to copy and implement the Quake 1 second analogue code? If that would work, it would be less work for you. I know that the second analogue is rather difficult to implement. As elhobbs have some minor problems with second analogue in the Heretic port as well. But MasterFeizz pretty much perfected the controls in the Quake 1 port.
 
About the second analogue support:

Would it be possible to copy and implement the Quake 1 second analogue code? If that would work, it would be less work for you. I know that the second analogue is rather difficult to implement. As elhobbs have some minor problems with second analogue in the Heretic port as well. But MasterFeizz pretty much perfected the controls in the Quake 1 port.
The Duke Nukem one also supports it, however, I believe he isn't using it as the control pad pro, instead he is using directly the C-stick, so that completely breaks compatibility with O3DS... Maybe adding a toggle or something? Not sure how pratical would that be for the developer.
 
  • Like
Reactions: SLiV3R
The Duke Nukem one also supports it, however, I believe he isn't using it as the control pad pro, instead he is using directly the C-stick, so that completely breaks compatibility with O3DS... Maybe adding a toggle or something? Not sure how pratical would that be for the developer.

Perhaps two builds could be a solution. One for N3DS and one for the O3DS. Not really convenient. But for the n3ds users it would be great :)


One other thing that shot me by surprise, that I can't explain... This test built is running much faster (probably 60 fps) in hax 2.6 compared to hax 1.1b (which is much slower). I prefer the hax 2.6 version. So there is no screen tearing in the hax 1.1b...
 
  • Like
Reactions: mironicurse
The Duke Nukem one also supports it, however, I believe he isn't using it as the control pad pro, instead he is using directly the C-stick, so that completely breaks compatibility with O3DS... Maybe adding a toggle or something? Not sure how pratical would that be for the developer.
Using the C-stick shouldn't break compatibility since I tested on my 2DS, but it is unnecessary code which should be disabled. And I'm not sure if circlepad pro support has been added into ctrulib.

Anyways, both projects will benefit from further development since Hexen II uses a modified version of the quake engine.
 
  • Like
Reactions: KaduPSE and SLiV3R
Using the C-stick shouldn't break compatibility since I tested on my 2DS, but it is unnecessary code which should be disabled. And I'm not sure if circlepad pro support has been added into ctrulib.

Anyways, both projects will benefit from further development since Hexen II uses a modified version of the quake engine.
I meant in the sense that if using the CPP the input would also be compatible with O3DS using the accessory, whilst using the C-stick makes this input only valid for the N3DS. But I see how I said might sound like adding the code would make the game not run on the O3DS :)
 
Using the C-stick shouldn't break compatibility since I tested on my 2DS, but it is unnecessary code which should be disabled. And I'm not sure if circlepad pro support has been added into ctrulib.

Anyways, both projects will benefit from further development since Hexen II uses a modified version of the quake engine.

For what i know ir:rst is still unusable (so circlepad pro it's impossible to use). I can add the second analog support by re-using my vitaQuake code (since vitaQuake take advantage from second PSVITA analog to move camera - https://github.com/Rinnegatamante/vitaQuake/blob/master/source/in_psp2.c#L60-L72 ).
 
For what i know ir:rst is still unusable (so circlepad pro it's impossible to use). I can add the second analog support by re-using my vitaQuake code (since vitaQuake take advantage from second PSVITA analog to move camera - https://github.com/Rinnegatamante/vitaQuake/blob/master/source/in_psp2.c#L60-L72 ).
Yep, I thought the circlepad pro wasn't implemented yet. I have the code for the C-button if you want:
https://github.com/masterfeizz/ctrQuake/blob/master/source/in_ctr.c#L71-L84
 
Water bug finally solved thanks to @MasterFeizz tip (it should be worked better but for now it's good enough).
Going to add now second cstick support for N3DS and i'll also modify a bit first analog function for O3DS users (let moving analog left/right to rotate camera instead of strafing).
 
Water bug finally solved thanks to @MasterFeizz tip (it should be worked better but for now it's good enough).
Going to add now second cstick support for N3DS and i'll also modify a bit first analog function for O3DS users (let moving analog left/right to rotate camera instead of strafing).

Yeah! This is party time! MasterFeizz and Rinnegatamante :)
 
Using the C-stick shouldn't break compatibility since I tested on my 2DS, but it is unnecessary code which should be disabled. And I'm not sure if circlepad pro support has been added into ctrulib.

Anyways, both projects will benefit from further development since Hexen II uses a modified version of the quake engine.

@MasterFeizz Talking about shareable code through ctrQuake and ctrHexenII, you could find interesting snd_ctr.c since now it has perfect sound with both 3DS audioservices (csnd and dsp): https://github.com/Rinnegatamante/ctrHexenII/blob/master/source/snd_ctr.c

--------------------- MERGED ---------------------------

Looks like the cstick code doesn't work for me. Maybe some issue introduced in libctru with newer releases? (since i remember ctrQuake i compiled with brightness fix had the same problem).
 
  • Like
Reactions: SLiV3R
  • Like
Reactions: SLiV3R
@MasterFeizz Talking about shareable code through ctrQuake and ctrHexenII, you could find interesting snd_ctr.c since now it has perfect sound with both 3DS audioservices (csnd and dsp): https://github.com/Rinnegatamante/ctrHexenII/blob/master/source/snd_ctr.c

Sorry for being a pestering commentator :p But it's a very great idea if you could share code, like in a real open source spirit. Hexen II have clearer and cleaner audio than Quake 1. And Quake 1 have perfect second analogue support. Win- win situation :)
 
The problem with analog is that barely the same code doesn't seem to work to me probably caused by libctru (?). I'm using one of the latest available version with few changes (like dsp thread opened on syscore instead of appcore).

Code:
if(isN3DS){

  hidCstickRead(&cstick);

  if(m_pitch.value < 0)
  cstick.dy = -cstick.dy;

  cstick.dx = abs(cstick.dx) < 10 ? 0 : cstick.dx * sensitivity.value * 0.01;
  cstick.dy = abs(cstick.dy) < 10 ? 0 : cstick.dy * sensitivity.value * 0.01;

  cl.viewangles[YAW] -= cstick.dx;
   if (inverted) cl.viewangles[PITCH] += cstick.dy;
   else cl.viewangles[PITCH] -= cstick.dy;
   
  }

--------------------- MERGED ---------------------------

Solved the problem with 2nd analog :D
 
  • Like
Reactions: KaduPSE and SLiV3R
The problem with analog is that barely the same code doesn't seem to work to me probably caused by libctru (?). I'm using one of the latest available version with few changes (like dsp thread opened on syscore instead of appcore).

Code:
if(isN3DS){

  hidCstickRead(&cstick);

  if(m_pitch.value < 0)
  cstick.dy = -cstick.dy;

  cstick.dx = abs(cstick.dx) < 10 ? 0 : cstick.dx * sensitivity.value * 0.01;
  cstick.dy = abs(cstick.dy) < 10 ? 0 : cstick.dy * sensitivity.value * 0.01;

  cl.viewangles[YAW] -= cstick.dx;
   if (inverted) cl.viewangles[PITCH] += cstick.dy;
   else cl.viewangles[PITCH] -= cstick.dy;
  
  }

--------------------- MERGED ---------------------------

Solved the problem with 2nd analog :D

Yay! Do you need any more testings, before you release it? :)
 
@MasterFeizz Talking about shareable code through ctrQuake and ctrHexenII, you could find interesting snd_ctr.c since now it has perfect sound with both 3DS audioservices (csnd and dsp): https://github.com/Rinnegatamante/ctrHexenII/blob/master/source/snd_ctr.c

--------------------- MERGED ---------------------------

Looks like the cstick code doesn't work for me. Maybe some issue introduced in libctru with newer releases? (since i remember ctrQuake i compiled with brightness fix had the same problem).
In regards to the perfect sound - does this stay in sync after 10 minutes or so? This is very similar to the timing values I used for prboom3ds and it gets out of sync after about 10 minutes.
 
I hope this comes in 3dsx format aswell, not just cia.

Pip'
3DSX is available and running AWESOME :D

Tried your latest Hexen II for 30-40 minutes. It is near perfect now. Some minor things:

- I don't know about elhobbs sound unsync comment.. I didn't notice it. So probably it isn't there. But it is possible it will show up...
- I have saved around 10 times. One of the times the game froze. It happened after the text: sdmc:/portals/demo1.gip...
- When saving or entering a new level we will hear the last sound generated, getting repeated until the save or entering the new stage is done. Not a thing I care about. But it is still a bug.
- The c-stick (second analogue) is perfect! Just like in Quake 1 :D These fps games gets 100 % more playable with the c-stick implemented!
- Water is working perfectly
- Not a big thing. But the custom mapped controls aren't saved. I mean, they could be saved together with the save. So we wont need to map the controls every time we start an old save.

I think you can release this beast now :D



PS. One last thing Im always asking about. I would really like to have the status bars moved to the lower screen permanently! Like this rather ugly picture I took from two mobile phone pictures.. But I think you get the concept :) (It would look like an official port if you did this :D)
 

Attachments

  • 20160318_231412.jpg
    20160318_231412.jpg
    425 KB · Views: 278
Last edited by SLiV3R,
3DSX is available and running AWESOME :D

Tried your latest Hexen II for 30-40 minutes. It is near perfect now. Some minor things:

- I don't know about elhobbs sound unsync comment.. I didn't notice it. So probably it isn't there. But it is possible it will show up...
- I have saved around 10 times. One of the times the game froze. It happened after the text: sdmc:/portals/demo1.gip...
- When saving or entering a new level we will hear the last sound generated, getting repeated until the save or entering the new stage is done. Not a thing I care about. But it is still a bug.
- The c-stick (second analogue) is perfect! Just like in Quake 1 :D These fps games gets 100 % more playable with the c-stick implemented!
- Water is working perfectly
- Not a big thing. But the custom mapped controls aren't saved. I mean, they could be saved together with the save. So we wont need to map the controls every time we start an old save.

I think you can release this beast now :D



PS. One last thing Im always asking about. I would really like to have the status bars moved to the lower screen permanently! Like this rather ugly picture I took from two mobile phone pictures.. But I think you get the concept :) (It would look like an official port if you did this :D)

Moving the statusmenu on lower screen is not as trivial as it seems cause i'm quite sure the menu is rendered with internal functions (it means it get printed with the same renderer used for the whole game).
For the sound when changing level, i was trying to "fix" it right now (just set the audio playaback volume to 0 until it finishes loading).
 
  • Like
Reactions: SLiV3R
"For the sound when changing level, i was trying to "fix" it right now (just set the audio playaback volume to 0 until it finishes loading)."

Well, that is actually a fix :) Dont forget that the same thing happens when saving as well!

--------------------- MERGED ---------------------------

I donated 40 euros :P

But please consider trying to move the statusmenu to the lower screen sometime. It would make you even more proud of your great port! :)
 
Last edited by SLiV3R,
  • Like
Reactions: Rinnegatamante

Site & Scene News

Popular threads in this forum