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

RBDOOM3-BFG GUI system

Started by Manson, August 07, 2015, 05:26:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

The Happy Friar

Reading this topic reminds me of the fights my kids get in to with each other.

Quote from: dingleberry on August 08, 2015, 11:02:12 AM
Since there is 0 modding happening here anyway we should either buy the site from Friar since he doesn't do jack shit with it or start a proper site with the intention of building documentation and modern tutorials for modding idtech 4 (not for the purpose of making money but just for fun, and if you want to use that as base to make money so be it).


       
  • Nobody ever asked me how much I'd sell it for.
  • I'm noone's momma.  My kids learned how to cook w/o tutorials for everything, I expect better from "adults" (I don't know anyone's actual ages here so I'm being general).
  • motorsep, devils, caedes, trebor, bielbdeluna & manson never went down to the level of name calling.  So, just so I do some "jack shit" you can be partially banned for several days.

bitterman

Sorry, guys.

I'm just looking for base information about new GUI system.

Early I work only with old GUI system (it's well documented) and now think about change engine from vanilla Doom3 to BFG.

Can you give me a links for beginning please?

VGames

#62
Quote from: The Happy Friar on August 08, 2015, 11:35:37 PM
Reading this topic reminds me of the fights my kids get in to with each other.

Quote from: dingleberry on August 08, 2015, 11:02:12 AM
Since there is 0 modding happening here anyway we should either buy the site from Friar since he doesn't do jack shit with it or start a proper site with the intention of building documentation and modern tutorials for modding idtech 4 (not for the purpose of making money but just for fun, and if you want to use that as base to make money so be it).


       
  • Nobody ever asked me how much I'd sell it for.
  • I'm noone's momma.  My kids learned how to cook w/o tutorials for everything, I expect better from "adults" (I don't know anyone's actual ages here so I'm being general).
  • motorsep, devils, caedes, trebor, bielbdeluna & manson never went down to the level of name calling.  So, just so I do some "jack shit" you can be partially banned for several days.

LOL
http://www.thelastdragontribute.com/wp-content/uploads/2014/03/Whos-The-Master-Shonuff-Julius-Carry-The-Last-Dragon.png
Get the latest on Perfected Doom 3 here - http://www.moddb.com/mods/perfected-doom-3-version-500

bitterman

#63
Ok, I look at Adobe Flash and have some questions.

("- Lightsabers? - No, questions.").

https://en.wikipedia.org/wiki/Adobe_Flash

1. Have BFG engine a inline Flash Player? What type (version)?
2. Are there some restrictions to use Flash (by version, by compile tools)?
3. Can I use one of third-party tools (see link above) for make .SWF? What is optimal?

Sorry, never work with Flash.

VGames, can you cut/hide your funny picture please? I would be very grateful.

********************************

QuoteProbably in order to speed up development, they are implemented in Adobe Flash. Doom3 BFG runs its own Flash interpreter (/neo/swf/ folder). Again Flash was used in order to speed up development.

http://fabiensanglard.net/doom3_bfg/

VGames, thanks!

bitterman

#64
bool idSWF::LoadSWF( const char * fullpath ) {

if ( header.version > 9 )
                {
                ...
idLib::Warning( "Unsupported version %d", header.version );
                ...
        }


So I think next features is available (not sure about updates):

Quote
Flash 9    June 2006    ActionScript Virtual Machine AVM2, ActionScript 3.
                                       
Flash 9 Update 1    November 2006    (v9.0.28.0, codenamed "Marvin")

                                         Support for fullscreen mode.

Flash 9 Update 3    December 2007    (v9.0.115.0, codenamed "Moviestar")

                                          Support for H.264 video and AAC audio.



And there is a deal with .swf and .bswf (binary).

Not sure but seems like BFG engine can work with both of them (/swf or /generated) and perhaps convert .swf to .bswf.

See also CVAR 'swf_loadBinary'.

********** update ********************

Or perhaps only swf version 7 (ActionScript 2)?

neo/swf/SWF_ScriptFunction.cpp:

// swf 7
case Action_Extends: return "Action_Extends";
case Action_CastOp: return "Action_CastOp";
case Action_ImplementsOp: return "Action_ImplementsOp";
case Action_Throw: return "Action_Throw";
case Action_Try: return "Action_Try";



BielBdeLuna

I guess the full screen GUI can be restored as an additional solution

Manson

trebor's JSON/Blender solution looks interesting. I actually dont like flash.... its a slow crap.

motorsep

Quote from: Manson on September 01, 2015, 01:51:16 PM
trebor's JSON/Blender solution looks interesting. I actually dont like flash.... its a slow crap.

It's slow on the web, or as in Flash games, but faster in BFG engine. Faster than old GUI that is. Not to mention all the images get atlased when engine authors SWF files.

bitterman

#68
Unlike old GUIs new flash-based system is really black box.

I'm try to read listing of any native .bswf file and don't see a easy way to do this.

Also I found 'idCommonLocal::StartMainMenu' but there is no procedure with call this.


/*
==============
idCommonLocal::StartMainMenu
==============
*/
void idCommonLocal::StartMenu( bool playIntro ) {
if ( game && game->Shell_IsActive() ) {
return;
}

if ( readDemo ) {
// if we're playing a demo, esc kills it
UnloadMap();
}

if ( game ) {
game->Shell_Show( true );
game->Shell_SyncWithSession();
}

console->Close();

}


How engine launch mainmenu, how call MoveToNewMap from mainmenu - no anwsers at now.

Needs a listing of (as I think) /generated/swf/shell.bswf (.swf, .as, any human-readable source code for new mainmenu).

And a second ground problem it's a understanding a conception of binary resources (.bimage, bswf etc) and     
how to work with them.

Can anybody give a point?

*****************

Other guys find same way for Rage:

http://forum.xentax.com/viewtopic.php?p=90422

*****************

Looks like game started via simple console command "map":


/*
========================
idMenuHandler_Shell::StartGame
========================
*/

cmdSystem->AppendCommandText( va( "map %s %d\n", "game/mars_city1", 0 ) );


But who/how call this proc from .swf?

************************

http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/swf/pdf/swf-file-format-spec-v10.pdf (pdf 1,1 Mb).

bitterman

#69
Ok, week have passed and the result is still not very impressive.

Since a typical .SWF file uses typical Flash events can be assumed that these events handles by SWF_Events.cpp.

if ( spriteInstance->scriptObject->HasValidProperty( "onRelease" )
|| spriteInstance->scriptObject->HasValidProperty( "onPress" )
|| spriteInstance->scriptObject->HasValidProperty( "onRollOver" )
|| spriteInstance->scriptObject->HasValidProperty( "onRollOut" )
|| spriteInstance->scriptObject->HasValidProperty( "onDrag" )
) {
parentObject = spriteInstance->scriptObject;
}



bool idSWF::HandleEvent( const sysEvent_t * event ) {
if ( !IsLoaded() || !IsActive() || ( !inhibitControl && useInhibtControl ) ) {
return false;
                ...
idSWFScriptObject * hitObject = HitTest( mainspriteInstance, swfRenderState_t(), mouseX, mouseY, NULL );
if ( hitObject != NULL ) {
mouseObject = hitObject;
mouseObject->AddRef();

var = hitObject->Get( "onPress" );
if ( var.IsFunction() ) {
idSWFParmList parms;
parms.Append( event->inputDevice );
var.GetFunction()->Call( hitObject, parms );
parms.Clear();
return true;
}


/*

class idSWFParmList : public idStaticList< idSWFScriptVar, SWF_MAX_PARMS > {
public:
idSWFParmList() {
}
explicit idSWFParmList( const int num_ ) {
SetNum( num_ );
}

void Append( const idSWFScriptVar & other );
void Append( idSWFScriptObject * o );
void Append( idSWFScriptFunction * f );
void Append( const char * s );
void Append( const idStr & s );
void Append( idSWFScriptString * s );
void Append( const float f );
void Append( const int32 i );
void Append( const bool b );
};


So now I think 'var.GetFunction()->Call( hitObject, parms );' looks like first candidate.

******************** update **********************

   
The truth is out there ))

It is necessary to understand the meaning of this expression:

idMenuHandler_Shell * shellMgr = dynamic_cast< idMenuHandler_Shell * >( menuData );


#ifndef __MENUDATA_H__
#define __MENUDATA_H__

enum shellAreas_t {
SHELL_AREA_INVALID = -1,
SHELL_AREA_START,
SHELL_AREA_ROOT,
SHELL_AREA_DEV,
SHELL_AREA_CAMPAIGN,
SHELL_AREA_LOAD,
SHELL_AREA_SAVE,
SHELL_AREA_NEW_GAME,
SHELL_AREA_GAME_OPTIONS,
SHELL_AREA_SYSTEM_OPTIONS,
SHELL_AREA_MULTIPLAYER,
SHELL_AREA_GAME_LOBBY,
SHELL_AREA_STEREOSCOPICS,
SHELL_AREA_PARTY_LOBBY,
SHELL_AREA_SETTINGS,
SHELL_AREA_AUDIO,
SHELL_AREA_VIDEO,
SHELL_AREA_KEYBOARD,
SHELL_AREA_CONTROLS,
SHELL_AREA_CONTROLLER_LAYOUT,
SHELL_AREA_GAMEPAD,
SHELL_AREA_PAUSE,
SHELL_AREA_LEADERBOARDS,
SHELL_AREA_PLAYSTATION,
SHELL_AREA_DIFFICULTY,
SHELL_AREA_RESOLUTION,
SHELL_AREA_MATCH_SETTINGS,
SHELL_AREA_MODE_SELECT,
SHELL_AREA_BROWSER,
SHELL_AREA_CREDITS,
SHELL_NUM_AREAS
};





trebor

#70
I uploaded a special branch that allows you to analyse the Flash data that the BFG edition uses: https://github.com/RobertBeckebans/RBDOOM-3-BFG/tree/flash-tools

Compile and run this build and play the game. Each time a .bswf is loaded it will be exported to base/exported/swf/* to JSON, raw images contained in the render atlas and a .swf file that you can open with a Flash decompiler like JPEGXS FFdec

https://www.dropbox.com/s/8sdnaejpgig8mxs/Screenshot%202015-06-10%2017.49.19.png?dl=0

It is work in progress. The flash export is not complete and I don't want to go that route. However the JSON text files will give you a good insight how the Flash files are structured and you will be able to reimport modified JSON files soon so you can even mod this thing and change the icons or brackground shader without dealing with the entire Flash package by Adobe.

I don't have much time to explain all this stuff but I hope that it helps to understand how the Rage/BFG menu code works.

bitterman

#71
Amazing!

Thanks, Robert (or mr. Beckebans, if you wish)!

:)

P.S. SWF-related topic is there: http://idtechforums.fuzzylogicinc.com/index.php?topic=315.0

*************************

A new WriteSWF() and WriteJSON() looks great. I thought the binarization process is irreversible.

bitterman

#72
Ok, it is possible to make own shell.swf (main menu GUI) and loaded it (instead of the original shell.bswf) in RBDOOM3 with command line arguments (like a part of mod).

At least I see the background image and sprites.

Now there is a problem with a missing cursor.

There is the code:

SWF_Render.cpp

if ( isMouseInClientArea && ( mouseEnabled && useMouse ) && ( InhibitControl() || ( !InhibitControl() && !useInhibtControl ) ) ) {
...
if ( !hasHitObject ) { //hitObject == NULL ) {
DrawStretchPic( mouse.x, mouse.y, 32.0f, 32.0f, 0, 0, 1, 1, guiCursor_arrow );
} else {
DrawStretchPic( mouse.x, mouse.y, 32.0f, 32.0f, 0, 0, 1, 1, guiCursor_hand );
}
}


This code does not receive control.

As I see 'useMouse'=FALSE.

The following code sets 'useMouse':

SWF_Events.cpp

idSWFScriptVar waitInput = globals->Get( "waitInput" );
if ( waitInput.IsFunction() ) {
useMouse = false;
...
} else {
useMouse = true;
}


I think the problem is in this line:

idSWFScriptVar waitInput = globals->Get( "waitInput" );

But there is only this one reference 'waitInput'.

Entire code is not includes "globals->Set( "waitInput" )" or declares 'waitIntup' as var, func or sprite (movieClip).

Also I can't find 'waitInput' in .bswf and .json (with RBDOOM3-flash-tools).

How to work with 'waitInput'? It's a sprite? SWF var?

bitterman

#73
If there was the ability to control the base values (e.g. 'state' and 'nextScreen') inside the SWF file this would allow to create any menu without changing the main code (as I think).

It should pay attention to 'native' SWF function (like inhibitControl()).

bitterman