The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => Tips, Tricks, Tutorials => Topic started by: Bronko on September 15, 2004, 12:20:18 AM

Title: Linux Compatibility
Post by: Bronko on September 15, 2004, 12:20:18 AM
In this post I would like to hopefully get everyone to make chars that will not only be compatible with Dos and Win mugen, but Linux mugen as well.

From reading other parts of this forum you should be able to this because Linuxmugen and Winmugen are almost the same, but also watch out for the following:

Keep all capitalization for filenames and inside the def consistent!
Act10.act != act10.ACT != Act10.ACT    :no:
Use either backslashes \\ :yes: or forward slashes // :yes: in file paths, but don't use both! :no: (Some Linuxes are touchy on this one)
Don't leave the storyboard parameters blank, make an empty filler for it. (Intro.def and Intro.sff with practically nothing in them.)

Code:
;EXAMPLE BLANK INTRO.DEF
[SceneDef]
spr = intro.sff
startscene = 0

[Scene 0]
end.time = 1

If there's anything I missed let me know cause those are all the issues I found so far.
Title: Re: Linux Compatibility
Post by: Messatsu on September 15, 2004, 01:50:13 AM
Quote
Use either backslashes \\  or forward slashes //  in file paths, but don't use both!  (Some Linuxes are touchy on this one)
Who would use those interchangeably!?

Linux is case sensitive and Windows is not.  Probably just affects the def file.

The topic name isn't the best. :-\
Title: Re: Linux Compatibility
Post by: Winane on September 15, 2004, 02:05:03 AM
Don't leave the storyboard parameters blank, make an empty filler for it. (Intro.def and Intro.sff with practically nothing in them.)

Oho, didn't know about that one.  So, you're saying that this:
Code:
[Arcade]
intro.storyboard =
ending.storyboard =
crashes Linux Mugen?
But, what if you simply leave out those parameters entirely?  That is, what if the DEF file ends immediately after "[Arcade]", or if the [Arcade] section simply doesn't exist?

Anyway, thanks for posting that.
Title: Re: Linux Compatibility
Post by: Bronko on September 15, 2004, 02:06:30 AM
Well so far I have run into all those problems in some of the chars I have so I guess it's not that uncommon or I got some reall crappy chars  :(

@winane it exits with the following error
cannot load chars/mychar/ /
error loading mychar.def
when you leave the storyboards blank or don't include them
Title: Re: Linux Compatibility
Post by: Winane on September 15, 2004, 02:14:38 AM
Well, that just plain sucks.  You're using the 2002.04.14 version, right?
Guess one can just make a single blank storyboard in the root Mugen folder and have every story-less character point to that, but that's still a bit of a nuisance.
Anyway, it'd be a waste of space to have almost every character come with its own blank storyboard, and many users would want to replace the blank one with storyboards obtained elsewhere anyway, so I'd not recommend character releases come with that.  Best to leave that to the user to choose how to deal with.
Title: Re: Linux Compatibility
Post by: Winane on December 05, 2004, 12:25:23 AM
Does Linux Mugen care about the capitalization of characters' DEF file extensions?  That is, if your select.def has this:
Code:
[Characters]
kfm, random
then does Linux Mugen care whether KFM's DEF file is named "kfm.def", "kfm.DEF", or "kfm.DeF"?
Title: Re: Linux Compatibility
Post by: Bronko on December 05, 2004, 01:28:16 AM
Well hopefully you will use .def instead of .DEF anyway because that's how it is by convention.
To put simply, it matters (usually)
Title: Re: Linux Compatibility
Post by: Winane on December 05, 2004, 01:36:52 AM
???
So in that example, both "kfm.DEF" and "kfm.DeF" would crash Linux Mugen, even though none of the text files mention "kfm.def" anywhere?  Didn't quite understand your response.
Title: Re: Linux Compatibility
Post by: BlackJack on December 05, 2004, 01:46:03 AM
He said that "typing in all caps" (KFM.DEF) would be worst than anything else. But I still don't know if he's talking about Linux Mugen or about something else (because of the: "usually").
Title: Re: Linux Compatibility
Post by: Messatsu on December 05, 2004, 01:49:49 AM
Winane wants to know if case sensitivity is checked on extensions when the extension isn't given in the select.def.  When you have kfm and not kfm.***
Title: Re: Linux Compatibility
Post by: BlackJack on December 05, 2004, 01:58:07 AM
IMO he didn't realize Winane wasn't asking for help.  :P
Title: Re: Linux Compatibility
Post by: Bronko on December 05, 2004, 02:11:02 AM
He said that "typing in all caps" (KFM.DEF) would be better than anything else. But I still don't know if he's talking about Linux Mugen or about something else (because of the: "usually").
Umm, I'm saying the complete oppostie. All lowercase is much better than all caps.

I can't test this at all right now because I'm having problems executing mugen remotely without the allegro system f*ing up on me.

Edit2: Fixed it, but runs too slow to test anyway. (Didn't load up in 30 mins, calling it quits.)
Title: Re: Linux Compatibility
Post by: BlackJack on December 05, 2004, 10:32:25 AM
Umm, I'm saying the complete oppostie.
Opposite. But you're right. Fixed.
Title: Re: Linux Compatibility
Post by: fbs777 on January 31, 2005, 08:26:35 AM
I have more than 800 chars in a mugen game and i have the both mugen.exe (winmugen) and mugen (linux) in the same directory to play the same game in linux and window$ (window$ just in an emergency)

I can tell somethings:

1 - Dont have ANYTHING wrong in intro/end blank, almost all my chars have the storyboard in blank and it never make any problem...

2 - The linux mugen is CaSe SeNsItIvE. Its permited RYU.DEF, Ryu.Def, ryu.def, but the name and the line on .def must be in the same way... If the line in .def is Ryu.def and the file name is Ryu.DEF it will close the mugen because its diferent...

3 - Linux mugen dont accept ANY \, in ANY .def files (including select.def, fight.def, system.def and all others .def files) I have to convert ALL \ to /, because in winmugen only the .def of stages must be in /, in others .def could be \ OR /, but in linux no. I dont know why creators put \ if the winmugen accept \ or / and linux only / in all defs...

4 - I hope this help the creators to make chars REALLY compatible with linux, because they post "compatible with winmugen/linux" but forgot (or even dont know about) this 2 things...

5 - The strange is that some chars in winmugen show this error :Assert failure in array.h line xxx (this xxx are diferent numbers sometimes) but in linux they work whitout errors ???
Title: Re: Linux Compatibility
Post by: Winane on March 12, 2005, 12:33:38 PM
Just to confirm, Linux Mugen really doesn't require every character to have storyboards.


Another problem with Linux that hasn't quite been mentioned:

Up through Mugen 2001.11.14, AI.Cheat works just fine.
But in Linux Mugen 2002.04.14, setting AI.Cheat in mugen.cfg doesn't work.  In fact, the string "ai.cheat" doesn't exist anywhere within the decompressed binary.  So, Linux Mugen 2002.04.14 always uses the default value of 0 for that setting.

Consequences:

1.  The CPU hardly ever uses any special moves, since the chances of it happening to choose the correct string of simulated keypresses is quite small.  Therefore, it's especially important for characters to have custom AI implemented to make up for the especially ineffective default AI.

2.  The humanly-impossible commands AI activation method cannot work.

3.  The XOR-ed commands AI activation method doesn't work nearly as well.  However, bizarrely enough, it does work somewhat (dunno why).  It appears that it only works with the basic "a", "b", "c", "x", "y", and "z" commands, but I'm not 100% sure about that.  And even with those commands, it seems to choose them by name (rather than by simulated keypress) very infrequently, so it can take several minutes before the method finally sets its variable.

So, it's important to use other AI activation methods (http://www.mugenguild.com/forumx/index.php?topic=10013.0) that don't rely so much on AI.Cheat being enabled.


Now, I suspect that it would be possible to hack the binary to change it such that AI.Cheat is always enabled rather than always disabled.  But I have no idea of how to find which of the 5,121,061 bytes needs to be changed from 0x00 to 0x01.  Does anyone think they might be 1337 enough to hunt that down?  If so, you wouldn't even need to worry about violating the terms of Mugen's license agreement by distributing the hack, as you could just provide hacking directions instead.  I expect 99% of Linux Mugen users would be capable of following simple instructions on how to decompress the binary with UPX; use a hex editor to seek to and set a single byte at a specified offset; and optionally use UPX to recompress the binary.
Title: Re: Linux Compatibility
Post by: Bronko on March 12, 2005, 02:24:10 PM
Hmm interesting...

As for the storyboard problem so far I've only had it on my school's computers (god knows what build of Debian Linux).
The problem does not exist on Gentoo etc.
also, fbs is right.  Linux will only accept forward slashes no matter what.

@Winane
Hey you're right, Evil Ken TOTALLY SUCKS in Linux.
Title: Re: Linux Compatibility
Post by: BlackJack on April 22, 2005, 07:52:03 PM
Now, I suspect that it would be possible to hack the binary to change it such that AI.Cheat is always enabled rather than always disabled.  But I have no idea of how to find which of the 5,121,061 bytes needs to be changed from 0x00 to 0x01.  Does anyone think they might be 1337 enough to hunt that down?  If so, you wouldn't even need to worry about violating the terms of Mugen's license agreement by distributing the hack, as you could just provide hacking directions instead.  I expect 99% of Linux Mugen users would be capable of following simple instructions on how to decompress the binary with UPX; use a hex editor to seek to and set a single byte at a specified offset; and optionally use UPX to recompress the binary.
Someone ( <-- I would have said "I", but I'm lazy and don't know if I'll do it or not) may use a debugger on Mugen.exe (the DOS one), go in training mode, set a match versus a character using a humanly-impossible-type AI, set "Dummy Control" to AI, wait for the custom AI to be activated*, and then check the debugger for the memory address.

*For that matter, using a character who uses an explod to tell you the custom AI has been activated would be a plus (Andre's Shermie, IINM, for example).

Spoiler, click to toggle visibilty
Title: Re: Linux Compatibility
Post by: BlackJack on April 22, 2005, 08:16:29 PM
*For that matter, using a character who uses an explod to tell you the custom AI has been activated would be a plus (Andre's Shermie, IINM, for example).
Fixing: using DisplayToClipboard/AppendToClipboard would be better, now that I think about it.

And if someone could provide the original un-hacked version of WinMUGEN, that would be a plus.
Title: Re: Linux Compatibility
Post by: Sepp on April 22, 2005, 08:24:10 PM
And if someone could provide the original un-hacked version of WinMUGEN, that would be a plus.

?
Title: Re: Linux Compatibility
Post by: Messatsu on April 22, 2005, 08:26:54 PM
I could take a look at this too, as I've also been pondering about possibly finding where the debug key's bit in WinMugen is and how to permanently shut it off.
It would be much easier to find the detection of the keys than a flag that you don't know if it exists.  Then disassemble the binary, create a byte for turning it on and off and place the command detection in a branch statement.  Finally, recompile the program.



BJ is assuming that the "clean" Rou Hei version is modified further than just the F1 screen, I guess.
Title: Re: Linux Compatibility
Post by: BlackJack on April 24, 2005, 01:28:41 AM
BJ is assuming that the "clean" Rou Hei version is modified further than just the F1 screen, I guess.
In fact it's more the other way around; added to the fact that being able to compare the original code from the modified would come in handy.