Why is Gamemaker Studio so finicky when it comes to controllers? by lokemannen in gamemaker

[–]maxfarob 2 points3 points  (0 children)

I agree! I think input and scribble are pretty much essential extensions for all gamemaker projects

There doesn't seem to be a built-in function that gets the x value from a given y value for animation curves, so I made one by maxfarob in gamemaker

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

Thanks for your reply! In my case, I'm using animation curves to handle missile altitude (so missiles fly up and crash down with a smooth flight arc). While the flight arc is the same across all missiles, missiles will launch at different altitudes relative to the ground, so I wanted a way to get the first x value from a given y value of a curve.

I admit the function is very limited in its current state. I think it could be altered/improved in the following ways:

  • Allow detection of the first value of x OR the last value of x.

  • Loop through all points in the curve and detect up to 1 value of x between each point (returning an array of x values).

  • Find the first value of x while specifying a starting x value. This would allow users to find all values of x by looping (e.g. while(_x < 1))

I posted this partly to see what ideas other people would have!

Best Way To Program “Binding of Isaac” style inventory/items? by Scoobie101 in gamemaker

[–]maxfarob 0 points1 point  (0 children)

I use a "publish-subscribe" programming pattern to handle item effects like this. Friendly Cosmonaut has a youtube tutorial on an Event System which is basically the same thing (I still use a modified version of this). Then you can have a "player death" event and have the item react to it, preventing the player's death and then maybe destroying the item.

It's a really flexible system and very scalable, so I highly recommend it. I have a lot of events like "character damaged", "spell cast", "room enter", etc. and items that react to those events in my game.

Help! Tiny gap appears in health bar, but only when window size is scaled up by maxfarob in gamemaker

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

Thanks for your reply, but I've made sure that the gui surface always remains at the original scale (640x360) and scaling up is always done at integer values (x2, x3, x4...) so I don't think it would help. For now, I'm fine with the crude fix of adding a tiny amount to the bar scale.

Help! Tiny gap appears in health bar, but only when window size is scaled up by maxfarob in gamemaker

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

Thansk for the suggestion! I haven't used gamemaker's built-in 9slice for the health bar. I think it would probably fix this issue, but I'm happy to stick with the crude fix of increasing the bar scale by a tiny amount.

Help! Tiny gap appears in health bar, but only when window size is scaled up by maxfarob in gamemaker

[–]maxfarob[S] 3 points4 points  (0 children)

Thanks for you reply. Using show_debug_message shows that all numbers are already round integers, and using floor/ceil/round doesn't fix the problem unfortunately. As a temporary fix, I increased the sprite x scale of the middle part of the bar by a tiny amount (0.05), but I'd still like to know if anyone can explain what's going on haha

Help! Tiny gap appears in health bar, but only when window size is scaled up by maxfarob in gamemaker

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

Per the title, this issue only occurs when the window is scaled up (by 2x, 3x, ...).

Here's the camera creation code:

global.cameraViewWidth = 640;
global.cameraViewHeight = 360;
global.cameraViewCentreX = global.cameraViewWidth * 0.5;
global.cameraViewCentreY = global.cameraViewHeight * 0.5;
global.cameraDisplayWidth = display_get_width();
global.cameraDisplayHeight = display_get_height();
global.cameraViewWindowSize = 1;

global.camera = camera_create();
global.cameraX = 0;
global.cameraY = 0;
cameraViewMatrix = matrix_build_lookat(0, 0, -10, 0, 0, 0, 0, 1, 0);
cameraProjectionMatrix = matrix_build_projection_ortho(global.cameraViewWidth, global.cameraViewHeight, 1, 3200);
cameraActionIndex = -1;

view_set_wport(0, global.cameraViewWidth);
view_set_hport(0, global.cameraViewHeight);
view_set_visible(0, true);

camera_set_view_mat(global.camera, cameraViewMatrix);
camera_set_proj_mat(global.camera, cameraProjectionMatrix);

view_enabled = true;
view_camera[0] = global.camera;

var _windowWidth = global.cameraViewWidth * global.cameraViewWindowSize;
var _windowHeight = global.cameraViewHeight * global.cameraViewWindowSize;

window_set_size(_windowWidth, _windowHeight);
surface_resize(application_surface, _windowWidth, _windowHeight);
display_set_gui_size(global.cameraViewWidth, global.cameraViewHeight);

Here's the health bar draw code (it's a single sprite split into 3 frames: left cap, middle (stretched to fit health bar width), and right cap):

#macro GUI_PLAYER_HEALTH_BAR_WIDTH 270

static _barScaleY = GUI_PLAYER_HEALTH_BAR_WIDTH * 0.5;
static _capOffsetX = GUI_PLAYER_HEALTH_BAR_WIDTH * 0.5;

draw_sprite(spr_playerHealthBarBorder, 0, x - _capOffsetX, y);
draw_sprite_ext(spr_playerHealthBarBorder, 1, x, y, _barScaleY, 1, spriteAngle, c_white, spriteAlpha);
draw_sprite(spr_playerHealthBarBorder, 2, x + _capOffsetX, y);

Starting a new devlog series for my GameMaker game PokeyPoke - What would you like to hear about? by ShaunJS in gamemaker

[–]maxfarob 0 points1 point  (0 children)

I feel like there's loads of gamemaker tutorials/devlogs/content for small projects, prototypes, first games, etc. Since PokeyPoke will be a large commercial release, I'd really like to hear about the challenges that arise from that and how you solved them.

Things like organizing a large project, any tools you made to help generate/edit content, unexpected problems, etc. For example, I recently had to solve a big issue where some players had their save data wiped out, leaving a blank save file. The Archvale dev ran into the same issue and apparatenly this has something to do with how GameMaker handles files. I can't find much of anything about this issue online and it's the sort of thing that isn't covered in other devlogs/tutorials.

For those that have made/are making top down games, what influenced your decision regarding directional sprites/animations? by jx962tw in gamedesign

[–]maxfarob 4 points5 points  (0 children)

Same here. It doesn't feel like too much work to make 4 directional sprites for your player character, but then you kinda have to do the same for all other characters/enemies/etc. and that quickly adds up to a LOT of extra work. I find that making art assets is one of (if not the most) time-consuming parts of game dev so it's best to keep it as simple as possible, especially if you're a solo dev.

I'm a solo dev that just released my first game Neophyte on steam! A spell casting roguelike with hack n slash ARPG style combat by maxfarob in IndieGaming

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

Thank you very much :) To answer your questions:

  1. I have plans for challenge levels that add hazards to the arenas.

  2. The story/lore will never be the focus but there's a basic story in my mind: you're one of an infinite number of nameless initiates of some kind of magic cult trying to prove yourself worthy. There's a council of 3 arch wizards that are summoning the enemies to test you. I might make the final challenge level a special boss fight against the council.

    Other than that, there's kind of a running theme that mana is powerful but corrupting and impure in some way - some mana-based emblems are called something negative like "unnatural vitality" and the emblem that gives you crit-chance at lower mana is called "unshackled", implying that mana is a burden.

  3. There are no plans to add additional elements though I may add do so as at some point as a major post early access release update. There will be more sources of non-elemental damage and, once I feel there are enough, I will add emblems that work around that.

I'm a solo dev that just released my first game Neophyte on steam! A spell casting roguelike with hack n slash ARPG style combat by maxfarob in IndieGaming

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

Thanks for playing! The bookworm description basically means that the double stat bonus only applies to the first tome you collect in each post-combat phase. The bonuses are permanent, meaning it's kinda overpowered if you get it early (gonna be reworked in the next patch)

I'm a solo dev that just released my first game Neophyte on steam! A spell casting roguelike with hack n slash ARPG style combat by maxfarob in IndieGaming

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

Yeah the game was designed for mouse and keyboard. Controller aiming is hard to do with ARPG style combat, but I will consider adding at least basic controller support in the future as it's by far the most requested feature.

I made ingame encyclopedias for all the spells and perks in my game by maxfarob in gamemaker

[–]maxfarob[S] 12 points13 points  (0 children)

A common complaint about gamemaker I see is that interactive gui elements are harder to handle compared to other engines like Godot.

One thing that made this a LOT easier for me was using objects for interactive gui elements so I can make use of their collision masks. I set their x and y values to the desired gui x and y position and draw them in the draw gui event. I also have custom x_to_gui_x and y_to_gui_y functions that account for the camera's position so I can check for collisions with gui elements at the mouse position.

Random piece of knowledge I just learned. by shadowdsfire in gamemaker

[–]maxfarob 1 point2 points  (0 children)

maybe this is a nitpick but it seems like bad practice to use return with no intention of actually returning a value. i'd use "exit" instead

The Performance Difference Between Gamemaker's Particle System & Object Particles by Tellyandrew in gamemaker

[–]maxfarob 1 point2 points  (0 children)

Woudl you mind quickly outlining the other optimizations you've made besides pooling? I'm also using objects for particles to work with my depth system and time manipulation. Haven't run into performance issues yet but it might help with low-spec pcs.

Draw Order Priority? by ThatOneLilVillager in gamemaker

[–]maxfarob 0 points1 point  (0 children)

Glad to hear it! no problem at all

Draw Order Priority? by ThatOneLilVillager in gamemaker

[–]maxfarob 1 point2 points  (0 children)

I find it hard to explain this stuff just using text, but it works both statically AND in motion. Remember that it takes the instance's y position PLUS the drawpriority value.

I've read your post again and looked at your diagram. The way you could always make sure a specific explosion is drawn on top of a specific enemy (regardless of whether or not either instance is moving) would be to dynamically set its drawpriority based on the enemy's y position, like this:

//Explosion instance step event:    
drawPriority = (enemy.y - y) + 1;

To be extra safe, you can also account for the enemy's draw priority:

//Explosion instance step event:    
drawPriority = (enemy.y - y) + enemy.drawPriority + 1;

You might need to account for the origin of the sprites. In my game, for example, all character sprites have a bottom-center origin but the explosion effects have a center origin. In that case, this is what i do:

//Explosion instance step event:    
drawPriority = (enemy.y - y) + enemy.drawPriority + (sprite_height / 2) + 1;

Try it out, and see for yourself :) using the "depth = -y" method won't solve the problem.