Download
(14 Kb)
Download
Updated: 01/13/21 02:39 PM
Pictures
File Info
Compatibility:
Markarth (6.2.5)
Updated:01/13/21 02:39 PM
Created:11/03/20 03:24 PM
Monthly downloads:30
Total downloads:2,559
Favorites:4
MD5:
Testify
Version: 1.1
by: Wheels [More]
Dependencies: LibAddonMenu, LibAsync

IF YOU AREN'T A DEVELOPER, DON'T USE THIS

This addon will break the Crown Crate UI while enabled, haven't found a fix yet. You'll still get your crate contents, but your wonderful Crown Crate Experience will be ruined. Would advise disabling while opening crates, but there is no other performance impact having it enabled otherwise.

Huge thank you to all of the developers that helped me get this working: Sirinsidiator, Solinur, Baertram, etc!


Testify is an event recording and playback tool to assist in developing addons. It will allow the developer to record scenarios of events and play them back to addons for testing purposes.
The window can be opened with /testify

Recording:
In the recording section, you can enter the name and start recording, which will capture all events as defined in the recording function. To customize what you record, modify the function found here.

Management:
In the management section, you can either save/delete a currently loaded scenario, or load/delete a saved scenario. Scenarios must be manually saved after they are recorded. The save and load process is a little lengthy due to some poor string processing, but it results in much less space being used in the saved variables files so you can store more scenarios. MAKE SURE ALL DATA MODULES ARE ENABLED IN THE ADDON MENU.

Playback:
In the replay section, you can select a loaded scenario and an event manager, as well as defining where in the scenario you would like to start your playback (default is frame 1). Starting playback will run through the recorded events in the scenario, and send them to the selected event manager, which will then fire registered callbacks from addons as if it were the ZoS event manager.
Note, filters must be implemented manually, and as such only a few are currently supported (I have added the ones I use so far). If you need another filter and are feeling generous, please implement it and either contact me with the change or submit a pull request on the git repo. Otherwise, inform me of the filter so I can prioritize it.

How to Implement:
While Testify will override the zos event manager and capture all registrations that occur after it loads (make your addon optionally dependant on Testify to use this feature!), I would highly suggest creating your own event manager for playback performance and test environment isolation. Doing so is simple, and can even be packaged in a deliverable addon without issue:
First, make your addon optionally dependant on Testify to ensure the tool is loaded first.
Second, when defining your reference to the event manager in your addon, change it to a line like this:
Code:
sam.EM = EventCallbackManager and EventCallbackManager:New("SamuraiManager") or GetEventManager()
This will check if Testify is currently loaded, and if so create an event manager with the name of your choosing, otherwise using the event manger provided by zos. You can now interact with this custom event manager the exact same way you would with the zos one, as it forwards all requests to the zos one in addition to saving all registrations.

NOTICE:
There is no 'sleep' function available to addons. The only way to wait a period of time before firing addon code is to use the RegisterForUpdate method (and references too it like zo_callLater). Additionally, the shortest period of time that can be delayed using these methods is ONE FRAME. As such, in order to minimize the amount of desync that appears during scenario playback, you want to have as much FPS as possible to reduce your frame time (the amount of MS each frame is shown). This will be less important on replays with more spread out events, but trial combat causes multiple events per millisecond to be recorded, and playing this back accurately is very difficult. I have had my best luck so far at about 400 FPS playing back a scenario with up to 5 events per millisecond, with reasonable desync. If you have suggestions on further optimization, please reach out!

I plan to continue working on this, improving playback performance as much as possible, adding additional filters, and various QoL improvements. Please feel free to make suggestions! Of course, if you find bugs please report them so I can fix them, but keep in mind this is a dev tool, so I'm more concerned about issues with playback rather than visual issues with the UI
1.1:
- fixed issue where the unit tag filter for effect_changed looked for a substring instead of an exact match
- added chat message logging by default
Optional Files (0)


Archived Files (1)
File Name
Version
Size
Uploader
Date
1.0
14kB
Wheels
11/03/20 03:24 PM


Post A Reply Comment Options
Unread 12/28/20, 10:32 PM  
Wheels
AddOn Author - Click to view AddOns

Forum posts: 60
File comments: 80
Uploads: 22
Originally Posted by DewiMorgan
I was wondering if this might cause problems for ZOS, but it looks like it just records and plays back events, not inputs, so should be in line with their ToS?

Still looks very handy for testing
This can't be used for automating inputs into the game, so there shouldn't be an issue.
Report comment to moderator  
Reply With Quote
Unread 12/28/20, 03:43 AM  
DewiMorgan
 
DewiMorgan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 14
File comments: 82
Uploads: 1
I was wondering if this might cause problems for ZOS, but it looks like it just records and plays back events, not inputs, so should be in line with their ToS?

Still looks very handy for testing
Last edited by DewiMorgan : 12/28/20 at 03:45 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: