Quite Unusual Newsletter #35
We're excited to share are latest newsletter as we finally reach the point of wrestling with the transition from foundational systems code to crafting actual games and finding out hoe theory doesn't life up to practice.
The last 4 weeks were a grab bag of accompleshment in programing
Working on AIFAS
- documented the internal working of AIFAS's vigncil system
- added named priorities with explicit relationship to .vigncil files
- updated the.vigncil file VScode extension
- redid the vigncil system so the Dialogue is a type of Portrayal instead of a type of Part
Number crates:
- now convert floats to fractions directly from the mantissa and exponent
- impled .powi() for my fraction and fixpoint crates
- redid .sqrt() and .pow() for my fraction crate use the method I learned impling .powi()
- fixed some bugs in my fraction and fixpoint crates
Some misc math stuff:
- made a rational trig replacement for atan2
- made a function to add two quadrance together
- made a function that finds the square number factors of a number
- modified square number factors finder to only merge factors if the higher factor already exists
started on generic chess-type game engine:
- made function to calc scored for squares
- made function to generate possible moves
Some other achievements where:
- developed a base personalities types based on 4 motivation and 3 struggles
- made a project to help automate something in my personal life that was eating up all my time.
TeaserTuesday
Through the window's lens, Mentor Waxworth quietly observes the world, her innate curiosity ever present, seemingly unperturbed, as if everything is simply as it should be...
Alta Article
Internal routines have an integer priority that is used to determine when portrayal repeats. portrayals are sorted into buckets based on their priority then keep repeating the portrayals in the highest bucket.
my first implementation of the .vigncils file you specified the integer of the priority directly. but that means if you want to insert a priority in between two existing priority so have to go through and change all the higher/lower priorities to make room for the new one.
So to solve this instead of specifying an integer you specify an identifier for the priority and Directed Acyclic Graph of which priorities need to be before another.
You can't just use a topological sort because if the DAG doesn't restrain it to a specific ordering it will just make one up for you. so for example if you have:
A->B->C
A->D->C
you don't want to go ABDC or ADBC you want A(BD)C.
but what happens if you have
A->B->C
A->D->E->C
it can't say if B is equal to D or E So I implemented a breadth-first search starting at the nodes without any parents
but if you have something like:
A->B->C
D->C
if will put B and C at 2 then try to put C at 3 but it's already at 2, so it will fail.
So I did was to keep track of a separate chain for each node without a parent then when adding a node check if it has already been added to the other chains and if so shift the integers in the shorter chain so that the integer it wants to assign to the Node that already exists in the other chain is equal to the integer in that chain and then merge the two chains.
But then there are cases where a chain is moved back so far the it's end goes past the current so one can't just have a list of nodes that need to be added to the chain but also the depth they need to be added at.
Though I took a lot work to implement all that most of it was because I had kept adding tiny improvements and it got very crufty and I'm not a fast typist to actual enter the code took white some time. I probably spent an hour in total decide what I wanted the program to do but I spent 3 full days on it as implement my idea then realize some case where it wouldn't work. If I had known then I know now I would have rewritten it from scratch 2 or 3 times instead of just making the changes to it. but because it was so crufty it was hard to see all the changes that needed to be made.
I did rewrite it once when I painted myself into a corner with borrow checker. It was easy fix I just borrowed the stuff mutable from the start instead of borrowing immutable then reborrowing it as mutable