Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 27/2/07 22:48

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

The Binary Improvement Project

Just wanted to add this thread to the new forum.

Hopefully, we'll see some cool stuff soon.

Link to the original thread on the old forum:
http://oni.bungie.org/forums/index.php?threadid=206


Note: I've been playing Oni again using Loser's modified striker mele and dashing strikers.
Its fun!

Offline

#2 3/3/07 12:28

Your_Mom
Member
From: Canada
Registered: 31/1/07
Website

Re: The Binary Improvement Project

And my OUP is glitching yay! I can't swap TXMPs! Weird error saying acess violation in level[whatever]_Final.raw...then saying that its use by another process...


droid803sig.jpg

Offline

#3 4/3/07 13:07

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: The Binary Improvement Project

Weird error saying acess violation in level[whatever]_Final.raw...then saying that its use by another process...

Usually that happens when you try to edit a level-file while Oni uses it... Hardly ever else.
Please report "glitches" in a thorough, developer-friendly way. Not like... some people wink

It would be great if we turn this thread into a workshop of OUP-powered hacking. Like, anyone who can replace a TXMP, try and post a step-by-step instructions for, say, Tracker there.
Once instructions seem OK, we can back the tutorial up somewhere on the wiki, and move on to something else, then turn to TXMP replacing again, if further detail is needed or more features become available.
After all, that was what the old BIP was about. Part of the cool things we figure out here will be considered as additions for ONK (the more modular, the better), but some of them are just random fun things to do (for iOni, machinimia, etc).

In short, if you can do something cool with Oni's binaries, you can share instructions here (yes, Loser, I mean you smile )

Last edited by geyser (4/3/07 14:09)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#4 4/3/07 19:05

Alloc
Member
From: Germany -> Darmstadt
Registered: 14/1/07
Website

Re: The Binary Improvement Project

Your_Mom wrote:

And my OUP is glitching yay! I can't swap TXMPs! Weird error saying acess violation in level[whatever]_Final.raw...then saying that its use by another process...

Hi,

error reports are *always* welcome ... I can't check everything myself and even if I could ... I would never find all. As the dev I just know what everything is supposed to do so it's hard for me to do anything "wrong" wink
First info I'd need is the version. And if you can reproduce this behaviour and if so the exact steps to do so.

Regards,
Chris aka Alloc


ONI2.net, link to just any important resource-pages about ONI.

Offline

#5 4/3/07 22:11

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

Re: The Binary Improvement Project

Yesterday SFeLi found a way to enable the console output in Mac OSX version of Oni!!!

console.jpg

The Mac version was lacking the function: COrConsole_Printf, here's how to enable it:

At 0x00189fdc in OniMacOSX patch byte-by-byte.
  7C 87 23 78
  7C A8 2B 78
  38 60 00 00
  3C 80 FF C0
  3C A0 FF FF 
  60 84 60 00
  60 A5 30 30 
  4B F2 F6 F8

Last edited by EdT (4/3/07 22:16)

Offline

#6 5/3/07 15:00

s10k
Member
From: Portugal
Registered: 14/1/07
Website

Re: The Binary Improvement Project

EdT wrote:

Yesterday SFeLi found a way to enable the console output in Mac OSX version of Oni!!!

http://edt.oni2.net/images/console.jpg

The Mac version was lacking the function: COrConsole_Printf, here's how to enable it:

At 0x00189fdc in OniMacOSX patch byte-by-byte.
  7C 87 23 78
  7C A8 2B 78
  38 60 00 00
  3C 80 FF C0
  3C A0 FF FF 
  60 84 60 00
  60 A5 30 30 
  4B F2 F6 F8

Nice one. smile

Offline

#7 9/3/07 21:38

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: The Binary Improvement Project

@ EdT: What's the output you see if you enter where at the console?

Last edited by geyser (9/3/07 21:38)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#8 9/3/07 22:07

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

Re: The Binary Improvement Project

MacOSX console output:

whereconsole.jpg

MacBeta4 console output:

wherebeta.jpg

The images are different in resolution.

Last edited by EdT (9/3/07 22:36)

Offline

#9 12/3/07 4:54

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: The Binary Improvement Project

Odd, SFeLi and I expected it to crash, or worse smile
Oh well, since it works OK, might as well wait.

There are two colors for the console text:
foreground and background (shadow).
Both can be custom-set in the hacked-up call up there.
I'm not sure what bytes correspond to the colors though.
(looks like I haven't logged that particular piece of info)
Will ask SFeLi to re:brief me on that one when I can.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#10 12/3/07 11:16

SFeLi
Member
From: Severodvinsk, Russia
Registered: 14/1/07

Re: The Binary Improvement Project

Offline

#11 12/3/07 13:51

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: The Binary Improvement Project

lis     r4,0xffc0               #Load imm. to r4 and shift (color_a).
lis     r5,0xffff               #Load imm. to r5 and shift (color_b).

The colors are 16-bit RGB: 5 bits red, 6 bits green, 5 bits blue
0xFFFF is white (1111111111111111 : all colors 100%),
while 0xFFC0 is a kind of orange (1111111101010000 : 100% red, some green and a little blue)

So in order to change the console colors you must play with these:

At 0x00189fdc in OniMacOSX patch byte-by-byte.
  7C 87 23 78
  7C A8 2B 78
  38 60 00 00
  3C 80 FF C0
  3C A0 FF FF
  60 84 60 00
  60 A5 30 30
  4B F2 F6 F8

Last edited by geyser (12/3/07 13:52)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#12 12/3/07 21:10

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

Re: The Binary Improvement Project

geyser: I had to make the following changes to make it work

At 0x00189fdc in OniMacOSX patch byte-by-byte.
  7C 87 23 78
  7C A8 2B 78
  38 60 00 00
  3C 80 FF C0
  3C A0 FF C0
  60 84 FF FF
  60 A5 00 00
  4B F2 F6 F8

From SFeLi 's info:

60 84 60 00                     #Two last bytes change color_a.
60 A5 30 30                     #Two last bytes change color_b.

whiteconsole.jpg

Looks Great!

Thanks for your help.

Last edited by EdT (27/4/07 21:47)

Offline

#13 12/3/07 23:12

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

Re: The Binary Improvement Project

Hey I just found an OSX disassembler: http://mach.ioctl.eu/

Offline

#14 13/3/07 17:51

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

Re: The Binary Improvement Project

I found the following in the OSX code, does that mean it might be possible to enable the script command chr_location?

chr_location.jpg

Offline

#15 13/3/07 20:09

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: The Binary Improvement Project

Err, Ed, did you have to make the penultimate degree of reverse engineering (disassembling) so f##king blatant? wink

Machonist could indeed be the ideal tool for a Mac-based SFeLi.
Then again, IDA already makes it possible to handle OS X executables on PC.

I told you about the space issue already... The lack of "free space" in the executable (and the time-consuming manual work involved) is what keeps SFeLi from systematically restoring the script interface of OMNI's engine and bringing it on par with the PC version.

Yes, almost everything required to define the chr_location script command is there. And I've told you before: it's all there.
Actually, every preset BSL variable or function typically corresponds to an actual variable or routine of the runtime engine.
And while the scripting interface is missing, the underlying stuff is there in the OS X build. So yes, everything can be fixed.
SFeLi has even found some more space he could consider using in order to define "missing" BSL functions and variables.
However, the systematic addition of several such features is too time-consuming to be a priority over the PC upgrade.
And the newfound space is not exactly "free": it's supposed to be used by the dev-mode dialogs (runtime BINA editing).
So in case we're going to reenable the dialogs some day, it's a good idea not to overwrite that space with massive hacks.

And another thing. chr_location is nothing you can't leave without. chr_focus is indeed unique (but it's only required for Tag and "weird" single-player logic). chr_set_class is interesting, too, since it allows you to set the skin of every bot either from the console or in scripts (without focusing to them and shapeshifting).
As far as chr_location goes, I'd promote the use of custom flags. Every level has a fair amount of unused flags, or flags that can be relocated a little or a lot without hurting the original single-player logic.

There's a number of worthwhile things you could do in that respect:
1) document the unused flags for every level (items, teleports, patrol paths)
2) create a Flag.BINA suiting specific needs (Rooftops OTA, Mukade's Crazy Escape...)
(replace unused flags with suitable locations and facings)
3) enjoy

Since the list is written to the RAW/SEP, OUP actually allows you to extend it indefinitely, but I wouldn't abuse that feature.
Keep in mind that every time you exceed the previous RAW/SEP size for a file, the whole list is appended to the RAW/SEP.
Custom flags are very powerful and already functional, so I encourage you to work in that direction if you want to increase OTA portability and such.

EDIT: About the console colors, note that there are two of them, supposedly:

At 0x00189fdc in OniMacOSX patch byte-by-byte.
  7C 87 23 78
  7C A8 2B 78
  38 60 00 00
  3C 80 FF C0
  3C A0 FF FF
  60 84 60 00
  60 A5 30 30
  4B F2 F6 F8

One of them is 0xFF C0 60 00, the other is 0xFF FF 30 30 (the bytes are alpha, blue, green, red).
In your fix, they are 0xFF C0 FF FF, the other is 0xFF FF 00 00
Honestly, I fail to see why any of those would appear as white (after the fix) or yellow (before the fix). SFeLi, help...
EDIT2: OK, SFeLi told me where to look. I'll try and debug those colors thoroughly ASAP smile

Last edited by geyser (14/3/07 12:52)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#16 16/3/07 22:59

Your_Mom
Member
From: Canada
Registered: 31/1/07
Website

Re: The Binary Improvement Project

Well, I figured out what was wrong. Apparently something in photoshop made the format...unreadable by OUP. It tried to replace it the first time, and the second time, that error comes out since its trying to complete the first process...

So...anyone mind filling me in on this console thing? looks weird. lol.


droid803sig.jpg

Offline

#17 17/3/07 9:40

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: The Binary Improvement Project

Whatever you mean with the "console thing"...
The Dev Mode console properly speaking is a command line from which you can script at runtime: that console is not what we've been discussing up there (it had a few issues, but the were fixed earlier, and addressed elsewhere).
The issue here is with "console output" (which not only displays the "return value" of console input, but also lots of other data: for example, that's where dprint output goes). Until recently, OMNI's OS X port of Oni was lacking console output.
What the riveting up there boils down to is simply that console output became available "again" on Mac. The PC version already has all that, so you don't need to bother. If you're interested in hacking the colors on PC, I can tell you how.
But that's not really needed, since the original colors are OK (and the colors for the prompt can actually be cycled at runtime, so that you can already pick one that looks the best for you).

As for your previous issue, it might be a good idea to give us the problematic image file, don't you think? smile
Glad you've figured it out anyway, and hope we'll see screenshots of your Photoshopped TXMPs soon...

Last edited by geyser (17/3/07 9:42)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#18 8/6/07 15:13

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: The Binary Improvement Project

Tentative fix of SFeLi's hack for Omni's port.
Same location as before, at 0x00189fdc.
But the 9 instructions are now as follows:

7C EA 3B 78        mr        %r10, %r7
7C C9 33 78        mr        %r9, %r6
7C A8 2B 78        mr        %r8, %r5
7C 87 23 78        mr        %r7, %r4
7C 66 1B 78        mr        %r6, %r3
38 60 00 00        li        %r3, 0
38 83 FF FF        subi    %r4, %r3, 1
38 A3 00 01        addi    %r5, %r3, 1
4B F2 F6 F8        b       _COrConsole_Printf_Color

This fixes the following issue: in the previous hack, the final two arguments were not handled, so they ended up with arbitrary values.
There are a few debug functions that use the 3rd and 4th string variables, notably the SOUND NOT FOUND error messages.
It's in situations like these that arbitrary "strings" are used, and may cause crashes if the cards fall the wrong way smile
Notably for the repacked level0_Final of the English Mac version (same as demo), the 4th "arbitrary" value was apparently affected by repacking.
(so some missing sound messages wouldn't crash for non-repacked level0_Final, but would for a repacked one, due to that arbitrary "string")

The font color is supposed to be white. Report if you don't like the color (or if it doesn't work at all, or if your computer fuses, of course).

Last edited by geyser (8/6/07 17:24)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#19 8/6/07 16:45

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

Re: The Binary Improvement Project

geyser: The fix works!  No more crashes with the repacked files!

Offline

#20 8/6/07 17:19

geyser
Member
From: beyond the veil
Registered: 14/1/07
Website

Re: The Binary Improvement Project

Brilliant. I'm glad we figured that one out at this early stage (basic DemOni).
Now that this nasty worrier is gone, let the Real Binary Improvement begin!

Thanks again to all the people involved, even those (especially those) not explicitly credited for their deeds wink


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#21 3/7/07 9:21

Tantir
Member
From: Cracow
Registered: 10/6/07

Re: The Binary Improvement Project

Er.. where can I get it?? link at old forum is death.... I mean for global folder - err....
eh. I mean this part of these witch unloked moves cywilnians itp... er

Last edited by Tantir (3/7/07 9:29)

Offline

#22 20/11/07 19:13

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

Re: The Binary Improvement Project

Here is the latest fix for Omnigroup's Oni.

Runs on Intel Macs, Dev mode enabled, console works, RETURN key works in Dev Mode.

http://edt.oni2.net/files/OniX.zip

Last edited by EdT (20/11/07 19:15)

Offline

Board footer

Powered by FluxBB