Organization: TerasologyFoundation / MovingBlocks
Project: Event Recording Feature
Terasology is a voxel sandbox game that focuses on grating player content through the addition of modules, and during this year GSOC, my goal was to improve the game's Quality Assurance by adding the possibility to record some events and replay them to create Regression and Acceptance tests with the replays. It is with great satisfaction that I can say that I was able to achieve my goal by the end of the working period!
With the Record and Replay feature, it is possible to play the game while recording some events, mostly Input Events, and then replay them. A new Module was created to add testing support to the replays, making it possible to write JUnit tests for the replays that can be used as Regression and Acceptance tests. With them, it is possible to assure that the player is being spawned in the correct place, that an axe always causes more damage to a tree than a pickaxe and many more possibilities!
There were many challenges during the creation of these features, especially because I had to have a good understanding of how the entity and event system worked, how to initialize a game without graphics (headless game), obtain the variables I needed for testing, how Terasology serialized and saved its data and how the UI worked. Besides having to learn all those things at least to some extent, the biggest challenge was the bugs, and there were many! The bugs were a real test of my problem-solving ability, but I am glad to say I was able to fix a great part of them.
Contribution Summary
Link to the Pull Requests:
https://github.com/MovingBlocks/Terasology/pull/3376
https://github.com/MovingBlocks/Terasology/pull/3416
https://github.com/MovingBlocks/Terasology/pull/3442
https://github.com/MovingBlocks/Terasology/pull/3443
https://github.com/MovingBlocks/Terasology/pull/3445
https://github.com/MovingBlocks/Terasology/pull/3455
https://github.com/MovingBlocks/Terasology/pull/3458
https://github.com/MovingBlocks/Terasology/pull/3462
https://github.com/Terasology/ModuleTestingEnvironment/pull/5
https://github.com/Terasology/TestReplayModule/pull/1
https://github.com/Terasology/TestReplayModule/pull/2
https://github.com/Terasology/TestReplayModule/pull/3
Link to the Wiki pages I've created:
https://github.com/MovingBlocks/Terasology/wiki/How-to-Use-Record-and-Replay
https://github.com/MovingBlocks/Terasology/wiki/Replay-Tests
https://github.com/MovingBlocks/Terasology/wiki/Record-and-Replay-Code-Details
Link to my Terasology's Forum Thread:
https://forum.terasology.org/threads/gsoc-2018-event-recording-proposal.2169/
Replay Tests code Examples:
Replay Test Using ReplayTestingEnvironment
Replay Test Using ReplayTestingEnvironment
Showcase Videos:
Future Plans and Ideas:
The Record and Replay feature has a lot of potential and I already have some ideas of how to improve and extend it:
Improve its UI by moving some buttons and creating a screen to select the name of the recording.
Improve the event's serialization.
Expand its support to Modules.
Link to the Issues created:
https://github.com/MovingBlocks/Terasology/issues/3465
https://github.com/MovingBlocks/Terasology/issues/3466
https://github.com/MovingBlocks/Terasology/issues/3467
https://github.com/MovingBlocks/Terasology/issues/3468
https://github.com/Terasology/TestReplayModule/issues/4
Acknowledgments:
I want to thank Google and the whole TerasologyFoundation community, but especially my mentors Cervator, Arav Singhal, Daniel H and Aresh Mishra for the support and guidance. This was a great experience in which I improved my problem-solving skill and learned a lot about code and documentation quality!
Comments