Activity

Tree Plate

Commit 65807e7

First, I implemented a few things to be compatible with the protocol:

  • fcGenerator
  • fcEnergyConsumer
  • drInsufficientEnergy
    I also did a few other things:
  • I added some placeholder icons
  • My fcMaterialStack implementation was like completely broken, so when one of those started being sent by the server, I found that out and fixed it (mostly by copying from fcMaterialPile).
  • Implement fcFactory’s set-rate command, and list inputs/outputs in kg when they’re bulk materials

Commit 113ba9e

  • A few places in my code were checking if a Uint64 (my custom type) equals 0 (a regular int), which always returned false. I replaced that with using .isZero.
  • sample-ore only works if you know the asset class, so I made the button not appear if you don’t know the asset class.
Attachment
1

Comments

Tree Plate
Tree Plate about 1 month ago

*placeholder icons for icons that the server was sending that I didn’t have icons for

Tree Plate

Commit 0b60af4

I updated this to be compatible with protocol changes:

  • fcStructure.quantity, fcStructure.hp, and fcStructure.minHP are uint64s now (they were previously uint32s)
  • fcMessage’s “From:” line is optional now
  • fcRubblePile has a remaining mass now instead of a remaining quantity
  • fcResearch has topics in the feature instead of having to send a “play” command to get what topics can be researched
  • Changes in how virtual assets are defined means I can assert that if an asset has zero size it must have zero mass and mass flow rate
  • fcOrePile.analyze now gives the masses of the materials now instead of the quantities
    I also made a few other changes:
  • I added a few icons that were recently added to the tech tree
  • I fixed some bugs with binaryreader while debugging a weird behaviour in my parser
  • I added > and min operators to my Uint64 class
  • My “Inbox” only shows fcMessages that are inside fcMessageBoards
  • My material dialogs now show mass per unit if it’s a component material
  • I added a few more checks for server invariants
  • I changed the minimum line item height when rendering an fcStructure to 32 (the height of a material icon)
  • I now support rendering messages outside of an fcMessageBoard (see attachment)
Attachment
0
Tree Plate

I did some geometry to determine the outer radius given that the tooth angle matched the angle between the teeth.
At first I got (attachment 1), because I used 180 instead of pi in my angle calculations. Then I still got (attachment 2) because i had an error in my calculations where the sum of angles was 360. and where i was forgetting to multiply something by 2. This got me (attachment 3), which, while better, still had the wrong angles.
Eventually I determined that my math was wrong and in fact it is impossible to do such a thing.

Attachment
Attachment
Attachment
0
Tree Plate

There are two main parts to this project. One is the function that makes a list of triangles that a gear is made of, and the other function converts that to an STL. The triangles -> STL part was easy, just look up the format on wikipedia, and find out that the only hard part (calculating a normal) was really easy with the library i’m using.
The main function was the code that generated the gear. The way I do this is by first making a list of points around the gear that the teeth are made of (these are the points between the pokey triangle bits in the image below). Then I iterate over this list and get each sliding window of two points. For each of these, I make two triangles for the top (tooth and inner part), two for the bottom, two for the left side of the tooth (it’s a quad, which is two triangles), and two for the right side.
My first iteration I had some issues, because I didn’t understand how the rotation function in the library i was using worked (i even filed a bug, and then realized that how i thought it worked doesn’t even make sense). I also was calling angleTo, which it turns out is the absolute value of the angle and I really should be calling angleToSigned. Eventually it looked mostly okay, except some triangles were being shown only from the opposite direction as I wanted. I realized this was due to the fact that my triangles weren’t following the right-hand rule, where the vertices needed to be listed in counter-clockwise order. After doing that it was almost entirely wrong, which it turns out was because I thought Z was up, when in fact it was down. Finally I got a reasonable solid, and after tweaking some settings i got the below gear (60T, inner radius 1, outer radius .1, thickness 0.2).

Attachment
0
Tree Plate

Shipped this project!

Hours: 2.03
Cookies: 🍪 3
Multiplier: 1.71 cookies/hr

I shipped my project! This is my first FlavorTown ship.

Tree Plate

I copied the results of ls on my home directory of my website, looked up css tutorials to figure out how to make a good card, and made a card for a bunch of the pages from ls.
After that, I put it through the W3C Validator (do people still do that nowadays?) and fixed the bugs it reported.

Attachment
8

Comments

parva
parva 2 months ago

You have not gave the full code of web.

Tree Plate
Tree Plate 2 months ago

@parbarvaliya4811 what do you mean?

imtheachyut
imtheachyut 2 months ago

awsome!

sebastiaolina1
sebastiaolina1 2 months ago

cara ficou muito dahora, to jogando o jogo da abobora até agora kkkkk

nok
nok 2 months ago

it’s not completed cryin

stormzzyyne
stormzzyyne 2 months ago

uhh, no ideea but simple

samiyaazad
samiyaazad 2 months ago

Awesome Project!

Tree Plate
Tree Plate about 2 months ago

@nok wdym?

Tree Plate

This project was started before flavortown. At the start of flavortown, I had an engine that used the vector_math library and a matrix copied from wikipedia to draw a cube made out of triangles. Recently, I tried to add a second cube, and got weird rendering artifacts. I eventually figured out it was because my code for determining whether a triangle was in front of or behind the camera was naïve and didn’t account for edge cases. I got a whiteboard out and (using a 2D plane and lines instead of triangles for simplicity) found several edge cases to fix. After a bunch of thinking, I figured out the solution, which was to test if two edges of the triangle extended out hit both sides of the box extending from the center of the screen. I tried to do this, and saw my cube didn’t render correctly (see attachment). I eventually figured out this was due to a bug in the vector_math library (https://github.com/google/vector_math.dart/issues/358).

Attachment
0
Tree Plate

Commit 74825a7

make structures not show minHP when you don’t know the asset class (because the spec says a 0 is always sent if you don’t know the asset class)

Commit 5a1597c

  • fcSample
  • fcResearch now has a “progress” field
  • make icons for a bunch of ores that are now discoverable via the sampling feature
  • update to dart 3.10 since i’m using a 3.10 feature
  • make the pile’s analyze button show how many units are unknown
Attachment
1

Comments

Tree Plate
Tree Plate 2 months ago

the silicon and iron icons are from the server, not my creation

Tree Plate

Commit 9d46c40

make platform_specific stuff check for dart:ui and don’t import path_provider otherwise

this is to remove a hack in my tasbot where i had a custom package called path_provider to emulate the features of the real one without needing flutter

Attachment
0
Tree Plate

Commits b120345 and 4abdb7b

I moved the platform specific files into their own subdirectory, and made a file to do all the conditional import stuff so i don’t have to everywhere i use it.

Attachment
0
Tree Plate

Commit 09c8fde

I updated this client to match protocol changes:

  • you can’t dismantle things you don’t own (the protocol was previously inconsistent regarding things like that)
  • the protocol says some features can only be sent by the server if you know the asset class, so i added some asserts regarding that
  • since the high score table should work better server-side now, add a way to see it on this client (mostly already done, but i added a “refresh” button so you can actually see it)
  • the “flags” of a miner/refiner (source limited, target limited) are now part of the bitfield
  • fcFactory
    I also added an icon for gold (newly in the tech tree), and fixed a bug in my websocket wrapper that made it break on web.

Commit 12bf7f0

it turns out my client was misimplementing a confusing part of the protocol ( being 0), which wasn’t an issue until now, so now I’m implementing it right

Attachment
0
Tree Plate

(this devlog references things defined in [https://software.hixie.ch/fun/isd/test-2024/servers/src/systems-server/README.md](the server docs), look there if you’re confused about something i’m saying)

Commit a3b3abd

First, I implemented some parts of the protocol that changed (fcPopulation’s “gossip”, special-casing string id 0).
This involved adding a < operator to my Uin.t64 type (I implemented my own type for 64-bit integers using two regular integers because dart, the language i’m using, uses JS’s Number type when compiling a int64 to javascript, and Number only supports 52-bit integers).
After that I fixed a long-standing bug where my client would error when the system server data was reset (the fix amounted to deleting one line of code)

Commit 2414edb

I was still having the issue i mentioned before, so i deleted a few more lines of code
…that didn’t seem to have fixed it tho :(

Attachment
0
Tree Plate

issue closed as not planned, i’ll just wait for official API support for devlog writing

Attachment
0