this week is another short week here in sweden, this is why people accuse swedish devs of never doing any work. anyway, i did some limited tests of the demo with some players and it exposed a ton of bugs.
i pretty quickly found that some bugs were not reproducible in the desktop version of the game vs the browser version so i did some work to address that.
Log Exports
when building for web, godot handily exposes JavaScriptBridge , which has a bunch of stuff for running in the browser. the most salient here being download_buffer. its a handy little fn that takes a string array and just sends a download request to the client.
we already have a Logging global in the game, it handles all logs and is the only function allowed to use print , plus it formats things and keeps track of the number of logs so far.
it can have a bunch of LoggerInstance agents that can be instanced per script (such as a game state or factory entity) with an arg that gets appended to the prints. within that script we can then use logger.print to always have the providence of the given log.
this can be further extended with logger.group and other helper functions so you end up with something like this
**[109 ] [FactoryGameManager] [load_level] (10, 10), FactoryEntityBase: id=1 grid=(10, 10) layers=2 entities=0, **
the 109th thing to happen was that FactoryGameManager loaded a level with a 10x10 grid and no entities (the starting grid)
anyway it was a pretty easy process to make the Logger keep all logs in a big queue when running in web and then download them with our friend download_buffer so now weird frontend logs can be saved.
in future i’ll use JavaScriptBridge to save the logs to localStorage in the browser periodically (then send them to the Telemetry server) so we can get all crashes but this’ll do for now.
additionally the following bugs were fixed and features added, its quite a laundry list
- make destroyed cargo buildings more obvious or replace
- add magazine indicator
- add indicator for new machines or just show them at level start
- stopping combat should reset factory without components
- make undo reset the factory and stop it
- explain how conveyors work
- give a ui element that shows how aligned with the barrel the aimer is
- bug: welder sometimes appears underneath the conveyor in level 2?
- turns out this was a very complicated issue involving drawing sequences and took longer than any other change on this list
- bug/ui: hide machine palette when combat active
- bug/factory: pistons try to fuse with welders palced behind them. perhaps they should only join the front 1 to the back n and not go beyond the front 1
- this was “fixed” by simply not fixing it. attaching part of the factory to the bullet is a feature, not a bug
- bug: dev colours still enabled on level mortar
- bug: enemy can’t actually hit player in bunker level due to low sky
- simply raised the sky, this will be a non issue in future though
- qol: it would be nice if fast forward stayed on when restarting.
- qol: fast forward and reset should show their hotkeys on tooltip
- qol: make it more obvious that the factory is playing
- by adding a spinning alert light as you would have in a factory
- qol/factory: rotators are always the wrong way around, make them get placed facing the other direction
- qol: it sucks waiting for the spawner to spawn, it should skip forward to the first spawner firing