Commit Graph

1859 Commits

Author SHA1 Message Date
tobspr 4636080dd7 Huge performance improvements 2020-09-21 18:09:27 +02:00
tobspr 2ac570f6d8 Fix belt paths not rendering 2020-09-21 18:07:47 +02:00
LeopoldTal ff2274f671
fix size overflow when building sounds (#676)
Building the standalone with V8 v8 (Node v14) fails at step `sounds.musicHQ`, either by running out of memory or with the error "Invalid string length". Building with V8 v7 (Node v12) succeeds.

This is because `gulp-cache` builds a 994-MB string when [stringifying file contents](https://github.com/jgable/gulp-cache/blob/master/src/task-proxy.js#L262) to cache them. V8 v8 [limits string length to around 537 MB](https://github.com/v8/v8/blob/master/src/objects/string.h#L384), and thus cannot represent this string. (V8 v7 allows around 1074 MB, which is why the build passes on Node v12.)

But [`theme-full.mp3`](https://github.com/tobspr/shapez.io/blob/master/res_raw/sounds/music/theme-full.mp3) is only 79 MB: how did we get 1250% overhead?

Unlike plaintext files, binary files are read as buffers, but [by default](https://github.com/jgable/gulp-cache/blob/master/src/index.js#L46) `gulp-cache` stringifies them naively, producing the extremely inefficient representation:

````
[
  {
    "cwd": "/Users/tobspr/shapez.io/gulp",
    "base": "/Users/tobspr/shapez.io/res_raw/sounds/music",
    "contents": {
      "type": "Buffer",
      "data": [
        73,
        68,
        51,
        4,
        0,
        0,
…etc.
````

Fortunately, `gulp-cache` [can read base64-encoded cache files](https://github.com/jgable/gulp-cache/blob/master/src/index.js#L26).

Instead of using the default file transform function, **pass a `value` option to base64-encode the file contents**. This results in only 33% overhead on cache file size (106 MB for the largest file).

This has multiple benefits:

- Fixes the build failure
- Requires less memory (from 6 GB down to < 1 GB on my machine)
- When cache files are found, the `sounds.musicHQ` is much faster (from ~30 s down to ~4 s on my machine)
- Smaller cache files on disk
2020-09-21 08:37:50 +02:00
Exund c4f2379010
Refactor entity cloning (#671) 2020-09-19 21:41:48 +02:00
tobspr 1f3991301d Fix miner highlight 2020-09-19 21:40:42 +02:00
tobspr 54f1c1dc93 Update changelog 2020-09-19 21:05:03 +02:00
tobspr 7def60c050 Fix belt planner placing down once a dialog pops up 2020-09-19 21:04:41 +02:00
tobspr 749383a318 Update changelog 2020-09-19 20:59:56 +02:00
tobspr 24eb060000 Fix mouse panning 2020-09-19 20:57:20 +02:00
tobspr ed32238412 Allow toggling units in the statistics dialog 2020-09-19 20:51:47 +02:00
tobspr fbff0a0ad4 Allow to pan the map with the mouse by moving the cursor to the edges of the screen 2020-09-19 20:30:35 +02:00
tobspr d6f56da9e4 Merge branch 'master' of https://github.com/tobspr/shapez.io 2020-09-19 19:30:06 +02:00
tobspr 26cd38b68c Refactor filters to make them not stall if one output is blocked 2020-09-19 19:30:04 +02:00
LeopoldTal a69cfde94d
fix French translation (#669)
"Créé le" must be followed by an absolute date, but this is always interpolated with a relative date, e.g. "il y a 42 jours", so the article is redundant.
2020-09-19 18:57:40 +02:00
tobspr 518d9b9f6f Merge branch 'master' of https://github.com/tobspr/shapez.io 2020-09-19 18:57:16 +02:00
tobspr fe97d28674 Minor adjustments 2020-09-19 18:57:14 +02:00
tobspr d0aa6db630 Trim savegame names 2020-09-19 18:32:39 +02:00
LeopoldTal c9c0b325cf
fix yaml lint (#670) 2020-09-19 18:02:40 +02:00
tobspr 1cd52f6dbd Fix tslint 2020-09-19 17:56:40 +02:00
tobspr 5ab3afdd30 Move item processing into separate methods 2020-09-19 17:55:36 +02:00
tobspr 3c56c4772f Update tips 2020-09-19 15:36:15 +02:00
tobspr 3e93681ce6 Add virtual stacker and painter, fix css 2020-09-19 15:33:24 +02:00
tobspr 8fa348ef30 Minor fixes 2020-09-19 15:14:10 +02:00
tobspr 6b7cfb48b3 Further ui improvements, fix simple belts with wires 2020-09-19 14:48:48 +02:00
tobspr 7d6af359a1 Polishing, CSS Improvements, Improve dark mode 2020-09-19 14:27:25 +02:00
tobspr 5bde508f86 Improve settings on low resolution 2020-09-19 12:41:07 +02:00
tobspr ee67470e34 remove pinned shapes drop shadow 2020-09-19 12:22:43 +02:00
tobspr 2075f4d011 Improve simplified belt, show hints everywheer 2020-09-19 12:21:32 +02:00
tobspr ed206363f2 Fix crash in potato mode 2020-09-19 10:45:55 +02:00
tobspr 47443058e0 Add potato mode 2020-09-19 10:34:46 +02:00
tobspr 7bc45d8959 Improve buffer backlog performance, should speed up whole game 2020-09-19 09:28:29 +02:00
tobspr 14350721eb Merge branch 'master' of https://github.com/tobspr/shapez.io 2020-09-19 08:51:30 +02:00
tobspr 5bdf6386a1 Improve mass deletion performance 2020-09-19 08:51:28 +02:00
Lapraniteon f98aa0e723
Update base-nl.yaml (#668)
Tweaked some translations
2020-09-19 08:26:42 +02:00
tobspr b7c773a70e Improve entity debugger 2020-09-19 08:15:40 +02:00
dengr1065 7650931f1f
New Entity Debugger (i hope so) (#665) 2020-09-19 07:57:29 +02:00
Caio Ricci 2c2fa6e831
Update base-pt-BR.yaml (#664) 2020-09-19 07:56:39 +02:00
tobspr 0174f625f7 Fix spacing 2020-09-19 07:56:20 +02:00
Fahrul Ramadhan Putra 15b1062c3c
Update base-ind.yaml (#660)
Change a lil bit, might change more later
2020-09-19 07:55:43 +02:00
Juho Tuominen ce437a0d21
Update base-fi.yaml (#656) 2020-09-19 07:55:18 +02:00
XLgaminginc e8c9b0757d
Error isn't a dutch word, it should be 'fout'. (#655) 2020-09-19 07:54:57 +02:00
PaulRotter 065a3bf54e
Improve german translation (#642)
Co-authored-by: Paul Rotter <paul@it-rotter.de>
2020-09-19 07:50:44 +02:00
LeopoldTal d2d2506a2a
Improve French translation (#629)
* minor fixes to French translation

Fix typos, grammar, mistranslations, clearly awkward phrasings. This commit should be uncontroversial and can be cherry-picked.

* rename wire to "câble" from "ligne énergétique" in French

* use sentence case instead of title case in French

* use non-breaking spaces near punctuation

* make French translations consistent and idiomatic

* improve translation for "switch layers"

* use fancier typography

* Fancier typography
* Improve a few translations

* improve grammar

* use no-break space after figure

* rephrase some new French translations

Co-authored-by: Naheulf <newheulf@gmail.com>
2020-09-19 07:50:02 +02:00
tobspr b5a2e77db4 Fix multiple typos, closes #627 2020-09-19 07:49:17 +02:00
tobspr 1ebfafd8de Further performance improvements, show indicator while game is saving 2020-09-18 20:41:40 +02:00
tobspr bba29b8a8b Improve (rendering-) performance in DEV mode 2020-09-18 19:51:15 +02:00
tobspr 0238de1260 Minor performance improvements, improve underground belt performance 2020-09-18 19:21:12 +02:00
tobspr 746f4935ad Improve item ejector system 2020-09-18 18:32:53 +02:00
tobspr c0c624135b Fix belt underlays 2020-09-18 18:20:18 +02:00
tobspr b8f27aec44 Proper belt underlays for splitters 2020-09-18 18:18:38 +02:00