Soffish Halo 2 Content Editor
-
- Posts: 57
- Joined: Tue Mar 27, 2007 5:53 pm
cause quaternions are a better >_>
there harder for humans but easier for computers lul
there harder for humans but easier for computers lul
Halo 2 Plugins | Lock-on To Just About Anything | My Sites | Snow Hog
Old Plugins you have, upgrade you must...
Always Maintain a High Quality-To-Crap Ratio.
One thing I've found to greatly improve performance is to block all contiguous reads/writes whenever possible...I don't think I need to supply all the source, this should be enough for you to get the idea ;P Basically if you're reading a bunch of values next to eachother in a loop, just read the whole block to a buffer and then parse with bitconverter. Same goes for writing...just write all values to a fixed buffer and write to the map afterxzodia wrote:Right now:
Soffish has a better meta editor then Entity, and with continued codeing we may be able to squeeze more speed from it.
Example:
Code: Select all
using System;
using System.Collections.Generic;
using System.Text;
namespace HaloMap
{
public class FileTable : List<string>
{
private Map Map;
#region Constructor
public FileTable(Map map)
{
Map = map;
Capacity = Map.Header.FileCount;
Load();
}
#endregion
#region Methods
// load filetable and indicies to buffers with single read operations, then parse after...
public void Load()
{
try
{
int count = Map.Header.FileCount;
int indexOffset = Map.Header.FileTableIndexOffset;
int nameOffset = Map.Header.FileTableOffset;
byte[] indexBuffer = Map.ReadBytes(indexOffset, count * 4);
byte[] nameBuffer = Map.ReadBytes(nameOffset, Map.Header.FileTableSize);
int nextIndex; //used to calculate string length
for (int i = 0; i < count; i++)
{
int index = BitConverter.ToInt32(indexBuffer, i * 4);
if (i != count - 1)
nextIndex = BitConverter.ToInt32(indexBuffer, (i + 1) * 4);
else
nextIndex = Map.Header.FileTableSize;
this.Add(ASCIIEncoding.ASCII.GetString(nameBuffer, index, nextIndex - index - 1));
}
}
catch (Exception)
{
throw new MapCorruptionException("Inconsistancy detected! - Unable to load filetable.");
}
}
public unsafe void Save(out byte[] indexBuffer, out byte[] nameBuffer)
{
int index = 0;
//creates index buffer
indexBuffer = new byte[Count * 4];
fixed (byte* ib = indexBuffer)
for (int i = 0; i < Count; i++)
{
*(int*)(ib + i * 4) = index;
index += this[i].Length + 1;
}
//creates name buffer
nameBuffer = new byte[index];
for (int i = 0; i < Count; i++)
ASCIIEncoding.ASCII.GetBytes(this[i], 0, this[i].Length, nameBuffer, BitConverter.ToInt32(indexBuffer, i * 4));
}
#endregion
}
}
Will the BSP viewer look better than Entity's &/or as good as Prey's Visual Scenery Mover
- Color for AI zones, death barriers/zones and banshee barriers
- RTH
- Unicode editor
- Script editor
- Chunk cloning
- Color for AI zones, death barriers/zones and banshee barriers
- RTH
- Unicode editor
- Script editor
- Chunk cloning
Shock120 on XLink & XBC
Thanks for the tip, I have to say it never occurred to me that that would be faster.xbox7887 wrote:One thing I've found to greatly improve performance is to block all contiguous reads/writes whenever possible...I don't think I need to supply all the source, this should be enough for you to get the idea ;P Basically if you're reading a bunch of values next to each other in a loop, just read the whole block to a buffer and then parse with bitconverter. Same goes for writing...just write all values to a fixed buffer and write to the map after
Would the same speed be gained if a MemoryStream was created from the byte[], since its not reading from disc? (to save writing the bitconverter code)
Halo 2 Plugins | Lock-on To Just About Anything | My Sites | Snow Hog
Old Plugins you have, upgrade you must...
Always Maintain a High Quality-To-Crap Ratio.
On the BSP viewer part though, it would be grand if you could implement the objective chunks as different colored boxes just like Sparkedit. I'm not trying to say turn Soffish into a Sparkedit but it would be a great addition and make it easier to tell the difference between each set. I think entity's objective spawns were all set to use the masterchief model but I think it's better having them color coordinated boxes.Shock120 wrote:Will the BSP viewer look better than Entity's &/or as good as Prey's Visual Scenery Mover
- "Perfect" Chunk cloning
Although, now that I think of it, making scenario chunk cloning IN the BSP viewer would be a FANTASTIC addition! That way, you could right click a tag in the bsp viewer's hierarchy box, (or however you may be going about that) and just have a selection such as "clone chunk". Then the cloned chunk would appear either right on top of the original or next to it somewhere.
Let me know if any of the things i've suggested are already on the planned list or if they are just too out of the question at the moment.
As far as my work with meta editing, it's not so much reading it that takes the time as setting up the display for the tag type.xbox7887 wrote: One thing I've found to greatly improve performance is to block all contiguous reads/writes whenever possible...I don't think I need to supply all the source, this should be enough for you to get the idea ;P Basically if you're reading a bunch of values next to eachother in a loop, just read the whole block to a buffer and then parse with bitconverter. Same goes for writing...just write all values to a fixed buffer and write to the map after
Example:
.
.
.
- Aumaan Anubis
- Posts: 2938
- Joined: Fri Jun 30, 2006 1:01 pm
- Location: Aumaan
- Contact:
I sincerely hope that you programmers will not risk speed to make the BSP Viewer, "look better."
It was one of my worst problems on Entity before I got a new computer. I had to go back to an earlier version of Entity to find a BSP Viewer that wasn't outrageously slow due to detail.
I really don't much care for the 'quality' of the Viewer, as long as I'm able to see things relatively clearly.
It was one of my worst problems on Entity before I got a new computer. I had to go back to an earlier version of Entity to find a BSP Viewer that wasn't outrageously slow due to detail.
I really don't much care for the 'quality' of the Viewer, as long as I'm able to see things relatively clearly.
It is expected, and demanded.Tural wrote:MrMurder, we're going to hold you to that promise.
Exactly, I couldn't view big sbsp's on my old computer.Aumaan Anubis wrote:I sincerely hope that you programmers will not risk speed to make the BSP Viewer, "look better."
It was one of my worst problems on Entity before I got a new computer. I had to go back to an earlier version of Entity to find a BSP Viewer that wasn't outrageously slow due to detail.
I really don't much care for the 'quality' of the Viewer, as long as I'm able to see things relatively clearly.
Same difference, since its working with memory instead of file io...I wrote that code when I was learning C# so I didn't know a whole lot thenxzodia wrote:Thanks for the tip, I have to say it never occurred to me that that would be faster.xbox7887 wrote:One thing I've found to greatly improve performance is to block all contiguous reads/writes whenever possible...I don't think I need to supply all the source, this should be enough for you to get the idea ;P Basically if you're reading a bunch of values next to each other in a loop, just read the whole block to a buffer and then parse with bitconverter. Same goes for writing...just write all values to a fixed buffer and write to the map after
Would the same speed be gained if a MemoryStream was created from the byte[], since its not reading from disc? (to save writing the bitconverter code)
-
- Posts: 193
- Joined: Sat May 17, 2008 1:15 pm
- Location: Silicon Valley
-
- Posts: 1262
- Joined: Sun Sep 03, 2006 10:43 pm
- Location: Michigan
- SkgSkrillaka
- Posts: 192
- Joined: Wed Mar 26, 2008 8:50 pm
- Location: Off the streets, net cafe's and home ;)
-
- Posts: 396
- Joined: Tue Nov 15, 2005 5:19 am
- Location: Right Outside Your Window With A Gun
- DemonicSandwich
- Posts: 1198
- Joined: Sat Sep 30, 2006 6:10 pm
- Location: �
Actually you modeling people need a PMI that injects bone information more....then animation tools will actually become even more useful.Evilsnowflakes wrote:Man, if you can make this the only program we'll ever need, that be great, now we just need that animation injector/extractor for us modeling people
AIM wrote:Demonic5andwich (6:10:10 PM): structure of a first person weapon animation:
Demonic5andwich (6:10:43 PM): mess, mess, maybe a node?, another header?! wtf!, more mess, tacos, more shit