Jump to content

  • Log In with Google      Sign In   
  • Create Account


PandaDragonThing

Member Since 07 Aug 2011
Offline Last Active Jan 22 2014 02:50 AM
-----

Posts I've Made

In Topic: Side Scroller level textures

21 January 2014 - 10:29 PM

I've seen something like what you want, but on a 2D tiled multidirection kind of game. I suppose the same could be achieved if you created small tiles that have a few options in what they can merge into( grass texture A can merge into texture B, C, and D to the right. This makes random generation of placement of textures ) and you can even break up some textures into their own thing like vines could be littered around and the same for foliage or small objects that protrude from the game. But making things like the sloping hills or even making it look nice would take lots of varying options( like a lot of lots ).

It seems like too much work, art and programming wise to even bother to implement. Hand drawing the map is the easiest and most effective way to do it and will end up looking more aesthetically pleasing. The only thing it wouldn't work for is randomly generated maps that are unique from each other which would be one of the few reasons to do it the harder way( Look at terraria, it achieves this and looks very good, but you can still see gaps in the fluidity ).


In Topic: Component design and game class design

13 January 2014 - 05:27 PM

 

 


You need to get OOP out of your mind.

 

Is this mainly because to avoid bad design when programming the game? I actually found myself using mostly composition. 

 

If you're programming a game using ECS, you need to stop trying to build entities using inheritance, but rather composition.  It was in response to the OP's design of having an CharacterInputComponent inherit form an InputComponent (I'm OK with having a base Component class).

 

Sorry. Those inherited classes weren't meant to be there. It was a short term solution so I could do some testing of functionality.


In Topic: Guiding me in the process of making a simple 2d game

13 January 2014 - 01:37 PM

"What language should I start off with?"
"Should I use an engine or start from scratch?"
"Why isn't my model drawing?"

"My implementation of linear interpolation isn't working, why?"

"What are some tips for making system independent code?"

These are the questions you should be asking.


In Topic: What types of math are used a lot when developing games?

13 January 2014 - 01:23 PM

For working with 3D graphics Matrices are what you'll most likely be working with as they make complex problems relatively simple and are very powerful. Understanding trigonometry both in 3D and 2D space is quite helpful as well.

Depending on what you are doing in your game you can scale through lots of levels of math, but just remember you don't have to be a genius in math to program them. Formulas already exist and I think it's more important to know how to look at a concept or loose formula and implement it. Knowing the math makes it easier, but without doesn't make it impossible.


In Topic: Component based game and component communication

12 January 2014 - 03:53 PM

I think if you want to send data between components, you should have them an anchor to a common root which actually handles sending the information between components.

For example, in my game, I have components bound to individual entities which gives them functionality. I also have some specialized components such as an InputComponent and a RenderComponent. Each component haves a pointer back to it's root entity and my entity has a function called BroadCastMessage( MessageClass data ) which calls the function RecieveMessage( MessageClass data ) for all bound components. All my component has to do is use it's pointer to its root entities to broadcast a message to other components.

My MessageClass is basically this:

struct MessageClass
{
   char* pchName;
   void* pvData;
}

You would use the name to listen for certain events from other components like maybe "UpdateXPos" or something to that effect. Also since I know how a message would be built based on the name, I'll know how to typecast the data to its correct format. Another way you might do it, but it leads to a bit more work, is to use an array of bytes for the data. You would have to break down the data you need to send into individual bytes and then rebuild it up when a component receives it.

 

EDIT
Here's a complete example:

//InputComponent
void KeyPressed( char chKey )
{
   if( chKey == 'w' )
   {
      int iMovement = 10;
      pEntity->BroadcastMessage( MessageClass( "UpdateXPos", &iMovement );
   }
}

//RenderComponent
void RecieveMessage( MessageClass data )
{
   if( strcmp( data.pchName, "UpdateXPos" ) == 0 )
   {
      m_iPosX += *((int*)data.pvData);
   }
}

PARTNERS