Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 07/24/10 15:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

OniLib

What is it?

OniLib is an ongoing project of mine to recreate the original binary editor OniTools for OSX and extend the functionality to allow any user to change/modify any of the game's content on the fly. While OniLib is primarily a tag editor, it also has the ability to edit the persist.dat files in greater detail than before. Since OniLib is still under development I will be doing my best to keep it up to date with any new updates before I work on backwards compatibility. OniLib will run on PPC and Intel Macs running 10.5 and 10.6. I will not be supporting 10.4 due to the API limitations. For those that do care I am building on a 64-bit kernel and coding accordingly so there should not be any issues related to being on a 32bit or 64bit kernel.

Why is it?

I enjoy game modding a lot. I came to Oni from a number of years of halo PC/Mac modding and was absolutely blown away by the amount of detail that has been gathered on Oni's engine and level structure and how well it was documented. After spending most of my modding years with being on the cutting edge of Halo modding and not having the time to apply to creating modding tools for it, I decided that I want to apply it to a game I have always enjoyed no matter how many times I go back to it. I had a look at the wiki and the current mac tools and an idea was born to recreate OniTools with a wider range of features.

What works?

Currently I am working on tag editing, as this is the most important part of the editor I am focusing on getting tag reading done. I have a plan for writing changes back to the game and that will be finished after a have a larger number of tags done. While this does not seem useful in the slightest to modders, I am doing this to become more familiar with the engine and to allow for any anomalies that I may encounter. There are already plans to include features such as new tag data importing.
Tags that work:
ABNA
AGQC
SNDD
IGST
TXMP

What is new?

You can look at the changelog here: http://samsoftware.info/software/onilib/update.html

Who is working on it?

I am the only active dev on it so far, but there have been a number of people that have been invaluable in getting OniLib going:
Iritscen
EdT
Gumby

What does it look like?

DAT file viewing
ONI file viewing
Saved Game Editor #1
Saved Game Editor #2

So where do I get it?

You can download this from the Mod Depot. The download for the depot will be updated as soon as possible after I push updates. All updates are handled by a service called Sparkle. This means when I push a new update, the next time you open OniLib it will alert you to a new update to download and install. Sparkle will handle the download and automatically install the new version where the old one was. This means you can download any version prior to the current and still be able to update to the most recent.
Mod Depot Page

Can I use this code?

Yes, you most definitely can use this code once the project is completed. The project uses an Objective-C base, but also includes some C/C++ code. This whole project will be released in source form on completion, I may post code before that time for the sake of public review or allowing people to use it.

Last edited by Dirk Gently (02/09/11 14:02)

Offline

#2 07/24/10 15:07

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: OniLib

Hmm, interesting!  I'd love to see an OniTools/OUP-style GUI, even just for browsing data (if not also editing).  Now, what code are you actually using for parsing the game data?  It almost sounds like you're either using the old OniTools code or else you're doing it from scratch based off the wiki.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#3 07/24/10 15:07

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: OniLib

Neo has something like this, but it requires XNA framework, so it only works in windows, and you have to install a bunch of crap to get it working. smile I, too, would love a data editor GUI for stuff like that.


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#4 07/24/10 16:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

Iritscen wrote:

Hmm, interesting!  I'd love to see an OniTools/OUP-style GUI, even just for browsing data (if not also editing).  Now, what code are you actually using for parsing the game data?  It almost sounds like you're either using the old OniTools code or else you're doing it from scratch based off the wiki.

Currently just using NSData to parse data. Hopefully we can make an OS X data editor with what I have now as well as porting the code over to C++ to be used as a library for parsing files. That was anyone can make their own editor with just a few calls from the library/framework hooked up to a GUI of their choice.

Gumby wrote:

Neo has something like this, but it requires XNA framework, so it only works in windows, and you have to install a bunch of crap to get it working. smile I, too, would love a data editor GUI for stuff like that.

Currently we are at a stalemate then. he is using XNA and I am using Objective-C. I am hoping there are enough people that know C++ well enough to help port it because I don't know enough C++ to do it all in C++.

Offline

#5 07/24/10 16:07

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: OniLib

Wow, you got a lot done is a short time.  This is great!

Offline

#6 07/24/10 16:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

EdT wrote:

Wow, you got a lot done is a short time.  This is great!

it is really not all that much. I have no idea how to parse the data or name tables. So far I have just followed what the wiki says for reading .dat files.

Also I got an icon I made for it, if anyone wants to make one go ahead, i threw this together in 10 minutes, and I don't think it is all that great.
content

Offline

#7 07/24/10 18:07

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: OniLib

Dirk Gently wrote:

Currently just using NSData to parse data. Hopefully we can make an OS X data editor with what I have now as well as porting the code over to C++ to be used as a library for parsing files. That was anyone can make their own editor with just a few calls from the library/framework hooked up to a GUI of their choice.

Sorry, my question was unclear.  I didn't even ask the question I meant to ask.  I was trying to ask how you knew how to interpret the fields in each resource.  The stuff that the OBD pages on the wiki cover.  I was wondering if you were re-implementing that from scratch.  The other two options are porting Neo's C# code or porting OniTools' code, but OniTools couldn't do 1/5 of what OniSplit does, so you'd still have to augment that code massively.  I wonder how hard the C# is to port....

I am hoping there are enough people that know C++ well enough to help port it because I don't know enough C++ to do it all in C++.

You probably do, it's just a matter of finding the open-source libraries to use in conjunction with your C.  Obviously there are some things you shouldn't have to write yourself as far as handling standard data types; you just need to convert Oni's data to those types and then send them to a picture-viewing or OpenGL library, etc.

I would really like to volunteer, but I know I won't be able to help much because of other commitments.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#8 07/24/10 18:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

I have no idea how to parse this data well in C++. I know how in Objective-C, I have tried to lay out the code as simple I can so someone could easily port it over to C++.

So far all the code is just me writing it based off what the wiki has. Instead of redoing EVERYTHING I am hoping to use code from OniTools. So far I have not gotten to each resource. I just have what they are, not the properties. If anyone can help me with understanding name and data tables that would be a LOT of help.

Offline

#9 07/24/10 19:07

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: OniLib

If you have specific questions, I'm sure someone would be glad to help.  Probably not me, though, it's the farthest thing from being my strong suit smile


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#10 07/24/10 19:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

Iritscen wrote:

If you have specific questions, I'm sure someone would be glad to help.  Probably not me, though, it's the farthest thing from being my strong suit smile

Does "how does it work" counts as a specific question? lol!

Offline

#11 07/24/10 20:07

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: OniLib

How does what work? Reading data in? Parsing it?


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#12 07/24/10 22:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

Gumby wrote:

How does what work? Reading data in? Parsing it?

How do I read data from the names table? If I understand it correct, each of the tags tell me where in the data table they are and the length of the part of that table they are. How do I read the names table?

Offline

#13 07/24/10 22:07

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: OniLib

You will probably want to create a struct for each type, then read the data into those structs.


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#14 07/25/10 07:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

OH! I think I see. I have the data table size and offset mapped by the tag info. That tells me the data stuff. I have the names table offset, and using the resource data provided by each type of tag I can create a struct to read the relevant data from the names table for that resource. That way the size of the names table information is taken care of on the basis of the type of tag it is.

EDIT: for not reading the wiki I asked a silly question XD

Last edited by Dirk Gently (07/25/10 08:07)

Offline

#15 07/25/10 11:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

Double post for victory!

content

Last edited by Dirk Gently (07/25/10 11:07)

Offline

#16 07/25/10 17:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

Triple post for today, I have successfully been able to parse the data and names tables. I have the tags in the map listed by order they appear in, at a later point I will put them into categories so it is easier to find the tag you want. Currently I have only been able to start on parsing TXMP data. If you double click on any in the list you will get a new window (shown below) that allows you to edit the data. Currently it is read only and I have only gotten done with the name, width, height and type of image it is.

it will only read original .dat files. I will be working on adding support for modified .dat files after I map out the rest of the resource types.

download (10.5, 10.6): http://cl.ly/1lnU

content

Offline

#17 07/25/10 17:07

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: OniLib

Thumbs up!  Though I did like the feature in the previous version that shows the name of the Dat file being explored.

Offline

#18 07/25/10 17:07

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: OniLib

Cool, looking forward to trying this when it's a bit further along smile  Looks like you're planning ahead for textures larger than Oni's 256px limit?  Perhaps you know that we've patched Oni to support up to 1024px.

P.S.: "0 to n, then n-1 to 0" is called "Loop Back and Forth" smile

P.P.S.: I'd like to follow you on Twitter for updates on this, but you'd totally flood my feed.  hmm


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#19 07/25/10 18:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

@Iritscen If you like I can put a #onilib hashtag on onilib related tweets. That way you can just have a saved search for that tag and only the related stuff will come up.

@edt That is a simple thing I can put in tonight. I will add the name of the level to the main window as well as the  secondary map info palette.

Offline

#20 07/25/10 20:07

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: OniLib

Dirk Gently wrote:

@Iritscen If you like I can put a #onilib hashtag on onilib related tweets. That way you can just have a saved search for that tag and only the related stuff will come up.

Ah, yeah, that would be cool if you don't mind.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#21 07/29/10 08:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

This is for edt.

content

Offline

#22 07/29/10 14:07

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: OniLib

Looking good!

Offline

#23 07/29/10 14:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

everyone should also check the twitter hashtag. I posted a secret on there today smile

Offline

#24 07/29/10 18:07

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: OniLib

Nifty smile


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#25 07/29/10 19:07

Dirk Gently
Member
From: Boston, MA
Registered: 06/12/09
Website

Re: OniLib

I can hopefully fix the problem with OSGE setting higher screen resolutions as well smile

Offline

Board footer

Powered by FluxBB