Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw Before Step #1475

Closed
wants to merge 1 commit into from
Closed

Draw Before Step #1475

wants to merge 1 commit into from

Conversation

RobertBColton
Copy link
Contributor

@RobertBColton RobertBColton commented Dec 20, 2018

This actually does make a difference if a draw, instead of step, event is the first event after the create and start events. To avoid having to make complicated changes to the event system, my solution in this pull request simply adds a screen_redraw call to the end of the load sequence, which gives the same effect anyway. This pull request changes ENIGMA to be more like older GameMaker 5-8, instead of being like GMSv1.4 in this regard.

I made a test GMD project: draw-step-order.zip

  • ENIGMA Master: create (black), step (black), draw (black), step (gray)
  • This pull request: create (black), draw (black), step (gray), draw (gray)
  • GameMaker 5: create (black), draw (black), step (gray), draw (gray)
  • GameMaker 8: create (black), draw (black), step (gray), draw (gray)
  • GMSv1.4: create (splash), step (splash), draw (splash), step (gray)

Practical Implications

I've found one game alone that is directly affected by this and it's the Wild Racing game. Its start screen is drawn in an alarm that is set to 1 in the create event. In GameMaker 8, this means the control information is drawn like a HUD on top of the already drawn scene. In ENIGMA master and GMSv1.4, a step event occurred between create and the alarm, so the alarm event will draw on top of a black backbuffer. This does not entirely fix ENIGMA however because screen refresh differences between D3D and OGL mentioned in #1474 are also related to whether the backbuffer was discarded just prior to the alarm event.

ENIGMA master (D3D and OGL)/Pull request (GL)/GMSv1.4

Wild Racing Init Black

Pull request (D3D)/GameMaker 8/GameMaker 5

Wild Racing Init Scene

@RobertBColton RobertBColton added Graphics Game visuals including render state, geometry pipeline, rasterization, and related assets. Compatibility Impact compatibility with legacy systems or GameMaker. labels Dec 20, 2018
@RobertBColton RobertBColton added the Feedback Needed Input is requested by other users and contributors. label Dec 20, 2018
@codecov
Copy link

codecov bot commented Dec 20, 2018

Codecov Report

Merging #1475 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1475      +/-   ##
==========================================
+ Coverage   17.42%   17.42%   +<.01%     
==========================================
  Files         165      165              
  Lines       17122    17123       +1     
==========================================
+ Hits         2983     2984       +1     
  Misses      14139    14139
Impacted Files Coverage Δ
ENIGMAsystem/SHELL/Universal_System/loading.cpp 87.5% <100%> (+0.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 092a9c3...4c2cffa. Read the comment docs.

Copy link
Member

@JoshDreamland JoshDreamland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't how you do this. Change the order in events.res. Although, if this actually solves a problem, we can talk about whether it's worth the new problems it introduces by running before half of everything is initialized.

@RobertBColton
Copy link
Contributor Author

RobertBColton commented Dec 21, 2018

@JoshDreamland two questions with regard to that.

  1. If we change it in events.res then how would we add forward compatibility? Hypothetically, doing it my way we could use the compatibility flag (if it gets fixed by Compatibility Setting Unusable In Sources #1461) and make it compatible with old and new GM.
  2. It still runs after create events, so why are you initializing in the step event?

@JoshDreamland
Copy link
Member

For now, they'll switch it out manually in events.res. In the future, we may want to add preprocessing to that file.

I'm not initializing anything in the step event. I just noticed you're running this immediately after the normal room load event chain, so this is unlikely to hit problems with uninitialized objects, but that doesn't change the fact that it's going against the flow defined in events.res.

@RobertBColton RobertBColton added the Experimental Features that are new and still being explored. label Mar 10, 2019
@RobertBColton RobertBColton deleted the draw-before-step branch December 31, 2020 04:08
@RobertBColton
Copy link
Contributor Author

It's possible this could be because alarms are either off by one or that alarms are supposed to go after draw events, not necessarily that a draw event comes before a step event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compatibility Impact compatibility with legacy systems or GameMaker. Experimental Features that are new and still being explored. Feedback Needed Input is requested by other users and contributors. Graphics Game visuals including render state, geometry pipeline, rasterization, and related assets.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants