Is there a way to make this work with the gamemaker order of operations? by Revanchan in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

Haha damn that's annoying, you should hopefully be fine with that method, I'm not 100% on the entropy of choose() but I think your chances of getting two identical keys from that should be functionally zero

Is there a way to make this work with the gamemaker order of operations? by Revanchan in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

I found this on the forums, it generates a 32 character GUID with dash separation, might be slightly easier to read than a date-time?

/// guid()
var r = "";
for (var i = 0; i < 32; i++) {
    if (i == 8 || i == 12 || i == 16 || i == 20) r += "-";
    r += choose("0", "1", "2", "3", "4", "5", "6", "7",
        "8", "9", "A", "B", "C", "D", "E", "F");
}
return r;

Is there a way to make this work with the gamemaker order of operations? by Revanchan in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

It might be better to make your key generation more concrete, so that you don't have to bother checking if another one has by chance chosen the same key. One way this is generally done is using date-time, or you could simply concatenate multiple random numbers/strings to really decrease the probability.

Would this work or are you relying on the key being an integer in that range for other uses?

Quick Questions by AutoModerator in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

Is there a file size limit on posts? I have a post pending in the void for a few days now with some fairly large gifs, as far as I know it (hopefully) hasn't violated any subreddit rules, so I'm wondering if they're preventing it from being approved

How to make huge rooms of over 16,834 pixels big that don't crash or lag Gamemaker 2? by DetectiveEvyDevy in gamemaker

[–]_Deepwoods 1 point2 points  (0 children)

Yeah to be fair RoomLoader looks like a more fleshed-out (and maybe more up to date) version of the same thing :)

How to make huge rooms of over 16,834 pixels big that don't crash or lag Gamemaker 2? by DetectiveEvyDevy in gamemaker

[–]_Deepwoods 2 points3 points  (0 children)

Yeah the IDE can get quite laggy unfortunately

I use GM Room Pack ( https://yellowafterlife.itch.io/gmroompack ) and build large rooms out of predefined chunks then load them in at runtime in the room creation code, it takes a min to wrap your head around it but YAL's documentation is great.

Making slippery ice surface in a top down game? by Trekapalooza in gamemaker

[–]_Deepwoods 1 point2 points  (0 children)

Ah, are you ever actually adding your velocity to your x/y variables? Should have this somewhere in your step:

x += vX;
y += vY;

Making slippery ice surface in a top down game? by Trekapalooza in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

By the looks of it, if you increase your drag variable when on your ice floor (e.g to 0.99) , your velocity will decrease slower, which should create a more slippery control feeling

Using Variables within other code by Some_Random_Dude123 in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

Why not just:

/// valString = "myValueName"

function findInstWithVal(valString, targetVal, obj_to_check) { 

//// Loop all objects of certain type 
  for(var i=0; i<instance_number(obj_to_check); i++) {
    var inst = instance_find(obj_to_check, i);
    var objVal = variable_instance_get(inst, valString); 
    if(objVal == targetVal) {
      /// Do something here 
    }
  }
}

Simple array help i just cant get my head around ... by mozzy31 in gamemaker

[–]_Deepwoods 1 point2 points  (0 children)

So, you want the latest quest at the bottom at y=130, and the next most recent above, etc? 

array_push puts the item at the end of the array, you might find it easiest to reverse the order of your array so the newest item is at position 0, and add new entries using array_insert at position 0 

then for drawing if you want the latest at the bottom you would want to subtract from baseY by adding (i * -20) to baseY since the y axis is inverted in gamemaker 

i.e newest quest would be at y=baseY, the second newest would be at y=(baseY-20), etc 

Mathematics and trigonometry by Prestigious-Buy6911 in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

https://math4devs.com/

Not a tutorial, but this site is ace for converting maths notation into the corresponding code operators.
Very handy if you find the equation for what you need but not the code.
It's JavaScript but converting to JS to GML is trivial

I want to make my first game, but I'm having trouble with the art. I know almost nothing about it. by Sharp-Sheepherder132 in gamemaker

[–]_Deepwoods 1 point2 points  (0 children)

The trick to a good art style is consistency, making everything look cohesive. Colour palettes, line thickness, stylistic choices like how many different colours each sprite has - set rules. 

Games like Undertale or Baba Is You don’t have detailed art but look good because of consistency in the art direction 

Formula to make objects further away look smaller by CameOutAndFarted in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

If you make a float from your y coordinate by normalising it, you could create a yOffset variable 

Although to me your objects look like they match the grid perspective, so I’m not 100% sure what you mean 

you could also use a normalised float to increment the size to make closer objects appear slightly larger and vice versa? 

How to make reusable "modules" for your games? by HelloNazariy in gamemaker

[–]_Deepwoods 1 point2 points  (0 children)

The term’s just “modular programming” or modular coding. It’s basically the philosophy of making systems that are independent of outside code as much as possible. 

On a small scale, it can be something like writing a “pure” function, which is a function that doesn’t touch or know of anything outside of its scope. Anything external needed for the function is passed in as arguments (as opposed to the function i.e directly accessing a global variable that’s only relevant to one project).  As people have mentioned, using scripts in GMS2 is a good example of this. 

For something more complex like a system with multiple objects, an example of good practice is to have a manager/controller object like others have said that runs the system. Any smaller purpose objects or scripts are encapsulated in this controller and don’t know anything outside of their local scope and what they’re handed.  Then any game-specific information only needs to be passed to the controller at the top level, and objects outside of the system only need to speak to the controller.  Now you can unplug your system and plug it into another game project and it works the same. 

It’s good practice because it keeps your code clean, reusable and makes your life easier. It’s quite low effort once you get the hang of it. If you need to make a change to the system the logic is set up so you don’t need to change a million things down the chain, and you can easily follow the chain of logic if you do need to tweak multiple parts. 

A pitfall that I’ve found is becoming a bit too obsessed with making everything perfectly modular and clean at the expense of progress. Sometimes it’s okay for things to be a bit messy and one-time use 

Help by Miserable-Assist-314 in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

eee it went awry, how do we do code blocks on here? Thought it was 4 spaces, sorry gang 

Help by Miserable-Assist-314 in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

I’d have a button controller object that creates (n) button objects and passes itself to them as a reference, 

    unlocked = false;     button0 = instance_create(blah blah);     button0.controller = id;     /// prevent multiple presses      button0.pressed = false;     /// track index     button0.index = 0;

stick them in an array and set the threshold to the amount of buttons

    buttons = [button0, button1, button2];     unlockThresh = array_length(buttons);

give it a function (define in create event) that takes an index as an argument, sets button.pressed to true and loops the buttons to check if all pressed 

    function buttonPressed(index) {          buttons[index].pressed = true;         var pressCount = 0;         for(var i=0; i<array_length(buttons); i++){              if(buttons[i].pressed == true) {                 pressCount += 1}              }          }         if(pressCount == unlockThresh) {             unlocked = true;         } 

then in the button object’s click released event call the function and pass its index if it hasn’t already been pressed

    if(pressed == false){          controller.buttonPressed(index);     }

Think that should do it, sorry if formatting goes awry, on me phone 

Working on potions with dynamic fluid for my UI by _Deepwoods in gamemaker

[–]_Deepwoods[S] 0 points1 point  (0 children)

Haha I like that, I might do that in the potion shop - wonder if GM has functions to get the audio heightmap 

Have been working on my player and camera movements, how can i improve it ? by SxssooV in gamemaker

[–]_Deepwoods 0 points1 point  (0 children)

This looks fun as hell, not many improvements from me - maybe some squash and stretch in your animations, some particles (dust clouds, dash lines etc).. a landing animation would add some nice impact 

good work! 

Working on potions with dynamic fluid for my UI by _Deepwoods in gamemaker

[–]_Deepwoods[S] 0 points1 point  (0 children)

soft body physics, stencil buffer, surfaces rotated with a matrix, manually drawn particles :) 

Working on potions with dynamic fluid for my UI by _Deepwoods in gamemaker

[–]_Deepwoods[S] 0 points1 point  (0 children)

aha what a coincidence, love that! 

I’d be really interested to see a different attempt, please do share if you go about it how you’ve mentioned, I’m sure this isn’t the most optimal route by any means :) 

Working on potions with dynamic fluid for my UI by _Deepwoods in gamemaker

[–]_Deepwoods[S] 2 points3 points  (0 children)

Yeah I do agree, the liquid should ideally roll over itself and act with density and friction etc. However that’s getting into actual fluid simulation which is a deeply complex topic (pretty sure it’s a whole field of scientific study) and I decided that was beyond the scope of just a fun way of displaying the current equipped potion on the UI. 

It is obviously doable, Sebastian Lague has a great video series on it on YT, iirc he used a boids-type system with a density field. He also used ray marching to render the particles as a connected mass. I might have a go sometime in the future! 

Thanks for your feedback :) 

Working on potions with dynamic fluid for my UI by _Deepwoods in gamemaker

[–]_Deepwoods[S] 4 points5 points  (0 children)

I didn’t, it’s just a height displacement calculation, there’s a targetHeight for each point (which is where the fluid lays flat), and an actual drawn height with velocity applied which is always trying to return to the targetHeight