ENIGMA Forums

General fluff => Announcements => Topic started by: Goombert on June 29, 2018, 07:23:13 am

Title: Graphical Fidelity Testing and Engine Cleanup
Post by: Goombert on June 29, 2018, 07:23:13 am
(https://i.imgur.com/7cZAYim.png)(https://i.imgur.com/HBHssYx.png)
Note: The two images are intentional false positives I did for the purposes of demonstrating the bot and to verify its behavior.

Hey guys! I've been busy for a few days working on a side improvement to the engine code base that I want to share with you all. It is closely related to the SDL changes fundies recently announced as well as us adding support for Direct3D11 and modern OpenGL ES. We have basically extended our continuous integration to perform an image analysis on graphics tests to improve graphical fidelity both between the graphics systems as well as between ENIGMA and GameMaker. This is still a work in progress but I just this morning got it fully working to where we can successfully screencap the game in the Travis CI virtual machine (minor bug in our test harness taking the screenshot directly after game start and before any draw events were processed).

You can see what we're up to on the pr here:
https://github.com/enigma-dev/enigma-dev/pull/1291

We expect to have it merged soon and will then be adding drawing tests from here on out.

I've also cleaned up the tile drawing code and optimized them on top of the vertex buffer functions I added for GMS compatibility. They are slightly different though because I use an index buffer to render them more optimally as an indexed triangle list. Regardless, from my benchmarks we can see that the tiles are not only more consistent now but also build and render much faster. When me and fundies get these image comparison tests merged into master, I will add a tile drawing test to prevent future regression of the functions and finally merge in the new tile code.
https://github.com/enigma-dev/enigma-dev/pull/1238

I will be following up those changes by rewriting the model classes as well:
https://github.com/enigma-dev/enigma-dev/pull/1289

The whole point of this changeset is to have less duplicate code by using proper abstractions of vertex and index buffer concepts, while essentially providing both to the user. This not only improves what ENIGMA already provided, but will bring new features and functions that users have desired. With all of that in place it will be super easy to finally have OpenGL ES working again as well as Direct3D11 because building a graphics system then simply consists of making each graphics system have working vertex functions.

I hope everyone likes these changes and will find that it's going to significantly improve the project. Open to comments/feedback/suggestions as always.
Title: Re: Graphical Fidelity Testing and Engine Cleanup
Post by: Goombert on August 06, 2018, 01:48:55 pm
I wanted to update this post a bit with some newer info on the drawing tests. We have finally merged them but we made some significant changes to the architecture. We no longer compare the results against golden images because we want to keep binaries out of the repository so cloning is quicker. What we do now is simply output the images from each draw test to a temporary directory and then essentially compare all the files in each directory.

We report when new tests are added or removed.

(https://i.imgur.com/B1W6x7Q.png)

That is from a test I recently added when fixing a tile-related regression that occurred in HitCoder's Sonic game. The issue was that the tiles vertex buffer and index buffer was not cleared during room transition.
https://github.com/enigma-dev/enigma-dev/pull/1349

(https://user-images.githubusercontent.com/3212801/43689010-78889e1c-98c1-11e8-9879-f251ab327d18.png)

Adding tests in this way ensures that once issues get fixed, they don't come back again in the future. I hope that this shows to everyone this will lead ENIGMA to being more stable than it has ever been before! The future of the project is looking really bright.
Title: Re: Graphical Fidelity Testing and Engine Cleanup
Post by: hpg678 on August 06, 2018, 02:01:16 pm
Thanks great! All good!


 (Y) (Y) :woop: :woop:
Title: Re: Graphical Fidelity Testing and Engine Cleanup
Post by: Goombert on August 07, 2018, 10:41:59 am
Update again: We've now added a test for 3D shapes (though they aren't completely correct in GL1 right now, we'll at least know when they change).
https://github.com/enigma-dev/enigma-dev/pull/1350

(https://i.imgur.com/f77cI0J.png)