Slugbroom banner

Slugbroom

15 devlogs
51h 52m 18s

A 2D procedurally animated survival exploration game similar to Rain World.
This game is made in C++ with and has its own custom engine. It uses OpenGL for rendering, Box2D for physics, glm for math and freetype for text rendering,

Slugarius

Improved the spider legs and AI, the legs now ray cast 20 times in a circle around the spider body and a list of viable leg targets are made, it then chooses 8 of those targets based on how spread apart the legs will be. The spider AI also got buffed so that it climbs wall and doesn’t jump whenever it detects one.

4

Comments

kuratus89
kuratus89 1 day ago

your project looks very cool!

Slugarius
Slugarius 1 day ago

ty!

Wando
Wando 1 day ago

THIS IS AWESOME

Eli Nelson
Eli Nelson 1 day ago

Wow this is really neat!

Slugarius

I worked on adding the spider AI. The spider checks in a certain radius from its body and checks if there are any bats or a player in the radius, if there is, then it sets that body as its target. There is a special case for eating batflies and players, for batflies, it calls the Batfly_Die function, whereas for players, it calls Player_Die.

0
Slugarius

I added a spider to the game!
Its legs IK work the same as the player but there are 8 of them and they all have 3 segments.
And it only has one rigidbody, its body.
I’ve only made the IK and legs though, it’s moved around with A and D which isn’t ideal.
I’m gonna add some AI for the spider next devlog.

1

Comments

Jadamek1337
Jadamek1337 4 days ago

nice

Slugarius

Added a menu! I’ve added two different scenes, a menu scene, and a campaign scene, I add all the components to the campaign scene beforehand and save it, then I create the menu scene and create an entity with a menu component. I also made a title screen similar to Rain World and made some cool art for it, it makes the opacity of the start image transition from 0 to 1 to 0, and then makes all the menu text and images fade in.

0
Slugarius

Added eating. You can pick up a batfly and press F to start eating it. It will set off a 0.5 second timer in which your hands’ targets are briefly your head to make it look like you’re putting the batfly to your mouth to eat it. And then it will destroy the batfly and fill up one of your hunger pips.

0
Slugarius

Added batflies, there’s a new component for a batfly now. They have two sprites, a wing and a body. There are four wings that are anchored to the body, there’s an AnimateWings function which makes them flap up and down. There’s a FlyAround function which raycasts in 8 directions from the body, and chooses a random free direction to go in. The batfly also rotationally adjusts to keep itself upright, and slightly tilts in the direction it’s going in.

1

Comments

alarixfr
alarixfr 8 days ago

this lowkey scary

Slugarius

Added crawling to the game. You can now press down to enter crawl mode, the legs’ rotation will be unlocked and you will collapse on the ground, this lets you get into narrow one tile wide corridors, which if you’re in, you can navigate because gravity is disabled when you are in a confined space. You can press up while you’re crawling to exit crawl mode. The head’s rotation will also be locked once you enter crawling.

0
Slugarius

I added a map mode to the level editor which lets you place levels on a grid and you can visualize the map you’re making. I also changed the format of the levels to make them more human readable. I added a level class to the game to load the map. I also made the camera track the player through screens.

0
Slugarius

Added items. You can pick them up by getting near them and pressing shift to pick them up. There are IK solvers for the hands and the transforms of the hands are attached to their IK very similar to the legs, but the sprites are only visible when there is something held in the hands. There can be two things held at once.
I also fixed a lot of the collision filtering because I was stupidly putting the f suffix at the end of hexadecimal literals. There was also a bug where the category bits for the level weren’t working and I had to apply the filter to the chain definition instead of the shape definition of the rigidbody.

0
Slugarius

I made ropes. You can climb them when you press up when you’re next to a rope. I added a circle cast to check for ropes in a certain radius.

0
Slugarius

I made a few changes to the level editor, like adding slopes and also I changed the bitfields from having 1 byte be a tile to every 8 bytes since I now have slopes as well as regular tiles and I need to differentiate between the two. I made it 8 bytes to make it easier for the computer as well as to future proof if I need to add more tiles. I added two new features to the level editor, rendering as an image, and exporting the level collider. The rendering renders the level into an image where each tile is 20 by 20 pixels, the colors are extremely boring because I will use this render as a base for me to paint over and actually make a good level. The exporting colliders takes in the bitfield of the level, finds every edge and saves it in a counter clockwise winding order to a file. I made changes to the actual game by adding a function that converts this collider file into a vector of points. I added a new rigidbody collider type called Chain. I used tons of boxes in my previous project to make the colliders for the level, but to optimize the collision in this project, I used chain shapes in Box2D which makes collision for the environment a lot simpler and faster.

1

Comments

Freddie
Freddie 16 days ago

WOW! this looks so cool!

Slugarius

Started work on the level editor for the game. It’s gonna be pretty similar to Rain World’s level editor.

0
Slugarius

I upgraded the player character. There was a problem where I was using the CastRayClosest function in Box2D incorrectly by assuming the second argument was a vector that was the end of the ray but it was actually a direction and magnitude for the ray to go in and so it fixed my problem that the endpoints of the legs were drifting left or right. I also made the legs overshoot to maintain balance. I also changed the IK solver to have a pole vector so the legs always bend outwards making it look a lot more natural. I also made it so the legs hover in mid air when you’re not grounded but it looks a bit silly since I didn’t code it properly.

0
Slugarius

I made a player character that is heavily inspired by the slugcat in Rain World. The body is composed of three rigidbodies, a head, a body and legs, which are connected by joints. The IK for the legs is purely visual and the collider for them is a circle. I used lerping to get the legs to move smoother and the legs shoot a raycast whenever they get too far from the body and the legs land at the hit result. There are four leg sprites whose transforms are adjusted every frame to match the segments of the legs.

0
Slugarius

I got a window up and running!

Attachment
0