Homebrew RELEASE systemshock - Shockolate

mathew77

Lovin' life.
Member
Joined
Jan 19, 2019
Messages
1,217
Trophies
0
Age
47
XP
3,747
Country
Kazakhstan
I updated the release but did not update the keymap in the zip, but I tried this one out
Thanks, now swinging the weapon works OK!

I guess your config is missing the 'F' button to change cursor modes, so here's my cfg just if you need it:
Code:
TOUCH_MOUSE_ABS=TRUE
DOUBLE_TOUCK_KEYBOARD=TRUE
RSTICK_MOUSE=TRUE
DUP=w
DDOWN=s
DLEFT=a
DRIGHT=d
LSTICK_UP=w
LSTICK_DOWN=s
LSTICK_LEFT=a
LSTICK_RIGHT=d
MINUS=ESC
PLUS=SPACE
LSTICK=RETURN
L=f
ZL=MOUSE_LEFT
ZR=MOUSE_RIGHT
 

Attachments

  • keymap.keys.zip
    285 bytes · Views: 217
Last edited by mathew77,
  • Like
Reactions: cucholix

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
42
XP
481
Country
United States
Nice project, thanks!

Sorry for asking that, but there's no music at all?

PS: maybe it could be useful to assign mouse click function and double click on some buttons, like ZL / ZR instead of R3, and use the A/B/X/Y buttons somehow.

Sound should be fixed
the game expects the xmis to be in
res/sound/sblaster/
so you should have a
res/sound/sblaster/titloop.xmi
and other xmis.
 

mathew77

Lovin' life.
Member
Joined
Jan 19, 2019
Messages
1,217
Trophies
0
Age
47
XP
3,747
Country
Kazakhstan
Sound should be fixed
the game expects the xmis to be in
res/sound/sblaster/
so you should have a
res/sound/sblaster/titloop.xmi
and other xmis.
I've tried to put all the 15 .XMIs into /switch/systemshock/res/sound/sblaster/, but no luck at all — no music, just silence. :(
 

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
42
XP
481
Country
United States
/switch/systemshock/res/sound/sblaster> ls
-rw-rw-rw- 1 Switch Switch 14226 Nov 11 01:50 end.xmi
-rw-rw-rw- 1 Switch Switch 2442 Nov 11 01:50 endloop.xmi
-rw-rw-rw- 1 Switch Switch 1120 Nov 11 01:50 ini-mt.xmi
-rw-rw-rw- 1 Switch Switch 190 Nov 11 01:50 ini-sc.xmi
-rw-rw-rw- 1 Switch Switch 32344 Nov 11 01:50 introthm.xmi
-rw-rw-rw- 1 Switch Switch 11814 Nov 11 01:50 thm0.xmi
-rw-rw-rw- 1 Switch Switch 35352 Nov 11 01:50 thm1.xmi
-rw-rw-rw- 1 Switch Switch 32242 Nov 11 01:50 thm10.xmi
-rw-rw-rw- 1 Switch Switch 32110 Nov 11 01:50 thm2.xmi
-rw-rw-rw- 1 Switch Switch 26238 Nov 11 01:50 thm3.xmi
-rw-rw-rw- 1 Switch Switch 36494 Nov 11 01:50 thm4.xmi
-rw-rw-rw- 1 Switch Switch 35018 Nov 11 01:50 thm5.xmi
-rw-rw-rw- 1 Switch Switch 42284 Nov 11 01:50 thm6.xmi
-rw-rw-rw- 1 Switch Switch 8142 Nov 11 01:50 thm7.xmi
-rw-rw-rw- 1 Switch Switch 4956 Nov 11 01:50 titloop.xmi

is what I have
Im attaching a nro with debug logging enabled, if you can run it under
nxlink -s ./systemshock.nro
it should show if there are any errors
 

Attachments

  • systemshock.zip
    3.9 MB · Views: 219
  • Like
Reactions: mathew77

mathew77

Lovin' life.
Member
Joined
Jan 19, 2019
Messages
1,217
Trophies
0
Age
47
XP
3,747
Country
Kazakhstan
Hmm, maybe I fixed one thing and broke another. Let me know if other sound effects work correctly.
All in-game sounds and music in the first location, start screen music included are good.

But audio in the intro-videoclip (first button in main menu) is muted. :( Exactly the opposite of the r2 release.
 

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
42
XP
481
Country
United States
I'll work on this, the code assumes it can open 2 audio devices, which it cannot on the switch. I think one is only used for the cut scene, so i can prob close/open them to do it or alter it to correctly use the mixer.
 
  • Like
Reactions: mathew77

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
42
XP
481
Country
United States
All in-game sounds and music in the first location, start screen music included are good.

But audio in the intro-videoclip (first button in main menu) is muted. :( Exactly the opposite of the r2 release.

Ok, I couldnt figure out how to port the sdl raw stuff to sdl mixer, but it was simple enough to close mixer and open raw and vice versa, raw is only used for the intro and mixer for game. So checkout r4 and let me know.
 
  • Like
Reactions: mathew77

mathew77

Lovin' life.
Member
Joined
Jan 19, 2019
Messages
1,217
Trophies
0
Age
47
XP
3,747
Country
Kazakhstan
Ok, I couldnt figure out how to port the sdl raw stuff to sdl mixer, but it was simple enough to close mixer and open raw and vice versa, raw is only used for the intro and mixer for game. So checkout r4 and let me know.
Works like a charm, thank you!
 

mathew77

Lovin' life.
Member
Joined
Jan 19, 2019
Messages
1,217
Trophies
0
Age
47
XP
3,747
Country
Kazakhstan
@capsterx
Sorry for bothering you again — but why the right stick make some 'struggling' moves, like stuttering or sluggishnes, do you know?

For example, if your character standing still and rotating the stick to the left (or right), It's not smoothly at all, moves are jerky.. Maybe, it can be fixed via some config?..

(btw it's not about drifting joycons or whatever, tried multiple controllers)
 

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
42
XP
481
Country
United States
@capsterx
Sorry for bothering you again — but why the right stick make some 'struggling' moves, like stuttering or sluggishnes, do you know?

For example, if your character standing still and rotating the stick to the left (or right), It's not smoothly at all, moves are jerky.. Maybe, it can be fixed via some config?..

(btw it's not about drifting joycons or whatever, tried multiple controllers)

Is this new or has it always done this?
 

Purple_Shyguy

Well-Known Member
Member
Joined
Nov 8, 2008
Messages
2,385
Trophies
2
Age
34
Location
Republic of Ireland
XP
4,895
Country
It was always like this. Probably something to do with the way the mouse is mapped to the right stick.
Maybe vsync issue? Mouse sensitivity issue?

If you use the touch screen with TOUCH_MOUSE=TRUE then moving left and right is smooth but with the stick its jittery and stutters.
 
Last edited by Purple_Shyguy,

cucholix

00000780 00000438
Member
Joined
Jan 17, 2017
Messages
3,246
Trophies
1
Age
44
XP
6,306
Country
Chile
@capsterx
Sorry for bothering you again — but why the right stick make some 'struggling' moves, like stuttering or sluggishnes, do you know?

For example, if your character standing still and rotating the stick to the left (or right), It's not smoothly at all, moves are jerky.. Maybe, it can be fixed via some config?..

(btw it's not about drifting joycons or whatever, tried multiple controllers)
This also happen with vanillara, the cursor movement is more fluid with Pro Controller than joy-cons.
 

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
42
XP
481
Country
United States
It was always like this. Probably something to do with the way the mouse is mapped to the right stick.
Maybe vsync issue? Mouse sensitivity issue?

If you use the touch screen with TOUCH_MOUSE=TRUE then moving left and right is smooth but with the stick its jittery and stutters.

TOUCH_MOUSE turns on a feature native to SDL itself, the RSTICK emulation is my code.

My best guess is that the joystick generates a lot more events and that causes slowdowns with how the mouse look code works. A mouse and touchscreen can generate x and y events at the same time, the joystick generates one per axis. I've been slowing this down by dividing the joy value by 0x1500, but maybe there is a better method of emulating this.
 

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
42
XP
481
Country
United States
So, this is pretty hacky, but see if this works.
You'll need to put a new value into your keymap.keys
RSTICK_MOTION_MODIFIER=2000

or any other number, high slows it down, lower speeds it up. The conversion algo needs to be more intelligent, but maybe this will help for now.
 

Attachments

  • sshock.zip
    3.9 MB · Views: 185

cucholix

00000780 00000438
Member
Joined
Jan 17, 2017
Messages
3,246
Trophies
1
Age
44
XP
6,306
Country
Chile
So, this is pretty hacky, but see if this works.
You'll need to put a new value into your keymap.keys
RSTICK_MOTION_MODIFIER=2000

or any other number, high slows it down, lower speeds it up. The conversion algo needs to be more intelligent, but maybe this will help for now.
It still get stuck, if you hold to the right for example it will eventually stop moving the camera view, it happens with Pro Controller, WiiU Pro Controller, PS3 controller and joycons, so I doubt it's a problem with stick deadzone, it feels like when you reach certain number of frames it stops reading the stick input, or it skips inputs between frames, giving the feeling of it getting stuck, same happen with vanillara.
 

capsterx

Well-Known Member
OP
Member
Joined
Oct 14, 2020
Messages
147
Trophies
0
Age
42
XP
481
Country
United States
It still get stuck, if you hold to the right for example it will eventually stop moving the camera view, it happens with Pro Controller, WiiU Pro Controller, PS3 controller and joycons, so I doubt it's a problem with stick deadzone, it feels like when you reach certain number of frames it stops reading the stick input, or it skips inputs between frames, giving the feeling of it getting stuck, same happen with vanillara.

The problem is that the game was written to use interrupts. When the port to SDL was made the SDL_PollEvent in a loop happens in the main loop. There is a queue, but it queues in the same thread very inefficiently. What I did was limit the number of events that can happen in a single loop and flush the rest out. Im attaching another experimental that is slightly different. The real fix would be to make the queue threadsafe and g the events from another thread.

It's also possible this is a red herring and Im chasing the wrong thing.
 

Attachments

  • sshock.zip
    3.9 MB · Views: 204
  • Like
Reactions: mathew77

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://youtu.be/amAULN7yJis?si=JWDANkaENVhXuLBd stay out of the water Psi