My TIGSource competition entry: This Cursed Rock

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Match the incoming diamonds with the same ones to earn score!
  • Scytos, open a crashing file with the XAudio2 object in Construct, and press Debug All instead of Run all. It should (hopefully) report an error via a messagebox. I just remembered the normal preview silently supresses errors - running a Debug will show you the error messages. If you could paste the error, if any, to me here then I can see what might really be wrong!

  • Unfortunately the error doesn't seem to be very informative.

    "A crash inside a plugin's non-event code has been intercepted! This may be a bug in the plugin, or a problem in Construct. The application has exited.

    Plugin: XAudio2.csx

    Object name: XAudio2

    Instance ID: 0 (of 1)"

    Maybe, is there some other program that uses XAudio2 that might give me a better hint on what's going on? I looked around and I couldn't find any.

  • Humph, I'll make a thoroughly error-checked version soon and send it to you, maybe that will help identify what's wrong.

  • Ashley,

    I got some feedback from one of the the players. The sound version was crashing for him, but the no-sound version works fine. Here's his specs:

    [quote:2bdkc2ck]Ok! I'm using an HP laptop with:

    Vista Home Premium, Build 6001, 32-bit (SP1)

    Intel Core Duo T7250, ~2.0GHz

    2046MB RAM

    NVIDIA GeForce 8400M GS

    DirectX 10

    Sound card/setup seems to be Realtek Digital Output (Realtek High Definition Audio)

    It seems the crash was happening for him when the sound was being stopped (upon walking back into the house from the outside, when the front door closes). I too have had a couple crashes with the sound stopping, usually on the menu screen. When selecting the "play" option it crashes sometimes. Only rarely though, and usually if I hit the Z key right away when the menu first becomes available. At that point the volume for the ocean sound is still being adjusted.

    I think setting the volume and turning off the sound in the same tick might be what's causing this particular problem. On the screen in question I have a sprite in the center of the room. When another sprite (which follows the screen as it scrolls) overlaps the room sprite, it adjusts the background sound volume.

    <img src="http://xs434.xs.to/xs434/08492/frontroom872.png">

    The event looks like this:

    volumeController: Overlaps frontRoomVol
    

    HouseSound: Set channel 1 volume to -8 dB

    HouseSound: Set channel 2 volume to 1 dB

    HouseSound: Set channel 3 volume to 0 dB

    HouseSound: Set channel 4 volume to 0 dB

    HouseSound: Set channel 5 volume to 0 dB

    [/code:2bdkc2ck]

    When the player crosses the door boundary it turns the environmental sounds off (the wind/crickets):

    Player: Overlaps doorTriggerA
    Player: Does Not Overlaps doorTriggerB
    System: Trigger once
    

    door: Set animation to "Closed"

    doorClosed: Set collision mode to Bounding box

    HouseSound: Stop channel 1

    HouseSound: Stop channel 2

    HouseSound: Autoplay resource "doorclose.wav" (No loop)

    doorTriggerA: Destroy

    [/code:2bdkc2ck]

    So in essence it's setting the volume and turning off the sound in the same tick. I don't know if that's exactly what's causing the crash, but I can run some tests to make sure.

  • Pretty cool game. I loved the graphics and the ending is awesome.

    Strangely enough, I didn't have any issues with it despite the fact that I have seemingly random sound crashing issues with the latest version of Construct.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is really cool and extremely well done, I like it a lot.

    I do have a question though, may I see how you did the AI? I can't wrap my head around how to do them half as well as you have them.

  • Scytos, can you try running this?

    http://www.scirra.com/files/xaudio2test.zip

    Let me know what messages appear - it's got a prompt at every stage of the initialisation process. Hopefully it'll be able to tell us exactly where things are going wrong for you.

  • I do have a question though, may I see how you did the AI? I can't wrap my head around how to do them half as well as you have them.

    Sure, no problem.

    Each of the enemies has six parts:

    <img src="http://xs434.xs.to/xs434/08492/enemy426.png">

    1. The enemy sprite

    2. The hitbox (has platform behavior on it)

    3. A detector for walls (the black and yellow striped sprite)

    4. A detector for the floor

    5. An enemy locator (the M is for 'monster')

    6. A separate death sprite

    The first five items are all in a container together. The only thing not contained is the death sprite. This is so I can show a dead body on the screen, but still have all the unecessary parts destroyed when the enemy is killed.

    When I build my level in the Construct layout editor, I don't place enemies. Instead, there's a seventh sprite that spawns everything. It looks like this:

    <img src="http://xs434.xs.to/xs434/08492/espawn997.png">

    This is the object I copy/paste around the level where I want my enemies to be. Everything else gets a checkmark next to "Destroy on startup."

    At the beginning of the layout I spawn all the enemies:

    +System: For each enemySpawner
    [ul]
    	[li]> enemySpawner: Spawn object enemyBox on layer "actionLayer" (image point 0)[/li]
    	[li]> enemyBox: Start ignoring user input[/li]
    	[li]> mLocator: Set position to object enemyBox (image point 0)[/li]
    	[li]> enemySpawner: Destroy[/li]
    [/ul][/code:2mh8izmo]
    
    This creates all the parts needed to run the enemies, and puts the hitbox and locator where the spawning object was.  Then it destroys the spawner.
    
    The sprite and detectors get placed on top of the hitbox every cycle, so there's no need to place them here.
    
    Now for the AI:
    Each enemy has a variable called "active" that is defaulted to 0.  When the enemy is on the screen, this is set to 1.  It stays at 1 until either the enemy or the player dies, so the monster can chase you from screen to screen when it sees you.
    
    For the movement, each enemy has the following variables:  mySpeed, lastX, lastY.  This sets up the speed (capBox is the player hitbox):
    
    [code:2mh8izmo]
    +Every 125 MS
    -> enemyBox: Add 1 to 'speedTime'
      +enemyBox: Value 'active' Equal to 1
        +enemyBox: X Greater than capBox .X
        +enemyBox: Value 'mySpeed' Greater than -4
         -> enemyBox: Subtract 1 from 'mySpeed'
        +enemyBox: X Less than capBox .X
        +enemyBox: Value 'mySpeed' Less than 4
         -> enemyBox: Add 1 to 'mySpeed'[/code:2mh8izmo]
    
    The speed can go from -4 (full speed left) to 4 (full speed right).  Notice that we're not setting the speed of the platform behavior directly based on where capBox is, but rather just adding or subtracting a variable.  This is so the monster doesn't turn around immediately when you jump over the top.  If the monster changes it's X in relation to the player, it takes one full second for the monster to turn around and gain full speed (every 125 ms add 1 from -4 to +4).
    
    But we still haven't actually set the speed yet.  There's another variable called "speedMod" that randomizes to give each enemy a slightly different speed, so they don't all bunch together:
    
    [code:2mh8izmo]-> enemyBox Platform: Set speed to (enemyBox.Value('speedMod')+25)*enemyBox.Value('mySpeed')[/code:2mh8izmo]
    
    And this is how we get the speedMod:  See the 'speedTime' variable up there?  When it reaches 5 this happens:
    
    [code:2mh8izmo]+enemyBox: Value 'speedTime' Equal to 5
    -> enemyBox: Set 'speedMod' to random(27)
    -> enemyBox: Set 'speedTime' to 0[/code:2mh8izmo]
    
    Dang, that's a lot of info just for one post.  We're about halfway done.  Here's how to set the direction of the sprite:
    
    [code:2mh8izmo]+enemyBox: X Greater than enemyBox.Value('lastX')
    -> monsterSprite: Set angle to 0
    
    +enemyBox: X Less than enemyBox.Value('lastX')
    -> monsterSprite: Set angle to 180
    
    +System: Always (every tick)
    -> enemyBox: Set 'lastX' to .X
    -> enemyBox: Set 'lastY' to .Y[/code:2mh8izmo]
    
    As you might guess, 'lastY' is for setting the jumping and falling animations.  I'm sure that's pretty self explanatory.  Speaking of jumping, here's how they do it:
    
    [code:2mh8izmo]
    +enemyBox: Value 'active' Equal to 1
    +enemyBox Platform: is on ground
       +enemyWallDetector: overlaps Family Terrain
       +System: random(20) Equal to 4
          -> enemyBox Platform: Jump
    [/code:2mh8izmo]
    
    I added in the randomizer so that they don't just immediately jump when they hit the wall.  Like the change in speed and direction I wanted it to look a little more natural, like they were thinking about it or something.
    
    Resetting and killing enemies:
    When the player dies, his position is set to the last eye stone that he touched.  At the same time, there's a loop that sets each enemy to the mLocator sprite in it's container (that was set back when they spawned at Start of Layout).  Then the 'active' value for enemyBox is set to 0 again so they don't just run around the level willy-nilly.
    
    When they're killed, the blinking "hit" animation is played.  When the animation is finished (and only if the enemy is on the ground) then a dead monster sprite is spawned and the enemyBox is destroyed.  Destroying the enemyBox destroys all the other objects in the container.  And that's about it.
    
    I didn't cover animations really, so if you want to know how that's done let me know.  Though I will be putting this kind of information in my Platform School tutorial, so if you can wait until then that's cool too.
  • I just played the third Construct entry in competition. Afterlife Consequences.

    It's pretty bad. Even the creators admit that it's pretty bad. The person in charge of making the game apparently decided to start using Construct at the beginning of the competition, so he had no idea what he was doing. The results definitely reflect this fact.

    What makes me a little sad is how he's constantly bagging on Construct the whole time, like it's Construct's fault he's made a bad game. He also states that Construct is just an "insane wall of bugs." He only mentions a couple of bugs in the thread, only one of which he posted about here in the Help forum, which was already a known issue and he actually found a fix for it anyway (the other is the IDE crashing when editing sprites... sounds like a hardware issue to me). The rest is just design issues... he's complaining about animation and hitbox problems that aren't actually bugs and are easily remedied, and all he had to do was ask. Hell, he didn't even have to ask... there are plenty of threads that talk about hitboxes and animation already.

    Sigh. When scytos mentioned there was a third Construct entry, I had some higher hopes for it than this. Oh well.

  • I just played the third Construct entry in competition. Afterlife Consequences.

    It's pretty bad. Even the creators admit that it's pretty bad. The person in charge of making the game apparently decided to start using Construct at the beginning of the competition, so he had no idea what he was doing. The results definitely reflect this fact.

    What makes me a little sad is how he's constantly bagging on Construct the whole time, like it's Construct's fault he's made a bad game. He also states that Construct is just an "insane wall of bugs." He only mentions a couple of bugs in the thread, only one of which he posted about here in the Help forum, which was already a known issue and he actually found a fix for it anyway (the other is the IDE crashing when editing sprites... sounds like a hardware issue to me). The rest is just design issues... he's complaining about animation and hitbox problems that aren't actually bugs and are easily remedied, and all he had to do was ask. Hell, he didn't even have to ask... there are plenty of threads that talk about hitboxes and animation already.

    Sigh. When scytos mentioned there was a third Construct entry, I had some higher hopes for it than this. Oh well.

    Well.. I don't really mind that he calls Construct buggy, he did encounter an annoying bug. What would be better is transferring the criticism into bug reports - which he has done with one bug, and it got fixed. Hopefully with more of these reports we can change Construct from an 'insane wall of bugs' into a rose scented stallion.

  • Deadeye

    Would you mind if I used some of those ideas for the Ai I am currently working on?

  • Well.. I don't really mind that he calls Construct buggy, he did encounter an annoying bug.

    Saying it's buggy is one thing, but the whole tone of his thread is "Sorry my game is so bad, it's Construct's fault for being a 'total piece.'" It's hardly fair to blame Construct, especially when most of his issues are either just design flaws or known bugs that have easy workarounds.

    Ah, well. I did have a rather wordy reply to his latest post on there but I decided to just drop it. I'll let Construct speak for itself when it comes out.

    Aeal5566: Sure, man... go for it. I'd like to see what you can cook up. If I post some code it's free for use. Just not my graphics

  • Okay np I wont take graphics just code. Its not cool to steal graphics...

    Great entry, I loved your game. Once I get more proficient with construct coding I think I may try to enter on of their compos.

    I looked at that thread on TGI it was unfair of that guy to blame construct I completely agree. I mean using it to make a basic platformer seems easy but then when you get to things like AI and that stuff its not so easy especially with some of the strange bugs that do pop up every once in a while but they are usually easy to devise a work around with some questions and brain power.

  • Deadeye, I think Scytos might have stopped checking this thread, could you get him to check out this file? http://www.scirra.com/files/xaudio2test.zip

    Hopefully it'll shed some light on the XAudio2 problem (I really want to fix it).

    As for someone somewhere moaning about the bugs in Construct, it might have its bugs, being a beta, but it's also free, so I'd rather people like that used it and submitted useful bug reports, or just never used it at all. What does he want, his money back?

  • Deadeye, I think Scytos might have stopped checking this thread

    No, I'm here, sorry it took me a while to post, I wanted to try updating my chipset/video drivers too before I posted (my sound card is onboard), which didn't work. I was just about to start writing when you posted that message.

    Scytos, can you try running this?

    http://www.scirra.com/files/xaudio2test.zip

    Let me know what messages appear - it's got a prompt at every stage of the initialisation process. Hopefully it'll be able to tell us exactly where things are going wrong for you.

    Ugh. I'm not sure the result is helpful - it went through every stage without a problem, then a generic Windows error happened at the end. That is,

    Beginning initialisation

    Creating XAudio2

    Creating volume meter

    Creating mastering voice

    Getting device details

    Setting master volume

    Done!

    then one of those generic "has encountered a problem and needs to close" Windows errors. Details say the error is in xaudio2_2.dll, which I guess is somewhat expected. Funny thing is, deleting that file makes the game run - without sound, but it runs (although it might break on sound triggered events, I don't know). Deleting that file and reinstalling DirectX doesn't fix it, either.

    I appreciate all the trouble, by the way.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)