openSMB2 icon indicating copy to clipboard operation
openSMB2 copied to clipboard

Create initial port prototype for Nintendo 3DS using LÖVE Potion

Open Matriks404 opened this issue 2 years ago • 5 comments

Since I got a New Nintendo 3DS XL, this could be a fun exercise.

Also see #93 for 3DS "fun exclusive features".

Ideas for optimization and small improvements for the prototype:

  • [x] Readd controls that are currently missing.
    • [x] In the level editor menu show appropriate controls for entering levels (Implemented in 4457eda35f6458a8d77de33af3686b291effb52b).
      • [x] Implement 8x8 graphics for buttons (Implemented in 6fedd58ec276ebbc0ac9b61ee79281afbbeefb14).
  • [x] Update README.md with current controls (see aaa5e4fc6a1dab521bf281d6f079e28dda17fad9 and 6f77d2b0d5509a308205edf7a555ab6bd6ac5bc1).
  • [x] Use love.graphics.getStats() to print stats on screen and investigate bottlenecks (implemented in e9fd0087675a97b5986d9fa92156da25e1a2a164, but note that this function doesn't exist in LÖVE Potion, so it was disabled for this port).
  • [ ] When starting a gamepack, write log what's happening behind the scenes on screen (use love.graphics.present() for that?).
  • [ ] See whether or not there's better way of drawing graphics, especially tiles from the tilemap (Use drawTexture()?). Maybe draw tiles to the background using canvas? Could do segments that appear when character is moving through them.
  • [ ] Maybe use some dialog system like talkies, since there is no way to display system dialogs on LÖVE Potion (or just write one ourselves, old Pokémon-like dialog system should be fine, so message on bottom and Yes/No choice on the right).
  • [ ] Having graphics atlas might be better for performance on 3DS (let's check that), although this might cause the code to differ too much between master and 3ds branches.
  • [ ] Level editor menu should have clickable buttons on the bottom screen with level labels, so user doesn't need to remember weird button combinations to access the level editor.

~~Temporarily (or not) add controls instructions on the bottom screen (maybe add them later to a submenu that opens by touching some button). This can be accomplished by writing a function that prints the table on some coords (printInstructions(text, x, y, width, height, line_spacing))~~ I really think that's bad idea (this will just crash the console when we approach the sprite limit) unless we use system font. I think having instructions graphics is a better approach (see #93) though. And this can be used on PCs (or more correctly: all compatible devices with keyboards attached) as well. MAYBE JUST USE CANVAS?

Matriks404 avatar Mar 24 '23 15:03 Matriks404

Very primitive support is implemented on 51-3ds_support branch. This is not officially supported.

If basic stuff is resolved and functionality of the 3DS port is the same as on the master branch, code will be moved to port_3ds branch. 3DS/LÖVE Potion related stuff probably will never be merged back into master to not overcomplicate code, but I might change the apparoch in the future for that port.

Some stuff still can be made more portable between these versions however, need to investigate on that though.

Matriks404 avatar Aug 30 '23 17:08 Matriks404

Some of the stuff for reworking controls is done on f0951effc7988f4feb84e5279e190d29138ed4ae. Level editor have been disabled for now, will work on this either tomorrow or some other day. Also I need to update controls section in README.

Matriks404 avatar Sep 06 '23 18:09 Matriks404

Last bits of level editor controls were implemented in 62938f7505a04cf7cd3179ff0a93e4a2369bed02.

I didn't implement some minor stuff though that's not really needed for anything on 3DS. I will make a Wiki article about this later though.

Matriks404 avatar Sep 17 '23 20:09 Matriks404

I have no idea how do I optimize font drawing, it seems to drop to 9 FPS when doing anything with text, regardless how much is loaded.

Matriks404 avatar Sep 24 '23 13:09 Matriks404

So... optimizing font drawing was not needed after all :)

image

Matriks404 avatar Sep 30 '23 20:09 Matriks404