-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3DS] DevilutionX and Hellfire builds #1035
Comments
A lot happened over the course of the landing of this port, one of the big changes was widescreen support.
We are actually planing to move more of the rendering to SDL exactly to achieve greater flexibility in regards to where the menus are places etc. |
If this is reasonable for the user to set then that sounds like a good solution. Or if you can make is so that the builds set it that might be an option too. |
Is this specific to the 3DS version, or simply the in-development Hellfire support? The end result should be compatible with save games from the original Hellfire, anything in between are considered broken beta versions.
yes this is known and somewhat expected while we iron out the last bits of Hellfire support prior to the next release. |
The current 3ds devilutionx build renders at 800x480. Scaled down to 400x240. Previous attempts to render at lower than diablo's default 640x480, resulted in a loss of quality and none scaling main menu. That's why i ended up having it rendered in widescreen, higher than the default resolution. It's the 3DS implementation of SDL which lacks a few features. Only video-modes available are rendering to top screen, bottom screen or both using a single SDL screen. Maximum resolution would be 400x240 for top, 400x480 for top and bottom, or 320x480 to match the bottom screens width. The 3DS has a 800x240 top screen, when rendering 3d its 400x240 for the left and 400x240 for the right eye. SDL is only able to render to the top left framebuffer. Without SDL, using libctru or citro3d, we can utilize the top right framebuffer (and bottom). And enable or disable the parallax barrier. Using the top right framebuffer with sprites drawn with offset, a 3d effect could be created. I was thinking of working towards having a second render buffer for the bottom screen, for in-game menu's and such. |
Great work, thanks!
It would also be useful to get the right joystick (Circle Pad?) on the N3DS working like on other platforms (for scrolling map and maybe cursor interaction) Multiplayer/networking doesn't seem to work just like on Switch (which is probably related) - see #880 |
3DS isn't being built with network support so this is a know missing feature: https://github.com/diasurgical/devilutionX/blob/master/CMake/ctr/n3ds_defs.cmake#L2 |
Unfortunately, SDL2 only has unfinished and outdated implementations for 3DS available for public use.
You're right, such occasions would be quite hard to display properly without additional information. Maybe i should just stick with some floating cows. But, the main goal would be 800px support for most 3ds/2ds models and bottom screen support.
Yes, the c-stick should also be utilized, I'll look into that soon. Same as relative positioning for the touchpad.
As for network functionality, i did look into it briefly. While i was able to compile libsodium, i wasn't able to include asio due to various errors and missing dependencies. Those are unrelated to the switch build. |
thats a really good idea.
I guess you could still lave all the rendering the same, no matter if SDL or memcpy is used, and then just change the step that handles screen presentation. Unless there is something special about how frame buffers are handled, or you want to put in the effort in order to do hardware rendering.
Do you know if libzt or SDL_net would be viable options? |
Seems like a good idea, but have you thought about (optionally) putting Toolbar and automap (or maybe even character, inventory and quest windows )on the bottom screen? |
Both libraries are not offered on any channels i'm aware of. The 3DS (libctru) supports BSD sockets, but both options would require some work porting the libraries.
Yes, i have. As much as i love to make use of the bottom screen, i do think it should be optional. Original layout should also stay available to toggle, for nostalgic reasons. |
Now that we explicitly pass the buffer to render to into all the functions, this should be more feasible. Currently we use |
I just came across this, thank you for bringing Diablo to the 3ds, it has indeed brought me many hours of fun and nostalgia already :) Maybe another cosmetic usecase for the 3D effect would be to bring the menu, and overlayed interface items forward, such as spell icons and the inventory / character screen. It would also be amazing if we could have the minimap on the bottom screen. |
Inventory window on the bottom screen would allow inventory interaction through the touchscreen / with the stylus. that sounds quite good to have. |
@MrHuu If we were to get UI/inventory/map on bottom screen, what do you think the best resolution for top screen would be? Here's the 3DS's current simulated resolution as a reference. Bottom screen
|
@Tumayto you should probably scale all of them to 400x240 to see how it affects the pixels. I don't remember if the 3DS is able to do this in the hardware or if it's done using NN in software? |
@AJenbo I'm not sure how the 3DS handles the scaling, but I was able to run a 640x384 resolution on it, gave me a good idea of what it might look like. A lot more visible than the 50% scaling (at least if the UI was out of the way). As of now, seems like if you try to render anything below 640 width it crashes. |
It likely crashes because it can't fit the panels on the screen. If they are disabled it should work. |
Ahh, that's what it seemed like. Is there any way to disable those elements through .ini? |
no |
I have decided to go the route of a single bin. Not being able to force Diablo only mode when using .cia is an acceptable limitation. f64e297 |
While possible how usable/discoverable is using command line arguments for 3dsx? I don't know how to execute apps with command line parameters on 3DS |
https://github.com/fincs/new-hbmenu#usage you also have the option of not-installing the expansion. If there is a way for us to ship preconfigured xml shortcuts? I would be happy with that solution. |
We could provide preconfigured shortcuts. But i don't think this makes much sense. DevilutionX isn't developed this way, as it includes hellfire by default. If an in-game menu is available to be able to select the 'default' diablo, additional shortcuts wouldn't be needed. |
it will be eventually |
Exactly. And like you already mentioned, if the hellfire assets aren't provided, it will still launch as regular diablo. Which makes me think to just have one main DevilutionX executable. This; f64e297, should be sufficient. |
@MrHuu with the latest master we are now low enough in memory usage that the game will run on old 3DS models. Performance is pretty low, something like 7 FPS. But if you where planning to make an OpenGL ES render for the port then that would probably allow the game to run decent on all 3DS models :) |
Does the 3ds have an 8-bit output mode? If it does, setting these can significantly improve performance: set(SDL1_VIDEO_MODE_BPP 8)
set(SDL1_VIDEO_MODE_FLAGS SDL_FULLSCREEN|SDL_HWSURFACE) Additionally, if it also supports arbitrary resolutions, you could switch the video mode before playing videos using this setting: set(SDL1_FORCE_SVID_VIDEO_MODE ON) |
|
@AJenbo I'm guessing it's because it doesn't support 8 bpp, so it falls back to 32 if you try to set 8? |
I'm just relaying from chat :) P.s. could you update to the latest SDL_audiolib so that we don't have all this audio cracheling :) |
It looks to me as though 8 bpp is supported so it shouldn't be falling back to 32. FYI, I had told @AJenbo it had no effect, but I think that was one of the times where I forgot to install the game after transferring the cia. It seems the real problem with 8 bpp is that the game freezes, crashes, and displays weird colors. I've also seen it repeatedly loop back to the beginning of the intro movie not long after reaching the Diablo splash screen. |
So now that the stability issues have been resolved, I've been able to give all these options a fair assessment.
|
We should use 8bpp wherever possible for maximum performance -- even if there is no FPS difference, the memory usage may be lower |
I just found one important difference between 8 bpp vs 16 bpp. When I change the resolution from 800x480 to 640x480, I get a sizable boost to performance on 16 bpp, but 8 bpp acts like I just turned on |
This sounds like there is some hack in 3DS's SDL specifically for 640x480x8 |
I'd also like to note this: Lines 315 to 317 in e4df940
It has been added to address rendering getting out of sync and stopping rendering completely. Mostly noticed with scaling enabled, either in town or during heavy encounters. This is far from a ideal solution. This should be taken care of by SDL, but right now calling Eventually this needs to be replaced with a better solution, as it does limit performance. If no scaling (SDL) is used, rendering at 400x240, performance should be good enough to stop running out of sync and |
Thanks, @MrHuu. I spent a lot of time looking at this last night, and I came to the same conclusion. I find it weird that |
I found the relevant code in devkitpro/pacman-packages. It's changed a bit, but fundamentally does the same thing as the nop90 repo. EDIT: Better yet, they have a branch in the SDL repo. |
Okay, so after dropping After reviewing the SDL code for possible reasons why, I noticed the following comment that looks pretty suspicious to me. And here are the descriptions for It seems apparent based on those descriptions that SDL is just frequently failing to display our frames because the GPU is often busy. I decided to experiment with a build that uses So now we know our issue can be fixed with a change to the SDL library for 3DS, which means we'd need a custom build or support from the maintainers. I guess we should submit an issue to devkitPro and see what they say. Note: The d-pad stopped working on my custom build. I haven't done any sort of investigation just yet, except that I did try another custom build with EDIT: This probably explains the d-pad. |
Since there now is an ingame way to switch i consider this issue closed. I know there are other things mentioned in the issue, but instead new issues whould be opened for them if someone intent to work on it in some capacity. |
It's great to see the 3DS port merged, huge thanks to anyone making it possible.
Current builds are running great on New3DS hardware and already has served me, and hopefully a few others, many hours of fun with this project.
As for future improvements, i was thinking about eventually moving away from SDL for rendering.
This allows easier access to features as wide screen (800x240), possibly 3d and moving menu's, automap and status-bar to the bottom screen.
Feel free to ask questions, or just laugh (or cry) at some of the changes made. And do let me know should any issue arise.
That said, there are a few details which may need attention:
Previous 3ds builds are based on having separate executables for diablo and hellfire, including assets.
Recent commits unifying hellfire results in both executables behaving in a similar fashion.
Both .cia builds will load hellfire if found.
The .3dsx builds allow us to pass --diablo as argument, to force running diablo.
Should the hellfire build be removed, including it's assets?
The current manual points to outdated releases, not reflecting these changes:
https://github.com/diasurgical/devilutionX/blob/master/docs/manual/platforms/n3ds.md
Note: Savefiles created with the old hellfire builds linked to, are not compatible with current builds.
I also just noticed, after loading a new hellfire savefile, oils aren't saved / loaded properly.
The icon remains in inventory, without description. Interacting makes them disappear.
The text was updated successfully, but these errors were encountered: