binary zoo
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 21, 2018, 04:08:51 PM

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 6969 times)
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #15 on: May 30, 2014, 08:27:12 PM »

Enums!  phew I can sleep easy tonight Smiley
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #16 on: June 05, 2014, 06:41:41 PM »

yeah , you pointed out a commonn lazy habit i have .

i love to use arrays for data , but i neglect to make the matching enums .

Code:
enum { NORMAL=0 , HOVER , CLICKED };
enum { rctX=0 , rctY , rctW ,rctH };
enum { JUSTIFY_TOP_LEFT=0 , JUSTIFY_TOP_CENTER , JUSTIFY_TOP_RIGHT , JUSTIFY_CENTER_LEFT , JUSTIFY_CENTER ,
       JUSTIFY_CENTER_RIGHT , JUSTIFY_BOTOM_LEFT , JUSTIFY_BOTOM_CENTER ,JUSTIFY_BOTOM_RIGHT , NUM_JUSTIFY_MODES };

^^ the real enums.

i also missuse .h files to tuck away parts like this .

 
Code:

#ifndef COLORSSETUP_H_INCLUDED
#define COLORSSETUP_H_INCLUDED

DWORD UI_COLOR_WHITE = 16777215 ;
DWORD UI_COLOR_MAIN_BACKGROUND = MakeColor( 45, 45, 48 ) ;

DWORD UI_COLOR_OUTLINE = 0*256*256 + 0*256 + 0 ;
DWORD UI_COLOR_TREE_BG = MakeColor( 236, 236, 236 ) ;

// ku_gui_w_01.ini
string iniFile = "UI_rez/ku_gui_w_01.ini" ;

DWORD UI_COLOR_TEXT_1 = 0 ;
DWORD UI_COLOR_TEXT_2 = 0 ;
DWORD UI_COLOR_TEXT_3 = 0 ;
DWORD UI_COLOR_CONTROL_TEXT = 0;

DWORD UI_COLOR_TEXTBOX_TEXT_1 = 0 ;
DWORD UI_COLOR_TEXTBOX_TEXT_2 = 0 ;
DWORD UI_COLOR_TEXTBOX_TEXT_3 = 0 ;
DWORD UI_COLOR_TEXTBOX_BG_1 = 0 ;
DWORD UI_COLOR_TEXTBOX_BG_2 = 0 ;
DWORD UI_COLOR_TEXTBOX_CURSOR = 0 ;

DWORD UI_COLOR_BAR_LINE = 0;//67*256*256 + 67*256 + 67 ;
DWORD UI_COLOR_BAR_TOP  = 0;//50*256*256 + 50*256 + 50 ;//50 50 50
DWORD UI_COLOR_BAR_BOTTOM = 0;//36*256*256 + 36*256 + 36 ;//36 36 36

DWORD  UI_COLOR_BUTTON_TOP1 = 0 ;
DWORD  UI_COLOR_BUTTON_TOP2 = 0 ;
DWORD  UI_COLOR_BUTTON_BOTTOM1 = 0 ;
DWORD  UI_COLOR_BUTTON_BOTTOM2 = 0 ;

DWORD  UI_COLOR_BUTTON_ACTIVE_TOP1_X = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_TOP2_X = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_BOTTOM1_X = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_BOTTOM2_X = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_TOP1_Y = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_TOP2_Y = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_BOTTOM1_Y = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_BOTTOM2_Y = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_TOP1_Z = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_TOP2_Z = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_BOTTOM1_Z = 0 ;
DWORD  UI_COLOR_BUTTON_ACTIVE_BOTTOM2_Z = 0 ;

DWORD  UI_COLOR_BUTTON_ACTIVE_SCHEME = 0 ; // : UI_COLOR_BUTTON_ACTIVE_SCHEME = ReadIntINI%("ku_gui_01.ini" ,"colors", "UI_COLOR_BUTTON_ACTIVE_SCHEME" ) ; 1 ;can be 0 or 1
; //  no INI for these values , they must be computations
DWORD  UI_COLOR_BUTTON_ACTIVE_TOP1 = ( 1 - UI_COLOR_BUTTON_ACTIVE_SCHEME )*UI_COLOR_BUTTON_ACTIVE_TOP1_X + UI_COLOR_BUTTON_ACTIVE_SCHEME*UI_COLOR_BUTTON_ACTIVE_TOP1_Z ;
DWORD  UI_COLOR_BUTTON_ACTIVE_TOP2 = ( 1 - UI_COLOR_BUTTON_ACTIVE_SCHEME )*UI_COLOR_BUTTON_ACTIVE_TOP2_X + UI_COLOR_BUTTON_ACTIVE_SCHEME*UI_COLOR_BUTTON_ACTIVE_TOP2_Z ;
DWORD  UI_COLOR_BUTTON_ACTIVE_BOTTOM1 = ( 1 - UI_COLOR_BUTTON_ACTIVE_SCHEME )*UI_COLOR_BUTTON_ACTIVE_BOTTOM1_X + UI_COLOR_BUTTON_ACTIVE_SCHEME*UI_COLOR_BUTTON_ACTIVE_BOTTOM1_Z ;
DWORD  UI_COLOR_BUTTON_ACTIVE_BOTTOM2 = ( 1 - UI_COLOR_BUTTON_ACTIVE_SCHEME )*UI_COLOR_BUTTON_ACTIVE_BOTTOM2_X + UI_COLOR_BUTTON_ACTIVE_SCHEME*UI_COLOR_BUTTON_ACTIVE_BOTTOM2_Z ;

DWORD  UI_COLOR_BUTTON_PRESS_TOP1 = 0 ;
DWORD  UI_COLOR_BUTTON_PRESS_TOP2 = 0 ;
DWORD  UI_COLOR_BUTTON_PRESS_BOTTOM1  = 0 ;
DWORD  UI_COLOR_BUTTON_PRESS_BOTTOM2 = 0 ;

DWORD  UI_COLOR_TAB_UNDERLINE = 0 ;
DWORD  UI_COLOR_TAB_TOP = 0 ;
DWORD  UI_COLOR_TAB_BOTTOM = 0 ;

DWORD  UI_COLOR_TAB_ACTIVE_UNDERLINE = 0 ;
DWORD  UI_COLOR_TAB_ACTIVE_TOP = 0 ;
DWORD  UI_COLOR_TAB_ACTIVE_BOTTOM = 0 ;

DWORD  UI_COLOR_TAB_PRESS_UNDERLINE = 0 ;
DWORD  UI_COLOR_TAB_PRESS_TOP = 0 ;
DWORD  UI_COLOR_TAB_PRESS_BOTTOM  = 0 ;

DWORD  UI_COLOR_TAB_CURRENT_UNDERLINE  = 0 ;
DWORD  UI_COLOR_TAB_CURRENT_TOP  = 0 ;
DWORD  UI_COLOR_TAB_CURRENT_BOTTOM  = 0 ;

DWORD  UI_COLOR_TAB_SEPARATOR  = 0 ;
DWORD  UI_COLOR_TAB_TEXT = 0 ;
DWORD  UI_COLOR_TAB_TEXT_SELECTED = 0 ;

DWORD  UI_COLOR_TITLE_OUTLINE  = 0 ;
DWORD  UI_COLOR_TITLE_TOP1  = 0 ;
DWORD  UI_COLOR_TITLE_TOP2  = 0 ;
DWORD  UI_COLOR_TITLE_BOTTOM1  = 0 ;
DWORD  UI_COLOR_TITLE_BOTTOM2  = 0 ;
DWORD  UI_COLOR_TITLE_BACKGROUND  = 0 ;
DWORD  UI_COLOR_TITLE_TEXT=0;

DWORD  UI_COLOR_TABBER_BACKGROUND_TOP = UI_COLOR_TITLE_BOTTOM2 ;
DWORD  UI_COLOR_TABBER_BACKGROUND_BOTTOM = UI_COLOR_TITLE_BACKGROUND ;



#endif // COLORSSETUP_H_INCLUDED



those UI colors are used in Frostings GUI


* ent_name_edits_1.jpg (233.84 KB, 826x539 - viewed 236 times.)
« Last Edit: June 05, 2014, 07:25:40 PM by Prime_8 » Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #17 on: June 05, 2014, 11:11:50 PM »

i also missuse .h files to tuck away parts like this .
If it works then I'm ok with it.  You should see some of the things I do.  And half the stuff I think is ok is probably bad practice as well  Tongue
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #18 on: June 06, 2014, 12:05:30 AM »

just use .h  as it is a pure include without special rules in most IDE.

if it makes code easier to read  all the better , but proper use of cpp and hpp file can speed up later compile times by only having to compile the effected objects.

I'm so in your camp as far as the what ever  works .

Though this last year i have had a mentor of sorts in C/C++ ( Aaron )  , who has done commercial contracts .  I since have done some .
they key will be clean and easy to read code.

Im not one for harping how something should be done  nor aspects of 'efficient' code as some compiler do amazing jobs of  optimizations it crazy .

but i have learned to stop passing data around though vars  , but rather work with pointers more , thus not moving data but working on it where its sits . lowering memory jobs .

ie  the old / BASIC way of doing things you pass values  with simple assignments ..

A= B  // this is essentially replicating value of a into A container of B .

in basic  one would chop up  a incomming packet from a data bank/block by reading / parsing parts out int vars .

thus doings a memcopy  for each action .

sometimes you just need to evaluate a value in a block  , or  you only need to work on the original instance of a value .

pointers become magic  in C++ for that .

my networking functions had a exponential speed increase by reading and working with data  by pointer & offset , and type casting .
  where data is : char* data[1024] ; // or some large enough buffer
  float  Xposition = (*float)( (char*)data + (DWORD)offsetToPosX);
 
even better  :  read it rite to the object  , results in 1 copy operation .

Code:
 if( gameID ==  (*unsigned int )( (char*)data + (DWORD)offsetToGameID)  )
  { // though this can look messy  it is faster to work rite on teh data where it sits ..
    if(  (*unsigned int )( (char*)data + (DWORD)offsetToThisPlayerID) )
    if(  (  (*unsigned int )( (char*)data + (DWORD)offsetToThisPlayerID)  > 0  )  &&
         (  (*unsigned int )( (char*)data + (DWORD)offsetToThisPlayerID)  <= PlayerCount  ) )
    {  // pos

       PlayerType * player = players[ (*unsigned int )( (char*)data + (DWORD)offsetToThisPlayerID) -1 ] ;
       player->pos.x = (*float)( (char*)data + (DWORD)offsetToPosX);
       player->pos.y = (*float)( (char*)data + (DWORD)offsetToPosX+4);
       player->pos.z = (*float)( (char*)data + (DWORD)offsetToPosX+8);
       // pos
       player->rot.x = (*float)( (char*)data + (DWORD)offsetToRotX);
       player->rot.y = (*float)( (char*)data + (DWORD)offsetToRotX+4);
       player->rot.z = (*float)( (char*)data + (DWORD)offsetToRotX+8);

       //
      (*DWORD)( (char*)data + (DWORD)ReadTimestamp) = GetTime(); // set direct to the packet where it sits .

    }
  }


 ^^ off the top of my head so might be small syntax erro


you can see how skipping many memcopy commands can gain speed especially when reading may packets .

and the one uses a  macro to  make all those brackets look less crazy if one wants to return the human readability .
( i cant remember the  read a write macros off the top of my head thought.)
« Last Edit: June 06, 2014, 12:28:13 AM by Prime_8 » Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #19 on: June 06, 2014, 12:07:05 PM »

Yeah I dont use pointers as much as I should although I'm not bothered about it until I run into performance issues.  Unnecessary optimisation and all that  Smiley
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #20 on: June 07, 2014, 03:22:51 AM »

yeah , some things just dont warrant it .

when performance is good and it is way easier to read and understand code  skip em .


for shits and giggles , was playing with raw OpenGL code , ( some help from Aaron fixing my view matrix and providinga reworked example. )

I thought i would try to make a simple entity class .  
one sure develops a respect for a engine real quick when working in raw API . lol



* test_001.jpg (22.26 KB, 285x288 - viewed 221 times.)
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #21 on: June 07, 2014, 09:54:06 AM »

Yeah if it was easy there would be no need for the hundreds of different languages out there Smiley
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #22 on: June 08, 2014, 12:34:06 AM »

part of me thinks i should just make my own . 
you know , that way im at fault LOL



* test_obj_loading_002.jpg (170.47 KB, 735x787 - viewed 223 times.)

* test_obj_loading_003.jpg (138.11 KB, 735x596 - viewed 217 times.)
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #23 on: June 08, 2014, 01:25:14 AM »

um in motion is better :
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #24 on: June 09, 2014, 11:07:58 AM »

part of me thinks i should just make my own . 
you know , that way im at fault LOL
I'm sure I said months ago that that's exactly what you would do eventually.  Grin
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #25 on: June 12, 2014, 03:28:34 PM »

i just need to accept your are usually correct when it comes to my coding habits . LOL

 Grin

I am going to make a simple OpenGL engine to mirror this NNG in as best i can . Or i may just try to finish NNG in pure NF first .

but  using 2 render API and such makes for high abstraction in game classes . keeping the visuals all just a output .

pic explains where im at , still no shaders .. or UV data on imported .obj .  or any animation systems. LOL



* last_snap_001.jpg (93.09 KB, 657x518 - viewed 196 times.)
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #26 on: June 13, 2014, 10:43:58 AM »

Good progress so far Smiley

i just need to accept your are usually correct when it comes to my coding habits . LOL

 Grin
Don't fight it Smiley  The quicker you accept the inevitable the quicker you'll finish writing your own language.
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #27 on: June 18, 2014, 07:29:38 PM »


 Don't fight it Smiley  The quicker you accept the inevitable the quicker you'll finish writing your own language.

hahah ,, seems so .  LOL

I'm forcing my self to move to OpenGL , because i think it will be there in some for longer into the future .

lol my impression on the surface of GL is like building your whole world in a particle engine.

most of how i make stuff is how i manipulated particles in D3D9 .


* last_snap_002.jpg (68.34 KB, 657x521 - viewed 189 times.)
Logged

fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13185



View Profile WWW Email
« Reply #28 on: June 18, 2014, 08:47:47 PM »

I'm forcing my self to move to OpenGL , because i think it will be there in some for longer into the future .
Plus it's multi-platform.

AGK uses OpenGL, however I've never looked at plain old OpenGL myself.  How much work so you think it is to build your own engine?
Logged

Prime_8
1000 XP
*
Offline Offline

Posts: 1438



View Profile WWW
« Reply #29 on: June 21, 2014, 05:29:13 AM »

fair bit .

1 , camera is not d3d camera .  in that the active cam ,  the world moves about it , not it in the world.

2 , transforms of objects all end in camera space .

3 , its been dine so laods of examples.

4 , need to make the base classes

5 , need to research textures and materials.

6 , make a simple test engine .

7 , plan out and build a mian engine

8 , expose shaders . (GLSL )

9 , learn some GLSL .

10 , make a native formats and loader & importer . 
 and that would just be  visuals  2D and 3D .

possibly use SDL2  for some stuff.
and figure out sounds and such after . hahah

crazy rite .
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!