Commit graph

1075 commits

Author SHA1 Message Date
42c59328a9 only make a 60fps call if we're actually animating 2020-10-06 08:55:21 -07:00
5b2e370295 oops, fix a missing await in modeling
This caused swf asset syncs to be unreliable!
2020-10-06 07:35:00 -07:00
900d102594 Merge branch 'modeling' into main 2020-10-06 07:06:30 -07:00
99e6480486 add logging to modeling
my hope is that, if we fuck things up, this will make it clear 😅
2020-10-06 07:06:19 -07:00
bb812a2b81 oops, fix bug modeling pet with no items 2020-10-06 06:38:21 -07:00
6ec6bbec57 first-time modeling UX improvements
These changes are most relevant for playing around in the dev server, modeing against an empty database. But they'll also help in real-world modeling scenarios! e.g. modeling a new species/color combo is now a bit nicer, we don't show a blank entry in the color picker
2020-10-06 06:37:51 -07:00
df2d814c13 enable running against a local dev database
had to add some missing tables, but it seems to work! (some known errors though, from assumptions we make e.g. blue acaras existing)
2020-10-06 06:18:19 -07:00
da72837d9e modeling saves item-to-asset relationships
this is the last one to get parity with current modeling, I think?? I'm gonna add one more feature though: removing no-longer-used assets from the item
2020-10-06 05:49:37 -07:00
fefb798e87 extract Pet GQL to Pet.js from Outfit.js 2020-10-06 05:04:44 -07:00
740d8415db extract modeling logic into modeling.js 2020-10-06 05:02:21 -07:00
68b5486bb7 update labeled field for pet appearances
Oops, when building the Support tool to label pet appearances, I didn't realize that there's also a boolean `labeled` field that needs to be true for labeled appearances. Without it, the old app shows the appearance as "Unlabeled".

I also ran this query to fix the rows we'd incorrectly written:
```
mysql> UPDATE pet_states SET labeled = 1 WHERE mood_id IS NOT NULL;
Query OK, 158 rows affected (0.14 sec)
Rows matched: 19640  Changed: 158  Warnings: 0
```
2020-10-03 04:05:25 -07:00
0f5c437ffd split up modeling code into smaller functions
This is mostly because I want to chain the rels after both items and assets save, and I want to be able to specify that stuff a bit more precisely, rather than the like, layers-of-awaits we were building up.
2020-09-27 03:57:14 -07:00
a8c351b102 oops, fix a bug with Pet name GQL 2020-09-27 03:21:07 -07:00
914a06f8c7 add test for UC modeling
This got fixed in the refactor last commit, where we added the petAppearance field!
2020-09-27 03:19:10 -07:00
e57af14625 refactor Outfit.js to split Pet to a separate type
yeah, I had unified Pet into Outfit, but now I think that was overly clever… 😅

Here, I define a new Pet type, and it has some of the fields of Outfit and the deprecated fields still.

I did this because I want petAppearance to work, for UC testing!
2020-09-27 03:18:46 -07:00
f543868924 fix bug that broke fades on cache-grouped layers 2020-09-25 07:53:04 -07:00
32c4e540a3 group and cache adjacent static outfit layers
perf win owo!
2020-09-25 07:35:49 -07:00
94f6363251 add LIMIT 1 to our updates, out of healthy fear
This is just me thinking about what could go wrong in the modeling rollout,

this at least makes it so that, if something breaks, it will break small
2020-09-25 05:15:58 -07:00
cc5a8a6fab set bodyId=0 when item's body id changes
that is, if we see an item modeled on a second body, then treat it as body 0
2020-09-25 05:04:12 -07:00
96a126ebba oops, stop sending unnecessary inserts/updates
got the types wrong on some stuff, and got pet state sorting wrong!
2020-09-25 03:29:02 -07:00
41e70ba8d0 finish modeling full pet appearance 2020-09-25 03:29:02 -07:00
50537758c5 start test/dev db IDs at 1, not wherever prod is
We download the schema from prod, and omit real data, but I didn't notice that we were still pulling the metadata of the auto increment counter for IDs! Now, we scrub that from the schema file we save.
2020-09-25 03:29:02 -07:00
71f491ce65 modeling saves pet state 2020-09-25 03:29:01 -07:00
5332c9e265 save biology assets on model
and start in comments on pet states :)
2020-09-25 03:29:01 -07:00
ff3fc943d7 modeling saves pet type 2020-09-25 03:29:01 -07:00
9111dfddd3 save item swf assets during modeling 2020-09-25 03:29:01 -07:00
f7d9faa265 update modeled item data 2020-09-25 03:29:01 -07:00
8793d8b570 refactor modeling code a bit to use syncToDb fn 2020-09-25 03:29:01 -07:00
e817ba705b add more valid urls to asset proxy
specifically, I found this one: http://images.neopets.com/cp/items/data/000/000/484/484412_92058359da/484412_HTML5%20Canvas.js
2020-09-24 08:30:39 -07:00
d52849c7a2 add animations and play/pause button to item page 2020-09-24 08:29:56 -07:00
ffe9d25b1c help user find play/pause when adding animation
I think it's great that we hide the button when it's not relevant, but that makes it hard to know that it exists. Here, we do some cute tricks to blink up the "Paused" button when it first appears, even if the user doesn't have the controls visible right now
2020-09-24 07:54:11 -07:00
2a8ac4ad65 improve contrast on play/pause button
I had trialed it on darker backgrounds, but on lighter ones we just need a higher base contrast imo
2020-09-24 07:19:29 -07:00
e5ce4a4a42 improve perf on item add/remove
We did this a while back too, but I guess something changed in Apollo: I guess it used to return identical item objects from the cache on its own, and now it returns brand new item objects. So we gotta do the object caching hacks ourselves!

This speeds up add/remove item state updates from 500ms to 100ms on my Mac, because we stop re-rendering all the Item components and their complex Chakra children.

This is especially worth doing now, because animations make long updates much more noticeable! (It interrupts the animation 😅)
2020-09-24 07:09:08 -07:00
05f7b3fcc7 oops, fix missing hook deps 2020-09-24 06:43:46 -07:00
ce402c23d7 include animated assets in preloading
Honestly kinda surprised this worked on the first go! I was worried something about the process would make the sorta like, instant-cache expectation not work.

Still thinking it might be considerate to like, keep a LRU cache of MovieClip options, so that we don't double-execute these scripts when adding stuff… we even re-execute the ones already applied lol 😅 and that adds lots of script tags to the body!

But yeah I'm not gonna push on it yet until I see evidence that it actually causes performance issues in practice
2020-09-24 06:25:52 -07:00
53b4d34419 only show play/pause when there are animations 2020-09-24 06:13:27 -07:00
5027a62ec5 cuter play/pause button at top of controls 2020-09-24 06:04:59 -07:00
c4a9ee8497 a bit more perf for static assets 2020-09-24 06:04:51 -07:00
5879324ebb play/pause button for animations 2020-09-22 05:39:48 -07:00
88f5c1f1aa fix bug where resizes pause the animations 2020-09-22 05:14:31 -07:00
30ec18e85e maybe fix races in movie script load order? 2020-09-22 05:12:59 -07:00
d50d1ecacc fix bug that reloaded all layers on resize 2020-09-22 05:01:56 -07:00
185d6acc88 some movie clip race condition fixes 2020-09-22 04:36:32 -07:00
d1be0f2d4a oops, add a missing assetProxy call! 2020-09-22 04:34:40 -07:00
772065815a Badge for animated items, support only
This is really very cute, but too many items it turns out are lod despite not actually being animated 🙃 it's helpful for looking for test cases tho, so I'm keeping it, but support only!

I also ended up really liking the icon-badge+tooltip design as a way to summarize lil things, so I'm trying Own/Want short badges in the same style.
2020-09-22 04:25:41 -07:00
ae26701be7 extend asset proxy to handle number version string 2020-09-22 04:16:45 -07:00
3fe2c478f2 log manifest image load errors, instead of crash 2020-09-22 04:12:52 -07:00
8cc034900d ah, refine the bug fix for number filenames 2020-09-22 04:08:05 -07:00
d27395bda2 hooray, animated items seem to be working?! ^w^ 2020-09-22 03:53:48 -07:00
a4d159381c add an underscore to numbered filenames
Here's an example, the file is http://images.neopets.com/cp/items/data/000/000/546/546022_1132b0ffeb/546022.js and the constructor is _546022, to account for the fact that JS syntax won't allow a plain number there.
2020-09-22 03:46:32 -07:00