Sep. 23rd, 2020

Work Post

Sep. 23rd, 2020 08:16 am
relee: Picture of Relee Starbreeze, Wizard (Default)
8:16am - Good morning! I'm a little worried about how little I want to do anything but code lately, but here I go again.

I found a Linked List GDScript implementation with a google search. It's on GitHub Gist and there's no license listed so I'm going to just hope for the best.

8:35am - Weird, I was so sure that Linked List implementation was what I wanted, but on like, the fourth time going through the code, it was completely different. Like I wasn't seeing it for real before that point, just seeing what I wanted to. I don't like that. :/

Anyways it looks like I'll have to do my own implementation, or use a GDScript Array, which is pretty fancy for an 'array'.

8:44am - Yeah I think I can make a variant of the Path class with the same functionality by making it a decendant of the Array class. Assuming that's a thing I can do.

Let's see how it's used first, though. I'll look over the PathFinder class.

8:57am - It looks like all the PathFinder class does is build a Path, it doesn't hold it or have any methods for manipulating it.

And the Path class seems to be just a list of Cells that also keeps track of the location in the list so you can say 'Next please' and it gives you the next step.

9:04am - I'm losing steam fast now. Not sure I want to keep working for now, or do something else. But I don't know what else I'd do, either.

9:11am - Ahh poo I took a glance at indeed.ca and found a fantastic job opportunity and now I really don't know what to do with myself! I'll have to find some way to calm down. Maybe play a game for a little while.

6:24pm - Apparently I was tired! I slept from around 10am to around 6pm. I'm going out for some food, then I'll be back.

11:45pm - I'm finally back and working on the code again. I'm doing some tests on GDScript code to see if I should redo the pathfinding system entirely, because of the way GDScript handles pass by value and pass by reference.

Apparently if I do a get_cell() call on a map, it returns a reference to that cell, rather than a new cell with the same data. This is good, though, because that's what I want.

I was worried that I'd be making a path out of cells with the values of the cells in the map, not out of the cells on the map.

1:52am - I ended up playing a game with some friends while working, and got the PathfinderPath class done to replace the Path class from RogueSharp. I think that if I publish this Godot Roguelike Toolkit that I'll probably re-write this class though, since it's pretty jank.

2:08am - Just spent some time debating with myself about modifying how the library works, instead of making it exactly like the RogueSharp library.

First of all, I'm doing this for myself before anyone else, so I should make it as useful to me as possible.

Second of all, if I do publish it, it's not like the RogueSharp documentation is current, so I can't point people to it for reference, and also the tutorials wouldn't work for it either.

The key is to make the advanced features functional in the same way, not to make the code identical.

I'm going to compare Godot's builtin A* solution to RogueSharp's and see if I can avoid having to make a second one.

2:37am - Okay so it looks like the Godot A* solution would require me to double up my map representation to have it compare that, while the RogueSharp A* solution doesn't take into account any border weights besides an optional set diagonal weight.

I don't like either of those options. There's some other stuff in here though. Let's see if there's another way in RogueSharp that I'm missing.

3:08am - There's a Djikstra Map implementation in RogueSharp that I might use for analysis later but I'm beginning to realize that there's a flaw in the genericness of RogueSharp, in that by not including a difficulty value for each cell, pathfinding can only be performed without consideration to tile types. It's walkable or it isn't, and that's all that is considered. No avoiding swamps or forests or hills unless they're significantly shorter routes, for example.

At this point, I'm thinking I should skip my idea of porting RogueSharp and just use its lead to create my own thing. I've already got most of the good bits from the Map implementation I did.

Alright. I'll need to roll my own for pathfinding, and modify my current classes to use tile weights. But there's still the field of view class that should still work. Let me go over it now.

4:07am - Interesting, the Field of View class seems good, except for one thing. It measures field of view as a square rather than a circle. Isn't that odd? I mean I know it's a roguelike divided up into square tiles, but the RogueSharp library has circle functions. I'll see if I can't fix it up.

7:44am - I suddenly noticed it was light outside and I was hungry. Geez I've been at this a long time. I've got my Field of View system working though, and it uses the circle instead of the square. Strange though, in the example vid on the github readme it uses a circle. Maybe it did all along and that bit I removed was truncating the square to a circle? Yeah on reflection I think it was! Geez.

Anyways next I'll do the two pathfinding methods and then I'll be ready to get back to my actual game.

For now, I think I've done more than enough work for one day.

Profile

relee: Picture of Relee Starbreeze, Wizard (Default)
Relee Squirrel

July 2023

S M T W T F S
      1
23456 78
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 31st, 2025 12:32 am
Powered by Dreamwidth Studios