Jump to content

ArBuZ

Members
  • Posts

    164
  • Joined

  • Last visited

Posts posted by ArBuZ

  1. The best way would be to write a game state system, typically called "screens". You have a Screen structure with an Update, Render, Finish set of member functions. A ScreenManager has a handle to the ActiveScreen, and will call the Update and Render functions for it. When Finish is called, next loop the screen manager will go to the next screen.

     

    We use such a system in Jeklynn Heights to go from Main Menu -> Loading Screen -> Game. And from game the next screen is GameScreen, when you press Escape.

    That is what I wanted to do. But don't know how to use framework in such system. I would use separate framework for each screen. It would have it's own world with it's own settings. So in main menu I would have one render settings and effects(bloom, refraction etc.) and in game other settings and effects. I understand that I can (and have to) do all that by my hands. But framework is already done, and I'd like to use it. :)

  2. I wanted to make 3d menu in separate world where I can perform raycasts and animation and have some effects and transparency. I thought using of 2 frameworks is good and simple way of doing this. If I use one framework I will need somehow to move menu entities to fw.main and fw.transparancy worlds and back or show and hide them. Wasting resources is not acceptable. So Ill keep searching suitable solution :P

  3. Thank you Lumooja.

    Ive noticed also that sometimes entity of any class in LEO becomes NULL or badptr in some cases. I cant remeber now how did that happen. But I had to use API instead of LEO.

     

    And by the way

    fw.GetMain()
    

    is absent in dll framework.

     

    And everything works if I use framewerk.cpp (not DLL). I think that something wrong with LEO.

  4. Hi! Ive tried to use framework directly that included in dll. Here is the simple code. When I try to move any camera of any layer the program gives an error.

     

    //	====================================================================
    //	This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard
    //	Written by Rimfrost Software
    //	http://www.rimfrost.com 
    //	====================================================================
    
    #include "leo.h"
    using namespace LEO ;
    
    int WINAPI WinMain( HINSTANCE hInstance,
    				HINSTANCE hPrevInstance,
    				LPSTR lpCmdLine,
    				int nShowCmd ) 
    {
    Engine engine( "Gma", 1024, 768) ;
    Engine::SetAbstractPath( "C:/Gma/Gma" ) ;
    Engine::SetFilters() ;
    
    
    Framework fw;
    fw.Create();
    
    fw.renderer.SetBloom(false);
    fw.renderer.SetHDR(false);
    
    //THIS CAUSE ERROR!
    fw.main.GetCamera().SetPosition(Vec3(0,0,-5));
    
    
    Material material("abstract::cobblestones.mat") ;
    Cube	 mesh( CREATENOW ) ;
    mesh.Paint( material ) ;
    
    Cube ground( CREATENOW ) ;
    ground.SetScale( 10, 1, 10 );
    ground.SetPosition( 0, -2, 0 );
    ground.Paint( material ) ;
    
    DirectionalLight light( CREATENOW ) ;
    light.SetRotation( 45 , 45, 45 );
    
    // Game loop
    while( !Keyboard::I****() && !Engine::IsTerminated() )
    {
    	if( !Engine::IsSuspended() ) // We are not in focus!
    	{
    		// Rotate cube
    		mesh.Turn( Vec3( 0.5f*AppSpeed() ) ) ;
    
    
    		fw.Update();
    		fw.Render();
    
    		Engine::Flip(0) ;
    	}
    }
    
    // Done
    return engine.Free() ;
    }
    
    

     

    But if I use API (not LEO) everything goes well:

    //	====================================================================
    //	This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard
    //	Written by Rimfrost Software
    //	http://www.rimfrost.com 
    //	====================================================================
    
    #include "leo.h"
    using namespace LEO ;
    
    int WINAPI WinMain( HINSTANCE hInstance,
    				HINSTANCE hPrevInstance,
    				LPSTR lpCmdLine,
    				int nShowCmd ) 
    {
    Engine engine( "Gma", 1024, 768) ;
    Engine::SetAbstractPath( "C:/Gma/Gma" ) ;
    Engine::SetFilters() ;
    
    
    Framework fw;
    fw.Create();
    
    fw.renderer.SetBloom(false);
    fw.renderer.SetHDR(false);
    
    //THIS CAUSES ERROR!
    //fw.main.GetCamera().SetPosition(Vec3(0,0,-5));
    
           //THIS WORKS!!!!
    PositionEntity(GetLayerCamera(fw.main),Vec3(0, 0, -3.5));
    
    
    Material material("abstract::cobblestones.mat") ;
    Cube	 mesh( CREATENOW ) ;
    mesh.Paint( material ) ;
    
    Cube ground( CREATENOW ) ;
    ground.SetScale( 10, 1, 10 );
    ground.SetPosition( 0, -2, 0 );
    ground.Paint( material ) ;
    
    DirectionalLight light( CREATENOW ) ;
    light.SetRotation( 45 , 45, 45 );
    
    // Game loop
    while( !Keyboard::I****() && !Engine::IsTerminated() )
    {
    	if( !Engine::IsSuspended() ) // We are not in focus!
    	{
    		// Rotate cube
    		mesh.Turn( Vec3( 0.5f*AppSpeed() ) ) ;
    
    
    		fw.Update();
    		fw.Render();
    
    		Engine::Flip(0) ;
    	}
    }
    
    // Done
    return engine.Free() ;
    }
    

     

    This works too

    Camera cam=GetLayerCamera(fw.main);
    cam.SetPosition( 0, 0, -3.5 );
    

     

    But this doesnt:

    Camera cam=fw.main.GetCamera();
    cam.SetPosition(0,0,-5);
    

     

     

    Maybe Im doing somethig wrong. Sorry if this problem is allready discribed on the forum.

  5. Hi guys! Im sorry, Ive made one mistake! Ive included fbx2gmf.exe to exporter archive instead of obj2phy.exe! That is why the exporter didnt generate *.phy files! To fix that just copy obj2phy.exe to "3dsmax root\scripts\startup\" or redownload exporter and extract it again. I will reupload it in a few seconds. Sorry for the inconvenience :)

  6. with my exporter it doesnt matter what objects do you have deal with. standard ptimitives or custom made shapes the exporter converts them all to the editable meshes and writes data directly to the file.

    Ive just tryed to say that the number of object wasnt actually a source of the problem if you used my exporter.

    I really want to help and find out why my exporter doesnt work for you. Do you have any messages while exporting? It must work ;)

  7. ..well..it happen same as when I just export manually as FBX and drag'n drop on to converter...it just create GMF file with size of few bytes (64 or 16, cant remember)..

     

    You are definitely doing something wrong. I ve seccessfully exported 4300 boxes. It has taken about 10 minutes!!! The file size was about 12Mb. But I couldnt even veiw boxes in model viewer. The frame rate was about 1 or 2.

    Have you allready exported such a big scenes in one file? I saw somewhere on the forum that leadwerks slows down very much when you have such huge amount of objects in one gmf. But I dont know if its true.

     

    I guess that you actually dont use my exporter. I think you use export via fbx function, don't you? Try this steps:

     

    Make sure that you are using the latest version of the exporter

    Go to "leadwerks tools"->"export objects".

    Uncheck "Selected only" "reset transforms" "Create *phy file".

    Export it. Max will hang for some time (it can be long time ;) ). But in the end it will give the message "All objects have been exported successfully" or "there was error..."

     

    Btw, make a copy of your scene befor exporting ;)

    Hope it will help :)

  8. ..hi ArBuZ..im not using it because it doesnt work..or I may be doing something very wrong..anyway, if you have some detailed description 'how to' i would follow..so far, every FBX format i try, doesnt convert in to GMF, and thats including your exporter..im not sure how big files you guys use to convert, but my level has 4300 objects on scene, roughly..anyway, let me know if there are some specific FBX settings for export, before actual FBX2GMF conversion is called..feel free to explain for both, max8 or 9..ill try on both..

    4300 objects!!! its very huge nuber. Im not quet sure that this is right whay to do such thing. Maybe you should try to split your level on some smaller parts?

  9. But I'm sure there must be better ways to do this.

    Can you create multiple seperate animation sequences in max (in the same file) and export only one at a time?

    If so, can someone tell me how?

     

    Hello Masterxilo! If you use "charecter studio" as sceleton then you are able to save animations in separate files with very easy way(one button click).

     

    If you use bones then things are more complicated, but not too hard. As far as I know there is "Save animation" tool in 3ds max. With it you can save any animation range in file. I havent used it, so I cant tell you how does it exactly work.

     

    Any way, I would do it this way: create all animations in one max file for one mesh. And then export them with my exporter (http://leadwerks.com/werkspace/index.php?app=downloads&showfile=7) to separate files. For example 0-100 - to one file, 100-150 to another file an so on. The exporter exports only active time range. You can set it in the "Time configuration" window (right click on play animation button). So first you set it to 0-100 and export it. Then set it to 101-150 and export it to another file.

     

    Hope it will help :)

  10. Leadwerks tools 2.3

    3ds max to GMF exporter is an alternative exporter that Ive made. It is max-script plugin that exports data directly from 3ds max to gmf file.

    There are fuatures and installation notes below. And some information how does this work.

     

    Supported features:

    1. Exporting of any number of objects saving hierarchical relationships.

    2. Exporting of smoothing groups.

    3. Exporting of materials IDs.

    4. Exporting of materials.

    5. Exporting of animation

    6. Exporting of skin data

    7. Exporting of vertex colors

    8. Exporting of 2 UV - channels

    9. Exporting of custom attributes (properties)

    10. Generation of *.ini files

    11. Generation of *.phy files

    12. Generation of LUA scripts for object properties

    13. Exporting of tangents and binormals

    14. Ability to export only materials without exporting of mesh.

    15. Scaling.

    16. Batch exporting of objects to separate files.

    17. Automatic LOD exporting.

     

     

    Installation:

     

    Extract files from archive to "3dsmax root folder\Scripts\Startup\"

    If you have files of previous version of the exporter, then remove them.

     

    The plugin will appear in main menu bar as Leadwerks tools menu.

     

    Download link:

    http://www.leadwerks.com/werkspace/files/file/210-leadwerks-tools-for-3ds-max/

     

    Help pdf file is included in exporter archive.

     

    Sorry for my English.

    I will be glad if someone will find it usefull. Thanks

    • Upvote 2
×
×
  • Create New...