20 days ago

August Game Dev Progress (2024)

Happy September everyone! I hope you're all well!
I don't feel like I got many individual things done this month, but I got a couple of major things finished/updated and lots of little bugs.

Which is always nice!


Sorry for some gifs as imgur links, they're too big for GameJolt

Status Effects

Since in July I made it so Weather can now set Trees on Fire, I took a look at how I'm doing Status Effects.
Pretty sure I was over complicating things.

Decided I should combine the system I have for Item effects with the other system, since it seems pointless having a [Poison] Status from attacks, when there's already the same sort of thing from eating bad food.

Additionally since the item ones have different ID's they can stack. The only question was how to apply them to things like Tree's without giving them status timers for things that can't effect them.

After much investigating and jumping around code, the merge and rework seemed to go well.

Also added Effects that can clear negative Effects too.

Here's the Antidote clearing the FOOD_HURT timer caused by eating a Baked Banato.

Not sure if I want to have a text popup for these. There is particles on the player but obviously they're hidden by the Inventory UI.

monstisla2158.gif

2158

This got me thinking about working on Status timers for the HUD, but it seems if I want circle times I'm going to have to either use primitives or surfaces, don't want to do the former, and the later is too much effort for such a small thing (at least for now). So for now, squares!

monstisla2159.gif

2159

Urgh, turns out the "smaller" font I made is the same size as the normal font, so that's going to need addressed. I wanna keep these Status Effect icons small, but the timer as text still takes up too much space.

Turned out I can't do a circular timer because I don't have a max time value, so I might have to add an additional value to my Status system to store that, but I'd rather not have specific max timer values for Status's?

Had a nice big dumb moment while making the Status boxes, I change the colours from just red, made positive effects green, but I couldn't see the box anywhere?!?

...it was the same colour as the grass (。Ó﹏Ò。)

Drew a bunch of Status Effect Icons! Usually they wouldn't be visible unless active, but I wanted to show them all. Will probably move them to the top left corner of the screen, but there's too much debug data up there so bottom left will do for now!
I'm not sure If I want positive effects to cancel out the negative ones , or have them compete; doing damage them healing (or maybe the other way round is fairer?)

monstisla2160.gif

2160

NPC Culling

Culling NPC's was going to be a lot of work so I've been putting it off for a while now, fortunately you don't need to cull them if you don't spawn any!

This ended up being so much effort, a lot of it wasted...

I thought I had NPC's being culled already as part of the [General] culling, things which weren't specified to go into their own lists (like the stairs and the shoreline), but it turned out they were just completely excluded from any culling what-so-ever.

HOWEVER, they still became inactive when I changed room by going into The Underground??

(also, need to do something to stop the pop in here. It's caused by the unculling being done by the sysTimer instead of being triggered by the transition)

monstisla2162.gif

2162

Much to my confusion I was able to get culled NPC's data and their portraits but not their sprites?

monstisla2163.gif

2163

So the way Game Maker is set up, it's not possible to doing things in with() statements if the object is deactivated. So I swapped the with for just putting _npc. in front of all the variables. Not a great method but it works.

monstisla2164.gif

2164

I thought that they weren't animating in the menu when culled, but that wasn't the main issue.

It turns out that paths don't work when an object is culled, even if you reactivate it and trigger it's step code, they'll never update. Also when the Player is Underground NPC's on the Surface start throwing out of grid errors in the debug console.

I eventually figured out how to update their position without using the path_start code, I skip using it and just do;

x = approach(x,destX,spd); y = approach(y,destY,spd);

Now to work out the maths for the spd, if they're culled I need it to be adjusted based on how often they're triggered by the sysTimer (it's broken up into blocks of frames so that 1000's of things don't all happen at once every frame)

It should be something like; timeSpd*(mSpd/path_get_length(path))

timeSpd being the reduced trigger rate and mSpd the speed the Goblin walks.

Next to figure out how to get the sprite animating.

monstisla2165.gif

2165

I managed to get them animating, but it meant putting instance_activate_object in the menu draw code, which I'm not happy with. Must find a better way of doing it. Maybe doing the image_index = approach like I am for movement.

[Realisation from later on]: The reason sprite animations weren't working when culled is because culled entities are only updated 1 in 20 frames, so they are updating it's just so a tiny and infrequent amount it's not noticeable. Multiplying the animation speed by 20 fixed it.

monstisla2166.gif

2166

Lets test out Culled moving speed. Since culled entites are only updated 1 frame in 20, I probably need to multiply their update values by 20?

https://i.imgur.com/5EHSMPY.gif

2169

This might be right? It's hard to tell, especially since they jump on the Minimap (which I don't think looks very good?), also getting some big step spikes in the debug (red bar).

monstisla2170.gif

2170

New math,s lets try comparing culled and unculled speeds. For this test I've set one Goblin to be permanently culled and the other to never be.

I think I have culled NPC's almost moving the same speed as unculled ones. They actually move slightly faster? It's most likely a rounding error?

ez2172.gif

2172

Decided to scrap the 1/20 frame rate for culled NPC's and just run through the culled NPC list constantly in the sysTimer script (outside of the switch that splits it), this shouldn't be any worse than doing a with() statement...
This removes any need to multiply their step or animation speed and keeps everything nice and uniform.

---

I'm not really a fan of having things in more than one data structure, but it's going to be much faster for searching and better for culling/unculling if I add the NPC's to the main Chunk Culling System instead of just having them all in a single list. In terms of speed it means they can check for other NPC's in the same Chunk as them rather than having to run down the entire list of NPC's which would get very slow the more are added (granted it would be as slow if all the NPCs' are in the same Chunk...)

[Sits and waits to see if culled Goblins will walk back into range and get unculled]

...I might be here a while T_T

[Bush wiggles on the right hand side of the screen]

OOO!! Phantom Goblin!! Dang, that means it's still culled, even though it's in range??

monstisla2167.gif

2167

More phantom Goblins!?!

monstisla2168.gif

2168

Realised the issue is with the Chunk Culling System, because Goblins can move around while culled, they're able to move into a different Chunk than the one that stores them.

Then when that Chunk gets unculled, they would be unculled despite being in a different chunk, also if you uncull the chunk they've moved into they WONT get unculled and be phantoms.

Going to have to build a script to update that!

I got that set up and it seemed to be working well, at the end of their wander state they check if their stored chunk coordinates matches the one they're in, if not update and uncull then recull into the correct one!

[Note from later, no I hadn't this was massively broken and caused many bugs and at least 2 days of issues/fixes and led to me changing entirely how something else was done. X'D]

Next up I need to get culled NPC's interacting with each other, turns out you can't do a distance check between an object and another if one or both of them are deactivated, so going to have to run down the cull list!

For now it just uses the basic list of all culled NPC's, but I'll update that at some point to use the Chunk specific one.

monstisla2173.gif

2173

Urgh, started getting massive lag when NPC's were awake?? (note the red bar spiking offscreen)
it's not effecting frame rate, it's just freezing the game for a moment...

monstisla2176.gif

2176

If an NPC is trying to interact with a culled one, they have to turn it on, do a distance check, then turn it off again, that's what's causing the issue. So instead I took that out and used distance_to_point(xDest,yDest) < minDist.

I'll need to update the xDest/yDest values so that they don't walk to the old point but this fixes the issue.

Now, making NPC's work in The Underground.

The Underground is a separate "room" to the Islands surface.

Experimenting with persistence in Game Maker. Seems if I want my NPC's to be able to change rooms (go underground) I need to have both them and the Underground room set as Persistent? All persistent object are moved to the new room, so I guess I need to just toggle that on and off before room change. The room needs to be persistent so I can have them move around and stuff there?

Question is how to move an object to another room, without the player going there. Do I just cull them into a new list until the player goes there or a timer runs out to return them?

Started by working with NPC's who are set to follow the Player.

Had to set up the room start code to place the NPC in the correct place, otherwise they got left behind in their old coordinates and got culled.

monstisla2191.gif

2191

Unexpected bug occurred, if I'm in The Underground for a while NPC's start teleporting to the top left corner of the room??
Thinking it might be because The Underground is smaller than the surface, so the coordinates don't match up and it gets forces in bounds?

Turned out to be related to my edge clamp fix, so it's fixed now.

Unfortunately I then found another similar bug. If you leave and NPC in The Underground and return to the surface, it gets teleported into the sea. Looks like I need to make The Undergrounds room persistent?

ez2193.gif

2193

Ah-ha! Ok! NPC's can now be taken Underground and left there without them ceasing to exist. They're still able to move around and do whatever actions they want. Even added a Static Shader over the Minimap since it doesn't work Underground!Now to figure out if I want/need all NPC's to be persistent or just Lore-related ones. I could just make it so RNG ones refuse to go Underground (or only make them persistent while in the Underground.

monstisla2194.gif

2194

I'm conflicted about the static shader. I feel like I probably shouldn't have the static if I'm going to show the NPC portrait/sprite?If the UI was an in-world item that you had, why would it not be able to show you the general area a Goblin is in, but able to show you their specific location (appearance/terrain).

Also I can't tell if the Static Noise shader glitches out every now and then, or if it's just my brain doing pattern recognition (⊙ _ ⊙')

Now to get NPC's to go downstairs by themselves! I have it working here with hotkeys.

They do seem to spawn in the wall in The Underground though. Turns out it's because the room hasn't been generated yet and neither has it's grid data so they find no valid place to stand and get pushed to the corner, it works if I go downstairs first.

I should be able to get NPC's pathfinding the stairs by using the findInteract code I have for Seating just feed it a different object type (obj_stairsD).

monstisla2195.gif

2195

Hmm, the culled lists are loosing the NPC's when they enter/exit The Underground, seems like they're getting culled twice? Eventually fixed it by removing the cull on room change, leaving it just up to the sysTimer cull.

Dang it, where the Goblin go?!? They're getting stuck in the corner again. It seems to happen randomly?

monstisla2196.gif

2196

It looks to be related to their movement paths? If I use use the non-path system it doesn't happen, so it appears that when you leave the room the path coordinates are scrapped/scrambled?

Using the culled system which doesn't use path_start fixes the issue.

monstisla2198.gif

2198

I'm unsure if there's any actual difference is between running path_start and just using coord = approach(), but I've now got things set up so Underground and culled NPC's use the approach method and that seems to have fixed them getting teleported to the corner when the Underground room is left.

It never happens when leaving the Island surface, so for now I'll keep the path_start for the Goblins there. Even give Shorty some Cheese as a treat. ...didn't seem that happy about it though :/

monstisla2199.gif

2199

I don't think my find stair code works...

monstisla2200.gif

2200

Ok so it seems there's no actual way to send things between rooms. All you can do is make them persistent and set their coordinates correctly. So when an NPC goes to the Underground they actually just go to the coordinates of the Island but act like they're there.

So this begs the question, should I have an actual second room, or just fake it by drawing it over the corner of the island, disabling everything else while I'm doing it?

https://i.imgur.com/EKhsNBh.gif

2202

Definitely hit a wall with sending/retrieving NPC's to The Underground, anything culled while the Player is there will cease to exist when you leave to the surface and there doesn't seem to be a way around it.

Even setting both rooms to persistent doesn't work. Turns out there's no way to do this as the internal instance lists are room specific, so anything that's part of The Underground can't be found from the surface. Looks like I'm going to have to discard The Underground as a separate room...

First step of reworking it as part of the surface! Swapped out any code that checks for the current room, and replaced if with a check for the players curRoom variable which I update when their touch stairs (or in this instance hit the hotkey)

https://i.imgur.com/mRPPgXx.gif

2203

That's the next part done, instead of generating The Underground the first time you go there, it's grid is set up on World Gen and it's objects are placed. Next, give them their own curRoom variable so they can be culled when the player has the correct curRoom value!
Because some of The Underground walls requires depth I've had to add a for loop to destroy their tiles when you leave, it was going to be the same code to hide them so may as well just make them every time.

https://i.imgur.com/L0FpxQ5.gif

2204

Fixed the uncull pop in, had to change the code order and move the camera before the player so the unculling happens first. Seem to have excluded the Teleporter, it's not got a parent object so I'll have to through that in as an extra condition.

monstisla2205.gif

2205

Now that's all set up it was time to try the NPC's again. Didn't initially work, they were becoming the same weird glitched state they were from the previous version. It turned out it was thanks to the Chunk Update cull code. When they fixed the Chunk that stored them they were being removed from the NPC cull list, which then returned a null value and they ended up being lost. So maybe I didn't need to do all this?!?
Well this way stairs work without any additional faffing about so I'm happy I did it all.

And now NPC's can find stairs, go underground and come back, whether the player is in the same curRoom as them or not!

Portraits

Decided I needed to fix the blink speed of portraits, also needed to fix the number of frames since it seems to miss the last one.

monstisla2174.gif

2174

This is much better! Even added a delay before the next blink cycle, realised I wouldn't need an extra timer for the delay if I just checked if it was on the last frame and if the current_time (number of seconds since game start) was divisible by how much of a delay I wanted!
I can probably use check for a bunch more stuff like this, will have to try keep it in mind!

monstisla2175.gif

2175

Decided I wanted an outline around my Goblin portraits but couldn't be bothered to pixel it, so I've thrown them onto a surface and used that to apply a shader! This should also reduce the amount of things drawn to the screen at once? Like, once they're added to a surface, drawing the surface only counts as one thing right?

Added backgrounds to portraits based on entities location! There's only a few so far, still need to draw the mostly flat [Rockland], [Bog] and [Darkgrass] areas (also maybe the deeper water but that shouldn't really be accessible....)

These are set up in such a way that I could animate them, but I don't have time to do that right now! T_T
Also I could adjust them for time of day? (maybe just blend some blue light over them? Might make them hard to read)

monstisla2180.gif

2180

Well since I've got backgrounds added to portraits I should probably do something to the character sprites too right? Oh dang here comes a big rework!

The way the world is draw is that it's only drawn when on the screen, the game runs through 2 for loops in the World ds Grid starting at the edge of the screen and draws the tile data that is stored there.

I can use that same code to draw the floor that an entity is standing on, but to the Town UI menu!

If before I draw it I set up a temporary surface and cut a circle out of it, I can have a nice little slice of land under the NPC sprite. This is a very hacky implementation and doesn't have any of the additional layers, but it works as proof of concept!

monstisla2181.gif

2181

Added a second circle, this time it's just one of the menu colours so it looks less like the NPC is just floating in the menu.

I'm liking having this approximation of the terrain below the player, but it's never going to be fully accurate it can only ever show the rounded position terrain since I'm using the grid data.

Behind the cutout I'm drawing a 3x3 of the grid data centred on the entity, maybe I should change it to just replicate the tile they're standing on instead?

monstisla2182.gif

2182

The hacky version worked, but I wanted to reuse the draw_world script. That means adding in the ability to define how big an area to draw (instead of the whole screen) and adjust the values since drawing to the GUI isn't the same as drawing normally (usually it would require an offset based on the camera position).

This was an absolute nightmare and too so much trial and error. I wasn't able to get the offset to work no mater what values I tried so in the end I just added an argument to tell the script if it was drawing to the GUI or not.

Might have broken somethings in the process...

ez2183.gif

2183

There we go, all working using the same script! THIS WAS SO MUCH WORK (╥﹏╥)

One issue with system is it can't draw shorelines? They don't exist as tiles, but as objects so they don't exist in the grid data. I suppose I could rework them to be so, especially since shoreline no long acts as collision checks for water based things (sailing/fishing etc).
Additionally, I'm thinking it might be cool to add a dome over the NPC? So they're like a little figurine?
I hate drawing glass so that can wait for now! X'D

monstisla2184.gif

2184

Misc

Fixed a bug where NPC's which are following you weren't able to Emote, previously they'd loose their follower status and end up in a bugged state.
This shouldn't come up in normal gameplay, but might be cool for cutscenes and stuff?

monstisla2161.gif

2161

Was faffing about trying to make my Goblin sprites only draw partially when sleeping and being in water...but that's dumb! Instead lets make them find dry land before sleeping!

Uh-oh! Glitched Goblin! I'm guessing the Emote animation got interrupted by sleep. Gotta add a state check to the State update, make sure they aren't doing something else first!

monstisla2185.gif

2185

Updating my Lightning to be a bit juicier! Added particles too them, but it made this weird box appear?

Turned out to be because of the Blend mode used to make it work with nighttime.

monstisla2187.gif

2187

I was going to make two sets of particles, one above and one below for the lightning strikes, but just having 5 in random directions actually works.

monstisla2188.gif

2188

Tripled the lightning! Really like how this looks.
I don't have a way for them to jump between each other, but they still look quite good like this with random spawn offsets. Not sure if I should also random the y spawn offset? Might experiment with random odd spawn amounts, 1/3/5 maybe.

https://i.imgur.com/2Xutt4l.gif

2189

YEA! That looks way better! (also reduced the height of clouds and by extension how long lightning is.

monstisla2190.gif

2190

Bug Fixes and small Changes

-Made Lightning Burn Trees for much less time.

-Trees hit by Lightning now produce Charcoal instead of Logs.

-Fixed Player shadow when sitting.

-Fixed Shelf tops not being loaded in NPC Buildings.

-Fixed NPC Buildings not loading all of their customisation's if saved while culled.

-Fixed Wall Hangings not keeping their correct image_index between saves.

-Fixed a bug with Loading a Save file...junk code line!

-Fixed a bug where Seating didn't save unless was part of a Building.

-Fixed a bug where Pots on Benches weren't saved because the switch checked for subTypeID instead of subObType.

-Reworked Save/Load system to have less redundancies and repeat code.

-Fixed resizing Buildings leaving Seating outside.

-Fixed mouth and blinking speed and delay for portraits.

-Fixed drawing offset for sleeping bags so they're centred on the NPC's location.

-Fixed NPC's rapidly changing direction when moving small distances.

-Fixed NPC's getting stuck in an emote when entering Sleep State.

-Fixed other Hanging Objects producing acting as light sources.

-Fixed not being able to hang Hanging Objects on freestanding Walls.

-Fixed being able to name yourself/Island/Community/Food/Thing 0 length strings.

-Fixed NPC duration failsafe for NPC's pathing.

-Fixed NPC spawning from making duplicate Patron NPC's if they were Culled.

-Fixed NPC's walking out of bounds of the World.

-Fixed NPC's teleporting to the edge of the World when unable to find a valid path.

-Fixed NPC's rapidly changing facing direction when walking small distances.

-Added duration to Attack Effects.

-Added % Item chance to Objects Burning so it's not a guarantee.

-Added pathfiding dryland for NPC's in water when time to sleep.

-Added fix to stop NPC emergency teleport from placing them out of bounds.

-Updated how Buildings mark their Parts/Objects and how the game checks if you can move/delete them.

And that is it for August!

I hope you all have an amazing September, please look after yourselves and keep being awesome!

parade045.gif

Thank you all so much again for your support and interest, I really do appreciate you all!

 

gobo-kiss-winkhalf.gif


4 comments

Loading...

Next up

I got bad rng recording this, but it works.

Today I'm mostly just cleaning up the code from the last couple days, so please enjoy my Goblins dancing. Thank you.

Happy Sunday everyone! Hope you all had a great week!

I'm off to lunch, then when I get back I think I'll set up the blacksmith building!

About time the Goblins had more things they can do.

Please look after yourselves and have a fantastic day!💚

Play our game, Bloodless, and complete the Help Tomoe quest to unlock the Bloodless sticker pack!

Start the quest: http://gamejolt.com/#quest

Game Jolt has given out all of their free Steam keys!

Got the Smithy set up, but resizing it is glitchy...

I think I might have to give up on this layout and do it like the others, where the back area is blocked off by the countertop.

Happy Video Game Day! 🎮

Celebrate by completing our quests!

(They'll be in your quest log until September 19th.)

Coded a 9slice system and got an expandable rug set up for the Smithy! Next make a nicer floor tile for the rest of it, I think I might just use the Rockland floor tile, I don't like how this floor is broken up into actual tiles.

so darn cute 😭🥺 edit: i'm having lasagna for dinner by coincidence, lol

Things my Goblins can do so far!

-Farm Farms and Orchards (only chop Trees so far but they do get fruit at the start)

-Sit in chairs.

-Go to and from The Underground

-Wander

-Work in Cafe's and Restaurants selling Food.

-Work in Smithies selling Ingots.