How difficult is it to port a games designed for windows to mobile and(VS.) web?

flyinian

Member
Pretty much what the title says.

i'd like to port my game designed for windows to mobile and web one day.

YOYO games are having a summer sale on their licenses and i'd like to take advantage of the price reduction.

Between mobile and web, which one is easier to port from windows?

or should I just wait until I release on windows before even considering porting?
 
S

Sybok

Guest
Pretty challenging. You choose the platform in the dropdown box. šŸ¤£
 
S

Sybok

Guest
Normally the manual will specify if a function only works for certain build targets.
 

flyinian

Member
Normally the manual will specify if a function only works for certain build targets.
True, what if someone builds their game around windows only and decides to port? Are we talking about hours and hours of code change or as simple as replacing a with b and nothing else.

Or does it entirely depend on the type of game it is. If this is the case, what could be an average amount of time invested in porting?
 

FrostyCat

Redemption Seeker
True, what if someone builds their game around windows only and decides to port? Are we talking about hours and hours of code change or as simple as replacing a with b and nothing else.

Or does it entirely depend on the type of game it is. If this is the case, what could be an average amount of time invested in porting?
That would depend on how much foresight you had for expansibility when you built the original. Chances are if you had to ask about this, you didn't take any of the measures needed to make this easy (e.g. soft-binding input, flexible layouts, not relying on extra mouse buttons, etc.). This belief that there's some sort of "average" time is a complete myth, some people make it easy for themselves with flexible architecture while others make it a virtual rewrite, and it's all their own doing.
 

Toque

Member
Mobile is a whole different beast. It really depends on your game. Sure you could port a game but is it playable? Does it make sense? I think it would be easier the other way around. Make a mobile game and port to windows........

What kind of game is it?
 

flyinian

Member
Mobile is a whole different beast. It really depends on your game. Sure you could port a game but is it playable? Does it make sense? I think it would be easier the other way around. Make a mobile game and port to windows........

What kind of game is it?
Click based simulation game.
 

Toque

Member
Ok. Well clicking mobile does well. Iā€™m guessing if you just squeeze your game onto mobile screen it wonā€™t be readable or difficult to click on the buttons. You will probably have to rework the UI and sprites.

I guess I would download a similar game on mobile and play it. Then ask myself can I make my game do and look like this??

Then you have to accomadate different screen scaling.

So itā€™s not just coding itā€™s design too.

But Iā€™m a mobile guy. So I make this mobile friendly from the go.

Iā€™m not trying to discourage you. People make multi platform games.
 

kburkhart84

Firehammer Games
It does vary based on the game and the design/coding that was done, and how organized it is, how separate systems are. For example, if you were doing a platformer that had hard coded inputs, it would be much more difficult to port to mobile, than say the same platformer, but with the input system done separately. In your case, its a clicking game, so the input can possibly stay about the same, and you will have more issues with graphics and resolution.

HTML5 on the other hand is a different beast. You have in general even more performance issues overall, and you have to deal with download times, etc... so some games simply aren't good for porting to HTML5 without massive changes to music and art. Worse, HTML5 can actually work on mobile, but the performance is even worse....although you DO get multi-touch in theory.
 

Yal

šŸ§ *penguin noises*
GMC Elder
For example, if you were doing a platformer that had hard coded inputs, it would be much more difficult to port to mobile, than say the same platformer, but with the input system done separately.
You can generate keyboard events yourself with keyboard_key_press, so it's possible to just make a bunch of objects that generate key press / release events when clicked and then the game will just magically work.


But yeah, there's a bunch of issues:
  • Mobile screen resolutions is a JUNGLE so you need to make all GUI code adapt to the resolution and make no game rooms dependent on a hardcoded resolution
  • Mobile games can be aborted at any time without a clean shutdown, so you need to make sure to save data continously and not have too long levels (this is a design issue as much as a code issue)
  • Most phones have terrible CPUs and especially GPUs compared to PCs, so your game might run like **** if you haven't optimized it, especially if it uses lots of shaders and big textures.
  • HTML5 has recursive interpreted code (GML interpreted by HTML5 run in a browser) so everything will run pretty terrible in it, especially things like nested loops. Things like alpha and color blending might be unavailable or much slower depending on browser settings/capabilities.
 

flyinian

Member
You can generate keyboard events yourself with keyboard_key_press, so it's possible to just make a bunch of objects that generate key press / release events when clicked and then the game will just magically work.


But yeah, there's a bunch of issues:
  • Mobile screen resolutions is a JUNGLE so you need to make all GUI code adapt to the resolution and make no game rooms dependent on a hardcoded resolution
  • Mobile games can be aborted at any time without a clean shutdown, so you need to make sure to save data continously and not have too long levels (this is a design issue as much as a code issue)
  • Most phones have terrible CPUs and especially GPUs compared to PCs, so your game might run like **** if you haven't optimized it, especially if it uses lots of shaders and big textures.
  • HTML5 has recursive interpreted code (GML interpreted by HTML5 run in a browser) so everything will run pretty terrible in it, especially things like nested loops. Things like alpha and color blending might be unavailable or much slower depending on browser settings/capabilities.
What would an example be for a room resolution being hard coded?
 

Yal

šŸ§ *penguin noises*
GMC Elder
What would an example be for a room resolution being hard coded?
A level that's "one screen big" (640x480) and has scrolling disabled being run on a 480x272 phone, so you can't see the entire level. Hope you like making blind jumps over pits!

1594069937685.png
 

kburkhart84

Firehammer Games
You can generate keyboard events yourself with keyboard_key_press, so it's possible to just make a bunch of objects that generate key press / release events when clicked and then the game will just magically work.
This is true, and is one way of separating input from the objects...its not really something I call a good idea though. Hard coded inputs are just not good, what happens if I want to support a different key map, or the gamepads, or mobile touches....in the end for any of those things you have to create separate code to handle each of those. At the least with generating the keyboard events, the other code can just do that and the object isn't affected...but I better like the idea of a simple somewhere to look for input data, and then having code driving that data. It also means that any object can look at that data in the same place, instead of needing to query a player object that now can't be destroyed at all if you want to detect inputs.
 
S

Sam (Deleted User)

Guest
Why has no one mentioned virtual_key_add/remove yet? Mouse clicks won't give you correct on screen button simulation if you have multiple thumbs or fingers on the screen.
 
Top