Water ... that adapts itself to the flow, that breaks everything like a sword
Mixing libraries
Get link
Facebook
X
Pinterest
Email
Other Apps
-
Let us try blogging again. If you search L.B.A. Tribute news you can find them at coffemonsters.com Here we will be focusing on more technical stuff.
These days I'm tracking some delay in the processing of interaction between my UI (Qt) and Backend (custom code). Generally still far from resolving issues but slowly digging through problems. One of them hit me as an interesting one: QtTimer.
I'm using them because they are the most efficient way of injecting some processing into Qt. If this claim is true I'm not sure but they for sure work better than anything I tested so far.
Generally, my whole tooling is based on multiple processes that communicate with each other. I got a little bit more into the details in the presentation that I did recently:
This setup result that I have multiple Qt event queues processing at the same time. One in the base process and one in the sub-process. It is really important, that they are processed efficiently because I discovered the hard way that if one of them lags other can lag too. Issue that on top of the Qt events I need to process in equal intervals some other tasks.
I thought originally that I would be processing events for some time and then move to additional ones:
QApplication app;
while(!isTerminated())
{
app.processEvents(QEventLoop::AllEvents, 100);
apiEditorMainLoop();
}
This turned out to be pretty inefficient as processing events with a timelimit is in Qt an active wait. Processes that did not have a lot happening were eating my CPU powers like kid candies :/ I dig a little bit and a better option would be to just allow Qt to process all system events without any timer. Then. Qt can enter wait on object which is more CPU efficient.
And it turned out it was as now I achieved a nice 0.01 CPU use for the majority of apps. But today digging around in the profile I discovered an issue:
What happens is that in apiEditorMainLoop() I'm using SDL_PollEvent(...) which leads to nested calls.
From what I understand QtTimer uses system timers that can be triggered while processing events using SDL. But I of course can be wrong here.
Still, it is interesting for me how sometimes while mixing some libraries we get this weird stuff.
So like always start with problem description: I have some pool of command represented as enumerator. Each of command can have unique data that size can be different. I wanted to create system that allow me in easy way iterate over them and execute. After some time I created this implementation: template<ECommands::enum cmd> bool execCommandTemp(ECommands::ENUM a_cmd, void* a_data) { if (a_cmd == cmd) { SCommand<cmd>::execute((SCommand ::SData*)a_data); return false; } return execCommandTemp<(ECommands::ENUM)(cmd+1)>(a_cmd, a_data); } template<> bool execCommandTemp<ECommands::WRAP>(ECommands::ENUM a_cmd, void* a_data) { return true; } bool execCommand( ECommands::ENUM a_cmd, void* a_data ) { return execCommandTemp<(ECommands::ENUM)0>(a_cmd, a_data); } where SCommand look in example such a way: template <> st...
On begin I wold like to thanks two people: You Tube user rezoner1337 for publishing info about remake on wykop and gog.com forum user M2Grzegorczy for this topic . It's really great to see that they shown such a initiative and to say truth the moment I saw this posts I couldn't believe. So what else left for me thanks you again. Second thing is the problem I was pinpointed by few people: there is no easy way to communicate with me. So I added email contact on blog because alexfont wrote that he couldn't found any. Maybe any of you have other proposition how to make contact with me easier? And on end progress of game: this week I spend mostly on AI and removing sliding of player. I will not say to much here because I plan to show both things in next movie which will have this time music created specially for game by Jesse Gorter . From more interesting changes is shown of discrete mode with animation and influence on gameplay. So e...
W ostatnich miesiącach rozpocząłem pracę wiec trochę mniej czasu pozostało na programowanie. Jednak udaje mi się go trochę wygospodarować. I tak poza kursem CUDA który realizuję na uniwerku. Moim głównym zajęciem jest tworzenie WRE jest to mój silnik wyposażony dodatkowo w edytor. Póki co nie ma za bardzo co pokazywać bo głównie poświęcam się rzeczą mało widocznym ale systematycznie w miarę dorzucam nowe rzeczy. Ostatnimi czasy zajmowałem się trochę systemem materiałów który doczekał się w końcu dziedziczenia :] pomaga to wielce w tworzeniu nowych materiałów. Zmienił się również system OCtree który w razie potrzeby potrafi się już rozszerzyć (w stosunku do wejściowego obszaru). No i dość dynamicznie rozwija się również edytor. Jak widać na screenie jestem już w stanie stworzyć prostą scenę jednak jeszcze dość długa droga zanim będzie można w nim łatwo i wygodnie tworzyć lokacje gry.
Comments
Post a Comment