Author Topic: SWF problems  (Read 3132 times)

0 Members and 1 Guest are viewing this topic.

bitterman

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
SWF problems
« on: October 04, 2015, 10:40:04 AM »
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:

Code: [Select]
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?





« Last Edit: October 05, 2015, 01:15:37 AM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: SWF problems
« Reply #1 on: October 05, 2015, 10:14:55 PM »
How to place custom shell.swf as a mod to debug it in MSVC?

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

Code: [Select]
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:

Code: [Select]
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?
« Last Edit: October 08, 2015, 11:38:31 AM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: SWF problems
« Reply #2 on: October 08, 2015, 11:47:26 AM »
Ok, filename -> fileName.

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

motorsep

  • Hero Member
  • *****
  • Posts: 978
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: SWF problems
« Reply #3 on: October 08, 2015, 12:17:43 PM »
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.
« Last Edit: October 08, 2015, 12:22:03 PM by motorsep »

bitterman

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: SWF problems
« Reply #4 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, how to add console command in my case?

***********

Ok, this is also wrong

Code: [Select]
if (!WriteBinary(fileName))
because:

Code: [Select]
void       WriteBinary( const char * bfilename );
« Last Edit: October 09, 2015, 07:48:09 AM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: SWF problems
« Reply #5 on: October 09, 2015, 11:31:39 PM »
Ок, looks like the problem with class and consrtuctor:

Code: [Select]
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:

Code: [Select]
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.
« Last Edit: October 09, 2015, 11:33:26 PM by bitterman »

motorsep

  • Hero Member
  • *****
  • Posts: 978
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: SWF problems
« Reply #6 on: October 10, 2015, 09:30:20 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

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: SWF problems
« Reply #7 on: October 11, 2015, 09:40:59 PM »
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? :))))
« Last Edit: October 11, 2015, 09:50:24 PM by bitterman »

motorsep

  • Hero Member
  • *****
  • Posts: 978
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: SWF problems
« Reply #8 on: October 12, 2015, 11:45:27 PM »
P.S. Hey, motorsep, your remarks make me move, but where? :))))

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

bitterman

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: SWF problems
« Reply #9 on: October 20, 2015, 11:43:56 PM »
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

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: SWF problems
« Reply #10 on: June 21, 2016, 09:51:08 PM »
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?
« Last Edit: June 21, 2016, 09:55:14 PM by bitterman »

motorsep

  • Hero Member
  • *****
  • Posts: 978
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: SWF problems
« Reply #11 on: June 22, 2016, 08:06:43 AM »
Lol dude. You have SWF file with working full screen interface and you can't understand how it works?! That's something else  :(

bitterman

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: SWF problems
« Reply #12 on: June 22, 2016, 10:12:19 PM »
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 ))
« Last Edit: June 22, 2016, 10:20:41 PM by bitterman »

motorsep

  • Hero Member
  • *****
  • Posts: 978
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: SWF problems
« Reply #13 on: June 23, 2016, 08:06:43 AM »
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

  • Sr. Member
  • ****
  • Posts: 301
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: SWF problems
« Reply #14 on: June 23, 2016, 10:13:39 PM »
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 ))