binary zoo
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 20, 2018, 09:15:08 AM

Login with username, password and session length
Search:     Advanced search
30178 Posts in 1158 Topics by 195 Members
Latest Member: dianeanderson
* Home Help Search Login Register
+  binary zoo
|-+  Game Development
| |-+  Guest Dev Blogs (Moderator: JDog053)
| | |-+  NNG (no name game ) :: ISO 2.5D experiment
Pages: [1] 2 3 Go Down Print
Author Topic: NNG (no name game ) :: ISO 2.5D experiment  (Read 6962 times)
Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« on: May 08, 2014, 07:04:43 PM »

NNG (no name game ) :: ISO 2.5D experiment

i wanted to test some ideas and use Kune in NF  ( Kune is available as standalone for VS 2013~14 ) .
If i leave NF i can use Kune's standalone 2D .

but in building and working out the scene I have come to like how the true 3D scene looks , so do i build it both ways .
pure 3d way could be less code overhead.  if i do 2.5D ISO I will have to make a ISO render engine in Kune .

I may continue with the build it both ways for now .   Grin


* new_iso_idea_001.jpg (139.55 KB, 1166x504 - viewed 223 times.)

* new_iso_idea_001_a.jpg (312.44 KB, 1061x605 - viewed 226 times.)

* new_iso_idea_003_a.jpg (266.4 KB, 1167x570 - viewed 215 times.)
« Last Edit: May 08, 2014, 07:06:48 PM by Prime_8 » Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #1 on: May 08, 2014, 07:10:30 PM »

bit more testing in my old P3D1 tool .

that is good test as it has physics live , so FPS is indicative of in game. In fact in a game it should be less. 

so with some work on making a loader , the full 3D could be great for RTS and RPG with standard camera settings.


* new_iso_idea_003_c.jpg (158.37 KB, 1364x707 - viewed 215 times.)
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #2 on: May 08, 2014, 09:39:52 PM »

That looks real good with the lights on, which is one of the benefits of the true 3D route I guess.

Doing everything twice though.  You mad  Wink
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #3 on: May 14, 2014, 01:58:25 AM »

yeah im gonna do just 3D now , but the cam angle and such i can use the system to render sprites for if i want to still build the pure 2.5D .

yeah real-time lights and fog are a big benefit as the fog is depth sensitive .

but here is a video
 


* new_iso_idea_006a.jpg (135.3 KB, 786x523 - viewed 210 times.)
« Last Edit: May 14, 2014, 02:00:04 AM by Prime_8 » Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #4 on: May 14, 2014, 11:36:04 AM »

Lovely.  Can't wait to see what game you have in mind for this Smiley
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #5 on: May 14, 2014, 02:18:35 PM »

its teh worst , its evolving as i go ..

im thinking point and click type thing . possibly squad based .

i'm doing the GUI / UI class tonight for the basic things .

i have physics in and you can mouse click the map and get the vector , normal , object , surface , tris  you hit . lol
lots more funs stuff to do .

I keep the 2d in mind the whole time too .
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #6 on: May 15, 2014, 03:53:22 PM »

its teh worst , its evolving as i go ..

im thinking point and click type thing . possibly squad based .
Yeah it would be great for that.  Another genre I love too.  XCom (the good one)  was one of the best games I played last year.  Brilliant.
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #7 on: May 17, 2014, 01:01:12 AM »

i want small tactical squads if i can figure it .. where teh user can directly control a uinit at a time while others continuing on in AI mode.
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #8 on: May 21, 2014, 07:02:33 AM »

some more done .
II have the GUI class started , with a UI_Surface class.  much like a basic window in win API.

Th GUI is actually a better re-code of some parts of the one i made for Frosting's GUI.

:: i have been pondering game code , engine wise, small squads ,  with option of turn base and real time play at game launch .
and light networking .

any how here is pic showing the simple GUI so far .

Code:

// basic rect that all widgets are composed of except pure draw objects
class UI_Surface
{
    public:
        static UI_Surface* UI_SurfaceHasMouse;
        static void ClearHasMouse(){ UI_SurfaceHasMouse = NULL;}

        UI_Surface(  );
        virtual ~UI_Surface();
        unsigned int GetCounter() { return s_Counter; }
        void SetCounter(unsigned int val) { s_Counter = val; }
        void SetState( bool _state = true){ state = _state; }
        bool GetState( ){ return state; }
        void SetName( string _name=""){ name = _name ; }
        string GetName(  ){ return name ; }

        void SetSize( int x, int y , int w , int h , bool setSc = true );
        void GetSize( gRect* _Size ){ _Size->rect[0] = mySize.rect[0]; _Size->rect[1] = mySize.rect[1];
                                       _Size->rect[2] = mySize.rect[2]; _Size->rect[3] = mySize.rect[3];}
        void SetPosX( int x ){ offsetX = x - mySize.rect[0] ;}
        void SetPosY( int y ){ offsetY = y - mySize.rect[1] ;}
        int GetPosX(){return mySize.rect[0] + offsetX ;}
        int GetPosY(){return mySize.rect[1] + offsetY ;}

        int GetOffsetX(){return offsetX ;}
        int GetOffsetY(){return offsetY ;}

        void SetColors( DWORD _top ,  DWORD _bottom ){ colors[0] = _top ,  colors[1] = _bottom; }

        void SetUseScissor( bool _useScissor = true){ useScissor = _useScissor; }
        void SetScissorSize( int x, int y , int w , int h ){ ScissorSize.rect[0] = x ; ScissorSize.rect[1] = y ; ScissorSize.rect[2] = w ; ScissorSize.rect[3] = h ; }

        int GetMouseOver( int _mouseX, int _mouseY , bool _grabMouse = false );

        void DrawSurface( int x , int y );
        void DrawSurface( );

        void SetParent( void* _parent = NULL ) { parent = _parent ; }
        void* GetParent( ) { return parent ; }

        unsigned int GetChildCount() { return numChildren; }
        unsigned int AddChild( UI_Surface* _child );
        UI_Surface* GetChild( unsigned int _index = 0 );

    protected:
    private:
        static unsigned int s_Counter ;
        static unsigned int s_CounterMaster ;

        unsigned int s_ID;
        void* parent ;
        bool active ;
        int state ;
        int offsetX , offsetY ;
        gRect mySize;
        string name;
        bool useScissor;
        gRect ScissorSize;
        DWORD colors[2];

        unsigned int numChildren;
        void* l_children; // KU list // Kune::NewList();

};


* new_iso_idea_007a.jpg (144.94 KB, 786x519 - viewed 203 times.)
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #9 on: May 21, 2014, 06:02:39 PM »

Bloody hell mate.  You and your annoyingly good UI systems.

I'm sure you only do it to taunt me. Wink
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #10 on: May 22, 2014, 05:30:06 AM »

i taunt you not!

lol

more done , most is supporting code in the surface class .

things like my own BMP font now work , and renders on the surfaces .

setup is this easy :
Code:
 
    UI_Surface Tester ;
    Tester.SetName("Just a Test!");
    Tester.SetSize(100, 100 , 200 , 100 );
    Tester.SetColors( MakeColor(255,128,128) , MakeColor(100,255,100) );
    Tester.SetFont(&default_font);


    Tester.DrawSurface();

    UI_Surface Tester2 ;
    Tester2.SetName("Just a Tester2!");
    Tester2.SetSize(150, 150 , 200 , 100 );
    Tester2.SetColors( MakeColor(255,128,128) , MakeColor(100,255,100) );
    Tester2.SetFont(&default_font);
    Tester2.SetCaptionPosMode(1);

    Tester2.DrawSurface();

    Tester.AddChild( &Tester2 ) ;


at the top of the dotweening() section :

Code:
if(Do3DTweening())
{  if(useManagedViewPort || UI_gMouseMove || wasKP )SetViewportVisible(gViewport , 1 ) ;

            Kune::ClearQueue();
            string satsD = string("FPS: ")+GetFPS() + " :: M x:"+string(MX) + " y:"+string(MY) + " cShapes:" + string(cShapes) ;

            font_Main.Draw_BMPF_String( 5 , 5 , satsD);
            default_font.Draw_BMPF_String( 5 , 30 , satsD);

            UI_Surface::ClearHasMouse();
            if( Tester.GetCounter() > 0 ) {
                int moRez = Tester.GetMouseOver(UI_gMouseX,UI_gMouseY, true ) ;//  0 no mouse , 1 over , 2 over and first , 3 over & parent is mouse over too
                if( moRez==2 ){ Tester.SetColors( MakeColor(255,5,5) , MakeColor(5,255,5 ) );}
                else if( moRez==1 ){ Tester.SetColors( MakeColor(5,255,5) , MakeColor(5,5,255 ) );}
                else { Tester.SetColors( MakeColor(255,128,128) , MakeColor(100,255,100 ) ) ;}
                Tester.DrawSurface();
                if( Tester.GetLastOpenChild_ID() ){ Tester.SetLastOpenChild_ID(); }


                moRez = Tester2.GetMouseOver(UI_gMouseX,UI_gMouseY, true ) ;
                if( moRez==2 ){ Tester2.SetColors( MakeColor(255,5,5) , MakeColor(5,255,5 ) );}
                else if( moRez==1 ){ Tester2.SetColors( MakeColor(5,255,5) , MakeColor(5,5,255 ) );}
                else if( moRez==3 ){ Tester2.SetColors( MakeColor(5,5,255) , MakeColor(255,5,255 ) );}
                else { Tester2.SetColors( MakeColor(255,128,128) , MakeColor(100,255,100 ) ) ;}
                if( moRez && UI_gMouseHit1 ){ DoffX = (UI_gMouseX - Tester2.GetPosX() );
                                              DoffY = (UI_gMouseY - Tester2.GetPosY() );
                                              Tester2.PushStatusToParent( true ) ; }
                if( moRez && (UI_gMouseDown == 1))
                { Tester2.DrawSurface( (UI_gMouseX-DoffX) ,  (UI_gMouseY-DoffY)   ) ; }
                else{  Tester2.DrawSurface(); }
            }
            // return to default clipping NONE
            Kune::QueSetScissor(0 , 0 , gViewportWidth, gViewportHeight );
            // draw lower left  logo
            if(!UI_gMouseDown)Kune::BlitImage( NNG_logo_LL , 5 , GetViewportHeight(gViewport) - Kune::GetTextureResY(NNG_logo_LL)-5 );

            UI_UpdateMouse(gWindow);

......


* new_iso_idea_008a.jpg (135.71 KB, 790x521 - viewed 173 times.)
« Last Edit: May 22, 2014, 05:37:22 AM by Prime_8 » Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #11 on: May 23, 2014, 11:02:12 PM »

I made some big changes in the GUI helper functions .
anything can parent / child to anything .

this is one of the object class templates .
Code:

// ___ GUI helper commands ___

void sysUI_Element_Clear( UI_Element* _target )
{   if( _target != NULL ) {
        if( _target->typeCode == 0 ){ UI_Surface* _sTemp = (UI_Surface*)_target->element ; _sTemp->SetParent( NULL , 0 ) ; }
        else if( _target->typeCode == 1 ){ sysGUI* _sTemp = (sysGUI*)_target->element ; _sTemp->SetParent( NULL , 0 ) ; }
        else { Notice("Error unrecognized type code passed to : sysUI_Element_Clear") ;}
    }
}

void sysUI_Element_Set( UI_Element* _target , void* _val =NULL , unsigned int _targetTypeCode=0 )
{   if( _target != NULL ) {
        if( _target->typeCode == 0 ){ UI_Surface* _sTemp = (UI_Surface*)_target->element ; _sTemp->SetParent( _val , _targetTypeCode ) ; }
        else if( _target->typeCode == 1 ){ sysGUI* _sTemp = (sysGUI*)_target->element ; _sTemp->SetParent( _val , _targetTypeCode ) ; }
        else { Notice("Error unrecognized type code passed to : sysUI_Element_Set") ;}
    }
}


//---------------------------------------------  sysGUI  --------------------------------------------------
sysGUI::sysGUI()
{
    //ctor
    g_CounterMaster++ ;
    g_ID = g_CounterMaster ;
    myTypeCode = 1;
    parent.element = NULL;
    parent.typeCode = 0;

    numChildren=0;
    l_children = NULL ; // a Kune::NewList(); if children get added.

    g_Counter++;
}

sysGUI::~sysGUI()
{
    //dtor
    if  ( l_children != NULL){
        UI_Element* _rez;
        while ( Kune::ListGetCount( l_children ) ) // remove self from children's parent ptr*
        {   _rez = (UI_Element*)Kune::ListPopFront( l_children );
            if( _rez != NULL ){ sysUI_Element_Clear( _rez ); delete _rez ; }
        }
        Kune::DeleteList( l_children ) ;
    }
    g_Counter--;
}

unsigned int sysGUI::AddChild( void* _child , unsigned int _typeCode )
{

    if( _child != NULL ){
        if ( l_children == NULL) { l_children = Kune::NewList(); }
        if( l_children != NULL ){
            UI_Element* _rez = new UI_Element;
            _rez->element = _child;
            _rez->typeCode = _typeCode;
            Kune::ListPushBack( l_children , (void*)_rez ) ;
            numChildren=Kune::ListGetCount( l_children ) ;
            sysUI_Element_Set( _rez , (void*)this , myTypeCode );
            return numChildren;
        }
    }
    return 0;
}

// the return is temporal !! and can point to a removed item if kept too long
UI_Element* sysGUI::GetChild( unsigned int _index )
{   if( (l_children != NULL ) && ( _index < numChildren ) ){
        UI_Element* _ret = NULL;
        _ret = (UI_Element*)Kune::ListGetItem( l_children, _index );
        if(_ret) return _ret;
    }
    return NULL;
}

// remove a child by index number.
unsigned int  sysGUI::RmoveChild( unsigned int _index )
{   if( (l_children != NULL ) && ( _index < numChildren ) ){
        void* _ret = NULL;
        _ret =  Kune::ListGetItem( l_children, _index );
        void* _retC = NULL;
        if( _ret != NULL ) {
            _retC = Kune::ListCurrent( l_children );
            if ( _ret == _retC ) { UI_Element* _sTemp = (UI_Element*)_retC; sysUI_Element_Clear( _sTemp  );
                Kune::ListRemoveCurrent( l_children );  delete (UI_Element*)_ret ;
            } else { Notice( " Error in sysGUI's UI_Element list! : sysGUI::RmoveChild failed! " ) ;}
        }
        numChildren=Kune::ListGetCount( l_children ) ;
        return numChildren;
    }
    return 0;
}



oh and a functional exit button was dead easy !

make / define a button:
Code:
    UI_Surface QuitButton;
    QuitButton.SetName("Quit App Button!");
    QuitButton.SetSize(gViewportWidth-55, 5 , 50 , 18 );
    QuitButton.SetColors( MakeColor(255,50,50) , MakeColor(255,5,5) );
    QuitButton.SetFont(&default_font);
    QuitButton.SetCaption("Exit");
    QuitButton.SetCaptionPosMode(1);

all i need to do to test in in a draw / tween section :
Code:
                moRez = QuitButton.GetMouseOver(UI_gMouseX,UI_gMouseY, false ) ;
                if( moRez ){ QuitButton.SetColors( MakeColor(255,50,50) , MakeColor(210,5,5) );
                   if( UI_gMouseHit1 ) ExitNow = true;
                }
                else  { QuitButton.SetColors( MakeColor(180,5,5) , MakeColor(5,5,5) );}
                QuitButton.DrawSurface();

and pic shows it .


* new_iso_idea_009a.jpg (173.73 KB, 786x520 - viewed 178 times.)
« Last Edit: May 23, 2014, 11:14:44 PM by Prime_8 » Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #12 on: May 24, 2014, 04:02:58 PM »

Nice.

Code:
QuitButton.SetCaptionPosMode(1);
You need more enums....I'm obsessed with using them  Smiley
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #13 on: May 26, 2014, 02:08:29 AM »

yeah , i usually have a few enums for that stuff , but i'm still in design phase  .
i should set some up now , or i will forget 
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #14 on: May 30, 2014, 04:38:05 AM »

iI added a set on enums to it but not on my dev rig or i would post how I do1 them . but nothing to fancy :

Code:
enum{ BTN_NORMAL =0 , BTN_OVER , BTN_CLICKED , NUM_BTN_STATES }; // NUM_BTN_STATES auto magicaly contains how many BTN states there are

enum{ BTN_JUSTIFY_TOP_LEFT=0 ,  .. put em all in .. , BTN_JUSTIFY_BOTTOM_RIGHT , NUM_BTN_JUSTIFICATIONS }; //  


pic of teh 3 state image buttons and such here


* new_iso_idea_010a.jpg (139.75 KB, 780x515 - viewed 175 times.)
« Last Edit: May 30, 2014, 04:39:55 AM by Prime_8 » Logged

Pages: [1] 2 3 Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!