Therefore, this fix is now incompatible with an up to date version of the game. It has been tailored only for Build 936, I do not know what are the effects of running it with a newer/older game version.Ī few days ago, SLRR was updated without changing the build number. Proper fix for that is to scrap this “optimization” and replace it with a strncmp function, which will gracefully return if line has less than 4 characters left.Īll documented fixes have been assembled into a proof-of-concept plugin. In my case, CFG reader tried to obtain tag close to the end of line, so it attempted to read invalid memory. While this seems harmless, it was a yet another cause of my crashes! This is a harmless optimization, as long as you ensure that at least 4 bytes of line are readable. Tag = * ( uint32_t * ) line if ( tag = ' ALCI ' ) Somebody came up with a “nice” optimization of parsing four-character long tags by interpreting them as a 4-byte value: Where I (finally) got into the game without a crash after fixing two previous issues, and then crashed… as soon as I pressed throttle!Īddressing that mistake in files of course helps, but ideally CFG parser should be updated to properly handle these cases (this game hates null terminated strings! Why?).Īgain (most likely) related to CFG file parsing. Unfortunately, this seems to be the case with at least 3 CFG files in the game – and it’s been a cause of a rather comical crash during testing, Annoyingly, tokenization does not seem to stop at a null terminator, so if the file does not end with a newline, Once again, my fix is to strncpy one character less and zero the last character on my own.ĬFG reader used by the game seems to tokenize lines by newline characters. Once again, logic in here is off by one – before being overwritten by zero, it is possible for the last character from src to be copied, and size + 1 logic present in the code once againĪttempts to copy character from memory which may be invalid! It doesn’t matter that it is being overwritten shortly after – any attempt to read from invalid memory may result in a crash. Strncpy_terminate(dest, src, size) appears to be a custom string copy function, which copies up to size characters from src to dest, and then overwrites the last character in dest with \0. Turns out, there are a lot of places in the code which do things like:ĭest = ( char * ) allocateMem ( size + 1 ) this -> text = dest strncpy_terminate ( dest, src, size + 1 ) this -> text = '\0' Crashing function was very suspicious, but I quickly identified it as memmove. With memory debugging tools enabled, I couldn’t even get to the game. Several hours of debugging, poking the game with different tools and disassembly analysis resulted in several findings: There is a noticeable amount of random crashes, which seem hard to reproduce – documented issues may be one of several reasons behind those. Please think twice before calling somebody out on “how buggy the game is”.įor the record, none of the found issues are normally fully reproducible, so it’s not like the game crashes for everybody all the time. Bear in mind that this is a code inherited from another developers, so most/all found issues trace back to the original game and not Raxat’s take on it. Of found issues, it may get very technical.ĭISCLAIMER: Although I am pointing out bugs in the game, its developer should not be blamed for them. Thankfully Raxat, main developer, is active online, so a much better way to help is to relay found issues directly! Therefore, since this post is meant to work as a documentation Of course! A new SilentPatch is out of question however – the game is still being maintained, so SilentPatching it could potentially turn into a non-hostile game of cat-and-mouse. However, it appears like game got just a bit less buggy than it used to be years ago… There is no better way to reunite with a game after years than to buy its digital re-release, and so I did! (like forementioned v2.2.1 MWM and v2.3.0). This was made obvious by the amount of official patches the game received, as well as numerous modifications overhauling the game and fixing some of its long standing issues However, this game has one major problem – it’s absolutely riddled with bugs! Concept of this game is pretty great, and I have pretty fond memories of playing v2.2.1 Miran Wichur Mod (yet another unofficial patch/expansion to the game, made by fellow Poles) around 2006.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |