Wuzzy/Repixture
6
33
Fork
You've already forked Repixture
10

Make formspecs usable on mobile #198

Open
opened 2024年07月12日 14:49:50 +02:00 by grorp · 2 comments

Problem

Repixture is a very good candidate for a mobile game because of its simplicity. Playing the game on Android already mostly works.

Unfortunately, the formspecs are quite unusable on mobile because everything is way too small. The craftguide is basically impossible to use. I'm attaching a screenshot to show what it looks like:

screenshot.jpeg

Please note that you need to view the screenshot at a small size to see the problem. On my desktop computer, a 30% scale gives the screenshot the same size as on my phone.

Solution

As a proof of concept, I modified some formspecs to make them usable on mobile here: https://codeberg.org/Wuzzy/Repixture/compare/master...grorp/Repixture:formspec-magic

goodscr.jpeg
goodscr2.jpeg

(Please note again, the screenshots need to be viewed at a small size.)

However, you probably don't want these modified formspecs as replacements for your existing formspecs. Instead, you probably want to switch between a desktop version and a mobile version of the formspec for each player, depending on what minetest.get_player_window_information() tells you.

### Problem Repixture is a very good candidate for a mobile game because of its simplicity. Playing the game on Android already mostly works. Unfortunately, the formspecs are quite unusable on mobile because everything is way too small. The craftguide is basically impossible to use. I'm attaching a screenshot to show what it looks like: ![screenshot.jpeg](/attachments/a4e5e95a-4cbd-459f-a9af-d964ff163f7e) Please note that you need to view the screenshot at a small size to see the problem. On my desktop computer, a 30% scale gives the screenshot the same size as on my phone. ### Solution As a proof of concept, I modified some formspecs to make them usable on mobile here: https://codeberg.org/Wuzzy/Repixture/compare/master...grorp/Repixture:formspec-magic ![goodscr.jpeg](/attachments/e5b0d1d5-2658-4bd4-9f8f-1b49c434fa85) ![goodscr2.jpeg](/attachments/66aa0d40-5942-4ba7-bb67-17dfde4b7c63) (Please note again, the screenshots need to be viewed at a small size.) However, you probably don't want these modified formspecs as replacements for your existing formspecs. Instead, you probably want to switch between a desktop version and a mobile version of the formspec for each player, depending on what `minetest.get_player_window_information()` tells you.
Author
Copy link

Doing this with raw formspecs would result in a huge amount of code duplication and complexity, so I would like to use this library: https://content.minetest.net/packages/luk3yx/flow/

The benefit is that it would allow me to have the desktop and the mobile layout in the same code, without duplication and without manually repositioning everything. For mobile players, I could simply replace some gui.VBox instances with gui.HBox and reorder some elements.

What do you think?

(I haven't yet made a proof of concept for doing this with Flow, though.)

Doing this with raw formspecs would result in a huge amount of code duplication and complexity, so I would like to use this library: https://content.minetest.net/packages/luk3yx/flow/ The benefit is that it would allow me to have the desktop and the mobile layout in the same code, without duplication and without manually repositioning everything. For mobile players, I could simply replace some `gui.VBox` instances with `gui.HBox` and reorder some elements. What do you think? (I haven't yet made a proof of concept for doing this with Flow, though.)
Owner
Copy link

Good issue, but not my highest priority right now. I first want to build on content and gameplay.

Unfortunately, I don't have an easy method to test mobile mode right now. But it's nice Minetest finally allows me to check if a player is on mobile. And given that Minetest has been traditionally horrible on mobile anyway (horrible controls), my motivation is not very high.
I still completely agree with the goal here, and that Repixture would, in theory, work well on mobile. I just don't have the experience.

So sorry, you currently just have to get used to the fact that Repixture is basically a PC game. At least for now.

About your suggestions:

I'm probably not willing to use flow because rp_formspec is basically already Repixture’s own formspec library so I rather extend that one. flow doesn't support all formspec features anyway.

The formspec still needs to be carefully designed for mobile anyway, no amount of syntactical suger will get you around that.

I don't like ur first proof-of-concept, the inventory slots look very messy with that empty space. Inventory slots MUST be aligned in a perfect rectangle, this is a hard requirement in this game's design. The only exception is Creative, where the number of items isn't predictable. But your idea of going from left-to-right rather than top-to-button is interesting, I think it might go in the right direction.

Are there other formspecs with problems? What about the chest menu? If this is problematic, then we have a huge problem. ☹️

Another problem: Supporting mobile for real will greatly increase the maintenance work. There's a very real risk that mobile support will exist only on paper since I will let the code rot untested, leaving us in a similar situation like Minetest right now. Especially as long I don't have a quick and easy way to test this for regressions. Officially supporting mobile is, like, a HUGE step, you know!

Frankly, I think I would rather tackle this after most of the other important tasks are completed. Mainly, content, gameplay, balancing, that stuff.

Feel free to keep commenting tho, I am still very interested about your thought because my experience with mobile is basically zero.

Good issue, but not my highest priority right now. I first want to build on content and gameplay. Unfortunately, I don't have an easy method to test mobile mode right now. But it's nice Minetest *finally* allows me to check if a player is on mobile. And given that Minetest has been traditionally horrible on mobile anyway (horrible controls), my motivation is not very high. I still completely agree with the goal here, and that Repixture would, in theory, work well on mobile. I just don't have the experience. So sorry, you currently just have to get used to the fact that Repixture is basically a PC game. At least for now. About your suggestions: I'm probably not willing to use `flow` because `rp_formspec` is basically already Repixture’s own formspec library so I rather extend that one. `flow` doesn't support all formspec features anyway. The formspec still needs to be carefully designed for mobile anyway, no amount of syntactical suger will get you around that. I don't like ur first proof-of-concept, the inventory slots look very messy with that empty space. Inventory slots MUST be aligned in a perfect rectangle, this is a hard requirement in this game's design. The only exception is Creative, where the number of items isn't predictable. But your idea of going from left-to-right rather than top-to-button is interesting, I think it might go in the right direction. Are there other formspecs with problems? What about the chest menu? If this is problematic, then we have a huge problem. ☹️ Another problem: Supporting mobile for real will greatly increase the maintenance work. There's a very real risk that mobile support will exist only on paper since I will let the code rot untested, leaving us in a similar situation like Minetest right now. Especially as long I don't have a quick and easy way to test this for regressions. **Officially** supporting mobile is, like, a HUGE step, you know! Frankly, I think I would rather tackle this *after* most of the other important tasks are completed. Mainly, content, gameplay, balancing, that stuff. Feel free to keep commenting tho, I am still very interested about your thought because my experience with mobile is basically zero.
Sign in to join this conversation.
No Branch/Tag specified
master
new_weather_types
clock
sponge
cushion
vase
pages
giant_crops
duckweed
new_hairs_new_skin_selection
new_hairs
multi_flower_2
dirt_redo
craft_compat
gold_coin_upgrade
gold_coin
new_traders
item_frame_flat
silktouch_paint
silktouch
newtrees
new_weather
creative_per_player
scrollbar_style
village_nextgen_thread
village_nextgen
new_website
tnt_faster
fixbrush
roots
amber_slime
fir
path_fixes
villager_pathfind_cost
fence_gate
slab_up
biome_skies
pencil_showlabel
moonflower_seed
unicode_signs_refactor_newsigns_sideways
unicode_signs
spyglass
craftcolor
villager_pathfind
mobs_new2
paint_book
moon_phases
newmusic
weblate_test
paint4dir
whistle
buoy
pot
4x4grass
village_vmanip
seagrass
3.20.0
3.19.0
3.18.2
3.18.1
3.18.0
3.17.3
3.17.2
3.17.1
3.17.0
3.16.0
3.15.1
3.15.0
3.14.0
3.13.1
3.13.0
3.12.1
3.12.0
3.11.0
3.10.0
3.9.0
3.8.0
3.7.0
3.6.3
3.6.2
3.6.1
3.6.0
3.5.0
3.4.1
3.4.0
3.3.0
3.2.1
3.2.0
3.1.1
3.1.0
3.0.1
3.0.0
2.1.0
2.0.0
1.5.3
1.5.2
1.5.1
1.5.0
1.4.2
1.4.1
1.4.0
v1.3.6
v1.3.5
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.2.0
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.0
v0.6.0
v0.5.0
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.2
v0.3.1
v0.3.0
v0.2.0
v0.1.1
v0.1.0
Labels
Clear labels
Category: Discussion
For discussions about the game
Category: Entities
About entities or objects (including player)
Category: Gameplay
About gameplay mechanics in general
Category: Graphics
About graphics
Category: GUI and HUD
Anything related to the graphical user interface or heads-up display
Category: Items and Tools
About items or tools, but not nodes
Category: Mapgen
About the map generator
Category: Nodes
About nodes
Category: Sounds
About sounds
Category: Translation
About translations
Category: Website
Related to the Repixture website
Kind
Balancing
About game balance
Kind
Bug
When something doesn't work right
Kind
Documentation
About documentation, both for devs and players
Kind
Feature
Ideas, feature requests, enhancements, etc.
Kind
Maintenance
Code quality, technical improvements, refactoring, etc.
Kind
Performance
About making the game run fast
Priority
CRITICAL
Highest priority level. For crashes, major data loss, etc.
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Decision needed
When the issue still needs a decision on what to do
Reviewed
Duplicate
When the issue existed already
Reviewed
Invalid
When the issue was not valid
Reviewed
Rejected
When something that was proposed was rejected
Status
Needs engine change
When it can only be solved after a Luanti bugfix/improvement
Status
Needs testing
If the task is believed to be done, but needs testing
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Wuzzy/Repixture#198
Reference in a new issue
Wuzzy/Repixture
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?