(Dev's please review this.) How PS2 Works and Where it can be Optimized

Discussion in 'PlanetSide 2 Gameplay Discussion' started by Kitsune94, Dec 9, 2012.

  1. Kitsune94

    How planetside 2 Works.

    It has come to my findings that the ForgeLight Engine is based on the FreeRealms Engine created previously by SOE. In my studies I have found that the engine which powers PS2 is quite unoptimized, not just at Run-Time but at its core. The game will run best on machines with nVidia Cards utilizing PhysX and the CudaSDK.

    One of the problems I have found is that the content is mixed between packed and unpacked. That being said, half of the content is contained within .pack files while the other half is floating around in open folders. The aforementioned .pack archive is based on the FreeRealms Archive format, however its key is different, any existing extractors for the format may not work. Due to the use of Adobe Flash. It is sad to say, a linux port may never be possible, nor more than a bronze rating in Wine as it currently has. I believe that there may also be too many assets where less could work. What I mean by this is that there are many assets which appear to be the same but labeled for their appropriate faction. This is good as it keeps it separated, however while this is great for meshes as those are indeed different. I believe more optimization could occur from creating a greyscale image and procedurally coloring it. Another thing which I believe could lead to more optimization if reworked is that the game uses 5 formats to script things. The UI for example, is made up primarily of .swf while also being configured by .xml and .txt at the same time. Furthermore, there are areas where .lua and .xml are used for the same thing. In addition to already mixing .swf, .xml, .lua and .txt, there is use of the .ini format. I believe the creation of a single script format or reduction to 2 core script formats would optimize the engine better. Another thing I had noticed was the support for different renderers, these being: OpenGL/Glut32, GL ES, DirectX 8, DirectX 9 and a Software Renderer, however there is no way to choose which renderer is used.

    There is also what I believe may be a potential security risk. That is, the ssl certificates for the store are kept open in an accessible folder instead of stored in a temp dir which is cleared or in a .pack. In testing, it is safe to say that the replacement of files can not be done. Intrigued by the use of the .cur format I proceeded to make 3 variants, 1 for each faction, of the cursors. However, upon booting the game after replacing the .cur files the cursors were still their defaults. With that in mind, I believe that if the content files such as the cursors are also in the .pack then they should be removed from the open folders to save space. The last and final thing I'd like to address is that the .dll's and .exe's are not packed. This means that any cheater/hacker with the intent to ruin the game can freely find memory addresses at will using a tool such as Cheat Engine or IDA Pro Disassembler. Also there doesnt seam to be any form of anti-cheat ran at run-time. This I believe is something that should be addressed imediately. A few common anti-cheat services that are known to work well are Punkbuster, Ahn Lab's Hackshield, nProtect GameGaurd and VAC2, these are availible for a cheap liscense fee. There are also many .dll/.exe packers, compressers and encryptors availible from free to low cost. An alternative to packing the files would be to randomize the memory addresses at run-time as some engines do.


    File Formats that make up PS2:

    .pack FreeRealms Pack File, this contains the majority of the core assets
    .cnk# Chunk File, This makes up the world as a whole, likely generated from a heightmap then broken into these chunks.
    .dme Mesh file for Environmental Assets such as foliage
    .dmv Mesh file for ground vehicles such as tanks, turrets, sunderer, etc
    .dma Mesh file for air vehicles
    .cdt Collision Meshes
    .dds Textures and Sprites
    .tga UI Textures
    .fsb Audio
    .adr Skeletal Meshes, for player models
    .nsa Animation Declarations and Frames
    .xml Configuration of Assets
    .crc CRC Checksum for integrity verification
    .swf UI Backbone
    .cur UI Cursors
    .lua Event Scripting
    .txt Textural Data

    User Interface is made in Adobe Flash CS5
    -UI\
    CharacterLoadout.swf
    CharacterCreate.swf
    ClickGobbler.swf
    Confirmation.swf
    Console.swf
    FirstTimeIntro.swf
    HelpScreen.swf
    Hud.swf
    Implants.swf
    InGameBrowser.swf
    KillCamAS3.swf
    LoadingScreen.swf
    LoadingScreenIntro.swf
    Map.swf
    Marketplace.swf
    MarketplaceBundlePreview.swf
    MarketplaceBundlePurchase.swf
    MarketplaceMembershipPurchase.swf
    MarketplaceStationCashPurchase.swf
    MiniMap.swf
    NavigationMenuAS3.swf
    NavigationMenuBgAS3.swf
    NotificationAS3.swf
    Profile.swf
    Respawn.swf
    ServerQueue.swf
    Settings.swf
    Skills.swf
    Social.swf
    TabLeaderStats.swf
    VehicleLoadout.swf
    Warpgate.swf

    The 1238 Visual Effects and Sprites are defined here in effects.xml
    • Up x 23
  2. Killtrox

    I too, enjoy a good slice of pizza on Thanksgiving.
    • Up x 1
  3. o_oNmKo_o

    Very good.

    Bump.
  4. Believer

  5. abstractconcept

    As far as I can tell our issues with running on Wine are not being caused by Flash at all, the current issues are with the IMM input library (we now have a workaround for this) as well as performance issues with particle effects:

    Also I would be curious as to what is using the other renderers, could you expand on that?
  6. iller

    What's the average size of their .ADR's? I ask b/c it seems like some of their DDS's can be quite large yet many players have reported better Performance in general when they disable Texture/LOD quality reduction and just allow the original "Ultra" resources to be piped to their GPU by Default without extra CPU load to tweak every single one down for every single element on every single Entity nearby (regardless of whether they're behind several hills/walls or not).
    • Up x 1
  7. Kitsune94

    @abstractconcept
    In my references to linux, I was leaning more towards an official native port being stopped by the lack of real support for adobe flash. I have gotten the game working in Wine 1.5 however, with text-less menus. As for the OpenGL support, I'm still trying to figure a way to switch the renderer to it. There are several .dll's and calls to them inside of planetside2.exe which reference them. These .dll's are: libEGL.dll libGLESv2.dll GDraw_GL.dll cgGL.dll and glut32.dll However, from inspecting these .dll's it appears that they not only contain typical OpenGL functions such as glBegin() but seam to have been modified to include imports from DirectX. It is possible that SOE had attempted to combine OGL with DirectX for something. In the executable itself, there are references to OpenGL as well as references to lib-xfree86 such as at '.rdata:028A15D4 a_xfree86_...'

    @iller
    I have yet to fully examine the .pack format being used, so far the only thing I've successfully extracted is the effects.xml I would imagine the .adr files in specific to be a relatively small size similar to that of .smd or compiled .md3

    Further proof that the Forgelight engine is based on the FreeRealms engine is shown by references to things such as: .rdata:0... | 00000017 | C | FreeRealms/sign_up.php
    • Up x 3
  8. Kitsune94

  9. Toxicmix1

    im not a programmer or an engineer, but they really need to release a "magic" patch for cpu performance very quickly......

    the servers are pretty much empty



    OPEN YOUR EYES SONY DEVS
    • Up x 1
  10. Kitsune94

    I agree. At current the engine runs almost entirely on 1 thread. Which is quite limiting.
  11. qazqazqaz

    What game are you playing that has empty servers lol?

    On the subject, I think devs know their game and engine better than some random guy trying to be smart, sorry.
    • Up x 1
  12. qazqazqaz

    I think you're delusional and you're the one that needs to open his eyes. Servers that have enter queues can't be empty.
  13. Toxicmix1

    miller is allmost empty all the time "the closest server i have in europe"

    lots of my mates with decent rigs are saying the same thing as me......poor cpu performance, resulting in a GPU botleneck......


    PS im talking about people with decent rigs, not dual cores and crap like that......im talking about people with i7´s and 3570k etc...etc.....

    i have an i5 750 at 4ghz and i can´t geet more than 30-40 fps in big battles......is pathetic
  14. Mansen

    And yet another interesting thread is completely derailed by people (oh look, Toxic is back!)
    • Up x 1
  15. cr1nge

    Excellent work!
  16. RAS

    only person here trying to be smart is you with a stupid reply trying to make yourself look good and failing , there is a big issue with performance even so after the latest patch , either post something helpfull or shut up
    • Up x 1
  17. Toxicmix1


    hey there mate...how you do?

    ;)
  18. Ckorus

    You're running an older i5. Although I agree optimization should be better for the older iCore processors and especially AMD ones, one thing we all know is they run better on newer iCore processors.

    Also, the i5 3570k processor is fine. I run this game with it and I'm getting constant 60+ fps apart from in big battles (usually 40+) which is acceptable to me based on the amount happening on screen. I use vsync as the game can be quite choppy otherwise. Dunno if this has anything to do with my fps.

    Basically, what I'm saying is that unless you have anything constructive to say, don't say anything please :) I'm pretty sure they're aware of the performance issues and the game is already a lot more stable for me (less errors, less falling through ground etc).

    One last thing...you know how servers work right? Usually when a game is released they lock the servers to a point for a while to see how the servers cope before they 'open' them up more to allow more players. Maybe this happened? I'm seeing just as many people on my server as 2 - 3 weeks ago, if not more.

    Ckorus.
  19. Toxicmix1

    ok i accept your statement...;)

    like you notice, im not an engineer mate im just a gamer...is just 30-40 fps is not for me....i prefer to not play....is simple.....i used to play as an assault, so i really need at least 45 steady frames in battles......the problem with this game is just on battles.....mate, i can easily get 60 or 70 fps but allways far from action....soon as i entry in a big fight, my frames go all the way down to 30-40 and that´s it....off course im upset with that. im planing to upgrade to an Haswell i5 in the next year, so i hope to see a MAJOR improvement there.....
  20. Vanuub

    User Interface is made in Flash
    Interface is made in Flash
    Interface Flash
    Flash

    I just lost all faith in the the devteam and those giving them orders.

    Your argument about packing is pretty much irrelevant. Packing (or rather, SFX compression of executeables), like with UPX or ASPack etc., is merely a nuisance. It can be unpacked (even though some packers also obfuscate a bit) and you can always run a debugger to inspect the running code in memory, entirely bypassing the question of it being packed or not.
    So it is wishful thinking to believe it really matters against competent adversaries with time and resources.

    The question of SSL certs being in the open does not carry much weight.
    1, they are only used by the PS2 client program.
    2, you gain nothing by modifying them.
    3, a 3rd party wont get anything from modifying them, except the tears of frustration it might cause at your end.
    • Up x 1