fisholith's Recent Forum Activity

  • That's a good point. On a mobile device it would be ideal to render once at the pixel art resolution and then just scale up to full screen.

    When running the game on the Galaxy, are you running the game as an installed android app, or are you running it from within a browser like Chrome or Firefox?

    You might want to try running from a few different browsers on the Galaxy to see if there's a difference in the scaling behavior. It's possible that the bilinear blurring is a side effect of the environment the game is running in and not you're project settings, especially given that the games scales correctly on your desktop computer.

    It may be that, the method C2 uses to tell the target environment to use "point" interpolation scaling, doesn't work for all environments.

    Finally you said in your first post that "Fullscreen scaling" was set to Low quality, which would seem to make sense, given that you don't want any filtering, but you could try high quality, to see if that makes a difference on the Desktop and Galaxy versions.

    This one is a long shot, but mobile graphics hardware does some weird things in response to settings you would think would be consistent across platforms.

    I've vaguely recall seeing a very (very) few situations where a graphics property on low settings will defer to the discretion of the target hardware on how to handle things, while a high setting will force the hardware to do things a certain way. Mind you, I've never seen or heard of that kind of thing in C2, but mobile graphics hardware is weird that way. It seems to me like it was a floating point precision thing, so likely not related.

    For an interesting example of said weirdness, here's an article on floating point calculations that does a good job of showing the inconsistent internal computational spookiness of mobile GPUs. Note: I don't think the effect described in the article below is specifically related to your problem. I was just trying to remember some of the articles I'd come across that showcases some of the same kind of esoteric mobile GPU characteristics that can result in unexpected behavior.

    http://www.youi.tv/mobile-gpu-floating- ... variances/

    (Scroll down to see various devices render the same exact shader script in uniquely distorted and variably buggy ways.)

  • Hey again,

    I suspected that Crop wouldn't fit the game correctly by default, which is why I mentioned the "start of layout" event that might be needed to see the pixels close up, but that said, did Crop mode fix the blurry pixel problem?

    The reason I'm curious is because Crop mode is (as far as I know) C2's most open-ended full screen display mode, and with some effort (and events) you can pretty much make it behave like any of the other modes, but with more control.

    The main thing that Crop mode will give you is that the game will not be rendered to an intermediate texture and then stretched to fit the target display. I'm not sure, but I suspect that might be the cause of the blur you're encountering.

    The Galaxy s6 has a res of

    2560 x 1440

    The image of the title screen you posted is

    1280 x 720

    And that title screen is a 2x scale-up of the pixel art, meaning its un-scaled res is

    640 x 360

    Out of curiosity, could your list you PC's monitor resolution?

    And most importantly, what is the game's "Window Size" property set to? If it's 640 x 360 that might help shed some light on the issue.

    Anyway, given the above, that means the pixel art is being scaled up exactly 4x to fit the Galaxy's screen, (from 640 x 360 to 2560 x 1440). Also is the image you posted from the Galaxy's screen scaled back down 2x, because it's not the full 2560 x 1440 res. No problem if it is, just curious.

    It looks to me like the 4x scaling being done on the Galaxy is using bilinear filtering. If I take your sharp title screen into Photoshop, scale it down (via Nearest Neighbor) to its 1x scale and then scale that up by 4x (via bilinear) to simulate the Galaxy's scaling, my re-scaled version is virtually identical to your blurry comparison image. (Note: I also scale my version back down by 2x to match the 1280 x 720 res of you're 2nd comparison image.)

  • Hey SirPumpAction,

    I have yet to build any games for mobile devices, so I'm not sure all of the potential causes, but one possibility comes to mind.

    "Crop" mode

    It may be that the "Full screen in browser" mode is rendering to an intermediate texture and then scaling it to fit the mobile's screen.

    To work around this you could try setting "Full screen in browser" to "Crop".

    The "Crop" mode means that your game will not be auto-rescaled regardless of the monitor dimensions.

    You'll then have exact control over how the game is scaled up to fit a monitor, but as a side effect you'll have to be a little careful with how you place hud elements, as object positions that work on a 16:9 aspect ratio display, might get cut off on a 4:3 aspect display.

    You may also need to zoom the layout with events, by detecting the monitor dimensions and scaling up by the best integer fit.

    Even if you don't plan to ultimately use Crop mode, you might want to at least try it to see if that suppresses the blurry bilinear filter effect you're seeing in the second image.

    Importantly, if your game displays at a 1-to-1 pixel scale (looks super tiny and zoomed out) when running in Crop mode, then you may want to temporarily add in an "On start of layout" >> "Set layout scale" to 3 or 4, so you can see if the pixels are coming out sharp when scaled up.

    Pixel Rounding

    One other option you might want to enable is "Pixel Rounding", though that isn't likely to fix the blur unless your entire title screen has pixel coordinates that are exactly half way in between integer pixel coords, (e.g. 0.5 by 0.5).

    That said, "Pixel Rounding" will ensure that all game objects will be rendered as if their origin points are snapped to integer pixel coords, though the internal game logic will still treat them as floating point coords.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey shalmu,

    Apologies if I misunderstand your question, but it sounds like you're interested in applying a "multiply" blend mode to an object.

    HTML5 vs Shader Effects

    So there are two systems that can apply blend modes to an object, basic HTML5, and Shader Effects. I think you may be looking at just the basic HTML5 list of blend modes, which has modes like "Additive" and "XOR", but it doesn't have "Multiply". Fortunately the Shader Effects do have a "Multiply" blend mode you can apply to objects.

    Applying a shader effect

    With the object selected, in the properties panel, in the "Effects" section, there should be two properties listed, "Blend mode" and "Add / edit" (Effects).

    The "Blend mode" property sets the basic HTML5 blend mode for the object, and does not require a graphics card. Again, this is the list that has "Additive" and "XOR", but not "Multiply".

    Alternatively, the "Add / edit" (Effects) property lets you add multiple shader "Effects", which require a graphics card.

    A "shader" is a graphics effect, like a blend mode, or a distortion, or a blur, but importantly these effects are rendered by a graphics card instead of just the basic HTML5 engine.

    • If you click the blue "Effects" link, to the right of the "Add / edit" property, you should see the "Effects" window pop up. This window shows you the list of effects applied to your object. It will be empty to begin with, since we haven't added any effects yet.
    • At the top of this window, click the plus "+" button, and you should get a list of all the available shader Effects you can choose from.
    • If you scroll down to the "Blend" section, you'll see "Multiply".

    Shader effect & Mobile devices

    Mobile devices like tablets and phones might not support shaders, because they might not have a graphics card to render the shader effects. But nearly all computers should have no problem rendering shader effects. Just something to be aware of.

    Hope that helps.

  • Hey deropke2,

    I'm not entirely sure I recall all the limitations of the free version but I think the following setup might be an option...

    "ScrollTo" & "Pin" Behaviors

    If you create a sprite object (e.g. named "camTarget") and scroll the camera to it using the "ScrollTo" behavior, you can then move the camTarget object to move the camera.

    As an added bonus, you can pin other objects to camTarget and they will follow the screen around.

    This means you don't have to fiddle with typing in pixel offsets in events to position the hud items. You can just position hud items in the editor, wherever you want them to appear, relative to the camTarget object.

    The HUD items will keep their positions relative to camTarget, and camTarget will always be centered. You'll need to enable "Unbounded Scrolling" in the layout properties, to make sure the camera can stay centered on the camTarget even at the edges of the layout.

    Another benefit of this setup is that it requires almost no events, just 1 per pinned HUD element. Or if you use families, 1 per pinned object type. (e.g. Put all the HUD sprites in a fam, and pin the fam. Put all the HUD text in a fam, pin that fam. That's just 2 events.)

    Behavior/Event sequencing Problem

    There is one possible problem though. Behind the scenes, behaviors work like invisible events. The problem is that you can't (to my knowledge) control exactly when behaviors execute their event-like effects.

    This means that the position updates executed by ScrollTo and Pin, may occur always after or always before your actual events. (I forget which) And the danger there is that, if you try to stick the camTarget to your main character with an "every tick" event, you may find that the behaviors are updating the camera position before your custom events move your main character.

    That is, the behaviors move the camera to your character, THEN your custom events move your character somewhere else, THEN the frame is rendered and the camera is looking at where your character was.

    This means that your character will always be one frame ahead of the camera position which will look stuttery. One work around is to also use the Pin behavior to pin and un-pin the camTarget object to your main character, so that the entire camera movement system is handled through Behaviors. That should minimize the possibility for behavior/event sequencing problems.

    C2 online manual

    In case you're interested, you can read more about those behaviors in the C2 manual at the links below.

  • Hey ryanrybot, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Just wanted to add a small additional note...

    At the top of the screen cap I noticed the LstickRadius was being set via the distance formula.

    C2 has a built in distance function that will return the distance between two points.

    It can be found as an expression in the "System" object, in the "Math" section. Or you can just type "distance" in any expression area.

    In your case, you want the radius of the stick position. Which is the distance from the stick's centered position (0,0) to the stick's current position (axisX,axisY).

    So you can use the distance function like this:

    distance( 0 , 0 , axisX , axisY )

    Granted the above example is simplified for clarity.

    Using the actual expressions for retrieving the stick positions you'd write the following.

    distance( 0 , 0 , Gamepad.Axis(0,0) , Gamepad.Axis(0,1) )

    Finally, there is also an angle(x1,y1,x2,y2) function, and an anglediff(a1,a2) function among others which can come in handy as well.

    Below I added a link to a full list of all built-in math system expressions from the online C2 manual:

    The "Math" section is a ways down the page. The "Text" section is also worth checking out. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    https://www.scirra.com/manual/126/system-expressions

  • Hey heagon, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I believe this can be done.

    I think what you're looking for is "preview over local network".

    It's a little tricky to set up, but I got it working with an Android tablet.

    Here is an article explaining the setup process:

    https://www.scirra.com/tutorials/247/ho ... al-network

  • Hey puck pao, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    If I understand correctly, whenever you roll your mouse pointer over a menu item, like "Start" or "Options", you want a "blip" feedback sound to play once, without looping or continuously triggering every tick (the machine gun effect).

    You can probably achieve this by adding the System > "Trigger once while true" condition to the mouse over event.

    So you would get the following:

    Event:

    • Mouse is over object menuItem.
    • Trigger once while true.

    Actions:

    • Play sound "Blip"

    This will trigger once when the mouse first moves onto a menu item, but it won't trigger again, until you move off the item and then back on again.

    You can read more about the "Trigger once while true" condition in the Construct manual at the link below.

    https://www.scirra.com/tutorials/292/gu ... t-features

    Hope that helps out. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Is there a way to copy a family from one project to another?

    Copying project files or XML data?

    This is more a question that I suspect Ashley or one of the other power users might be able to shed light on. Is there a way to copy a family from one project to another by fiddling with the internal project files or project XML data? (i.e. Assuming I save the project as a folder instead of a single file.)

    Families are a really cool addition to ACE-style programming, and I would love to find a method for using them in a more portable way.

    Why I'm interested

    I'm looking to make modular prefab systems, like a menu system.

    By prefab, I mean a self contained set of events and objects that can be copied from one project to another easily. That way, when I need menus, I can just copy the menu prefab events and objects into the new project.

    I've been using this prefab workflow for a while already, and it works great for any prefabs that don't need to use families, but as soon as I need to have a family be part of a prefab, I encounter a problem. Everything seems portable between projects except families.

    I know that you can technically exactly reconstruct all the families you wish to copy in the target project, but that starts getting fairly complicated and lengthy as the use of families becomes more complex. Families are a fantastic tool, so I would love to be able to move them between projects easily.

    There are some other reasons I'm interested, but that is the big one.

    Thanks in advance for any thoughts or suggestions.

  • Hey RadDevVan101,

    So if the two objects never go invisible, then it seems like somehow the two values ("Web" value & "Project" value) are never considered to be the same, even when it looks like they should be.

    From here on I'll refer to the two objects as the "Sprite", to make things simpler.

    I'm assuming that somewhere in your event's there's an event that looks something like:

    If Web == Project: Then Set Sprite Invisible.

    Firstly, as a test, I would try changing that event's condition to always be true (i.e. Delete just the condition, or test for 1 == 1 or something) to make sure that the event is even capable of turning the Sprite invisible at all.

    When you run the test described above, the Sprite should turn invisible as soon as that event runs, regardless of the Web and Project values.

    If that works, and the Sprite becomes invisable, then you know that the event does get executed, but the Web == Project test is always false for some reason. If so, be sure to undo the changes to return the event to it's original form. On the other hand, If the Sprite does not turn invisible, it may mean the event is never actually running for some reason.

    If the event is running, then the question is, "Why does Construct insist that the values never match?"

    There are a few reasons the values might not match.

    • There is a space before or after one of the version numbers, e.g. "1.0.0_"
    • One of the values is being treated like a numeric data type (integer or float) at some point in your events, or in an expression. That would cause "1.0.0" to become "1", which will not match "1.0.0" if you compare strings.
    • You might be storing one of the values in a Construct2 variable, that is set to "number" instead of "text".

    Finally, you can try printing out the values to an other text object when the event runs so you can see exactly what the values are at the instant they are being compared. To do this, add another text object to your layout, (e.g. named "debugText"). Then in the Web == Project event, add an action print the Web and Project values to the debugText object.

    Hope that helps.

  • Hey ericksr,

    When adding an "On button index pressed" condition, one of the values you can specify is the "Gamepad" number. This number is "0" by default, which essentially means the first player. "1" would be the second player, "2" would be the third player, and "3" is the forth.

    So, to create an event that detects only the second player pressing the jump button, you would use the "On button index pressed" condition and enter "1" for the "Gamepad" number.

  • I'm not sure if this will help, but I can share a little of my own experience with optimizing, via the use of "every-x-seconds conditions".

    If there is a lot of collision checking going on in a single event, and you can get away with doing it less often than every tick, that's the main place I've actually seen directly visible performance gains.

    Though I suspect that pretty much any non-tick-essential event, if it's already eating up a large share of your game's CPU budget, is a good candidate for demotion from per-tick to every-x-seconds.

    Example

    As a practical example, in ArcherOpterix, the phantoms check to see if they are touching a wall, so they can reverse direction. That check uses an "overlapping at offset" condition. The phantoms move slowly, so I didn't really need it running absolutely every tick. I switched it from every tick to every 0.2 seconds, so the phantoms behaved identically to the naked eye, but the game ran about 2 to 3 times faster.

    Now that said, I'm not sure why I wasn't then just getting a minor slowdown every 0.2 seconds. But I didn't. The game ran smoothly. I thought it was a bit weird, since my game should still be running all of the collision checks on a single tick every so often, and in-between there would be a bunch of far less demanding ticks.

    So if the work load isn't being spread over multiple frames automatically, and I don't think it is, at least not at the C2-event level, then maybe there's some hapless downstream system that gets backed up if you just pile tons of work onto it, until you start to see that burden manifest as a performance hit.

    In hindsight, I could have given each phantom a random group number from 1 to 10, and then just handled one group per tick, round-robin style, to spread out the work load a little. Though the every 0.2 seconds optimization worked so I've left it with that.

fisholith's avatar

fisholith

Member since 8 Aug, 2009

Twitter
fisholith has 2 followers

Connect with fisholith

Trophy Case

  • 15-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies