Continuing from last month, I've scrapped The Caves as a separate room and done them the same as The Underground.
Took quite a bit more code rework than I expected, had to move the code from Room Start to a new script that gets triggered when you activate the Stairs. Main issue was a lot of the code was all over the place so I had to de-spaghetti it and make sure I had it happening in the correct order.
2210
Next, make it so Goblins and Pets can follow you into the Caves! I just need to remove the curRoom check that stops it, the existing code for going to The Underground should work.
After that, I need to decide what I'm doing with NPC's in The Caves. I've got it set up so you can't Split Up from them, but I could make them leave on their own back to The Surface, or just have them automatically follow you to the next floor/ The Surface.
https://i.imgur.com/QV890iI.gif
2209
One issue I need to address (and have been unable), because of how I've been cropping The Caves to avoid having to make rooms with unnecessary empty space, if you zoom out when in them the floor gets drawn offset incorrectly.
I think the issue is something to do with the view clamping.
I set it up so the view wouldn't go out of bounds and would be centred even if there was empty space to the left or right of the generated caves, but I can't seem to adjust it to fix it. I'll get it eventually!
2211
Lets do some NPC things!
First up, just checking that Seating still works after last months pathfinding and NPC reworks.
Had to fix a bunch of NPC bugs I made when I got them to interact with Stairs, I don't think I've got them all yet, but it seems to be all working again.
The second I stopped recording the Goblin on the left teleported off the chair...
Seems like there was some left over code from the WAY old collision path finding that was causing issues. That combined with NPC's not fully leaving the collision box of the Seating caused them to get teleported into the ocean. Figuring this out took WAY too long T_T.
2212
Found an issue with my findInteract code.
It looks for an object to interact with, if it finds one it adds it to a list.
It then takes the closest one and tries to plot a path to it.
If it succeeds it sets a path and the Goblin goes there.
BUT this means if it fails, it will try again with the same object, over and over unless it moves first changing the distance.
Need to update this to add some randomness...I'd rather not keep track of the last thing interacted with.
Maybe this will be less of an issue once I've programmed them daily routines?
Since Goblins have the data of the Object they're interacting with, and since they were floating in the menu, I added their Stool to the Town UI.
Looks like there's something wrong with the yOffset though, seems I wasn't taking the Flooring offset into account, had to add it to the Goblin sprite and remove it from the Stool.
2213
Had the idea of adding a [Specials Board] to Goblin Restaurants. Figure each day they'll have up to 3 things on special discount, or maybe bonus amount for sale?
2215
Since I'm on Restaurants lets keep going. Set up Cook's job paths, added their Stone Oven.
Thought I was having issues at first but it was the wrong time of day, I thought work started at 10, but it was 11!
Unfortunately I made two different systems for pathfinding, one for NPC's to find their Jobsite (for Farmers and Foresters), and one for NPC's to find objects like Seating, Beds and stuff.
There wasn't going to be a convenient way of combining them, so I just decided to use the non-jobsite version for the majority of Jobs.
There are three entry destination points for an Oven, initially set as left/right and centre of the Oven. The offsets aren't quite right here though, Shorty ends up standing in the walls.
2217
Fixed the Oven interaction offsets, making it 3 places in front of the Oven instead of 2 at the sides.
Also added smoke particles, which I should really add to all furnaces and the like at some point.
I was really worried I'd have to make a separate particle system for each building but I think I can just use the one in my Surface Object that deals with lighting and stuff as that particle system is always on top of everything.
Does the grey look ok for the smoke? I had it white at first but it looked more like steam, maybe I'll lighten it a bit.
Also updated the Bartops to be Countertops, with a nice little glass window.
2218
Hmm, you can't resize Restaurants...also I'm getting duplicate tables XD
Gotta redesign the Build code! Bartop and Countertops are classified as Walls, so it's not possible to resize past them, will have to add an exception. Will reclassify as "Barriers"! Then I'll need to include them in the OutsideRoom check to destroy them if they're no longer inside the rooms boundary.
Added tables to the important object list and remove them from the rebuild part.
2219
Added a Till to the Restaurant NPC pathfinding. This doubles as a way of buying Restaurant food while the NPC is busy with other tasks. (Thought you can't use it when it's closed!)
2220
Added Tables to the pathfinding! I had to make the Tables have slots for Seats, so the pathfinding code could know which Seats were in use. If a Table has at least one Seat in use then it gets added to the pathfinding list. If the NPC moves to that Table, they place food in front of any Goblins sitting at the Table!
2221
This works, but I think I need to add a check for how long an NPC has been sitting, the Cook can end up going to a Table that's already been left before they arrive.
2222
That's better! It does add the food before they even sit down though X'D
Guess I need another check! Maybe throw in check for NPC's current State.
2223
New NPC Building! The Smithy!!
A place to get Ingots and Tools!
Dang, seems the expansion code needs another rework! Ended up doing some pretty extensive reworks of how Buildings are done, including updating the Build Menu Draw code.
2224
Reworking the Building Expansion code I found an issue with Cafes too. They weren't expanding the same for each direction. It made no real difference, but it looked weird how not all the Outside Walls were being moved (instead being recreated), much prefer it to look uniform.
Here I've turned off the Rebuild code that fills in the Wall gaps, so I could figure out what the issue was.
2225
Blacksmith NPC's are able to find their work points. I think I'm going to make it so only the Furnace is a default part of the building. That way I can have the Anvil and the Waterbath give additional effects.
For each they'll increase the quality and types of things you can buy, but I'm not sure what good JUST a Waterbath would be? It makes sense as a final part of the Forging process, but would it be of any use if you don't have an Anvil?
2226
Figuring out how to split the Smithy's floor type by detecting where the horizontal Countertops are was going to be a total pain in the butt. SO I decided to draw a Carpet in the Shop part of the room, using the position of the Control Orb as a starting point.
Since GMS1.4 doesn't have a 9slice system, I had to build one from scratch! It wasn't too difficult, main problem was figuring out how to split it up to use as few loops as possible to and to stop the repeats going into the corners.
After I got it working I ripped it out of the draw code and made it it'sown little script so I can use it in other places, just have to feed it a start x/y, a width/height and the sprite to use!
2229
Calendar Update
October 1st is my birthday (👉👈), so I had to set something up for it...
I reworked the Mail System so Goblins can send you a message and a gift to celebrate!
Obviously you need a Mailbox or you won't be able to collect them, so maybe I should add a message to build one?
Looks like I messed up the loop, either that of Shorty REALLY wanted to celebrate my birthday X'D
2227
Updated the Character creator so you can set your Birthday. Usually you won't be able to change this during normal gameplay. I think I'm going to change the Calendar to have 32 days in each month, letting people set their Birthday to their real life one feels better than doing something dumb like trying to match real world day counts. This does mean I need to invent a new day...or I could keep 7 days in a week and knock it up to 35 days in a month.
Either way, I need to redraw the Calendar :(
2228
There we go, correct looping! Here it's triggered my a hotkey, but I've coded it so the morning of your Birthday you'll receive mail from each Goblin Resident (not including Merchants, who are temporary Residents of the Island).
When I get around to reworking Friendship, I'll make that play into the Quality and Type of Item they can send you, currently they pick a random item from this awesome list: (CHEESE,PINEAPPLE,WALL_MEAT,PINEAPPLE_PIZZA) >:D
2230
New Crop!
There's a few Items I've been meaning to add, but before I could I needed to add a new Crop, Sugarcane!
Here it can only be grown in DarkGrass, but I think I'll make it grow in Grass too, but at a slower rate.
Once collected you can cook it in a Campfire to make Molasses. I'd prefer to cook it in the Cooking Pot, but that would require a recipe and I've so far avoided 1 ingredient recipes (instead things like the Campfire Convert one item into another).
Forgot to set it to edible...dang it XD
2232
New Tool and Stats!
The Magnifying Glass! I was going to have a different item for this, [Soil Kit], but it seemed a bit too advanced tech-wise so for now you're just looking really close to the Soil. I can always change it later!
This lets you find out information about your Crops and I totally didn't just add it for Debug purposes...not at all!
I've also updated all Crops and Flowers so that they have preferred Land Types and Seasons, which effects how fast they Grow and Wilt when not hydrated. They also effect how fast the Soil dries out!
2236
Also added Seashells because I need them for some crafting recipes, but I'm not sure where you're going to get them.
I like the idea of them washing up on the Shoreline, but I'm not sure if the sprite really works for that.
The other option is to dig them up on Beaches, but it's currently set so you can't dig there. (Originally I didn't want to have to save massive amounts of dig spots on the Beaches/Deserts but maybe it's time for a rework)
That said...I do have these Crabs...
2234
Bug Fixes and small Changes
-Fixed NPC's not offsetting correctly when Sitting.
-Fixed NPC's Object Interact State getting bugged when talking to playing.
-Fixed NPC's getting stuck when leaving Sitting state from some directions.
-Fixed? The bug which caused NPC's to sometimes teleport to the top left corner of the room.
-Fixed NPC's getting stuck in the wrong animation.
-Fixed a bug where NPC's wouldn't do anything between 17:00 and 18:00. X'D
-Fixed and reworked the Building resize code, seems there was some oversights despite it actually working (the destroy/recreate code was fixing any issues it produced X'D)
-Fixed Walls connecting to Barriers.
-Updated NPC findInteract code to let them find things deactivated in the same SubChunk as them.
-Reworked the code for the Build Menu drawing NPC buildings. Since they're made up of parts and some things like Tables, also build Stools I've compressed the code to remove any repetion.
Think that's everything for this month?
Thank you all so much as always for your support, it really means the world to me and helps keep me motivated!
Please look after yourselves and stay safe out there.
And don't get sick from eating too many sweets!
0 comments