ID:1765829
 
Code:


Problem description: I haven't gotten this far in my game so I'm just curious. First is it hard to make a web client for someone who has little knowledge with html? Second is it very possible to make a server that is called "mobile" where the entire interface and hud is remodelled to compensate mobile devices? Again neither of these things I've never really dipped into yet as I haven't released anything yet.

Oh and one more If lets say my game releases its a big hit, which is a dream but anyway would my connection at home faster internet speeds make it more lag free?
Obviously, the more you know, the more interesting you can make things. But since most DM skins transfer to the webclient you should be able to do it without knowing javascript. However, I can't see you being able to rearrange an interface for mobile without knowing it pretty well. You would either have to create a separate server or make an interface that works well on both.

If internet speeds are your bottleneck, then yes it would help. But if it is say your CPU speeds, this will not help. If the game got big enough, you would probably not want to host it at home. If it got large enough, you probably wouldn't even want a single computer, but instead have multiple with load balancing.
In response to Mightymo
yes that's what i meant a seperate server. So it is possible with that way? thank you. Do games on here even get that big to be able to afford those type of systems?

I doubt it would be cpu. As its a 2d game and I assume most computers can handle anything in a 2d enviroment unless of course my code was terrible enefficient. But there is no lag on my home computer so far with most of my systems in place so i assume it will never be a problem.
In response to Mightymo
and if byond games can make that much is load balancing hard to set up?
You could have a separate server, but then players on mobile would not be connected to those without it. I wouldn't really recommend it. You would also need to detect who is mobile to redirect them to the right server.

Don't assume that it would not be CPU. If you get enough players, and especially if the game is not programmed well, you will end up maxing your CPU.

If you don't program a game with load balancing from the start, it can be difficult to implement. Otherwise, it isn't too bad.
so more players will increase my cpu? right now my game uses 0.3 percent of my cpu. Is that bad for one player? at least that was the last time i checked it on task manager.

yea i was thinking of having a button on the start screen instead. Called "mobile mode" or something which loads a different hud. That means i wouldnt need a seperate server

Well load balancing sounds congusing and I haven't so hopefully it doesnt come to that. It sounds confusing

In response to Mightymo
i just did it again im using about 1-2 percent
That's pretty good overall, although it is hard to tell how it will scale.

That's probably a better choice.
Honestly, if you want something that's going to be responsive to different screen sizes in the webclient, your best bet is to use some JavaScript to detect the size of the available window/iframe and go from there. There isn't an easy automated solution to that kind of thing--at least not at this time.

In the near future I'd like to add some support for passing a number of parameters to the webclient via JSON, which should allow for this kind of thing to be handled more smoothly.
Keep in mind with HUD objects you can also set their screen location with the keywords EAST, WEST, NORTH, SOUTH, CENTER and even put offsets so no matter what size, the HUD objects will be aligned properly.

If you have 'edge' type HUD you can also set it from EAST+1 to WEST-1 and cover a whole line (except the first tiles, for different corner HUD).
okay thank you all for the info. For mobile all id would want to make is a 4 slot wheel for touch movement. And maybe an icon to do basic attack when you click/touch it. I don't know if it the time its easy to access your mobile devices keypad when you go to text, so if that not an option I just want the player to have some basic privledges(as screen is to small to make up for 1-9 hotkeys+punch+movement).
I'm not sure what you mean by "go to text". If you mean when you click inside an input control, then yes, a mobile device's keyboard should pop right up; because it's a regular input element, the mobile browser already recognizes it as a place for text input.

We have the D-pad control for mobile devices right now, so you don't really need to reinvent the wheel, but I'm always curious to see what other control schemes people might come up with.
In response to Lummox JR
oh okay sweet, I guess when I get to that point I'll ask more on how to get it started.

and yea thats what i was asking about the keyboard. The d pad is already in there that's sweet. Are we able to make 2 d pads and map the verbs we want to each of them?

Obviously I have no knowledge on the webclient but once i finish my game I want that to be a viable option
In response to DanteVFenris
At present the D-pad just reads the macros and tries to choose smart defaults. If you want a custom control solution I would actually recommend writing one outright.
In response to Lummox JR
Lummox JR wrote:
Honestly, if you want something that's going to be responsive to different screen sizes in the webclient, your best bet is to use some JavaScript to detect the size of the available window/iframe and go from there. There isn't an easy automated solution to that kind of thing--at least not at this time.

And to that end, you can try libraries such as http://detectmobilebrowsers.com/ but you have to trust the browser user-agent string which has a rough history and can be spoofed (although why a gamer would want to spoof the screen size on a mobile device is rather beyond me).

Better off to get the viewport of the window. There are a variety of cross-browser libraries such as Verge (https://github.com/ryanve/verge), and actual (https://github.com/ryanve/actual) - the later using media queries to get accurate data. Both use window.innerWidth and window.innerHeight to grab the inner window size. outerWidth/outerHeight is good for getting the whole browser window, which is nice if you want to size your desktop/laptop game screen.

You can, or course, roll your own in Javascript:

var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0)
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0)