7DRL devlog: Grim Rejoiner

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
TMC
Metal King Slime
Posts: 4310
Joined: Sun Apr 10, 2011 9:19 am

7DRL devlog: Grim Rejoiner

Post by TMC »

The pitch: You are an eldritch blob born of an accident of magic or science. Acquire and attach limbs to grow and escape these horrid laboratories!


A yearly tradition, Seilburg and I are back for our 6th 7DRL, the 5th in a row using Godot. This one has by far the least planning, ergo the smallest design doc, ergo the smallest scope, ergo the best chance of success!

As always, I'd hoped to use the OHR but am not going to do that until the new script interpreter is in place. I did however make good progress on 3D in the OHR which I'd planned to use for this game; I'll to post a thread about those experiments later.

I forgot to pack a DVI cable, so with no monitor day zero was spent setting up VNC to access my desktop remotely via borrowed laptop. Wasted time trying to start X11 without a screen before remembering Xvnc does that for you.


Seilburg's devlog: Day 1, and the quest begins again

Day One: You have legs
(crossposted to itch.io)

Our most successful 7DRL day one yet! I spent most of it selecting and cleaning GDscript code to reuse from our 7DRL last year, Grift & Grind. That game had no combat so a little was borrowed from earlier games but we'll mostly do combat from scratch. This is the 5th 7DRL in a row in this codebase's lineage and each year start by mkaing improvement. Too bad all of last year's sophisticated dynamic interaction and most GUI code has been deleted.

So we have the basics: player movement, items on the map and in inventory, NPCs you can bump into to attack.

What's different this year is that we've switched to (primitive, tile-based) 3D! All my 3D gamemaking experience has been in the OHRRPGCE (a 2D engine, 3D is render-it-yourself) so a lot to learn. I wasted hours trying to get the camera to focus on and rotate about the player. Eventually I gave up and read a tutorial which revealed the camera points *backwards* in the negative Z direction. Knowing this I fixed it immediately.

Then lots more time wasted getting billboarded sprites positioned correctly.
Attachments
day1.png
day1.png (112.32 KiB) Viewed 2405 times
Bluefeather42
Red Slime
Posts: 53
Joined: Fri Jan 13, 2023 1:13 am

Re: 7DRL devlog: Grim Rejoiner

Post by Bluefeather42 »

Good luck to you! Are you just making billboarded sprites or are you going for the retro-shooter sprite rotation effect? I couldn't get that to work for the life of me when I was messing with Godot.
TMC
Metal King Slime
Posts: 4310
Joined: Sun Apr 10, 2011 9:19 am

Re: 7DRL devlog: Grim Rejoiner

Post by TMC »

Thanks! 3D maths is hard, I can't believe how long it took me to get the camera right. There are so many axes to screw up everywhere! Retro-shooter sprite rotation? You mean like DOOM and Wolf3D where there are multiple versions of the sprites for different angles? That's too much work so just billboarded.


Seilburg: Day 2: Forward, ever forward

Day 2: Look about you
(crossposted)

Good preparation is the key to success.
So I went a bit overboard on surface prep for painting the shed.

As usual we got stuck on the game's name (the codename is Abomination). I liked the sound of Abomlimbation but not the spelling. Grim Rejoiner isn't the greatest name, but we were both glad to agree and move on.

In our five previous 7DRLs the mapgen has been left to me and I typically left it until sometime day 6, 7, or even 8, resulting in something somewhere between basic and nonexistent. Setting priorities is hard! This year I spent day 2 improving and writing map utility code. The mapgen code has been thrown out after each game because it wasn't reusable enough.

And there's the other side: converting the 2D map into 3D geometry. There's a dazzling array of different possibilities Godot provides for that, and I spent a lot of time studying the options for procedurally generated maps and meshs and learning about lighting.

Spent the day working towards getting back-face culling working and in the end I don't know I like it much.

The shadowcasting here is built into Godot, but I plan to also use traditional tile-based FoV, if the combination doesn't look bad.
Attachments
day2.gif
day2.gif (2.73 MiB) Viewed 2385 times
TMC
Metal King Slime
Posts: 4310
Joined: Sun Apr 10, 2011 9:19 am

Re: 7DRL devlog: Grim Rejoiner

Post by TMC »

Day 3: Standing in place

Day 3 is the tipping point from having lots of time left to running out of it and needing something to show. The shed looks good after all the painting I did today, but there's still a 2nd topcoat to go.

As for the game, the rest of day 3 was lost in the GUI swamp I foolishly waded into, despite knowing the dangers. Mainly that my grasp on UI in Godot is very poor and inevitably I got stuck in the mud thrashing about trying the escape crawling bugs.

So by the end of the day, I managed to add a message log and a modal textbox popup (copied directly from last year's game without changes with enormous difficulty, fighting hidden error messages), overcame some horrible key and mouse focus bugs and just gave up on others. Appalling.

Meanwhile Seilburg has entered a strange mood. He talks about instability and attaching and severing limbs, but how it will play out in practice has me worried. Attaching limbs itself won't be interesting if you can't do much with them. Running, biting, throwing, flying, spitting venom, breathing fire!
Bluefeather42
Red Slime
Posts: 53
Joined: Fri Jan 13, 2023 1:13 am

Re: 7DRL devlog: Grim Rejoiner

Post by Bluefeather42 »

TMC wrote: Wed Mar 06, 2024 8:00 am
Thanks! 3D maths is hard, I can't believe how long it took me to get the camera right. There are so many axes to screw up everywhere! Retro-shooter sprite rotation? You mean like DOOM and Wolf3D where there are multiple versions of the sprites for different angles? That's too much work so just billboarded.
Yep, exactly! You get the player's position relative to the monster and that, along with the state, determines which animation plays. I couldn't even get it to return the correct dot product. And depending on how many frames your animations are, there's probably a point where 3D models are simpler.

I need to pay more attention to 7DRL, seems like a lot of cool stuff comes out of it. Good luck to you!
TMC
Metal King Slime
Posts: 4310
Joined: Sun Apr 10, 2011 9:19 am

Re: 7DRL devlog: Grim Rejoiner

Post by TMC »

Well you don't want to use a dot product, that loses the distinction between clockwise and anticlockwise. Use atan2 if necessary to convert facing direction vectors to angle if needed. If you have the facing angles of the player and the NPC you can simply subtract them, wrap into the range [0, 359), and divide by 360/NUMDIRECTIONS.

Day 4: Austere visage

Great progress painting the shed, the exterior is almost finished. I'll just leave it there and let someone else finish the work.

Terrible progress painting the game, though Seilburg seems productive out of sight. At least I made a good start on a BSP map generator (pictured without the doors, which are the hard part to get right - the rest worked first time without even a parse error).

But then... I wanted to decorate the map. Since he's got a clue about this 3D stuff I got Seilburg to create some simple 3D models for more interesting walls and I offered to texture them -- of course I know better than to derail the project by trying to learn Blender. But then he had me install Blender in order to preview the texturing instead of doing it blind! That didn't go well, but finally after great struggle, I had drawn one texture.

That was such a time waster that I decided there must be a better way. So next I tried Goxel for drawing voxel models. It was easy and fairly featureful. But that wasn't a good solution because the result is a mess of multiple mesh chunks with each voxel face an individual quad. There's a Blender plugin to simplify and bake a texture but I wanted simple not Blender.

Conclusion: 3D is hard, probably a bad idea for a 7DRL if you have no experience.
Attachments
bsp1.png
bsp1.png (463.69 KiB) Viewed 2350 times
TMC
Metal King Slime
Posts: 4310
Joined: Sun Apr 10, 2011 9:19 am

Re: 7DRL devlog: Grim Rejoiner

Post by TMC »

This devlog is no good. So I wasted a lot of time trying to salvage it, just like everything else that was no good.


Day 5.333: Cells and Membranes


Wasted much of a day again, this time on BSP map generation and doors. It's good for rectangular rooms, which are boring. Because I don't like it much, I spent a long time trying to make improvements without success. Finally I realised it's not the shape of the rooms that makes them interesting, it's what you put in them... and I've got nothing. Still, I don't want a maze.

As I said before, placing doors is tricky. There are many ways to do it, and I haven't written a BSP mapgen before so I don't know which is easiest. I went with telling the child rooms in which direction they should place a door. One child is told to connect in the direction passed in recursively from the parent, the second child is told to connect to the first. Doors are put on a list to be placed later once all walls are down.

This produces a tree-connected set of rooms (not enough doors), and breaks when you try to break up the grid doing all the things I tried: shrinking rooms, omitting rooms, omitting walls. Add more doors, check for full connectivity, restart on failure, etc.

That was Day 5. The first part of Day 6 was wasted on... *alcoves*. That alcove model from Day 4 turned out to not be aligned to the grid. Where the problem is along the Blender -> .gltf -> Godot scene -> Godot MeshLibrary chain we couldn't figure out. After Seilburg looked and gave up I spent an embarrassing amount of time trying to fix the problem while refusing to use Blender, by computing the correct offset and setting the mesh offset or even modifying the mesh.

Next, wasted time trying to get the shadows cast by/on the alcove to look right by tweaking bias settings. I had no idea shadow maps were so unreliable.

Also, fixing more 3D graphical glitches. Wrote Customise sprite billboarding to support rotations, for all those limbs we need to connect at funny angles. They remained billboarded anyway. Had to disable billboarding in about 10 places.

Meanwhile Seilburg's being concerningly productive pumping out various concerningly unfinished features and we'll probably need a week to get it all working!
Attachments
An evil alcove, a door, an L-shaped room, a hopeless jumble of limb sprites, perspective-corrected billboarded sprites, everything in sight unfinished
An evil alcove, a door, an L-shaped room, a hopeless jumble of limb sprites, perspective-corrected billboarded sprites, everything in sight unfinished
day5.png (508.14 KiB) Viewed 2337 times
TMC
Metal King Slime
Posts: 4310
Joined: Sun Apr 10, 2011 9:19 am

Re: 7DRL devlog: Grim Rejoiner

Post by TMC »

Our 7DRL game is released! Rather: our game's 7DRL release is! (Two days ago.) I've marked it as 'incomplete' because it's not quite feature-complete, buggy and unpolished... but you shouldn't set your standards too high for a 7DRL. We'll continue working on it, because we don't want to set our standards *7DRL*-low.

Normally I'd be unhappy to release a game in this state but I think there's interesting things that you don't need polish or balanced combat to try out. Things which I was uneasy about initially but now seem to work, such having an equipment system for your limbs. I'd thought collecting equipment was redundant to collecting limbs, but it gives you extra considerations when deciding which limbs to attach (and I hope in future, where). And losing limbs is displayed graphically so you don't need to read combat messages too closely as I feared.

Downloads on the itch.io page: https://voxelate.itch.io/grim-rejoiner

Day 6 & 7: Out on a limb

After mapgen was acceptable I largely worked on graphical polish in the final two days. I even spent time touching up sprites Seilburg generated with the pixellab.ai tool instead of just asking him to regenerate.

Alcoves came back with a vengence! They refused to cast shadows from most but not all of their faces. Finally found a "Cast shadows: double sided" mesh setting that fixed it. They don't have back-faces, but neither do the normal walls! I don't understand.

I rewrote the map renderer, twice, trying out different methods of displaying 3D meshes -- Godot has a few. GridMap is easy but very inflexible: I wanted to be able to fade wall pieces out for a tile-based Field of View. However I never actually got to adding FoV so the rewrite was helpful. Plugging in my FoV code will be fast but I didn't have time. The 3D lighting is a decent substitute plus restricting allowed camera pitch & distance to not see too far.

What I did achieve by rewriting map rendering was breaking positioning of alcove meshes again! I also struggled to position meshs for tables and cabinets. (They're just decoration in the 7drl release.)

I even added a custom shader to ignore normals on billboarded sprites for lighting, so they can be lit from behind. Seilburg also added normal maps. Looks better... what's that? He inverted the normals for alcoves. -_- Well this time I got him to fix them.

I was a bit surprised that he spent much of the last 12 hours adding content, such as a wide variety of equipment, instead of the most pressing gameplay matters.

I admit, at the same time (and all the time) I was adding dumb stuff like hostile/nonhostile indicators on NPCs when we had absolutely no reason to add nonhostile NPCs and had never discussed them. But they were so easy to implement! Just an 'if' or two, the code's mostly copied from a previous game! Of course, all the work is always in the flow-on stuff, like drawing and redrawing the indicators until they're just the right size and colour and positioning them correctly, at the right moment, and removing them... Nonhostile NPCs do have one use: they let the player decide when to attack, to self-regulate the difficulty. Err... you can't actually attack non-hostiles.

In fact, I only added AI for *hostile* NPCs 7 hours into day 7. At least, I thought I'd made NPCs attack. I kept saying there was something wrong but didn't investigate. Finally... *five hours after the deadline* it hit me: only the minotaur enemies hit (because they have axes), the innate attacks on other enemies don't work! The minotaurs hit so hard that it hardly mattered that the others were hard of hitting. Definitely 'Incomplete'.

Seilburg wrote nearly the whole body part system including GUI, equipment, attacks, stat bonuses, part definitions, and display. But by day 6 it was time I helped, firstly connecting the body part sprites at attachment points. I made limbs wave around slowly, and more aggressive when walking or attacking -- it looks like a different animation. Then I had the idea that whatever point you're standing on should be the fixed point rather than your central bodypart. It looked great but had side effects on position alignment. Trying to fix it, I progressively broke camera positioning, sprite billboarding, lighting, and not falling through the floor. It was a struggle to undo it all and get back to where I started (make git commits often!). Hours lost.

The intro (including its room decorations) was the last thing added before the deadline, but I put in a (joke) ending only afterwards, so that's excluded from the 7DRL version. You would have hated it.
Attachments
shot8.png
shot8.png (436.58 KiB) Viewed 2326 times
shot2.png
shot2.png (512.22 KiB) Viewed 2326 times
Bluefeather42
Red Slime
Posts: 53
Joined: Fri Jan 13, 2023 1:13 am

Re: 7DRL devlog: Grim Rejoiner

Post by Bluefeather42 »

So after finishing 7DRL, how do you like working with 3D in Godot?
Post Reply