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

Reduce interface terminal TPS impact + break some backends + new gui #394

Merged
merged 22 commits into from
Oct 27, 2023

Conversation

firenoo
Copy link

@firenoo firenoo commented Sep 27, 2023

I really wished the star import refactor was done after this, because now there are merge conflicts... eh wasnt too bad, fixed

This is actually a subset of the features I want to implement.

Backend Changes

  • Reduce the rate at which server-side changes are polled. Before this was done on every tick, but this has been changed to when changes were detected on either the ME network (i.e. a connection was added) or when the player performs an inventory action.
  • Deprecate (it's only been like 5 versions lol) the old interface terminal handler. Despite approving the old one, I feel like it could have been done a bit better. This is a breaking change with GT5 and AE2FC.

GUI Changes

  • Revisited the GUI. I felt like learning OpenGL, and decided to implement a true viewport widget for the interface terminal.
  • Names of each interface title are pinned at the top.
  • Shift + scroll = scroll from section to section
  • Ctrl + scroll = go to top/bottom of the page.

Would like some brave testers to test this. Initial tests seemed fine, but there are probably a ton of corner cases that need to have bugs squashed.

Copy link

@Laiff Laiff left a comment

Choose a reason for hiding this comment

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

Great work! Will try to reuse Packet logic and container. It mostly does not affect my implementation of LMTerm

Does two things:
* Deprecate old interface terminal support classes.
* Refactors the interface terminal API into AEApi.
* Changes the API to use only relevant operations. Relevant here means
  things we will actually use when the packet format is updated in the
  next few commits.

This is a breaking change, but it won't be hard to fix.
The booting/nonbooting event is posted whenever the ME system starts its
"boot" phase and when the "boot" phase is finished. This commit
distinguishes the two phases.

Some subscribers might need this information to determine whether to push
an update or not.

An example is written in this commit - part interface terminal is only
curious about when the terminal boots back up, not when the network enters
the booting state.
@firenoo firenoo force-pushed the interface_term_simple branch from 248ada6 to f902a46 Compare October 6, 2023 16:18
@firenoo firenoo self-assigned this Oct 6, 2023
@firenoo firenoo added the merge by assignee only assignee should merge label Oct 6, 2023
@github-actions
Copy link

github-actions bot commented Oct 6, 2023

Warning: 2 uncommitted changes
#400

@firenoo firenoo force-pushed the interface_term_simple branch from f902a46 to 7b1a916 Compare October 6, 2023 16:49
@Laiff
Copy link

Laiff commented Oct 7, 2023

What about realtime update in interface terminal from other interactions. Like other player put new pattern if interface or other path that valuable in my implementation for Level terminal state has been changed and we need to notify opened gui about this

@firenoo firenoo force-pushed the interface_term_simple branch from 7b1a916 to c71a2e5 Compare October 7, 2023 14:57
Adds a new packet specifically for updating the entries on the terminal.
Reduces network traffic, potentially significantly, as it allows for
incremental updates instead of sending a fresh list every time the entries
on the list change (Note it WAS smart enough to not send a fresh list if
only patterns changed).

Deprecates appeng/core/sync/packets/PacketCompressedNBT

Commit does not add functionality to handling on the client side yet.
The interface terminal is ripe for many optimizations. This commit seeks
to fix the biggest issues:

* Every tick, the interface terminal checks for any network changes. This
  has been improved to check only when the network has finished booting.

* Every tick, the interface terminal iterates through all of its tracked
  inventories to check for changes. This is bad when the ME system has a
  nontrivial amount of tracked inventories, because it it tries to check
  whether items are different, and is expensive for NBT items such as
  patterns. This has been changed to send changes that have been marked
  dirty.

This commit does not implement handling on the GUI side.
appeng/client/render: Render items using translations

appeng/client/gui/AEBaseGui: Use custom renderSlot

Squash of 2 commits:

* Depth test should be allowed to be used when rendering slots to make it
  easier to support z-level translations rather than use a pass-based
  rendering system.

* This commit disables those depth tests which allows tooltips to be drawn
  before the rest of the screen is drawn, which makes it way less messy to
  code as everything can be done in 1 pass.

MC's native RenderItem disregards z-level when drawing item overlays,
since it disables GL_DEPTH_TEST before drawing it. This commit adds a way
for AE2 to draw slots with its own z-level methods.
@Laiff Laiff assigned Laiff and unassigned firenoo Oct 22, 2023
@firenoo
Copy link
Author

firenoo commented Oct 25, 2023

I will assign laiff so he will decide when to merge. I dont see too many open issues after the last round of fixes so I assume most of them are good. I would recommend another round of tests for each part of the terminal before merging.
Edit: seems like you've already done it.

Fragile parts are the search components (each text box)

Copy link
Member

@miozune miozune left a comment

Choose a reason for hiding this comment

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

2023-10-26_16 14 20
Textbox rendering looks broken in dev env

@Laiff
Copy link

Laiff commented Oct 26, 2023

2023-10-26_16 14 20 Textbox rendering looks broken in dev env

What language should be here? I think utf flag somehow lost for this textboxes

@miozune
Copy link
Member

miozune commented Oct 26, 2023

I typed "yellow"

@Laiff
Copy link

Laiff commented Oct 26, 2023

I typed "yellow"

ok i'll check it

@Laiff
Copy link

Laiff commented Oct 26, 2023

I typed "yellow"

I can't reproduce this behaviour. I tried to enter this in plain english in japan and greek. There are no problem with rendering. Can you clarify what exactly you do to get this strange rendering? And i think it can be splited out into separate
issue

@github-actions
Copy link

Warning: 2 uncommitted changes
#415

@Laiff Laiff force-pushed the interface_term_simple branch from f45a21f to f35c5af Compare October 26, 2023 13:48
Copy link
Member

@miozune miozune left a comment

Choose a reason for hiding this comment

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

The issue I raised is

  • Cannot be reproduced on Laiff's env
  • Cannot be reproduced on my modpack instance
  • Cannot be figured out how to fix on my end

So I'd approve this PR. Great work!

@OneEyeMaker
Copy link

OneEyeMaker commented Oct 27, 2023

@Laiff Look carefully at Miozune's image. It's not the textbox rendering that's broken; it's the rendering order. Look at counts of items. These numbers are rendered behind items. Also word 'yellow' is correctly rendered (if you check width of characters), but every character have some rectangular overlay.

@Laiff
Copy link

Laiff commented Oct 27, 2023

Look at counts of items

Yes there are few problems fix zIndexes, mainly all of them related to DuraDisplay where Depth test completely disabled for overlays. I'll try to figure out solution but separately after discussing with caedis or someone else

@Dream-Master Dream-Master merged commit 4f25784 into master Oct 27, 2023
1 check passed
@Dream-Master Dream-Master deleted the interface_term_simple branch October 27, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge by assignee only assignee should merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants