Your ideas for a statedef-editing tool?

Started by Kyran, February 28, 2010, 08:23:37 PM

Previous topic - Next topic

Kyran

Hello folks,

I'm planning a state file editor (in C# for .NET 2.0) and would like to know what features you guys would like. Version control? Code generation? Syntax highlighting? Tooltip help? Word processing? Refactoring?

Cyanide

Syntax highlighting is a must.
Code generation should be available but not specifics. Allow it to generate a basic code with the parameters defined but commented out. Blank triggers, that sort of thing. It would be handy if you could also edit and add to the available options. Like "insert this file into my code"
See if you can do a compiling parser. Just has to read the code and pull up errors in spelling or syntax. That would be really handy and nothing so far does it. I shouldn't think something along the lines of a spell checker with a defined list would be too hard to do.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Bastard Mami

I have a small project that does this:

allows you to define constants.
allows you to define blocks of code.
allows you to create sctrls with inheritance.

then it parses your source code files and generates mugen code.

http://www.mediafire.com/download.php?ynozil2tmmn

it's C# and opensource, though it's still not ready for a public release, dunno fi I will ever make it so anyway.

Kyran

Cyanide,

If you need syntax highlighting right away, get TextPad. I still have to teach my app every last SCtrl and Trigger before it will be able to nanny us or generate blanks. I did~ get a language working this morning for the SCtrls, but the data entry is time-consuming. I'm up to GameMakeAnim!

The good news is it has tooltip support, syntax highlighting, and auto-complete, single-click browsing directly to a Statedef via a tree control, and the app loads SCtrl definitions from a text INI file, where text descriptions of each field (and each field parameter) can be stored for tooltips, as well as loading all state files listed in the character .DEF. A parser isn't too far off.

I've done a lot more in 48 hours and accomplished much less. This project's going very well.

Screenie time.


Cybaster

This looks great and very useful. Good luck for the rest. :)

Kyran

I need a cost-benefit calculation...

Templates (blank Statedefs such as hitdef which can be inserted via a single button)
-vs-
Autocomplete detecting what SCtrl you're in and showing a list of available fields (and tooltip help) when you type a letter at the beginning of a line. This method could also auto-fill in default parameter values such as "hitflag = MAF" or "attr = SCA". Finally, Autocomplete could add in required fields (such as trigger1) when a new statedef type is auto-entered, unless it finds them already in that Sctrl block, and it could display lists of options (and tooltips) for parameters like MAF -- where valid entries have a range of acceptable values.

I think people would prefer the latter, although templates would allow us to define more complex relationships (such as "supercharge" helper + superpause). I can't discount the usefulness there, but since syntax checking depends upon an aware subsystem, the autocomplete feature would be best to extend first.

For what Cyanide's suggesting, I could add dynamic toolbars having one button per custom template script...all organized by the end user in text INI files. The point of insertion could be the cursor of the active file, regardless of whether it messes up your code. Then you can configure your own toolbar icons and all, although no two Gremlins would look alike. But maybe they shouldn't.

Full syntax checking requires an algorithm which can read a line, break it down into its individual components while respecting order of operations, and analyze whether the result returns a valid type. The SCtrls are set up to expect their respective types such as int and float. It'll have to analyze trigger return types as well to read them. I just might be able to get this working.

On another topic, Gremlin opens all state files at once. So if you're tweaking Anims, you can run FF at the same time, save your work there, and then save the state files in Gremlin...and run Mugen to test. No opening and closing FF just because you updated a state file, and no taskbar clutter.

Are there any other features you guys want? Any suggestions?

Cyanide

not total autocomplete. Typing type = (insert sctrl) does the predictive text thing maybe?

Like typing type = vel would put veladd in, until you typed the next letter at which point it would be velset, or velmul and you could press enter and it would give you all the parameters as well as a blank trigger1 line. I don't know if that's easy to do or not, but it would be faster than select from drop down or select from list.

This is much like word autocomplete actually, typing in bits of stuff = larger bits of stuff. Could you add templates to the side as well? As "this is a block of code i wish to insert" ?


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Kyran

Cyanide,

It's taking some time debugging, but Autocomplete works like this. You type in a letter, and the list of options opens, focused on the best matching text. You can either type what you want, or you can select an item (with arrow keys) and hit ENTER to insert it at the cursor. So far, you're required to type a capital letter to get the list of valid SCtrls, but all SCtrls AND their overloads are listed, with tooltip text showing details -- including variations such as VarSet verbose for floats and ints. (Yes, I can have it detect whether the line begins with "TYPE = " without case-sensitivity or concern for spaces.)

Otherwise, if you're typing at the beginning of a line within a known SCtrl block, and it doesn't have any overloads, then you get a list of the fields you can enter. Fields are lowercase. For this situation, having the required fields filled in by Gremlin like you said would solve everything. Then it could read its Mugen Docs for the same-named SCtrl that has that required field...thus allowing it to know which SCtrl override it's working in...providing Autocomplete feature for every last SCtrl.

Any more thoughts on templates? You just want to click something and have it pasted in the doc right? Simple enough! Like I said, I can make dynamic toolbars. You can organize them as you need, icons and all, and spam code like no tomorrow. Or did you have something else interface-wise in mind?

I'll get back to cooking.

Cyanide

Yeah, that's pretty much what i meant.

As for the templates. Whatever is simple for you. If we can type in a block of code, select it and save it as a template code block, then double click or type a quick code or something to get it back, whatever works and doesn't look awful in that situation.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

「ⒻⓊⒸⓀⓎⒺⒶⒽ」

I would very much like a quick reference/pop up thing for some controllers that are rarely used but can provide additional control. In my prime I used to browse the documentation while coding, it got tedious... too much text really.

A formatting helper would be nice (liberal use of tabbing) but not essential, but for some of the messy coders out there?  :sugoi:
Don't PM me. =(
(•_•)

( •_•)>⌐■-■

(⌐■_■)

Kyran

Some progress...

*  Docked pop up help descriptions for SCtrls, swaps between top and bottom to stay out of our way.
*  Floating pop up help appears when entering fields (pic 1 below)
*  SCtrl Autocomplete 95% working
*  Eliminated "most" pop up persistence





So far so good.

Cybaster

Looks great, the 2 screens seem to be exactly what Cyanide asked for, and I can only agree with this. :yes:
This might become one of the most useful tools for Mugen creation out there. :)

Also, it will be a portable executable, right ? Or will we have to install it ?

Kyran

Templates are a go.

Before clicking INSERT:


After clicking INSERT...


Gremlin reads up from the cursor to find the Statedef and adds the # and description for you, even though Mugen doesn't know the difference. The template format is simple. Just copy/paste into a text INI file with a little header like !MyHitDef! and you're in business.

Example:

!ChangeState.OnEndAnim!
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

I figured toolbars would be more tedious for users to setup and less informative than a nice combobox list. Well, that's a wrap for today. More to come soon.

Cyanide

That's what i was thinking of. However, in the interests of being a little pedantic here. we'd need some method of preventing that pickup up if you had something like

trigger1 = command != "holdfwd" && !var(5)

which fits inside your system. # and _ are not used for anything mugen wise and may be better options. Or {}, those aren't used by anything.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

MirageAtoli

#14
Sorting values by their data-type would be interesting. Separating values that are floats, Booleans, int etc.

Not sure if that is too useful, but was something I have been toying with for a while.
Quote from: Titiln on December 31, 2007, 10:46:10 PM
i think we should call it an "engine" so we don't look like total idiots because otherwise we'd be arguing about a "game" and that would be somehow "dumber" than arguing about an "engine" on the "internet" for countless hours

Quote from: Beatrice on March 01, 2010, 06:55:03 PM
Quote from: Iced
I for one, do not enjoy round corners!  :bigcry:
But they hurt much less when we accidentally hit them!  :S

Kyran

Cyanide,

I see you're experienced enough with software to be aware of such issues. However, the parsing function identifies a new template when the line~ begins with ! and end with !. It checks the line with myString.StartsWith() and myString.EndsWith(), and so you don't have to fear application sensitivity. Only the first and last characters are checked, ignoring the line-feed carriage return.

The template loader does a copy/paste of the text within your template -- it doesn't try to decipher the meaning of anything. I have yet to write the algorithm to read values for proper syntax highlighting and tooltip help.

I could've used the square bracket as an identifier, but I probably shouldn't, since the syntax could the template INI file more difficult for a person to read. One existing problem is due to the parsing routine being hard-coded to detect what Statedef the user is before adding in the header block. As-is, the routine will add a State block on top of any StateDef defined as a template. This means the user will have to delete that line every time he or she uses that template....annoying.

Instead how about this...

{StateDef.AirSpecial}
type=A
physics=N
movetype=A
anim=1300
ctrl=0
velset=0,0
sprpriority=1

!PosSet.AlwaysY0!
type=posset
trigger1=1
y=0

Selecting the Statedef in the Combobox could cause a textbox to appear where you can type in your desired Statedef #. Next, hitting enter puts both this Statedef and the PosSet sctrl (and any others) into the text editor, with the appropriate State # header for everything. I can change the existing !name! format to parenthesis...

(PosSet.AlwaysY0)
type=posset
trigger1=1
y=0

This way, your templates can be simple or complex, and the editor has some meaningful structure to work with -- which could be built on later.

@Mirage,

I can probably rig the AutoComplete to show a list of acceptable var-types for the currently highlighted field parameter -- basically making you use stuff like ceil() where necessary. Gotta get them triggers into a formatted file first though. That's another 100KB worth of text waiting for me to type it. The SCtrls were 152kb.

More to come. Keep up the suggestions.

Cybaster

Also, maybe something to keep track of variables (integers and floats), in which states they may be changed, etc.
They may have as comment the comment you used when defining it :

[state 1234, Special Groove Variable]
type=varset
trigger1 = blabla
var(15) = 1


would give on the left scrollbar a "variables" thing with :
Special Groove Variable : var(15)
Modified in states : 1234, 4523, etc.

Saohc

Since you can do this..

Maybe you can help me with something?

I'm trying to have unlockable characters in my game, and it involves passwords..

Since you know how C works, maybe you can help me.

Xinos

Quote from: Luigi1632 on March 04, 2010, 05:58:16 PM
Since you can do this..

Maybe you can help me with something?

I'm trying to have unlockable characters in my game, and it involves passwords..

Since you know how C works, maybe you can help me.

In my opinion, it would be best if you PM'd the OP about this.

Cyanide

In the interests of keeping mugen functions out of the template stuff to some extent, stick with ! and {}, not () as those are also used in mugen code. I realise it'll change them, but it's going to be less confusing for some people if they're using special characters for a single purpose rather than multiple ones.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.