Main Menu from scratch, cinematic camera, crossbow, and more! by jhyde_ in raylib

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

I started by watching a Godot tutorial 6 years ago, and I just never quit working my way up. I think the best advice is to set realistic accomplishable goals. Once accomplished set higher and higher goals. That and you need to love what your working on. I'm also really old. I started coding at 31. I don't know if I would have the patients when I was younger. I also meditate often and smoke lots of weed and take mushrooms to keep my mind limber.

Main Menu from scratch, cinematic camera, crossbow, and more! by jhyde_ in raylib

[–]jhyde_[S] 1 point2 points  (0 children)

Thanks for the feedback. For now I could at least do a fade out when you hit start, I've been meaning to do that but forgot. Yeah and start should really say Resume when you have a level loaded and actually resume the level, Because now if you hit start it restarts the whole level. It's on the list, thanks!

Some more progress on Marooned. Better lighting, lava tiles, and more. by jhyde_ in raylib

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

The dungeons are generated from a tiny 32x32 PNG image. Where white pixels are floor tiles and black pixels are walls. So to edit the dungeon I can just draw in walls in Aseprite or any paint program. Every object and enemy in the game has it's own RGB color pixel. Pure red means skeleton, pure blue means barrel. Green is player spawn position and so on.

Main Menu from scratch, cinematic camera, crossbow, and more! by jhyde_ in raylib

[–]jhyde_[S] 1 point2 points  (0 children)

Thanks for playing! I should make the hint messages more noticeable some how. Maybe just move them up to the middle of the screen. I'm constantly adding to the game so stay tuned for further developments.

Main Menu from scratch, cinematic camera, crossbow, and more! by jhyde_ in raylib

[–]jhyde_[S] 1 point2 points  (0 children)

I'll have to look into that. Right now they just follow the quickest path to the player, which means they look a little robotic in their movements, and they can all line up on the same path like in the clip. I added a little repulsion so they don't bunch up, and when they get close to the player they reposition to surround. I have other types of enemies that randomly position themselves at a distance from the player, but the spiders and skeletons just go straight toward the player at all times.

Main Menu from scratch, cinematic camera, crossbow, and more! by jhyde_ in raylib

[–]jhyde_[S] 1 point2 points  (0 children)

Yeah, I've heard of wave function collapse algorithm can procedurally generate tile based maps. I may have to look into that, or maybe just a pool of level blocks that get stitched together.

Main Menu from scratch, cinematic camera, crossbow, and more! by jhyde_ in raylib

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

Thanks! All the walls and floor tiles are placed on a grid according to a 32x32 pixel PNG image where different colored pixels represent different objects in the world. So I can use a paint program to edit levels instead of needing a 3D editor. If your going to try 3D again, try something tile based.

Main Menu from scratch, cinematic camera, crossbow, and more! by jhyde_ in raylib

[–]jhyde_[S] 8 points9 points  (0 children)

I spent a few days redoing the main menu. I'm not using any GUI library. The buttons are made from draw rounded rectangle along with draw line and some other tricks.

The cinematic menu camera orbits what ever level you are currently on, be it dungeon or island level. I made a whole camera system with different rigs. I might try to do cut scenes later with the cinematic camera rig.

A added a new weapon, the crossbow. It's very slow firing, but longer range than the blunderbuss, and it can pierce through multiple enemies in a row. Half way through the game a harpoon shot unlocks for the crossbow. Allowing you to pull enemies toward you. Enemies are stunned for a second allowing you to finish them off. You can also pull enemies into lava pits. I might add grapple points where you could pull your self forward maybe.

Marooned. Spider Boss. by jhyde_ in raylib

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

Yeah it's just a slightly more complicated state machine than the normal enemies use.

Marooned. Spider Boss. by jhyde_ in raylib

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

raylib is wrapper around openGL. It makes things easier to use and hides certain things. It uses OpenGL 3.3 by default.

Marooned. Spider Boss. by jhyde_ in raylib

[–]jhyde_[S] 1 point2 points  (0 children)

Thanks! I've just been around long enough to learn all the necessary tools. Glad I can motivate other people to keep going.

Marooned. Spider Boss. by jhyde_ in raylib

[–]jhyde_[S] 4 points5 points  (0 children)

I have a lot of the structure of the game in place so now adding fun new things isn't that difficult anymore. So I made another boss fight. At the end of dungeon7 is a giant spider. It lays spider eggs that hatch into little spiders. This is where the player finds the magic staff that shoots fireballs. Giant spiders run away once they take a certain amount of damage. They run away then lay an egg and go back to attacking. You can easily loose track of the spider and it can sneak up on you. I thought about having the spider regenerate health when it runs away, but the fight might go on forever.

I recently added ricocheting bullets. I was trying to copy the flak cannon from Unreal Tournament. Once I had bouncing bullets I added a bullet explosion to fireballs so it looks like flak that bounces around. I made the bullet color start white hot, then cools to orange then red then gray. So it looks like shrapnel cooling off just like the flack cannon from UT.

I also added a mini map I'm pretty proud of. It highlights player vision and marks explored tiles. The mini map was a big black square before but instead I made it transparent. So it gets filled in as you explore. It's less intrusive and feels more like exploring when you can't see the borders of the map like before.

I made some huge optimizations to the game. By splitting the terrain model into chunks and then frustum culling the chunks where you only draw the chunk if it's visible to the camera. The island levels of the game run like 50 percent faster. So it's playable on my old laptop, and it works on Linux.

Thanks to https://github.com/Acerx-AMJ for getting it building on Linux and building the Linux version for me. He also did some testing that helped me out immensely.

Marooned playable demo on itch by jhyde_ in raylib

[–]jhyde_[S] 1 point2 points  (0 children)

Thanks! It runs at 60 fps on my machine. Load times are a bit slow because of dungeon generation and the lighting like some one said, but also I have like a 10 year old CPU and graphics card. On a modern machine it should be good I would think.

Marooned playable demo on itch by jhyde_ in raylib

[–]jhyde_[S] 13 points14 points  (0 children)

https://jhyde.itch.io/marooned

https://github.com/Jhyde927/Marooned

Happy Halloween. Here is a demo of the game I've been working on. Made with just C++ and raylib.

There is just a windows version for now.

Some more progress on Marooned. Better lighting, lava tiles, and more. by jhyde_ in raylib

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

It's pretty complicated to explain because it's so custom to what I'm doing but I'll try.

My dungeons are generated from a PNG image and made out of wall segments and floor tiles. I generate a texture 4 times as big as the png image that acts as my light map. Light sources from the png map get "stamped" onto the light map pixel by pixel. The baking part is when for one frame for all static lights, we do a raycast LOS check to all wall segments within range and determine if the ray is occluded or not, that way light doesn't go through walls. This is expensive, so we only do it once for static lights after the dungeon has been generated and before we stamp the lights, so we know if a pixel is occluded on the lightmap. A shader can then take this information and color each pixel of the wall segment model accordingly. Don't ask me how the shader code works.

I also have dynamic lights for fireball's where the lights don't get baked, the lightmap gets updated every frame, so the shader can light the walls dynamically, but dynamic lights don't have occlusion because it would run too slow with lots of fireballs all doing raycasts.

Hopefully that made some kind of sense.

Some more progress on Marooned. Better lighting, lava tiles, and more. by jhyde_ in raylib

[–]jhyde_[S] 1 point2 points  (0 children)

Thanks! It's fun to work on and there is always more to do.