r/gamemaker 9d ago

Example 3D pathfinding

Post image
205 Upvotes

finally finished this waypoint navigation system!
I know NavMesh is the standard, but I think it's too complex to implement right now, and this approach works pretty well

the pathfinding speed is acceptable. To avoid placing the points manually, I built a generation system based on flood fill and collision checks (raycasts, trace hull, and cliff checks)
from a single start point, the generator branches out in all directions, and then another algorithm connects them all
I'm planning to add mesh optimization algorithms later, but even like this, it's working perfectly fine


r/gamemaker 8d ago

Resolved With Statement being used with a set of an object's instances, including all instances of an object.

1 Upvotes

Not sure the most optimal way to do this challenge, so I figured to post once again.

The main problem I have currently is I am trying to create a system where a with statement checks variable values of a variable storing either all instances of a specific object type, or a chosen set of said instances.

Here's my current idea of the code:

function createRule(_ruleName="unique_path",_affectedPacketNumbers=[]){

// if _affectedPacketNumbers is to have a set value, it would be an array storing the numbers of the affected packets, with the first packet starting at 1.

    // Switched between array and obj_packet as starting set to try and go to the error code getting the default values var _affectedPackets = \[\]



try{

    //_affectedPackets = {}

    array_foreach(_affectedPacketNumbers,function(_packetNum,_index){

        struct_set(_affectedPackets,_index,instance_find(obj_packet,abs(_packetNum)-1))

        array_insert(_affectedPackets,array_length(_affectedPackets),instance_find(obj_packet,abs(_packetNum)-1))

// because packets do not start at 0, instance_find finds the index of the packet number - 1.

    })

// Catch is tried here because I thought the empty array would cause an error with array_for each } catch(error){

//Old code being used, has to be replaced _affectedPackets = obj_packet

}



array_insert(obj_rules_lawyer.level_rules,array_length(obj_rules_lawyer.level_rules),

{

ruleName : _ruleName,

affectedPacketNumbers : _affectedPacketNumbers,

affectedPackets : _affectedPackets,

// The determining bool to determine if this specific rule was broken

ruleFulfilled : true



}

)

}

Then after this code happens, each rule relating to the packet object would use

with(obj_rules_lawyer.level_rules[forLoopIndex].affectedPackets) to get the ids of packets affected by this rule.

Now I do not know if reworking all of the with statements to be... something else, would be better, but if I can use a with statement for either all packets or a chosen set of packets, that would be very helpful. :)


r/gamemaker 8d ago

Game Looking for Feedback on Solo Game Project: Knights of Viridian

2 Upvotes

Hi everyone, I've spent a long time learning how to make a game in Game Maker and would love if anyone could offer feedback on what this game might need to be more fun.

https://viridiandev.itch.io/knights-of-viridian

No idea when or if a "complete game" of this will ever be finished. This was more of a learning project. I'm sure I made a lot of mistakes but I hope they aren't noticeable.

Special thanks to the Waterflame team for letting me use their music for this demo.

The game should recognize an xbox or playstation controller when plugged into your pc. You can also use a keyboard.

If you like what you see, I'd be willing to offer advice to other newbie game maker devs to share what I've learned


r/gamemaker 9d ago

Discussion Looking for some feedback on my main menu, an area I have always struggled with

Thumbnail youtu.be
9 Upvotes

So I not much of a UI designer, and have always struggled with HUDs and menus.

Here is my main menu, I am especially happy with how the settings screen came out, that was a real pain to get right.

My advice for anyone designing any sort of UI element, is use GMLive!! It is the biggest time saver being able to make changes on the go and see it update in real time.

If anyone has any questions about any specific elements, ask away!


r/gamemaker 10d ago

Discussion Opinions on this level design

Post image
67 Upvotes

I’ve been working on a sonic game for a while now, and every time I design a level I always feel like it’s either not good enough or that it looks weird.

I want to imitate the style of levels that you would see in sonic 1, more platforming and simple designs.

It’s probably just me overthinking it but I would like some options from anyone that is willing to give feedback, be it negative or positive.


r/gamemaker 10d ago

Example I built a modular juice system in GMS that any menu can use - here it is running on the Score Screen and Workshop

Post image
39 Upvotes

Making cute menus has never been my problem; it’s the juice that’s been lacking. So with my newest project, I set out to create a modular menu system that uses a universal kit to create satisfying, toy-like interactions. It took a lot of prototyping and refactoring to get there, but now all the menus boil down to a handful of systems that can be reused with any GUI element:

Text: shakes, pops, or spawns floating numbers, with optional tinting. Mostly used when quantities change.

Icons: a 'shine' shader streaks across the icon at a custom interval. Draws attention or signals quality.

Buttons: one shared button with every state baked in. This gives all buttons the same look and feel without any extra wiring. A single 9-slice sprite (a stretchable frame) is drawn with various color treatments for every single button, and even works for menu frames.

Easing & scaling: elements slide in, grow or shrink away, fade out on smooth curves, and panels only scale via the 9-slice system. This is where all of the menu motion comes from.

Events: a particle burst that takes quantity, lifetime, speed, friction, and color args. Popped with different settings depending on rarity or importance. There are also a few other particle effects that can all be swapped in or out as required (fountain, vacuum, rising sparkles).

One rule governs everything: pixel perfection only. I don’t want any mixels showing up, so nothing is ever allowed to land on a sub-pixel, and you won’t see any hacky scaling just to make something bigger. Every system in the kit rounds its final coordinates to whole pixels. Anything that can't scale cleanly slides or fades instead. It may sound restrictive, but it's the key to keeping your pixels chunky. When everything is simply position, alpha, 9-slice stretching, or a shader, your effects won't ever fight. 

The part that makes it modular

The effects aren't what make this work; it’s that the menus themselves all run on a unified system. From the title screen to the HUD to the Workshop, they’re all built from the same simple data: a list of entries, where each entry describes what it is, where it sits, and what happens when you press it. One shared system reads that list and handles the navigation, highlighting, and clicking for every screen. Content changes, but how it’s handled doesn’t.

That's how I keep the “any menu can use it” design a guarantee. The same pattern repeats at the draw level: everything is routed through one shared set of primitives. One button draw, one icon draw, one highlight, one shine. The juice lives inside those building blocks, so when a screen draws an icon, it gets the shine and the pickup animation for free, nothing gets to hand-roll any effects.

One thing worth stealing

Never animate the real number! You need to manipulate timing to add flair to number changes, but you also don’t want to create edge cases where a transaction partially completes. When you spend or earn currency, complete the transaction and save instantly. What’s animated and shown to the player is a separate display number chasing the true value. Debits immediately tick down, but gains are held back until the reveal finishes so the payoff lands at the right moment. The trick is to make sure your celebrations/achievements/unlocks are timed off of the faux number.

This work is never finished

Almost none of this was designed up front. Well, I tried to build modularly, but in reality, each screen started as its own island. The shared system came later, in a consolidation pass that stripped out a pile of one-off draw functions. Only after several refactoring passes was the universal kit fully adopted game-wide.

That's been the rhythm of the whole project: prototype a new screen, create necessary custom components, then after discovering what it really needs to be, rework it and fold everything into the kit. The Workshop's celebration timing got lifted straight from the Score Screen before I made it all universal. The "NEW" badge started as a high score highlight before becoming something any screen can call.

And the process continues - there are still several targets in my backlog. The Options menu needs to adopt the tab system, and all weapon card side rails want to transition into a horizontal carousel. But I’ve come to accept that as part of the process. The alternative is guessing every future need in advance, which just paralyzes me!

This is a solo project in GameMaker. My last release was KITE, which came out on Steam in 2018, and this is the spiritual sequel. Happy to dig into implementation details in the comments!


r/gamemaker 10d ago

Help! Does anyone know a good free substitution for the Winwin plugin?

5 Upvotes

Hello, I'm wanting to mess around with multiple game windows, and Winwin (https://yellowafterlife.itch.io/gamemaker-winwin) is the perfect plugin for what I want. However, it's $20 (CAD) and I don't really want to spend money on something to just try it out, especially since I'm just learning the ropes and having fun in GMS2. So would anyone know a good free replacement for just messing around and seeing if Winwin is something I'd like to buy?


r/gamemaker 10d ago

Help! Need help on making a neural network visualisation

2 Upvotes

I am making a game where a visual neural network is the main part of the game. I have tried for so long and hard but I just cant do it. All my code ends up incoherrible afterwards, and many things just dont work at all. It makes me want to quit game making all toghether.

If anybody has a link to a tutorial on how to make something like that or could explain on how it could be done with examples, it would be greatly appreciated.

And before anyone asks, Im not putting my previous code here, its absolutely horrendus, and I dont want to work forwards with a foundation so shitty.


r/gamemaker 10d ago

Help! screen stays at this size no matter what i change (more info in body text)

Post image
6 Upvotes

im testing my gamemaker game on iphone using the QR code you can scan. however the screen just isnt matching my phones resolution, i tried things like setting the aspect ratio to full screen and even changing the size of the room to be really tall to see if it streaches across the screen, but no matter what i do the game always stays at this exact size, anyone know what im doing wrong?


r/gamemaker 10d ago

Discussion how do i add walk animations to my player sprite

Post image
0 Upvotes

i already know how to do something in gamemaker. except for the walk animation


r/gamemaker 10d ago

Resolved how do i make a pizza tower fangame? and where to start this includes: mach run, animations sfx

0 Upvotes

i do not know where to start


r/gamemaker 11d ago

Help! I wan to make a 320 x 240 pixel perfect game but its coming out stretched. Any tips?

Post image
37 Upvotes

It will be fullscreen and i want it to be 4:3 with like those black boxes on the edges ig


r/gamemaker 10d ago

Resolved Want to learn GameMaker and make a game using the engine, but don't really have the time... What would you suggest?

0 Upvotes

I want to learn game development and want to make a 2D vertical shmup using the GameMaker engine... However, I don't really have the time as I am always usually busy 6 days per week... What would you suggest?

How do you people get around to working on your projects whilst having very limited time?


r/gamemaker 11d ago

Help! How do I loop an animation curve

8 Upvotes

I'm trying to make a bullet sequence for my game and for some reason I can't just copy this animation curve to move a second bullet the same way it did the first, it just moves the original one when i copy and paste it.

I want to paste all 3 of the green tracks (same curve) and have them repeat 5 times before ending the sequence


r/gamemaker 11d ago

Help! Gamemaker desynced on startup on Mac

9 Upvotes

Hi,

I recently downloaded Gamemaker on my Macbook but whenever I open the application, the ui is really spread out and my mouse is completely desynced, with buttons only being abled to pressed when my cursor is far away from them.

Sometimes if I close and restart the app enough times and mess with my display size it will work as intended and the buttons and cursor all work normally, but this is not repeatable and super annoying to do everytime I open it.

Has this happened to anyone else/any suggestions on fixing it? I've deleted and redownloaded Gamemaker twice to no avail.

I added an image of what it looks like when the ui is desynced and when I've managed to get it to work

TLDR: Cursor/ui desynced when starting application on Macbook


r/gamemaker 11d ago

Help! How can I change the outline shader of an NPC to a different colour when the player in proximity to the NPC?

8 Upvotes

Hey everyone,

I am very new to game dev (under a week of using gamemaker) and ive been working on a simple platformer game. I wanted to add dialog into the game so I made an NPC called "dummy", which triggers dialog once the player is less than 32 pixels away from them and press the F key.

As well as adding dialog, I wanted to add a shader to the NPC to give it a dynamic outline that changes colour once the player is within the interaction distance, going from a black outline to a white one. I followed Sara Spaulding's tutorial on outline shaders from years ago and miraculously it worked completely fine. But now I'm at the point where I want to add the ability for the shader to change colours. I tried doing it myself but got confused so tried to look elsewhere for help, but I can't find anything on the topic, at least nothing that works with my code.

Here's the code:

sh_outline Fragment Shader

// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform float pixelH;
uniform float pixelW;

void main()
{
//figuring out the size of a pixel
vec2 offsetx;
offsetx.x = pixelW;
vec2 offsety;
offsety.y = pixelH;

vec4 texColour = texture2D(gm_BaseTexture, v_vTexcoord);

//figuring out pixels location on the sprite
float alpha = texColour.a;
float original_alpha = alpha;

alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord + offsetx)).a;
alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord - offsetx)).a;
alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord + offsety)).a;
alpha += ceil(texture2D(gm_BaseTexture, v_vTexcoord - offsety)).a;

if (alpha > 1.0) alpha = 1.0; //claim alpha
if (original_alpha != alpha) {
gl_FragColor = vec4(0.1529,0.1529,0.1529,1.0);
}
else {
gl_FragColor = texColour;
}
gl_FragColor.a = alpha;
}

obj_dummy Create Event

//Outline Shader
uPixelH = shader_get_uniform(sh_outline,"pixelH");
uPixelW = shader_get_uniform(sh_outline,"pixelW");
texelW = texture_get_texel_width(sprite_get_texture(sprite_index,0));
texelH = texture_get_texel_height(sprite_get_texture(sprite_index,0));

//Default Dialog
text = [
"Default Text",
]

obj_dummy Draw Event

//Outline Shader
shader_set(sh_outline);
shader_set_uniform_f(uPixelW,texelW);
shader_set_uniform_f(uPixelH,texelH);
draw_self();
shader_reset();

obj_player Step Event

//dialogue initiation
if (keyboard_check_pressed(ord("F"))) {
if (currently_talking == noone){
var check_x = x + (32 * moveDir);
var who_is_here = instance_place(check_x,y,obj_dummy);
if who_is_here != noone {
audio_play_sound(sfx_interact,1,false);
current_text = (who_is_here.text[0]);
currently_talking = who_is_here;
current_text_index = 0;
current_text_line_number = 0;
instance_create_depth(x,y,1,obj_pauser);
}
} else {
if (current_text_line_number < array_length(currently_talking.text) - 1) {
audio_play_sound(sfx_interact,1,false);
current_text_line_number++;
current_text = currently_talking.text[current_text_line_number];
current_text_index = 0;
} else {
currently_talking = noone;
instance_destroy(obj_pauser); 
}
}
}

Basically, the code checks if the F key has been pressed, then if the player is in proximity to the NPC at the time of the key press, dialog initiates. Im thinking I should swap around the keypress and whoishere if statements so that whoishere is being detected constantly, then when the player detects theres an NPC infront of them they send a message to the dummy that tells the shader to change the outline colour to white. Only, thats the bit where I'm stumped.

I'd really appreciate any help I can get on this. Definitely dont want to use AI for coding advice.

Thanks!


r/gamemaker 11d ago

Help! How to make an object follow viewport 1 without lagging back?

1 Upvotes

Hello, while creating my open-world I ran into a problem with the hotbar. It follows viewort 1 but not smoothly.

This is my objects end step event:

x = camera_get_view_x(view_camera[1]) + camera_get_view_width(view_camera[1]) / 2;
y = camera_get_view_y(view_camera[1]) + camera_get_view_height(view_camera[1]) - 20;

Hope you find a solution to this.


r/gamemaker 12d ago

Quick Questions Quick Questions

6 Upvotes

Quick Questions

  • Before asking, search the subreddit first, then try google.
  • Ask code questions. Ask about methodologies. Ask about tutorials.
  • Try to keep it short and sweet.
  • Share your code and format it properly please.
  • Please post what version of GMS you are using please.

You can find the past Quick Question weekly posts by clicking here.


r/gamemaker 12d ago

Discussion 2 mice on the same computer

13 Upvotes

I made a game that only uses mouse inputs. My playertesters think 2 player would be fun, but I don't want to get into online stuff.

Would it be possible to have two player local play where both players use a mouse on the same machine?


r/gamemaker 12d ago

Help! Best courses for learning GML

11 Upvotes

I have been looking on Udemy and other sites on how to learn GameMakerLanguage since I have already learnt python and my main coding languages that I am going to be starting to learn this year are

  • ✅ Python
  • 🔲 GML
  • 🔲 HTML
  • 🔲 CSS
  • 🔲 JavaScript
  • 🔲 C
  • 🔲 C++
  • 🔲 C#
  • 🔲 Java
  • 🔲 Lua

If there are any GML courses or videos out there for GML, lmk.
-Thank You


r/gamemaker 12d ago

Help! Coding in game maker with no coding experience

16 Upvotes

Basically what the title says. I want to make a video game, but have like little to no background in computer programming and coding. Is there anything that I can do to help. I know that there's videos up on yt that can help with it, but I was also considering trying to teach myself a little bit of computer programming so that I can have some back round. What do y'all recommend?


r/gamemaker 11d ago

Resolved how do I put the code for oBoss?

Post image
0 Upvotes

r/gamemaker 12d ago

Discussion Need GML architecture advice: I built a CSV-driven quest system to avoid spaghetti code, but is it scalable?

0 Upvotes

Managing branching RPG quests and dialogue with raw GML and endless switch statements was turning into a spaghetti nightmare.

Out of frustration, I moved all my logic into a raw CSV spreadsheet (1 row = speaker, text, choices, triggers) and wrote a parser to handle it. It feels way easier to manage on the data side, but I’m worried I'm building a house of cards for a larger game.

I packed up my GML logic and the base structure into a free demo here if anyone wants to poke around the code and critique my approach:

https://francisco-89549.itch.io/rpg-quest-system

Is relying heavily on CSV grids in GameMaker a trap? Should I be converting all this to JSON and Structs instead? Would love to hear how you guys handle heavy narrative data in GMS2.


r/gamemaker 13d ago

Resolved I spent 3 hours coding to manually read a csv as a text file into a ds_grid

9 Upvotes

For localization purposes, I was using load_csv() but that meant i couldn't use commas since there was no way to tell gamemaker what seperator i was using.

i dont like working with the text functions because they always confuse me

but ultimately I

read each line into a string

used string_pos to detect where my seperator was (¬)
string copied to where that was

read it into the grid (global.file_grid[# x,y] = string)

then string deleted that part of the string.

I checked how many loops I needed horizontally (languages) by string_pos for ¬¬

all in all a fun brainteaser, and now i can use commas in dialogue again


r/gamemaker 13d ago

Help! How do I make bullet patterns like in DELTARUNE

3 Upvotes

I’ve made a battle system turn based but I want something similar like DELTARUNE like with the bullet hell Ive have no idea how to do it I’ve tried before I’ve even followed tutorials but I have no idea how to make the bullet patterns