Commit Graph

566 Commits

Author SHA1 Message Date
Daan Vanden Bosch
8118ac006b When an NPC is added while an event is selected, the new NPC will be created with the event's wave. 2019-12-29 23:06:12 +01:00
Daan Vanden Bosch
596bd103da Events can now be selected by clicking anywhere on the event and the selected event can be deleted by pressing the delete key. 2019-12-29 23:00:09 +01:00
Daan Vanden Bosch
030a77aa65 Bugfix: after setting the current wave, deleting an NPC would make all NPCs visible again. 2019-12-29 16:37:59 +01:00
Daan Vanden Bosch
de20e7b82f - Bugfix: FlatMappedListProperty wouldn't recompute its value and emit an event when it's computed property changed
- Event section IDs are now immutable
- Top level events can now be added
2019-12-27 23:33:34 +01:00
Daan Vanden Bosch
5b5ce69d07 You can now view just the NPCs of a specific wave by clicking a button next to the wave ID in the events view. 2019-12-27 16:56:48 +01:00
Daan Vanden Bosch
c8b0025096 - Moved Persister to core/persistence
- Simplified number_to_hex_string and reused it in disassembly.ts
- Fixed sporadic layout issue with ApplicationView
2019-12-27 03:16:52 +01:00
Daan Vanden Bosch
c5d78b49ac Bugfix in FlatMappedProperty and FlatMappedListProperty: flat mapped values would not update correctly if the flat mapped property didn't have observers. 2019-12-27 02:49:30 +01:00
Daan Vanden Bosch
5c0329f39f Tweaked EntityInfoView look. 2019-12-27 01:36:54 +01:00
Daan Vanden Bosch
994afa7387 Refactored HTML element creation code. Removed PropertyChangeEvent, properties don't emit their old value anymore. Added an EventsController and moved some code from EventsView and QuestEditorStore to it. 2019-12-27 00:55:32 +01:00
Daan Vanden Bosch
89d9de0f12 Added flat_map_to_list function for flat mapping over multiple properties into a ListProperty. Simplified observables code. 2019-12-26 22:25:21 +01:00
Daan Vanden Bosch
86f9f74785 Added flat_map function for flat mapping over multiple properties. 2019-12-26 20:20:42 +01:00
Daan Vanden Bosch
64a132590a When a quest editor subview cannot be instantiated, an error message is now shown in the GoldenLayout component that failed instead of crashing the entire quest editor. 2019-12-26 19:47:24 +01:00
Daan Vanden Bosch
b4dcbba8f8 Added NpcCountsController and added snapshot tests for NpcCountsView. 2019-12-26 18:46:28 +01:00
Daan Vanden Bosch
044136c26d Simplified DisposablePromise. 2019-12-26 18:10:23 +01:00
Daan Vanden Bosch
f105c0011f Added jest snapshot that I forgot to add during last commit. DisposablePromise now doesn't delay calling the initialization function or callbacks for increased speed. 2019-12-26 01:14:17 +01:00
Daan Vanden Bosch
2808983add Added DisposablePromise to facilitate cancelling promises that are underway when a component is disposed. Added EntityInfoController with unit test and added tests for EntityInfoView. 2019-12-26 00:44:30 +01:00
Daan Vanden Bosch
4414a4f7e4 Improved application startup test. 2019-12-25 00:53:17 +01:00
Daan Vanden Bosch
99d50d754d Replaced js-logger. Improved testability with mocks, improved test configuration and code improvements. 2019-12-25 00:17:02 +01:00
Daan Vanden Bosch
243638879c Entity counts in area select are now updated when adding or removing entities. Added more unit tests. 2019-12-24 03:04:18 +01:00
Daan Vanden Bosch
100272a115 Added a QuestInfoController and added unit tests for QuestInfoView. 2019-12-23 22:38:44 +01:00
Daan Vanden Bosch
b8210f8ea7 Fixed bug in quest editor ui persisted that prevented empty Golden Layout stacks from closing. 2019-12-22 23:45:06 +01:00
Daan Vanden Bosch
ebe2c78ca9 Stop the quest runner when a different quest is set. 2019-12-22 23:38:22 +01:00
Daan Vanden Bosch
89ed00718e Don't advance the instruction pointer after jumping unconditionally. 2019-12-22 23:28:11 +01:00
Daan Vanden Bosch
66b8e808dd Fixed bug in QuestRunner that prevented the correct episode from reaching the VM. Improved logging performance in several different components. 2019-12-22 23:15:05 +01:00
Daan Vanden Bosch
be144ce9b1 Event section IDs and delays can now be edited. 2019-12-22 17:24:22 +01:00
Daan Vanden Bosch
79407523d8 Quest editor UI persister now remembers active item index of stacks again. 2019-12-22 17:14:01 +01:00
Daan Vanden Bosch
33026ce015 Improved golden layout config persistence. A prompt is now shown when the user tries to leave the page after making changes to the current quest. Set production log level to INFO. 2019-12-22 15:30:16 +01:00
Daan Vanden Bosch
5522e7c6af Small improvements to QuestRunner. 2019-12-22 13:50:55 +01:00
Daan Vanden Bosch
f1374fe100 Improved log view performance and fixed bug in quest runner. 2019-12-22 04:34:50 +01:00
Daan Vanden Bosch
d168030550 Improved application initialization test. Improved error handling in hunt optimizer. 2019-12-22 02:37:06 +01:00
Daan Vanden Bosch
2083793e67 Added basic test for application initialization. 2019-12-22 00:43:27 +01:00
Daan Vanden Bosch
05c9f3ce81 All code now uses HttpClient interface instead of fetch for improved testability. 2019-12-21 22:49:41 +01:00
Daan Vanden Bosch
7ad3044c1e Changed deprecated Three.js addAttribute calls. 2019-12-21 20:52:56 +01:00
Daan Vanden Bosch
15ea3f5112 Upgraded all dependencies. 2019-12-21 20:49:20 +01:00
Daan Vanden Bosch
8ce19fac62 Most dependencies are now injected to improve testability. 2019-12-21 19:40:42 +01:00
Daan Vanden Bosch
063d524a7b Tweaked styling of entity info view. Entity names are now always fully visible. 2019-12-21 16:07:41 +01:00
Daan Vanden Bosch
f8a9c65086 NPC wave numbers are now shown in the entity info view. 2019-12-21 15:56:24 +01:00
Daan Vanden Bosch
ccf8ea6630 ASM editor is now readonly when necessary again. 2019-12-21 14:33:14 +01:00
Daan Vanden Bosch
202c01bf25 Added support for p_dead_v3 opcode. 2019-12-20 21:13:59 +01:00
Daan Vanden Bosch
02332929af Fixed conditional jump instructions. Floor-local threads are now started up but not yet terminated when necessary. 2019-12-20 21:03:15 +01:00
Daan Vanden Bosch
8e0b7abc52 The current stepping line is now automatically scrolled into view. 2019-12-20 18:26:16 +01:00
Daan Vanden Bosch
e4dda8c1c7 Added key bindings for debugging actions. 2019-12-20 18:20:02 +01:00
Daan Vanden Bosch
c7cbc4a377 Stepping over sync calls works now. 2019-12-20 18:08:04 +01:00
Daan Vanden Bosch
027b50d3e4 Fixed sync calls and step out now works too. 2019-12-20 17:57:34 +01:00
Daan Vanden Bosch
714a2b500e Removed unnecessary code. 2019-12-20 16:11:45 +01:00
Daan Vanden Bosch
663ad75435 Debugging now happens in the VM itself, this simplifies the code. 2019-12-20 16:10:50 +01:00
Daan Vanden Bosch
352365170f Fixed bug that resulted in the starting floor's floor_handler to run too early. 2019-12-20 00:32:56 +01:00
Daan Vanden Bosch
3fee246bd8 Fixed a bug in game state reset when debugging. 2019-12-20 00:22:41 +01:00
Daan Vanden Bosch
f8fc12c468 Fixed some bugs and added VM support for bb_map_designate. 2019-12-20 00:11:54 +01:00
Daan Vanden Bosch
aa0d398545 The floor handler for the initial area is now run when running a quest. 2019-12-19 22:14:59 +01:00
Daan Vanden Bosch
17daa26fb3 Area geometry in editor 3D view no longer disappears when running a quest. 2019-12-19 21:11:48 +01:00
Daan Vanden Bosch
52f2ddccd2 Virtual machine now suspends instead of halts when there no threads anymore. 2019-12-19 20:45:02 +01:00
Daan Vanden Bosch
88a60a9223 Area selection is now enabled even when running a quest. 2019-12-19 20:11:12 +01:00
Daan Vanden Bosch
c1b733cadf Entity controls are now disabled when running a quest. 2019-12-19 20:02:52 +01:00
Daan Vanden Bosch
1c48ca15ec Removed unnecessary console.log statement. 2019-12-19 18:54:38 +01:00
Daan Vanden Bosch
20885cb0f2 Simplified Widget.finalize_construction. Added game state to QuestRunner and modified execution flow to enable loading of area/entity models. Split QuestModelManager into two different classes so a different loading strategy can used in the quest runner view. Quest runner view is now automatically created when running a quest. 2019-12-19 18:54:01 +01:00
Daan Vanden Bosch
4d6bf4ba5c Fixed VM unit tests. 2019-12-19 14:41:31 +01:00
Daan Vanden Bosch
0585bbacec Removed VM dependency on QuestModel. 2019-12-19 14:35:13 +01:00
Daan Vanden Bosch
3714f5582a Renamed ZeroableBuffer to Memory and put it into its own file. 2019-12-19 13:58:11 +01:00
Daan Vanden Bosch
fcff6a2cd6 Almost all quest editor UI elements are now disabled when running a quest in the VM. 2019-12-19 00:11:42 +01:00
Daan Vanden Bosch
3bd3be8c4a Moved Thread to its own file and renamed vm/index.ts to vm/VirtualMachine.ts. 2019-12-18 23:40:38 +01:00
Daan Vanden Bosch
786e83ad99 Put breakpoints in script editor gutter behind feature flag. 2019-12-18 23:03:29 +01:00
Daan Vanden Bosch
86187a0539 Fixed bug in script editor that would add breakpoints whenever a line was deleted. 2019-12-18 22:58:46 +01:00
Daan Vanden Bosch
46b62cfaf7 Stack arguments are now always popped, even if an opcode is not implemented. 2019-12-18 22:47:53 +01:00
Daan Vanden Bosch
2366cb3aa0 Refactored script debugging code to avoid circular dependencies and separate concerns. 2019-12-18 22:37:26 +01:00
Daan Vanden Bosch
c0e9856d8a Using Select instead of DropDown in RegistersView. Only use monospace font in register container. 2019-12-18 20:20:32 +01:00
Daan Vanden Bosch
28b8fa03d9 Simplified quest logging system. 2019-12-18 20:06:09 +01:00
Daan Vanden Bosch
4ee4de95fa *Fully* put new VM views behind feature flag. 2019-12-17 22:12:55 +01:00
Daan Vanden Bosch
b9ca58ee16 Fixed bug in area mesh loading. Put new VM views behind feature flag. 2019-12-17 22:09:15 +01:00
Daan Vanden Bosch
b2c8a56a7b Fixed bug in QuestEntityControls that resulted in entities being positioned incorrectly when transitioning between sections. 2019-12-17 22:03:17 +01:00
jtuu
bb1a6b185e Added an execution count to QuestRunner to prevent the browser from freezing. 2019-11-23 17:01:04 +02:00
jtuu
8c102976a8 Added a VM registers viewer. 2019-11-21 23:04:16 +02:00
jtuu
8d4b149fba Added a readonly setting to Input. 2019-11-21 22:16:04 +02:00
jtuu
02e9690187 Fixed a bug where Menu items that had a defined falsy value could not be selected. 2019-11-21 22:12:08 +02:00
jtuu
d16c1634ba Modified QuestRunner to set paused state to false every time the execution loop is started regardless of whether any breakpoints are hit. 2019-11-21 19:52:42 +02:00
jtuu
b24afee12a Fixed VM threading in auto-advance mode.
Now when a thread is started at least one advance is required to have valid execution state.
2019-11-21 15:22:47 +02:00
jtuu
8582a25bc3 Lint 2019-11-16 18:07:21 +02:00
jtuu
918d8f7bdc The script editor is now set to readonly mode when a quest is running. 2019-11-16 17:35:20 +02:00
jtuu
f6f5fa7c3f QuestRunner now works in inline args mode. 2019-11-16 17:08:09 +02:00
jtuu
c57595a7af Simplified the way the VM manages the registers and the string argument store. 2019-11-16 00:16:09 +02:00
jtuu
0365b40e55 Added stop button. 2019-11-15 20:17:24 +02:00
jtuu
24abf3ae7f Modified QuestRunner's execution flow.
Now it goes like this:
1. Advance instruction pointer.
2. Check for breakpoints.
3. Execute instruction.

Also fixed some bugs.
2019-11-15 19:59:05 +02:00
jtuu
6e41b6fb79 Reworked script editor decorations.
Breakpoints now move correctly when script is edited.
2019-11-15 19:59:05 +02:00
jtuu
8c4e0c2ed2 Hooked up the stepping buttons to their respective methods in QuestRunner. 2019-11-15 19:59:05 +02:00
jtuu
b8f0cbfcb3 Added running and paused properties to QuestRunner.
Also tried to improve the situation with the circular dependencies.
2019-11-15 19:59:05 +02:00
jtuu
a219200291 Added buttons for VM controls.
Also added new icons.
2019-11-15 19:59:05 +02:00
jtuu
69f044ead1 [VM] Changed how mapping labels to segment indices works slightly. 2019-11-15 19:59:05 +02:00
jtuu
5c6dc50b4e Started working on stepping execution for QuestRunner.
Step over and step in kind of work but there are still bugs. Step out is unimplemented.
2019-11-15 19:59:05 +02:00
jtuu
6fc543bdff Fixed bug where calling SimpleListProperty.prototype.remove with an argument that did not exist in the list would corrupt the list.
Caused by not checking the return value of Array.prototype.indexOf.
2019-11-15 13:38:09 +02:00
jtuu
911bde2bd9 Highlight the source location currently being executed when VM pauses. 2019-11-14 00:34:07 +02:00
jtuu
90ad66e96d Breakpoints now cause VM to pause. 2019-11-14 00:31:20 +02:00
jtuu
144e9513ac Added toggleable icons that represent breakpoints in the script editor. 2019-11-13 21:51:30 +02:00
jtuu
fbc9d96d25 Fixed VM state resetting. 2019-11-13 21:50:01 +02:00
jtuu
d2b57bb0c6 [VM] Implemented template string parsing for arg_pushs.
Most of the tags aren't implemented though.
2019-11-13 19:10:30 +02:00
jtuu
2267419c8e Fixed a bug where parsing RLC files would always fail.
Caused by the PRC buffer cursor not being rewound before and after decryption.
Fixes #3.
2019-11-12 22:23:38 +02:00
jtuu
66525ca00c Added definition for opcode 0xf882 get_pl_job. 2019-11-12 17:10:03 +02:00
jtuu
d85de25f31 [VM] Fixed a bug where string arguments did not have a null terminator. 2019-11-11 23:00:56 +02:00
jtuu
f6b766bda3 Fixed VM tests that were broken by the changes to ExecutionResult. 2019-11-11 18:09:51 +02:00
jtuu
b8db5d46fc [VM] Allow last instruction to return an ExecutionResult other than Halted.
The next call to execute will then be a no-op and return Halted.
2019-11-11 18:07:26 +02:00
jtuu
87cabac307 Added a unit test for list opcode. 2019-11-11 16:08:38 +02:00
jtuu
6b2a61bc4f Added RegTupRef argument support for the argument stack. 2019-11-11 16:07:25 +02:00
jtuu
fbd4df4b58 Changed the way VM input is handled.
Now the VM informs the runner when it requires input via ExecutionResult. Input is provided to the VM by calling methods directly on it.
Also implemented opcode list.
2019-11-11 15:21:13 +02:00
jtuu
b9e762fa6e Use the new message log in QuestRunner. 2019-11-08 18:34:58 +02:00
jtuu
7e99857baf Added a message log in the quest editor.
QuestEditorStore was extended to hold the state of the message log. The view is handled by a new core GUI class MessageLog.
2019-11-08 15:07:46 +02:00
jtuu
065b6333a6 Added style for Golden Layout's close button. 2019-11-07 11:42:29 +02:00
jtuu
8247934e78 Changed the items argument of DropDown to be readonly as it doesn't need to be mutable. 2019-11-07 11:38:10 +02:00
Daan Vanden Bosch
9545f056ab Added QuestRunner for managing game state, orchestrating the VM and controlling the visual aspects of a virtual quest run. 2019-11-05 21:07:17 +01:00
Daan Vanden Bosch
4a755a884f Entity world-relative rotation now stays constant while translating manually. 2019-11-04 18:02:30 +01:00
Daan Vanden Bosch
db9d15b78a Fixed bug in computation of inverse rotation of section. The bug manifested while manually translating an entity across a rotated section. 2019-11-04 18:01:11 +01:00
Daan Vanden Bosch
8212348a81 Made event rendering more robust. Added call_now option to ListProperty.observe_list. 2019-11-04 17:19:57 +01:00
jtuu
e7a39168ae [VM] Print a warning instead of throwing an error when a unimplemented opcode is encountered. 2019-11-01 21:05:20 +02:00
jtuu
4441435302 [VM] Implemented opcode set_episode and made it possible to load the entire quest in the VM. 2019-11-01 21:04:50 +02:00
jtuu
89a119e90d Modified the function convert_quest_from_model to do a deep copy of the given object.
Added a couple other cloning functions.
2019-11-01 18:13:32 +02:00
Daan Vanden Bosch
af5c27a565 Removed unnecessary console.log statements. 2019-10-31 19:11:58 +01:00
Daan Vanden Bosch
ee76fb8aea Merge remote-tracking branch 'github/master' 2019-10-31 19:11:20 +01:00
Daan Vanden Bosch
f1fa19238d Event DAG edges are now shown with lines. 2019-10-31 19:11:14 +01:00
jtuu
c726cd3461 [VM] Implemented gettime opcode. 2019-10-30 23:00:06 +02:00
jtuu
260c070f34 [VM] Implemented get_random opcode and added a unit test for it. 2019-10-30 21:02:35 +02:00
Daan Vanden Bosch
95da6e9e57 Logging when duplicate events are encountered. 2019-10-29 15:26:10 +01:00
Daan Vanden Bosch
5f1b3d5ff1 Quest events are now grouped in DAGs. 2019-10-29 15:22:46 +01:00
Daan Vanden Bosch
dff39bd194 Improved events view UI. 2019-10-27 23:21:58 +01:00
Daan Vanden Bosch
13fd0a984c Fixed bug in QuestModel. 2019-10-27 22:47:38 +01:00
Daan Vanden Bosch
2ed9659d9b Only the current area's event chains are now shown. 2019-10-27 22:40:26 +01:00
Daan Vanden Bosch
a72b51511c Added many unit tests to the observable module and fixed a bug. 2019-10-27 22:39:47 +01:00
Daan Vanden Bosch
cced7539c5 Added ListProperty.filtered. 2019-10-27 19:33:16 +01:00
Daan Vanden Bosch
d6ebb8e21a Added simple transparency to entities. Seems to work for most entities except for those that use translucent texture to emulate light rays etc. 2019-10-27 16:45:30 +01:00
Daan Vanden Bosch
e6d1730e26 yarn upgrade. 2019-10-26 17:41:13 +02:00
Daan Vanden Bosch
a8997e66a9 Removed bind_bi from Property. 2019-10-26 17:03:12 +02:00
Daan Vanden Bosch
22cf7165f8 Tweaked combobox arrow button. 2019-10-25 18:46:19 +02:00
jtuu
27e0d2fd6d [VM] Added a unit test for float arithmetic. 2019-10-17 23:57:47 +03:00
jtuu
f42d66e7e1 [VM] Transform float arithmethic arguments to valid 32-bit floats. 2019-10-17 23:53:15 +03:00
jtuu
2caa4eea2b Fixed a bug in QST header parsing.
Headers were parsed incorrectly if the basename of the file chunk was less than 5 characters.
2019-10-17 23:36:25 +03:00
jtuu
48f525a3bd [VM] Fixed floating point arithmetic opcodes.
They were broken because they weren't actually using floats.
2019-10-17 22:11:59 +03:00
jtuu
2906c8b577 [VM] Added unit tests for integer arithmetic. 2019-10-17 21:48:21 +03:00
jtuu
fc2e7647fe [VM] Throw error on division by zero. 2019-10-17 21:38:47 +03:00
jtuu
cd52ca4576 [VM] Made the implementation of opcodes letb and letw more correct. 2019-10-17 20:02:53 +03:00
jtuu
4b7e03931c [VM] Implemented opcodes leta, flet and fleti. 2019-10-17 19:58:31 +03:00
jtuu
da6cdc7d74 [VM] Reset state more thoroughly when halting and loading new object code. 2019-10-17 18:44:05 +03:00
jtuu
755e38c76a Removed unused imports. 2019-10-17 17:53:20 +03:00
jtuu
4e9507cd3e Changed argument type of VirtualMachineIO.prototype.error from string to Error.
Also lint.
2019-10-17 17:50:19 +03:00
jtuu
bcc24e7a47 [VM] Added a unit test for window_msg. 2019-10-17 15:56:22 +03:00
jtuu
064f0659e4 Moved a function to test utils. 2019-10-17 15:14:13 +03:00
jtuu
cb81b988e5 [VM] Made the methods for getting register values public to enable unit tests.
Also renamed them so it's more obvious what they do.
2019-10-17 14:45:59 +03:00
jtuu
416e15e68e [VM] Changed some warnings into errors and added source locations to warnings. 2019-10-17 14:40:47 +03:00
jtuu
f3c26f9eda [VM] Added an interface for handling the virtual machine's IO. 2019-10-17 14:21:45 +03:00
jtuu
4cd0b58f66 Added a decorator for marking methods as stubs. 2019-10-17 12:01:37 +03:00
jtuu
f8dc1af8ea Split VM code into separate files. 2019-10-15 15:34:30 +03:00
jtuu
9facc6357c Dispose threads when VM halts. 2019-10-11 15:02:54 +03:00
jtuu
c7b27846c8 [VM] Quick and dirty implementation of window_msg, add_msg and winend. 2019-10-11 12:49:20 +03:00
jtuu
4499009e5a Added methods for reading strings at specific offsets to Cursor. 2019-10-11 12:48:49 +03:00