News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

SWF problems

Started by bitterman, October 04, 2015, 10:40:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bitterman

Spent a lot of time with try to change engine from D3 to D3BFG.

The main reason was the possibility of using glsl in D3BFG (unlike ARB shaders in D3).

But there are a few ground problems.

First it's a new GUI system based on SWF.

As I suggest guys from ID make a own swf-parser based on ActionScript 2.0 and commandset swf version 7. Moreover the engine convert swf into bswf and then run it with code.

All menus found in base/generated/swf. A main menu (shell.bswf) contain a one main sprite (MovieClip) and ~20 sub-sprites placed in certain sequence. Every sprite action (event) is hardcoded and handled with own proc (HandleAction). Transition between sprites (menu screens) is also hardcoded via SetNextScreen().

In D3BFG a game start with simple "map game/mars_city1" after exec ShowDoomIntro().

There are a few CVARs for swf (swf_loadBinary, swf_debug).

The next shell.swf (Flashdevelop AS2, 1280x960) is compiled and exec in Flash but not working as well in Game:

class Main
{

public static function main(swfRoot:MovieClip):Void
{
// entry point

var menuScreens : Array = new Array(
"NULL",
"menuRoot",
"menuCampaign",
"menuSettings",
"menuLoad",
"menuNewGame",
"menuSystemOptions",
"menuGameOptions",
"menuPartyLobby",
"menuGameLobby",
"menuStereo",
"menuDifficulty",
"menuControls",
"menuKeyboard",
"menuResolution",
"menuController",
"menuDev",
"menuLeaderboards",
"menuGamepad",
"menuMatch",
"menuModeSelect",
"menuBrowser",
"menuCredits");

var myClip : MovieClip = new MovieClip;

myClip = _root.createEmptyMovieClip("menuStart", 0);

for (var i = 1; i < 23; i++) {
// trace( menuScreens[i] );
myClip.attachMovie( menuScreens[i], menuScreens[i], i);
}
}
public function Main()
{

}


And there is no original shell.as or a manual like iddevnet.

Have anyone an idea how to proceed reverse-engineering this process?

Is it possible to ask the developer of the code listing for shell.bswf (e.g. for education/modding purposes)?
How to make it correct?






bitterman

#1
How to place custom shell.swf as a mod to debug it in MSVC?

Ok, now I'm trying to add custom console command:


CONSOLE_COMMAND(swfToBswf, "Convert SWF to BSWF", NULL) {

idStr fileName = args.Argv(1);

if ( LoadSWF(filename) ) {
fileName.SetFileExtension(".bwsf");

if (!WriteBinary(fileName)){
idLib::Printf("BSWF write error");
}

idLib::Printf("SWF to BSWF converted");
}
else {
idLib::Printf("Can't load SWF");
}

}


But it gives an unexpected errors:

4 IntelliSense: this operator is not allowed in a constant expression d:\DOOM-3-BFG-master\neo\idlib\geometry\DrawVert.h 182 1 Doom3BFG
5 IntelliSense: this operator is not allowed in a constant expression d:\DOOM-3-BFG-master\neo\idlib\geometry\DrawVert.h 183 1 Doom3BFG
6 IntelliSense: this operator is not allowed in a constant expression d:\DOOM-3-BFG-master\neo\idlib\geometry\DrawVert.h 184 1 Doom3BFG
7 IntelliSense: this operator is not allowed in a constant expression d:\DOOM-3-BFG-master\neo\idlib\geometry\DrawVert.h 719 1 Doom3BFG
8 IntelliSense: this operator is not allowed in a constant expression d:\DOOM-3-BFG-master\neo\idlib\geometry\DrawVert.h 745 1 Doom3BFG
9 IntelliSense: this operator is not allowed in a constant expression d:\DOOM-3-BFG-master\neo\idlib\geometry\DrawVert.h 746 1 Doom3BFG
10 IntelliSense: this operator is not allowed in a constant expression d:\DOOM-3-BFG-master\neo\idlib\geometry\DrawVert.h 747 1 Doom3BFG
11 IntelliSense: this operator is not allowed in a constant expression d:\DOOM-3-BFG-master\neo\idlib\geometry\JointTransform.h 58 1 Doom3BFG
12 IntelliSense: this operator is not allowed in a constant expression d:\DOOM-3-BFG-master\neo\idlib\geometry\JointTransform.h 59 1 Doom3BFG
13 IntelliSense: enumeration value is out of 'int' range d:\DOOM-3-BFG-master\neo\renderer\Material.h 290 26 Doom3BFG
14 IntelliSense: PCH warning: cannot find a suitable header stop location.  An IntelliSense PCH file was not generated. d:\DOOM-3-BFG-master\neo\swf\SWF_Main.cpp 32 16 Doom3BFG
15 IntelliSense: identifier "LoadSWF" is undefined d:\DOOM-3-BFG-master\neo\swf\SWF_Main.cpp 715 6 Doom3BFG
16 IntelliSense: identifier "filename" is undefined d:\DOOM-3-BFG-master\neo\swf\SWF_Main.cpp 715 14 Doom3BFG
17 IntelliSense: identifier "WriteBinary" is undefined d:\DOOM-3-BFG-master\neo\swf\SWF_Main.cpp 718 7 Doom3BFG


Why this code not work?

bitterman

Ok, filename -> fileName.

But why these native funsc (LoadSWF, WriteBinary) are "undefined"?

motorsep

#3
I think it would be more beneficial to port back original fullscreen GUI system so that RBDoom 3 BFG could use original Doom 3 menus and such.

That would ensure menus can be modified on Linux / Mac by modders.

The only thing you'd want to improve is support for widescreen and gamepad. Since gamepad works with in-game GUIs, it shouldn't be hard to make it work with full screen GUIs.

bitterman

#4
Then I vote for the revision of the original D3 engine only with ARB -> GLSL (binary resources are also not a sugar).

What kind of lamp I have to rub? :)

No kidding, how to add console command in my case?

***********

Ok, this is also wrong

if (!WriteBinary(fileName))

because:

void       WriteBinary( const char * bfilename );

bitterman

#5
Ок, looks like the problem with class and consrtuctor:

class idSWF {
public:
...
private:
   friend class idSWFSprite;
   friend class idSWFSpriteInstance;

   bool       LoadSWF( const char * fullpath );
   void       WriteBinary( const char * bfilename );


So I can't use just "LoadSWF()" anywhere where I want.

Some like:

idSWF LoadSWF(filename)

This example was compiled but worked incorrect.

But I see a great potential of CONSOLE_COMMAND.

Perhaps this is much easier than creating an separate tools.

motorsep

Quote from: bitterman on October 09, 2015, 03:41:55 AM
Then I vote for the revision of the original D3 engine only with ARB -> GLSL (binary resources are also not a sugar).

What kind of lamp I have to rub? :)

No kidding, old menu rendering code and parsing is in the engine. You'd basically disable entire SWF menu code and bring back old menu code.


bitterman

#7
Well, it's sounds too hard for me.

By the way, code can be inserted directly into loadBinary().

After that my custom .swf (2 Kb) was converted to bswf (114 Kb).

Very nice 8)

But as I think all this movements are hopeless without original .swf (.actionscript) source code.
Guys, do you know who wrote it?
May be few tips from that guy...

P.S. Hey, motorsep, your remarks make me move, but where? :))))

motorsep

Quote from: bitterman on October 11, 2015, 09:40:59 PM
P.S. Hey, motorsep, your remarks make me move, but where? :))))

Like, move to another engine? That would be a wise move :)

bitterman

http://idtechforums.fuzzylogicinc.com/index.php?topic=280.msg3340#msg3340

Thanks trebor looked at the structure of the shell.bswf (and dialog.bswf).

As I think it's working with frames and a little actionscript.

Looks like the menu is mostly based on the timeline and only use opensource FlashDevelop will not work (as I tried above).

Remains trial version of Flash Professional. Not sure about this.

And hard-coded transitions (from one screen to other) are still the problem.

bitterman

#10
Very simple hud

P.S. Still not clear about registration/transformation point for movie clip (sprite) in Flash.
Must it always be set to upper left corner?

motorsep

Lol dude. You have SWF file with working full screen interface and you can't understand how it works?! That's something else  :(

bitterman

#12
When I play with regpoint then my nested sprite start to wander on screen.

But in your words hidden wisdom I feel that now you kindly explain ))

motorsep

Not sure what you mean by reg point. If you mean anchor point, then it doesn't matter where it is. My SWF files are already setup to work with existing BFG's code. Just look at the layout and follow the trend.

bitterman

Your's .fla files are good but as I said earlier they needs a tutorial.

Like a tutorial about change native doom3 gui to doom1 gui (remember doom3wolrd).

Too many complex stuff and interactions.

But yes, files are good ))