Skip to main content

More progress on my task & getting close to the finish line

Hello! I was not as close to finish as I had estimated before. However, I have some more good progress on my task!

Right after my blog the previous week, I found the problem which was making me very concerned about my code. Whenever I ran ScummVM, it took about 20-30 seconds to start. I was worried that some of my code could be troublesome, but then I found out my configuration file was a little too big.

The configuration file (scummvm.ini) stores some useful information and is often low in size (~10KB) or so. In code, we interact with this file using "ConfMan". For my previous task, I configured this to get a boolean from the .ini file to force the RTL-based GUI.

I think some of my temporary code would have caused this issue. The ini file was around 150MB big!


I was curious to see what it contained, so I opened it in sublime. It took ~15 minutes to open and it had this:


15 minutes! For my own amusement, I have saved this file in another location. I simply deleted the file and relaunched scummvm, and I was so happy when it was running smoothly! I was genuinely thinking I made a big mistake somewhere or my code is very poor. Phew!

Apart from this little incident, this week I also enabled all engines in my project. Previously I had only enabled one to speed up compile times on my potato pc.

The compilation times really took a lot. A lot of time. There were ~350 errors after the first time I enabled all (stable) engines. I solved all of them, and the project was now fully compilable!

I also had to add in support for my own version of printf, which took in U32Strings. To be honest, the existing code was really confusing to me, because I hadn't really dealt with language-feature level code before. My mentor pointed out a good StackOverflow answer, which helped a bit to understand but I was still confused.

After getting nowhere on it for an hour or so, I thought I would just write a temporary code to get started. I passed in the code as U32String and used iterators to loop through and check for "%", then switch according to characters. I did this only for 1 argument because I wasn't really sure how to do it for a variable number of arguments.

Following along slowly side-by-side with the answer from StackOverflow and the existing code of ScummVM, I was able to do it!

So, what's next? To adapt my code across the project, I am now nearly modifying ~210 files when compared to the master. This means that I have to be more careful of my code effects, and more testing. Even though I plan to open the PR soon, I am thinking it will be a few more days to test out everything and make sure there is no funny business (like the 150MB ini file!)

That's it for this week's progress! I have one more thing to say, though. My previous task - "RTL GUI" is near merge now. My mentors have told me that now is a good time to look back and reflect on my task because I have achieved the first milestone. It's a great idea, and I will be writing a new post regarding this, and it will be going up shortly after this post!


Thanks for reading!

Comments

Popular posts from this blog

The (official) end of an amazing journey!

 Hello! GSoC has officially ended, and I'm in the final stage - submitting my work for the entire summer to Google! When I first received the acceptance letter in May, I was very much baffled. It was exciting and a bit scary at the same time, because I have never ever worked on a project of this scale. Well, first time for everything I guess :) So, what have I been doing this past week? Last week I left off saying my U32 PR was showing some activity, and this week, @criezy helped out a lot by reviewing my U32 PR, and providing much feedback. He also helped out pretty much entirely towards the MacOS/iOS platforms, because it was quite not an area (Objective-C) I was comfortable in. It was really a huge help. Apart from that, I mostly spent the entire week looking at the PR to see what could be changed, fixing my mistakes, and making the PR ready for merge. It has improved quite a lot!  Criezy pushed an update for iOS, which led me to believe that there might be many more missin...

Touching upon all 3 tasks

Hello! So, this week I have done things that ranged across all my tasks. Recently I checked out our sister project, ResidualVM. ResidualVM's codebase is largely similar to ScummVM, but the main difference is the addition of capabilities to run 3D games. They also take regular snapshots from ScummVM to keep up-to-date. So, the work of RTL GUI which was merged in ScummVM was also present there. When I was running the application with the Hebrew language, some popups and drop-down buttons looked quite different from the normal GUI. Upon a little investigation, it looked like paddings were being set wrong for the RTL-widgets set in the theme. This was because back when I was on my RTL task, I temporarily set a padding of "2" as a placeholder to check, and then completely forgot about it as the difference was ever so subtle. I'm glad though, that I found this, and opened a PR to fix it. English, proper paddings Hebrew - Improper paddings Hebrew, mirrored and matching paddi...

Getting a better understanding & a little progress

Hello! The first few days this week, I spent trying to understand my task, and work on a small number of engines, and try to make games detect/work as a means to see if everything would work as expected. But first, some context. ScummVM has a MetaEngine and a Engine. MetaEngine A MetaEngine is responsible for, as the name would suggest, a meta-data related things before we actually start the engine. This is an abstract class, and each specific engine must inherit it and have their own implementation of it. Alternatively, we also have an AdvancedMetaEngine, inheriting from MetaEngine, which provides a default Game Detection algorithm - which saves individual engine developers the hassle of providing detection tools. The detection algorithm is an Md5 + filename check and makes game detection easier for engines. These engines can inherit from AdvancedMetaEngine and provide some other metadata/utility functions, like getting supported games, querying which features an engine has, etc. Adva...