Jump to content


grandhighgamer

Member Since 07 Sep 2004
Offline Last Active Mar 28 2016 09:14 PM

#4943085 General performance issues

Posted by grandhighgamer on 28 January 2016 - 12:17 PM

I'm not quite sure how that works.....If I see a big drop, are you saying that as long as the maximum and average are still strong, then it's okay?

The higher the frame rate, the lower the amount of time a single frame takes. Therefore super-high frame rates will drop easier. The only true measure of performance is frame time, i.e. how long it actually takes to do everything.


  • 2


#4936999 Optimizing your game further

Posted by grandhighgamer on 18 January 2016 - 12:50 AM

Than having the code in-line? Yes. But you now have the gml_pragma command to force scripts to be compiled inline, as well as the YYC export to compile to actual bytecode and negate a lot of the issues that cause the slowdowns.


  • 2


#4936623 Array Scripts Memory Leak

Posted by grandhighgamer on 17 January 2016 - 12:54 PM

Try creating some new data afterwards and see if your memory usage decreases. For speed reasons, among other things, memory isn't always instantly released by a program the moment it stops storing anythign in the excess space. It seems entirely possible the arrays were freed but GM/Windows was simply keeping the memory allocated.


  • 1


#4919023 Why does my audio sound distorted and horrible?

Posted by grandhighgamer on 12 December 2015 - 03:11 PM

Probably the sounds didn't clip in older versions of GM is simply because GMS supports more sound channels, and thus can have more instances of the sound playing concurrently. If you're not gonna add a cap, maybe use audio_channel_num(num); to set the number of sound channels low enough that your enemy sounds don't stack into a cacophony. Having different variations to the sound that is played would help too.


  • 1


#4918887 Why does my audio sound distorted and horrible?

Posted by grandhighgamer on 12 December 2015 - 03:01 AM

Suddenly, the music was exactly twice as loud, because the sound waves stacked!

There is twice as much energy though. That's why decibels are logarithmic, you don't percieve twice the energy as twice as loud. But computers have limits on the range, you'll hit clipping with a few instances of sound playing at once.

 

Either you're accidentally calling the sound effect multiple times in the same step, or you're using an old version of GMS that has a glitch with the audio. Given that you apparently can't use audio_debug, you're definitely using a pretty old version, so that should be your first port of call. Update.

 

Beyond that, try having a control object with a variable that resets ever Step Begin, that also draws the value of that variable. And then increment that variable in your sound script.

If you're ever seeing a value greater than 1 you know your function is being called too often and causing clipping.


  • 1


#4914375 GMC forums cyber attack.

Posted by grandhighgamer on 02 December 2015 - 04:29 PM

I have to get a new password?!

 

password2 it is.

New password: passw0rd. With the letter O replaced with the number 0. Genius! Unbreakable!


  • 1


#4908835 My engine was possibly reposted to the marketplace

Posted by grandhighgamer on 19 November 2015 - 08:31 PM

Lonewolf, fairly sure 'redistributions in binary form' would be YoYo's use of the product. Not the output from Game Maker. The Zip code might be valid, since zip_unzip exists, but stuff like SVN or LLVM won't exist in the compiled product at all.


  • 1


#4905643 destroy object = destroy data structure?

Posted by grandhighgamer on 12 November 2015 - 09:47 PM

Destroy it in the Destroy event. The data structure doesn't exist within the object in any sense. All you have is a reference that's held in whatever variable you assign it to.


  • 2


#4903549 SNEW! The most efficient approach

Posted by grandhighgamer on 08 November 2015 - 03:46 AM

I'm losing a little bit less than .5 FPS per snowflake. In this video I have 400 flakes at a cost of about 200 FPS

That's a poor way of measuring performance, since at 2000fps even drawing a single snowflake will probably take off 200fps. Frametime or bust.

 

But in general, particles with a 'blurred' sprite that rotates in the direction of moment will look fine. The turbulence can be simulated with a bit of random jitter to the directions.

 

Having the particles light up isn't too difficult, just draw the system manually to a surface, darken everything but the light areas, then draw it back over the screen with bm_add and you should have snowflakes that are lit by nearby sources.


  • 1


#4898700 Debug which instance changed a variables value?

Posted by grandhighgamer on 28 October 2015 - 07:44 PM

Breakpoints would be the sensible option. There's also an alternative, you create a 'changed by' variable that every object that alters that variable sets to their name/ID. Not the cleanest solution but pretty straightforward.


  • 1


#4896494 Using Parents as object groups

Posted by grandhighgamer on 25 October 2015 - 01:54 AM

Basically an object with a parent (you just set this in the object window via a drop down box) will be included in any function that affects its parent.

 

So if object_red_bullet has a parent called object_any_bullet you can use with(obj_any_bullet){instance_destroy();} to destroy object_red_bullet and any other bullets without having to repeat the code for each type. This makes checking for collisions, etc a lot simpler.

 

Obviously stuff like instance_create would only create the parent object itself. But any kind of "check an object" or "do something to an object" function will be applied to the child objects of a parent object.


  • 1


#4889687 Depth Buffer / Z Buffer

Posted by grandhighgamer on 12 October 2015 - 01:50 AM

You're gonna have to render one yourself. Just using the fog functions gives you a functional approximation if you render it to a surface.


  • 1


#4763640 What are legal implications of using resources others created for you?

Posted by grandhighgamer on 08 March 2015 - 04:55 AM

If you have any intention of selling something someone else has created for it, get a contract written up. None of us are lawyers and don't expect any kind of legal protection to an agreement as utterly informal as a forum post.


  • 1


#4758251 How to make a mute button in game?

Posted by grandhighgamer on 27 February 2015 - 07:36 PM

Firstly where is the code even run? Secondly, your code is longer than it needs to be.

if mouse_check_button_pressed(mb_left){
    if image_index = 0{
        audio_stop_sound(bgm_song)
        image_index = 1
    }else{
        audio_play_sound(bgm_song,1,true)
        image_index = 0  
    }
}

 

Is what you'd want.

 

I imagine the bug, assuming your code is in a sensible place, might simply be that you're not setting the image_speed to zero, thus it is animating the image_index and breaking the logic entirely.


  • 1


#4754173 Permanent Trait System

Posted by grandhighgamer on 21 February 2015 - 05:35 PM

Switch to global variables, initialise them in an object that is only in the first room of the game (so that the values arn't reset). Manually reset whatever needs resetting between waves. If needed you could also create two sets of variables, a temporary set for stuff that should be per-wave only and a permanant set to be carried between rooms.


  • 1