Toma400 / The_Isle_of_Ansur

Python-based text RPG game, successor of Between Shadows and Light.
Other
9 stars 0 forks source link

Lag during put_rectext, two functions running can almost freeze the game #51

Open Toma400 opened 2 years ago

Toma400 commented 2 years ago

As in title, put_rectext (introduced in 8bfec43) in its current implementation lags the game heavily. Two heavy nested loops put into every program frame are obviously hitting the gameplay, and even though after optimisation (6b0c524) making one function running bearable, this should not stay, especially as someone may want to add new functions through scripts.

Concepts which can help:

Materials which can help:

This is also kinda "call to arms" towards other aspects of the system needing optimisation, as there can be another reasons why the game lags in the first place - though put_rectext function made it clear and obvious, so this is the priority.

Toma400 commented 11 months ago

This goes pretty far into optimalisation part of the game, but also into rewrite of procedural programming part of IoA into OOP one. Since put_rectext isn't used widely, it isn't critical issue to address right now, and it will be automatically solved by introduction of Text object and one-time load.

Moving into pre-alpha 4.

Toma400 commented 11 months ago

Additionally, there's interesting issue with the same element, so passing info here:

Possible issue with - https://github.com/Toma400/The_Isle_of_Ansur/blob/6b0c524d4f841b8b19c9503f956885b8c78d0416/core/graphics/text_manag.py - rect/text spacing in put_rectext

Toma400 commented 7 months ago

Pushing this far beyond current scope. PA7 we go!