Source Code Homefront Revolution

0 views
Skip to first unread message

Vannessa Rataj

unread,
Aug 4, 2024, 4:12:34 PM8/4/24
to horncatchwortcam
Thediscovery of a fully playable version of TimeSplitters 2 being hidden in Homefront: The Revolution this past weekend was a tremendous find for retro gaming enthusiasts. Despite fans clamoring for a modern re-release of the TimeSplitters trilogy, THQ Nordic has been reluctant in putting any of the classic PS2 titles on newer systems. With this Easter Egg, fans can at least play one of the games on current-generation hardware. Interestingly, though, it seems that the full game was never intended to be unlockable in any form.

A new report from Eurogamer has revealed that developer Dambuster Studios (responsible for Homefront) unwittingly ported the codes into its 2016 shooter. After speaking with sources close to the studio -who have remained unnamed-, it turns out the studio didn't even learn of the codes until after Homefront: The Revolution had shipped. The original Easter Egg was only ever intended to be the first two levels of TimeSplitters 2, but porting over all of the original game files with a soft lock on later content was the easiest method given time constraints.


As you can surmise, those hidden unlock codes were a part of the porting process. One of the sources Eurogamer spoke to speculates that these codes were likely included in TimeSplitters 2 for testing purposes or to show off different levels at public events. It explains why accessing later levels within Homefront: The Revolution will sometimes crash the game as Dambuster never tested past the initial two levels.


It's certainly an interesting turn of events for an Easter Egg that many hadn't thought much of in roughly five years. Homefront: The Revolution may still be a rather unremarkable shooter, but it's probably going to see a big uptick in sales thanks to the discovery of these codes.


In May 2016, German game-development company Crytek made the, decision to upload the source code of their game engine, 'CryEngine V' to GitHub. The project is in active development, which leads to a large number of errors in the code. We have already checked the project with PVS-Studio for Windows, and now we can also analyze it using PVS-Studio for Linux. There was enough material for an article with the description of only crucial errors.


CryEngine is a game engine created by the German company Crytek in the year 2002, and originally used in the first-person shooter Far Cry. There are a lot of great games made on the basis of different versions of CryEngine, by many studios who have licensed the engine: Far Cry, Crysis, Entropia Universe, Blue Mars, Warface, Homefront: The Revolution, Sniper: Ghost Warrior, Armored Warfare, Evolve and many others. In March 2016 the Crytek company announced the release of the new CryEngine V, and soon after, posted the source code on GitHub.


To perform the source code analysis, we used the PVS-Studio for Linux. Now, it has become even more convenient for the developers of cross-platform projects to track the quality of their code, with one static analysis tool. The Linux version can be downloaded as an archive, or a package for a package manager. You can set up the installation and update for the majority of distributions, using our repository.


This article only covers the general analysis warnings, and only the "High" certainty level (there are also "Medium" and "Low"). To be honest, I didn't even examine all of the "High" level warnings, because there was already enough material for an article after even a quick look. I started working on the article several times over a period of a few months, so I can say with certainty that the bugs described here have living in the code for some months already. Some of the bugs that had been found during the previous check of the project, also weren't fixed.


The function does nothing because of a typo. It seems to me that if there was a contest, "Super Typo", this code fragment would definitely take first place. I think this error has every chance to get into the section, "C/C++ bugs of the month".


This error is worthy of a separate section. In general, in the CryEngine code, there are a lot of fragments where unsigned variables are pointlessly compared with zero. There are hundreds of such places, but this fragment deserves special attention, because the code was written deliberately.


So, there is an array of unsigned numbers - outArrIndices. Then the array is filled according to some algorithm. After that we see a brilliant check of every array element, so that none of them has a negative number. The array elements have the uint16 type.


The developers planned to compare a real val variable with a positive zero and with a negative zero, but did this incorrectly. The values of zeros became the same after the integer constants were declared.


In the last part of the conditional expression there is subtraction of the variable m_joints[i].limits[1][j] from itself. The code looks suspicious. There are a lot of indexes in the expression, one of them probably has an error.


A conditional expression is written in such a way that the result does not depend on the subexpression m_State != eFP_PAUSED_OVERRIDE. But is it really worth speaking about here if this code fragment is still not fixed after the first article?


The analyzer detected null pointer dereference. The code of the function is written or refactored in such a way that there is now a branch of code, where the pointer pCEntity will be, initialized by a zero.


The analyzer detected a repeated check of the pos variable. A part of the code will never be executed because of this error. There is also duplicate code in the function, that's why this function is worth rewriting.


The analyzer can find several types of error which lead to undefined behavior. According to the latest standard of the language, the shift of a negative number to the left results in undefined behavior.


I should note once again that this article provides only some of the errors we found. I didn't even get to the end of the High level warnings. So, the project is still waiting for those who may come and check it more thoroughly. Unfortunately, I cannot spend that much time, because dozens of other projects are waiting for me.


Having worked on the development of an analyzer, I came to the conclusion that it is just impossible to avoid errors, if the team increases or decreases in size. I am really not against Code Review, but it's not hard to count the amount of time that a team lead will have to spend reviewing the code of ten people. What about the next day? What if the number of developers is more than 10? In this case, the Code Review would only be necessary when editing key components of the product. This approach would be extremely ineffective if there is more code, and more people, in a team. The automated check of the code with the help of static analyzers will greatly help the situation. It is not a substitute for the existing tests, but a completely different approach to the code quality (by the way, static analyzers find errors in the tests too). Fixing bugs at the earliest stages of development doesn't really cost anything, unlike those that are found during the testing phase; the errors in the released product may have enormous cost.


Several gaming developers took to social media to discuss their favorite Easter eggs during Easter weekend which included games such as Amnesia: Rebirth, Pokemon GO, Hitman, Halo, and even Homefront: The Revolution.


Easter eggs are typically hidden references to other franchises that are methodically placed in our favorite video games to add humor and fun to the game or change things up how it plays. Matt Phillips was among the countless gaming developers to share their favorite Easter eggs on Twitter over the weekend, sharing his TimeSplitters 2 arcade machine from Dambuster Studios' Homefront: The Revolution.


Matt Phillips included an arcade cabinet in Homefront: The Revolution which apparently included a fully playable, native 4K port of TimeSplitters 2 at one point, but the unlock code has been lost over time. When activated, the arcade cabinet could activate a multiplayer menu if placed in the same map as a second activated arcade machine, making 4K TimeSplitters 2 multiplayer playable. This is Phillips' proudest moment not only in developing Homefront: The Revolution but in his gaming dev career as a whole. Sadly, the unlock code to this arcade cabinet has been lost to time, with its last remnants being leaked on Discord years ago.


"The unlock code has been lost to time, I don't have the notebook with it in any more," said Matt Phillips on Twitter. "I once gave it to a friend to leak in some Discord channel and they called him a liar and banned his account ahahah."


Dambuster Studios began as TimeSplitters creator Free Radical and it retained the source code over the years, allowing Matt Phillips to create this impressive Easter egg. Matt Phillips not only created the 4K port of TimeSplitters 2 inserted into Homefront: The Revolution, but he also specially designed the in-game arcade cabinet that it plays on. Since Homefront: The Revolution released fans knew that the full TimeSplitters 2 game files were hidden in the game, but now they know why. Since leaving Dambuster Studios, Matt Phillips has lost the notebook that included the unlock code for the TimeSplitters 2 arcade cabinet in Homefront: The Revolution, leaving hackers to figure out how to unlock the 4K port of the classic Free Radical shooter.


"I ported the network stack to ride on top of [Homefront: The Revolution's] co-op mode," continued Matt Phillips. "If, and that's a big if, anyone was able to hack two or more arcades into one of the co-op maps, it'll boot to the [multiplayer] menu."


While several TimeSplitters fans are hoping for hackers to crack the arcade cabinet's unlock code in Homefront: The Revolution, Matt Phillips allowed a friend to leak the code on Discord several years ago to no avail. TimeSplitters 2 released way back in 2002 and many fans have been clambering for a remake since then, and lots of them just want the 4K port included in Homefront: The Revolution to be fleshed out and released as a stand-alone title. Considering Dambuster Studios was built on the remnants of Free Radical, it's entirely possible that more games from the studio will include references to TimeSplitters 2.

3a8082e126
Reply all
Reply to author
Forward
0 new messages