chaosmaster's Recent Forum Activity

  • True, dragging stuff around in Construct right now takes a lot of time and is pretty awkward. The Gamemaker tile-based editor is a lot easier to create levels in.

  • Yeah, I've done the rumbly thing myself now, using that method, and it works nicely. It was just that comparing it to the volume was the first thing that came to mind, which brought to my attention the lack of a 'get volume' expression. Granted, it's pretty redundant in the example I gave, but it'd still be a nice feature, and I'm sure someone could find a use for it.

  • Yes, this would be extremely helpful. As it is now, you have to reposition the hotspot and image points whenever you flip an image.

  • I was messing around with XAudio2 and the 360 controller, trying to scale the controller's rumble to the volume of a positioned sound, when I realised there's no way to get the current volume of a channel with the XAudio2 object. I guess there's only limited uses for it, but it would be useful if you could test the current volume of a sound. That way, you could change the visuals on-screen according to your proximity to a sound, might be a cool effect for 'atmosphere' games. I was just going for 'the closer you are to an explosion, the more rumbling the controller does.'

    • Tom
  • This example should give an idea of what I'm trying to achieve:

    http://www.mediafire.com/file/qamdwzzi2vm/SoundTest.rar

    Basically, I'm trying to do directional sound with multiple levels, with certain parts of the sound only becoming audible when you are close to the emitting object, and the sound fading out completely the further away you are.

    I initially tried using the positional sound built in to the XAudio2 object, but this didn't seem to work correctly. The actual volume of the sound didn't decrease over a distance, rather, the sound just seemed to 'intensify' the nearer the player object got. Also, there doesn't seem to be any function in the XAudio2 object to set the range of the sound; to set the distance limit at which a sound is audible, which would be necessary for the type of layered sound I am trying to achieve.

    I set up events to change the volume of the sound manually, based on distance from the object, but using this method the sound seems to become distorted. The channels 'pop' every time the volume is changed, which makes the sound crackle as you move nearer. Also, the sound sounds crackly and slightly distorted when played at full volume (when the player is directly on top of the emitter).

    Is there any way to achieve the effect I'm going for in Construct at the moment? Am I simply missing a trick with the XAudio2 object?

    Many thanks,

    • Tom
  • Yeah, selectable resolutions would be simple enough to add in, but with this method you always get the best resolution for your monitor. Also it could be adjusted to scale by height instead of width for 4:3 resolutions, and you could switch between fairly easily using variables. Can I aks how you managed to make scrolling work? I've tried simply making the layer with the bars on non-scrolling, but then I can't work out whether you can reposition the layer to the right place or not. I've also tried repositioning the bars with maths, but I can't work out the correct algorithms to place them reliably for every monitor, without cutting off the edges of the screen.

  • Objective

    The objective of the article is to implement a system for dynamic fullscreen scaling, maintaining your game's aspect ratio on all monitors. By default, when using fullscreen mode, Construct will stretch or squish the display to fill the entire screen, which will distort your graphics on a monitor with a different aspect ratio to yours. With this method, the application scales to fill the screen without altering the aspect ratio, and adds black bars to the parts of the display outside of the visible area.

    The example I�ve used is for making games in the HD resolution 1280x720, and supports any monitor resolution between 640x480 and 1920x1080. In this case, black bars will appear on the top and bottom of the screen if you are playing on a monitor with a non 16:9 aspect ratio. You could easily alter it to work with 4:3 as standard, adding horizontal bars on widescreen displays.

    Setting up

    First, you need to work out the maximum size of monitor your game will display on, in this case 1920x1080, and decide the resolution you want to build your game in, 1280x720 here. Make the layout size the maximum resolution, and you then need to �box off� the game resolution space in the middle with black boxes. In the example, the 1280x720 game space is in the middle of the 1920x1080 display, with the rest of the space blacked out. You then need an object placed at the very centre of the screen with the �centre view on me� attribute, to make sure the game always centres the visible layout.

    I�ve set the default resolution to 640x480, to enable it to launch on any monitor. Applications sometimes have trouble starting in a higher resolution and scaling to fit a smaller monitor, so it makes sense to start with the smallest possible resolution. It�s also important to start the application in windowed mode, to allow for resizing before fullscreen mode is activated. Make sure that �Resizing� in �Window Properties� of the application is set to �Show more window content�.

    The events

    You�re going to need to add two objects to the scene, the Window Object and the SysInfo Object, these are vital for scaling.

    <img src="http://img15.imageshack.us/img15/7928/img1tne.png">

    With that done, you can start adding events.

    Step 1: The system object is used to set the application resolution for the resolution of the monitor, using the GetScreenWidth and GetScreenHeight expressions of the SysInfo Object. The Window Object then resizes the app window using the same values.

    <img src="http://img38.imageshack.us/img38/4236/img2r.png">

    Step 2: Now that the screen size matches the monitor resolution, we need to scale the visible layers by the difference between the screen width and the native width of the application. In the example, I�ve used the number 1280 because that�s the width of the visible window. The equation for zooming the layers is 100*(Screen Width / Native Width).

    With that done, you can activate fullscreen mode.

    <img src="http://img18.imageshack.us/img18/3459/img3d.png">

    And that is the essence of it. Download the example here http://www.mediafire.com/file/mjkdue0ee ... caling.cap to see it in action. The example uses a simple loop to ensure that if any more layers are added to the layout, they will scale correctly as well, with no extra events.

    This method is limited in that currently it only works for one-screen-per-layout games. I�m trying different ways of making it work with layer scrolling, but haven�t had any luck so far. Feel free to take the example and modify it to your needs, and if you can find a way to make it work correctly with scrolling, then fantastic, let me know!

    My thanks go to Davioware for introducing me to the Window object, as well as AshyRaccoon for pointing out the SysInfo object and Mipey for coming up with the required scaling coefficient.

    Hope this article�s been useful!

    - Tom

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've been having trouble with resolution scaling as well, check out this thread and try the .cap I posted, that should scale to fit the screen while maintaining aspect ratio, and as far as I can tell it works fine with effects as well. Give it a go anyway. I'm working on trying to get it working with scrolling and stuff, which I harder than you'd think it would be.

  • It is indeed a great game. I love the atomsphere and sense of intrigue it has, even though it's 'just' a fairly simple puzzle game. The presentation is truly top-notch. But DAMN those last few levels were tough...

  • I'm having trouble with positioning the black bars when trying to enable scrolling. My initial solution was to simply put the black bars on a different layer and set the scroll ratio to zero, so the bars don't scroll when the other layers do. Trouble with this is, that screws up the positioning of the bars relative to other layers, and I can't seem to reposition them.

    Is there a way to reposition a layer, without changing the scroll ratio? I've also tried repositioning the bars at runtime using equations, but my math is completely wrong. I made it work fine on my monitor, but trying it on one with an even slightly different ratio and it screws up completely.

    UPDATE: I've kind of got it working by repositioning the bars according to the dimensions of the screen. The trouble is, you can't see objects at the very edges of the screen when you are not playing on a 16:9 monitor using this solution. Have a look anyway:

    http://www.mediafire.com/file/wtlxlznqu ... Scroll.cap

    Also, I'm not sure if there's a way to stop the bars 'jittering' when the character moves, it's as if the 'Always' event isn't repositioning them fast enough.

  • ... I did what?

    You, my friend, wrote this thread:

    I nicked your example of using OriginalHeight'*(DisplayHeight/'DefaultHeight') to zoom the layers to the right amount. Would've taken me a while to work out for myself.

    I'm currently trying to make it work with scrolling. It's...interesting. I might've done it now, needs testing on other monitors first though.

  • I think I've cracked it! I've made an app that displays correctly on all the monitors in my house anyway. Test it out, let me know if it looks right on your monitors:

    http://www.mediafire.com/file/tnmykyzml1y/Scaler.cap

    Basically, it should display in widescreen, 16:9 format, with black bars at the top and bottom if your display is not 16:9. The circle should be round, the square square, and Samus should be pretty much in the middle. There should be corner markers right at each corner of the display.

    It works using the Window Object to resize the display to match the size of your monitor, then zooming the layer using the coefficient [monitor width]/[native app resolution], to scale everything to the new window size. Then it kicks the app into fullscreen mode.

    My thanks go to Davioware for introducing me to the Window object, as well as AshyRaccoon for pointing out the SysInfo object and Mipey for coming up with the required scaling coefficient (it's been a long, long time since I had to do any real maths, it would've taken me a while to work out by myself).

    Let me know if this works for everybody. If it does, I'll make a better example .cap and write up a proper tutorial on how to do it, as this is a useful technique for those looking to make HD games in Construct.

chaosmaster's avatar

chaosmaster

Member since 12 Jul, 2007

None one is following chaosmaster yet!

Trophy Case

chaosmaster has no trophies yet!

How to earn trophies