 |
 |
GoldenEye 007 Nintendo 64 Community, GoldenEye X, Nintendo 64 Games Discussion GoldenEye Cheats, GoldenEye X Codes, Tips, Help, Nintendo 64 Gaming Community
|
 |
 |
 |
 |
|
 |
 |
 |
 |
 |
bmw Hacker


Joined: 04 Jan 2006 Posts: 1367 Location: Michigan  |
Posted: Mon Sep 21, 2009 1:41 pm Post subject: manually deleting vertices |
 |
|
Without having to go through the headache of exporting a GE room and opening it in a 3rd party modeling editor, I was wondering if there's a relatively easy way to delete vertices from a pre-made GE room?
There is the primary indices (top) and vertices (bottom) file open in a hex editor for a basic room with 2 tris and 4 vertices. I've figured out how to interpret the vertices file, that each line represents the data for 1 vertice. I assume that for whatever vertice I want to get rid of, I delete that line of data in the vertice file.
But what about the indice file? Can somebody explain to me the format of that file and what exactly I would go about modifying there to accomplish this?
I'm asking because I'm considering getting back to work on my backzone mp map pack, and to get framerates up, I want to go through the maps and get rid of unnecessary data from the background file (for instance, the pipe in the bottling room which contains a ton of vertices) |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6177
 |
Posted: Mon Sep 21, 2009 2:42 pm Post subject: |
 |
|
B1s and BFs (8 bytes) draw triangles. 04 offsets using lowest 3 bytes which vertice offset you're at.
So here 04 offset to 000000, then draw tri (max 4) at vertice 0 + 0, 0 +1, 0 + 2, and then next at 0 + 0, 0 + 2, 0 + 3.
The b1 command draws triangles at points:(not drawn if all 0s)
B100DCBA DDCCBBAA (where AAA = tri, BBB, CCC, DDD).
BF is similar but only draws one tri and it's a byte per vertice, and I think it's 10x of value (ie 0x14 is vertice 04 offset + 0x14/10 = 2.
You'd delete B1s/BFs but leave vertice file alone as the other draw commands are based on that and it's a lot easier not to redo all of them.
It's really a pain to follow non-programatically.
Last edited by SubDrag on Mon Sep 21, 2009 3:14 pm; edited 1 time in total |
|
|
|
|
|
 |
 |
 |
 |
 |
bmw Hacker


Joined: 04 Jan 2006 Posts: 1367 Location: Michigan  |
Posted: Mon Sep 21, 2009 3:04 pm Post subject: |
 |
|
Ok you pretty much lost me there.
Quote: | 0 + 0, 0 +1, 0 + 2, and then next at 0 + 0, 0 + 2, 0 + 3. |
I understand that, I know that in my example, there is one tri drawn between vertice points 0-1-2 and another between 0-2-3, but I don't understand how you came up with that from the hex data posted.
I think I'm lost because I don't understand the concept of the 04 offset. |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6177
 |
Posted: Mon Sep 21, 2009 3:13 pm Post subject: |
 |
|
Essentially they group triangle draw commands.
So they get a 04, and say vertices drawn now start at vertice 0. So every little piece of B1 command is offset from that 04. Now after those draws, lets say it has 04 with 0x100. Now next vertice draws are 0x100 + A positions, 0x100 + B positions, etc. Your example only has 04 at 0 though. |
|
|
|
|
|
 |
 |
 |
 |
 |
bmw Hacker


Joined: 04 Jan 2006 Posts: 1367 Location: Michigan  |
Posted: Mon Sep 21, 2009 3:39 pm Post subject: |
 |
|
I'm still completely lost here.
Perhaps I would better understand this if you could quote exact pieces of data out of the indicie file I posted and explain to me what those pieces of data do.
Pretend that you're teaching this to a 1st grader who has never seen goldeneye before. In this example there are 4 vertices - quote the exact data that tells the game to connect points 0 1 and 2 and then quote the exact data that tells the game to connect points 0 2 and 3. |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6177
 |
Posted: Mon Sep 21, 2009 5:54 pm Post subject: |
 |
|
Indice file has commands 8 bytes long. E7... starts it. B8... ends it.
043000400E000000 Vertice offset currently at 0 for all subsequent commands till see another 04.
B100003200002010
B100DCBADDCCBBAA (points go R to L)
AAA First tri = vertice offset + 0,1,2 = 0,1,2
BBB Second tri = vertice offset + 0,2,3 = 0,2,3
CCC Third tri = vertice offset + 0,0,0 (not drawn since 0s)
DDD Fourth tri = vertice offset + 0,0,0 (not drawn since 0s)
Since vertice offset is 0, points are drawn from their exact positions.
Make any sense?
If were:
043000400E000010 Vertice offset currently at 0
B100003200002010
B100DCBADDCCBBAA (points go R to L)
AAA First tri = vertice offset + 0,1,2 = 10,11,12
BBB Second tri = vertice offset + 0,2,3 = 10,12,13
CCC Third tri = vertice offset + 0,0,0 (not drawn since 0s)
DDD Fourth tri = vertice offset + 0,0,0 (not drawn since 0s) |
|
|
|
|
|
 |
 |
 |
 |
 |
bmw Hacker


Joined: 04 Jan 2006 Posts: 1367 Location: Michigan  |
Posted: Mon Sep 21, 2009 6:38 pm Post subject: |
 |
|
Thanks, that makes 100% more sense. So I just zero out the AAA or BBB or CCC or DDD values.
If I have any specific problems or questions I'll post them here - first thing I want to try to do is remove the pipe from the bottling room. |
|
|
|
|
|
 |
 |
 |
 |
 |
Wreck Administrator


Joined: 14 Dec 2005 Posts: 7253 Location: Ontario, Canada  |
Posted: Mon Sep 21, 2009 10:35 pm Post subject: |
 |
|
Sub: Would it be possible to include a new feature in the GoldenEditor that removes specific tris from the map? Say you're in the Visual Window and you have the Facility open. If you switch to Edit BG Mode and right-click on a triangle, you could select an option from the droplist that would remove the tri from the map. It wouldn't actually effect the Vertices themselves, only the drawing commands in the Indices. They'd be blanked out entirely, so that nothing is drawn. You'd then export the room files and redo your BG. That way, projects like what BMW is attempting would be made much easier.
BMW: While I'm still at home, I have to remember to upload those modified Depot rooms and link you to them. Just need to figure out where the heck I have them stored...
Edit: Uploaded the room files and sent you a PM!  _________________
YOUTUBE | TWITTER/X | FACEBOOK | VAULT | MOD DB | RHDN |
|
|
|
|
|
 |
 |
 |
 |
 |
bmw Hacker


Joined: 04 Jan 2006 Posts: 1367 Location: Michigan  |
Posted: Mon Sep 21, 2009 11:51 pm Post subject: |
 |
|
Wreck wrote: | Sub: Would it be possible to include a new feature in the GoldenEditor that removes specific tris from the map? Say you're in the Visual Window and you have the Facility open. If you switch to Edit BG Mode and right-click on a triangle, you could select an option from the droplist that would remove the tri from the map. It wouldn't actually effect the Vertices themselves, only the drawing commands in the Indices. They'd be blanked out entirely, so that nothing is drawn. You'd then export the room files and redo your BG. That way, projects like what BMW is attempting would be made much easier.
|
I actually didn't have that difficult of a time hex editing them out. Its relatively easy to locate and get rid of an entire object when there's a lot of tris, but it can be a little more tedious locating and getting rid of individual triangles.
But I can see where it would be difficult from a programming standpoint to implement something like this because of the way the data is formatted. If it could be done, I would envision an output option similar to the "export original vertices file" except it would export the 2 indices files. The changes made to the indice files would simply be to replace the vertices found in the draw commands with zeros.
And a quick question - in theory, will this improve framerates the same amount as it would getting rid of them out of the vertice files altogether? In other words, does leaving the vertices in the vertice file and only removing the draw commands leave any overhead that might slow things down a bit? I haven't gotten around to actually testing anything yet. |
|
|
|
|
|
 |
 |
 |
 |
 |
Wreck Administrator


Joined: 14 Dec 2005 Posts: 7253 Location: Ontario, Canada  |
Posted: Tue Sep 22, 2009 12:34 am Post subject: |
 |
|
I wonder that myself...
Technically, the vertices are all still there. The size of the files aren't really being reduced. The compressed versions of the indices might end up being a little smaller, but they'll end up the same length once decompressed in memory (possibly not - would require looking into). Now, those vertices aren't being used by anything, so nothing is being drawn. I suppose the less that gets drawn on-screen at one time - even if the model points still exist - the less visuals there are to process. Stop drawing only a few, I doubt you'll notice much difference. Stop drawing a handful, and it may be an improvement. I guess you'll see for yourself during testing. _________________
YOUTUBE | TWITTER/X | FACEBOOK | VAULT | MOD DB | RHDN |
|
|
|
|
|
 |
 |
 |
 |
 |
Camaro Secret Agent

Joined: 10 Aug 2009 Posts: 308 Location: Indiana  |
Posted: Tue Sep 22, 2009 4:13 am Post subject: |
 |
|
Could this be used to help optimize maps by reducing tris? _________________ 304 HP |
|
|
|
|
|
 |
 |
 |
 |
 |
radorn 007


Joined: 23 Sep 2007 Posts: 1424
 |
Posted: Tue Sep 22, 2009 9:05 am Post subject: |
 |
|
mmmm
more like removing stuff, I believe, since vertices also contain uv mapping and color shading info... removing/not drawing them would also cause that info to be lost so it's not like you could easily reduce detail with this method as new uv mapping and shading (among other things) would have to be calculated for the remaining/new vertices so you could mantain a certain level of facsimilitude with the original.
obviously not drawing these would get you some speed improvement, as Wreck has noted, but seems to me more like something for removals of undesired stuff than for a more thorough optimization. |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6177
 |
Posted: Tue Sep 22, 2009 12:19 pm Post subject: |
 |
|
It's a possible future item, at the moment not a focus. You can also delete B1 commands BMW if need be instead of just nulling out tris since in rooms there are no pointers inside it. |
|
|
|
|
|
 |
 |
 |
 |
 |
bmw Hacker


Joined: 04 Jan 2006 Posts: 1367 Location: Michigan  |
Posted: Tue Sep 22, 2009 1:51 pm Post subject: |
 |
|
I'm going to run a few more tests, but it appears as though simply nulling out draw vertices does improve framerates, though be it minimal.
The test I ran was in the Bottling Room - first I loaded it without any modifications, loaded it 4 players, each holding up a weapon, and put them each in a specific location oriented a certain direction. Then I timed a firing test using the KF7 and a set number of bullets.
I ran the same identical test using the modified room with the pipe removed, one of the conveyor belts removed, and the legs on the other conveyor belt removed.
Results were 62 seconds for the original room and 58 seconds for the modified room. This is about a 7 percent increase in framerates.
I'm going to run the test a few more times to see if the results are similar with players standing in different locations on the map.
EDIT - ran the test again, 2 more times, different player setup, and both times same results:
48 seconds vs 53 seconds
48 seconds vs 53 seconds
about 9 percent gain.
Next I will remove some of the secondary vertice draws, I'll keep the railing but get rid of the secondary pipes on the back wall. May also get rid of some other triangles that aren't necessary.
I figure if I can get this up to about a 15-20 percent gain in framerates, it will be that much closer to a playable map. |
|
|
|
|
|
 |
 |
 |
 |
 |
bmw Hacker


Joined: 04 Jan 2006 Posts: 1367 Location: Michigan  |
Posted: Tue Sep 22, 2009 7:55 pm Post subject: |
 |
|
I'm also working on adding a few rooms from runway, attached to the back. It wasn't too difficult to resize the room to scale and line it up. I'll probably end up adding just the inside of the runway building.
 |
|
|
|
|
|
 |
 |
 |
 |
 |
|
 |
 |
 |
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
 |