Toby R's Forum Posts

  • I believe it's not a bug, it's a feature! ;P But seriously, it could be developed that to save some CPU. Anyway have you tried to set your player's Y position -1pixel together with disabeling solid behaviour? I believe it will do the trick and will look totally natural.

  • I don't think anything can be done. I have the same problem (I don't find it a problem actually cause it's just a blink). White line below shows because browser goes in the fullscreen mode so it's kinda redrawing the content.

    Maybe setting CSS background to black would do the trick? Haven't tried.

    But the Custom Loader layout issue is a loss to the game trully...

  • That's the one! Thanks!

  • I'm looking for a game I saw once but can't remember the title, maybe somone knows this game. Let me explain a bit...

    It's a top down shooter. The graphics was drawn with a pencil or a pen (at least it looked like that) so it was black&white game. If I'm not mistaken universum was in a Wild West but heroes where not the Cawboys but the mexican rebels(?). So from the top you see the big sombrero, not the entire man.

    Does it ring a bell to anyone?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just remember the starting cords of the object and on object release check if new position is wrong or right. If it is wrong then use lerp function or simply Move at angle. Depends what do you mean by "smooth"

  • You can add a second condition to "On touch" ( I'm assuming it's for mobiles).

    On Touch SOMETHING

    (and)

    isTouchAllowed

    (do)

    some action

    Now "isTouchAllowed" can be a variable, or any other condition. For instance you might even add a check if the message is visible or not (On Touch XX and Message is not visible). There are many ways to handle this. It depends on your project.

  • It's a wrong section. Post it to "How do I".. .and you definitely have to show some more info. How do you call PHP in C2? How do you return data to C2? is it a plain text or JSON (keep in mind JSON structure for C2 is a bit different)? Just describe the problem somehow that we could understand what is going on. Right now you just wrote almost something like "it doesn't work - here is the blank screen".

  • Rable thnx for the link! That clears everything.

    Let me quote Ashley again here [quote:8k49ccl3]"In Construct 2, images are loaded layout-by-layout. This means when a layout starts, every object on the layout is loaded in to memory immediately. This is to avoid mid-game pauses as textures are loaded on the fly. When the layout ends, it will free all the images in memory not used by the next layout, and load any new images the next layout uses."

    So it is totally pointless to store all images in one layout. And a good practice is to stick to semantic rules - which is also a good news .

  • For host I suggest to export the game to NWjs (desktop), and run it directly from the OS on the server. That will give you much better performance rather than opening a browser on the server and run an HTML5 directly from the browser.

    As long as the host process will be active on the server you will have an online open world where players (peers) can connect to. You can even have a lot of server instances in order to handle more players as it is usually done with high traffic mmorpgs etc.

    Now regarding peers (players), they can join or disconnect from the server. It has no impact on server/game stability (unless you code it to be). When player closes a browser tab then it simply disconnects from the server, and such an event should be handled by you in your host events (for instance you might want to inform the rest of players that the particular one lost connection/quit).

  • Host is the first player who connects to the signaling server room/game. So yes - you just have to put it on some server, run it and keep it alive (simply not killing the process). That's how you get a stable game no matter how many players connect or disconnect, because the first one (host) is all the time online.

    You said that you know how it works and that you've managed to do a Multiplayer game so I am confused about the part where you say "how a server is used through the events". What exactly is unclear for you here?

    Regarding this "My knowledge so far is that the browser object are being used to open a new tab on the server and then so the multiplayer object uses that tab to join". I don't think that browser object has anything to do here. Multiplayer object and signaling server take care about communication via WebRTC.

  • I'm not sure if I understand your question.

    To put host game instance on the server, I believe you can simply export it to NWjs and run it on the server.

  • Maybe something has changed since last year - I haven't tested it recently. However last year when I was releasing my trivia game I clearly noticed that every layout first loading took on my mobile approx 2s. Then every layout second (and n-th) loading took about 0.5s. So the difference was clerly noticable.

    Now regarding RAM. It depends on how the program is written. I am not sure how C2 works atm. But system does not clear any RAM data "by default". Clearing RAM takes time as well so data usually stays there even if it is not used and then some GC (Garbage Collector) clears it periodically. Or you can do it manually by coding as well ofc.

    And let's say I have an app exported to desktop. My laptop has 16GB of RAM. It is "strong enough" to keep in RAM whole game even if it is not being used. But access to the RAM memory is much faster than HDD read so the game would be much more optimised if all the data would remain in RAM rather then be cleared and loaded everytime the layout changes.

    For mobile devices it is a bit different story cause we usually have 1-3GB of RAM which is not that much and indeed sometimes RAM might be not big enough. In such cases unused data will be overriden by the new data.

    I am not an expert, just saying how I see it based on my knowledge and experience.

    Now the last thing to say here is that putting all objects in one layout is not a good practice when you think from the perspective of being a good coder. Good code is semantic and hermetised code, which means (in short) that every "thing" should be where it belongs and nowhere else.

    But loading everything on first layout is acceptable even for good developers in C2 simply because of performace.

    But then again if for some reason data is cleared when you swich to other layout... then there is absolutely no point doing so. It requires testing on various platforms and various mobiles to be sure how it works I believe. Nice topic tho!

  • The need for native mobile exporters is getting more urgent every day!

    Well I think the opposite. The need of native import is less important everyday now. C2 biggest problem comparing to other engines is the performence for mobiles apps. It's because whatever you do in C2 your output is HTML5 and then you have to wrap it to whatever you need. Now keep in mind that even though you can't build very big complex mobile games with C2 due to the performance issue, you still have a tool which lets you build apps in the fastest and most comfortable way on the market.

    Imagine now what will happen in a year or two from now. Power of newest mobiles like SGS6 is higher than the average 3 year old laptop. In a year from now SGS6 will not be the newest and most powerful, it will be the average. What I mean here is that day by day we are getting close to the time where performance limitations won't be really a problem for an average user.

    Now keeping pressure on Scirra to make a native export is pointless. It would be a tons of work for them to implement something like that. And even if they'd decide to do it, it would probably take a year or two. So there is no point cause in that time wrapped HTML5 will work fast enough anyway.

    Now regarding Cocoon IO and IntelXDK. I see there are people voting for and against. Eeach of them has a reason. It looks like it depends on the game itself, plugins used etc.. So if your game release is a serious thing then just take a shot and test both.

    Noone is complaining for no reason, that's clear. Both XDK an IO have some issues. But then again remember that it is not forbidden to use any of them. You do have a choice.

    It reminds me the old times before W3C actually started to do their job. All browsers had their own rules for parsing/interprating CSS,JS and even HTML. That was a real nightmare for frontend developers that time .

    Now we have one project in C2 and it behaves differently when you wrap it with IntelXDK or others... I believe there will be a time soon where it will be obvious what to use OR it will have no matter what to use.

  • Anyone have the same problem? I can't get custom Loader layout working as well. It worked with my previous mobile game (Crosswalk), and now I see only default scirra progressbar.

  • I think everyone of us had that kind of trivial issues which blocked him for hours. You just simply cannot see the obvious for some reason .

    Several days ago I lost few hours wondering why my sprite is not moving, and it turned out that I accidentally typed "=" instead of "+" character in some variable calculation...

    I call it a "ghost error". You know it's there... you know it's simple.. but you can't see it!