Please sign in to access this page

Inhabitants (Minecraft Mod)

Inhabitants (Minecraft Mod) Used AI

27 devlogs
32h 55m
Created by mattseq

Minecraft mod that adds fictional fauna. More can be found on the Github page and in the Team Obsidian Discord: https://discord.gg/xyUefhk8

Repository

Timeline

did a few things now: fixed a bug with capturing the gazer with the pod item while its pathfinding to a pod block, updated the helmet (finally!) to being the right side up, and made it possible for the gazer pod item to be placed down as a gazer pod block. Here are all the commits I made today! Overall, very productive day, not sure how much there is left, mostly just QoL and niche stuff, making it more clean and professional, less buggy, more consistent, etc.

Update attachment

i gotta go EAT so heres a picture of my git commits with all the stuff. i made the gazer pod feature only spawn on crimson nylium so it doesnt spawn on trees, fixed gazer spawning and discarding by making it do so only on the server side, and added sounds to entering pod and exiting pod. I also identified a problem with capturing the gazer with a pod item while its pathfinding to a pod block

Update attachment

now it should only spawn on crimson nylium, instead of on top of the trees. it seems to always spawn next to a crimson nylium block too though. they are might be some desync between client and server (honestly i expected as much) which i'll need to investigate and fix before a full release

Update attachment
Earned sticker

So i had to mess with a part of modding that i've never really touched before: datapacks. After a decent bit of research on the minecraft wiki, I figured it out, but i couldnt get the pods to spawn. Turns out, they WERE spawning, just on the nether roof. From there I had more problems so I just looked at how Minecraft configured stuff like crimson fungi to spawn in the crimson forest. After some more messing around, I got it to work. They now spawn very infrequently in the crimson forests. It also seems like they might be lagging the client a lot so i gotta fix that. Also they usually spawn on the trees and occasionally inside them.

Update attachment
Earned sticker

modified the block model and texture to include a new bone: the gazer. I made it show the gazer inside the pod while it has a gazer and show an empty pod when it doesnt

Update attachment

So I'd been trying to fix the destroy block particles for the GazerPodBlock and nothings worked so I decided to just overwrite them and make my own destroy particles. I think it looks a bit better and more nether themed.

Update attachment
Earned sticker

Another important update. The pod block can only be mined with silk touch pickaxes and the mining speed now correctly matches that of netherrack. it also drops a gazer pod item with the correct nbt data (different depending on if the pod block had a gazer or not)

ok i made the gazer pod entity into a block (technically a block entity). i had to change a few things but it works pretty much the same way. the one new problem is that when its mined, the destroy particles are from purple and black null texture minecraft uses, instead of colors from the gazer pod block's texture

Update attachment
Earned sticker

gazer pod entity and item now only receive gazer after animation, fixed bug with controlling gazer. took a while bc i ran into a ton of bugs caused by the old code, which really didnt like how i was doing it now. now i just need to switch to using a block instead of an entity for the pod and then make it use a different model when there is a gazer in it

Earned sticker

I tried making the delta movement of the gazer stop after it completes its pathfinding, not sure if it really works better but its pretty accurate already. Rn I'm trying to make both the item and the pod entity update with whether or not they have a gazer only after the animation so theres no weird confusions.

Update attachment

nvm i figured it out! I just looked at Minecraft's code for the Bee reall intensely for like 10 minutes and found this line in its constructor: this.moveControl = new FlyingMoveControl(this, 20, true); It works really great now. I guess the pathfinding didn't seem to be working because the Path it found was one that goes up and over the obstacle since its the shortest but the moveControl wouldnt allow it to fly over so it just went forward into the wall. Now I need to switch the GazerPodEntity to a block bc its better for the design

Update attachment
Earned sticker

Ok so i kind of improved some of the GazerEntity's navigation but I can't make it pathfind properly for some reason. It won't really go around obstacles at all and never changes its y-level even if its target is below it. And there are no videos or anything else that talks about how to do this. THE POD WAS SUPPOSED TO BE THE EASY PART.

Update attachment

Ok i fixed the client-server mismatch with discarding the gazer for real this time. I accidentally removed the client side discard called in the animation controls and so the only thing changing it was on the server bc it used the timer on the server thread. There's still a client-server mismatch with whether the gazer pod entity has a gazer or not but everything still works fine. Here's my todo list for the Gazer Pod. I thought this was gonna be easy part :(

Update attachment
Earned sticker

fixed the gazer dying (technically entering pod problem). it was bc of only the client getting the discard method called like i suspected. bc i wanted the discard to be called only after the animation finished, i put it with the animation logic, but that only gets called client-side i guess. Anyway, instead of doing it after the animation finished i just used a small timer. Now I'm running into some bugs with using the pod entity and item together.

Update attachment

Almost forgot about the gazer pod entity so i started on that recently. Shouldn't be too hard but im worried about the problem from earlier about the gazer's not actually getting discarded properly. I wonder if maybe that's only getting triggered on the client side because it happens after the animation; it would explain a lot.

Update attachment

Made it impossible to attack other mobs when in control of the gazer, made the right click make a little more sense (before, the hand would move regardless of if you actually clicked on the gazer, giving a false sense of whether it was clicked or not). I also added the item to the creative mode tab with the necessary nbt data.

Update attachment

Made the overlay when wearing the gazer pod. Looks crappy but I'm not the artist. Spent the rest of the time trying to figure out two things: why whenever i do /kill @e[type=inhabitants:gazer] does it say it killed more entities than however many i spawned and why can't i control the gazer when i save and quit and get back in. Didn't get anywhere with those two problems unfortunately, but it's possible I fixed some other problems without realizing it since I switched from usnig IDs to UUIDs for most of the handling of gazerIds from the GazerPodItem

Update attachment

I'm lazy and need to go to sleep, here's my commit message instead:

ownership stays after quitting and other bug fix attempts

use UUID instead of int ID for gazerId in GazerPodItem, use EntityDataAccessor for enteringPod flag too, modify other goals to work with FollowPodHolderGoal

and this still doesn't work:

Update attachment

Did a lot of small but important things today: added animations and made gazer go toward owner when entering pod, added flipbook animations, and switched from just using variables to using synced EntityDataAccessors for better client-server syncing. Here's a video of the whole thing. There might be a small problem with the goal that makes the gazer go to the owner when entering pod and also the right click is misleading bc it always shows success even when you don't right click on the gazer.

Added the textures and made them change depending on whether the pod has a gazer or not. btw, i didn't mention, apparently the pod is supposed to go the other way on your head so your head goes through the hole and it looks like a hat so i have to fix that later. Also prevented it from being equipped as a helmet if it contains a gazer.

Update attachment

Ok so I spent about an hour and a little setting up the behavior with the entity and item and how it's used as a helmet. And then, IntelliJ stopped working. It was some weird JDK problem. IntelliJ just messed some stuff up, I have no idea why. Anyway, after spending like half an hour fixing that, I finished up the mechanics with the gazer pod and gazer. Now I'm going to just do some polishing, check any potential edge cases, get the texture to change depending on whether or not the pod has a gazer, and then show the team. Oh and get the animations working. I don't know why I didn't do that earlier.

Update attachment

So i made the pod item a helmet now and added a keybind to start controlling the gazer. Haven't finished it yet so its not committed but heres a picture of the pod on my head taken from the third person perspective of the gazer

Update attachment
mattseq mattseq 26 days ago
actually i’ll commit it right now

Well i fixed the bug from earlier, it wasn't exactly chunk loading that was the problem but it was distance from the player. i tried to make dynamic chunk loading for the gazer when it was being controlled but it doesnt work. i'm going to start working on the actual behavior for the mob now instead and get back to that later.

Update attachment

After ONE WHOLE HOUR of debugging and trying different things, I know what's really happening. I was explaining the problem to my brother who only knows basic python and he immediately said to me, Oh, it's out of render distance, isn't it? Brain short-circuits bruh. The desync wasn't really the problem although it could have caused problems anyway. The desync no longer happens, at least not enough, and i completely forgot what i changed. Now I'm probably either going to find a way to keep chunks loaded where the gazer is or have the player lose connection to the gazer and make it a game mechanic. Here's a screenshot of the client sending a GazerControlPacket and the server receiving it but not moving or updating the Gazer.

Update attachment

Ok so now the player can control the gazer, it just switches to the gazers pov and uses the player's control and sends those inputs to the server for use. It seemed to be working great and was only a little jerky, but I just discovered something TERRIBLE. The client and server's positions for the gazer are not synced. This leads to the gazer getting stuck and glitching into blocks and the camera sticking there but the gazer keeps moving. As the gazer is used, the differences between client and server slowly accumulate. I kind of assumed client and server would be synced but I forgot that I was sending packets with the client's input not the client's position for the gazer. I don't really want to rely on the client for this since its not very secure and open for hacking but nobody would do that on a mod, right??? I'll have to use the gazer's movement, not position, because changing position every tick would appear very laggy. Here's a screenshot of the logs that shows the syncing problem:

Update attachment

got the camera and some control stuff working. it doesn't feel the smoothest but its not laggy. i could have used the passenger system for this but just switching the camera seemed easiest and i want to stick with that. im working on yaw and pitch now and then moving relative to the yaw and pitch. I would upload a video or picture of it working but I already launched Rocket League so... here's some code ig

Update attachment

Began working on the Gazer. It's a very unique mob and probably going to be very tough to implement but things are going well so far. Basically you can control it and use it to scout. I have a good structure for how the entities AI will work and the camera and movement setup should work. For the first time, Minecraft actually has something for switching to a mob's camera already. I'm having some trouble with server and client differences and ownership between Gazer Entity, the player, and the Gazer Pod Item which the player uses to interact with the Gazer.

Update attachment