Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Topic on Talk:Assassin's Creed III

Moved from actual Talk Page.

1
Nicereddy (talkcontribs)

Regarding "Field of view (FOV)":

(I tried "Add topic" - the animation appeared, but nothing else happened, so I abuse the "add header" function instead. Apologies.)

The game uses LWJGL, so I Google'd for that and FOV, found http://lwjgl.org/wiki/index.php?title=The_Quad_with_Projection,_View_and_Model_matrices

The suggested approach is "float fieldOfView = 60f;", and maybe Delver even used it. So, I think the FOV is hardcoded, and I looked in "delver.jar" (a Java executable - basically just a ZIP-compressed directory tree).

The file "\com\badlogic\gdx\graphics\PerspectiveCamera.class" contains the word "fieldOfView", which might be just the variable that the LWJGL-documentation suggests. Now all we need is someone who has experience with Minecraft-modding (or somesuch) to show us how to modify the hardcoded FOV in this file.

Used a Java decompiler (http://jd.benow.ca/, first Google hit), and it indeed gave me the full source code of that file. I'll only paste the key line:

public float fieldOfView = 67.0F;

Looked up what the structue of compiled Java files is, found this:

http://en.wikipedia.org/wiki/Java_class_file#File_layout_and_structure

Found that "float" values have the byte prefix "04". Searched for 04 - there is one close to the beginning (position 0F). Changed the value that follows. Decompiled this changed file. Got "public float fieldOfView = 1072.0F;" - Will keep trying.

...

Fail. These are not the droids you are looking for. I changed the value to "42C0", which resulted in "public float fieldOfView = 96.0F;", so I packed the whole thing and replaced the original Delver.jar with it. Game ran just fine, but the FOV was not different. Either "PerspectiveCamera.class" is not what's used for the player view, OR the variable "fieldOfView" is changed somewhere else.

...

The Constructor of PerspectiveCamera has these parameters: "(float fieldOfView, float viewportWidth, float viewportHeight)" The fieldOfView is then stored in the variable I made such much fuzz about above. So, we have to look where the game creates an instance of PerspectiveCamera. I found "public static PerspectiveCamera camera;" in "\com\interrupt\dungeoneer\game\Game.class". This creates the globally accessible variable "camera", but it doesn't yet create the PerspectiveCamera instance that "camera" will hold. Looking for something like "camera = new PerspectiveCamera(".

...

Wow, this Java decompiler has a batch feature that saves all source code and puts it into a ZIP. Awesome. I now have the JAR with all its files (ogg etc.), except all .class files are now .java files. Fired up Eclipse, new Java project, dragged the whole file tree into the src folder of the new project. Eclipse can even browse this properly! Did a global search for "new PerspectiveCamera", these are the hits:

"this.perspective = new PerspectiveCamera();" in "\com\interrupt\dungeoneer\entities\ProjectedDecal.class"

"this.camera = new PerspectiveCamera(60.0F, 2.0F * aspectRatio, 2.0F);" in "\com\interrupt\dungeoneer\gfx\GlRenderer.class"

"this.camera = new PerspectiveCamera(60.0F, 2.0F * aspectRatio, 2.0F);" in "\com\interrupt\dungeoneer\gfx\GLRenderer10.class"

Must be one of the last two. FOV is obviously 60°.

We're getting there!

...

MUHAHAHAHA! Toyed with "PerspectiveCamera.class" in the above described way until the decompiler reported "60": That's hex "4270". Searched for that value in both above mentioned files - only one hit each. Changed them to 42C0 each. Packed the tree, replaced the Delver.jar. PLAYING WITH HIGH FOV NOW! :D :D :D

...

Edited Delver pcgamingwiki page using Borderlands page as template to be sure that it's proper. Well, this text is now garbage, isn't it. Though it has some educational value.

God, owner of the universe (talk) 14:47, 7 December 2013 (UTC)