Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 31 Mar 2013
Online Last Active Today, 10:53 AM

Topics I've Started

Lighting and Sprites

22 July 2014 - 08:10 AM



I currently have a 2d engine, and I wanted to add lighting to it. I am not well versed in graphical programming (hence posting it in beginners). After following a few tutorials online I have managed to implement lights into my engine (kinda) that being I can draw a 2D plane (which I manually input the vertices)  with the lighting effects.





However, when ever I draw a sprite (see code below). The lighting effect is not present, it is the original image. I think, although I am unsure, this may have to do something with LPD3DXSPRITE (what I am using as the actual sprite) I suspect this does not have any vertices hence no normal that are required for the light effect to be shown. Is this correct?


If it is correct how would I go about correcting this? Would I have to create vertices for each sprite image and add a texture to it? If this is the case I would appreciate some guidance on how to do this. If it is not correct, what is my problem, I have been scratching my head for a while now :/ 



Sprite drawing:

void Graphics::drawSpriteWithOffset(const SpriteData &spriteData, 
int x, int y, COLOR_ARGB colour)


	D3DXMATRIX matrix;
	D3DXMatrixTransformation2D(&matrix, NULL, 0.0f, &scaling, &spriteCenter, (float) (spriteData.angle), &translate);


Creating the Light:

void Graphics::init_light(void)
    D3DLIGHT9 light;    // create the light struct
    D3DMATERIAL9 material;    // create the material struct

    ZeroMemory(&light, sizeof(light));    // clear out the light struct for use
    light.Type = D3DLIGHT_DIRECTIONAL;    // make the light type 'directional light'
    light.Diffuse = D3DXCOLOR(0.5f, 0.5f, 0.5f, 1.0f);    // set the light's color
    light.Direction = D3DXVECTOR3(-1.0f, 0.0f, 1.0f);

    device3d->SetLight(0, &light);    // send the light struct properties to light #0
    device3d->LightEnable(0, TRUE);    // turn on light #0

    ZeroMemory(&material, sizeof(D3DMATERIAL9));    // clear out the struct for use
    material.Diffuse = D3DXCOLOR(1.0f, 0.0f, 0.0f, 1.0f);    // set diffuse color to white
    material.Ambient = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);    // set ambient color to white

    device3d->SetMaterial(&material);    // set the globably-used material to &material

Any help is appreciated, smile.png

Air Control: Parody Game or Just Bad?

15 July 2014 - 03:56 AM



I have been wondering this for some time now. I can decide whether Air Control (http://store.steampowered.com/app/295810/) is a parody game or not. If you don't know the game, I strongly recommend watching a video on youtube about it. The main premise of the game is that is it a flight simulator.


However, the game is terrible in so many ways, its hard to pick the worse parts of the game, but an example would be the menu's don't disappear in game, and the curser isn't locked to the middle instead the developer has buttons on the screen (whilst you are playering) to centre the cursor to the middle.


The reason I think it may be a parody is that I have seen all of these terrible features in other fully released games, and it seems the developer has compiled them all into one game. Another thought that it may be a publisher that made a game using the worse bits from all the games that come across his desk. However, it doesn't claim to be a parody game, and has received A LOT of flak for being so bad. This could just be some un-experienced person that got lucky with a publisher and BAM its on steam. 


I'm still undecided, what do you think?

Urgent! Interview re-sheduling dilemma

01 July 2014 - 01:04 PM



Hopefully you can give me some advice on what I should do, or just give me food for thought.


So recently (an hour ago), telling me I have been selected for an interview at [Big/well known game company], and I should select a day/time I am available. I was over the moon. However, when I looked at the dates, my face fell. The only dates that where available are the days I am either Traveling too and or at Develop in Brighton conference (biggest game dev conference in uk). D:



If I select the earliest interview I will miss my train to Develop, and thus I will have to pay up to £200 on a new train ticket, not to mention waiting the money I spent for that day at Develop (which is quite expensive). 


I am debating calling them to see whether they have any earlier interview slots (which I doubt, as they provided me with a list). I also really want the job, and don't want to come off as not giving a crap by trying to re-schedule my interview to earlier/later date than they provided.



Any advise?


Develop and Gamelab Conference

20 June 2014 - 10:54 AM



So the next few weeks will be exciting for me, next week I'm going to Gamelabs Barcelona conference then I'm going to Develop in Brighton (9th July) :) . I've already decided on my 'must see' talks  but I do have a few gaps. Maybe you can help me fill them. Which talks would you go to if you could?



GamelabBCN schedule: http://gamelab.es/2014/en/conference/schedule/

Develop schedule: http://www.developconference.com/page.cfm/Action=Seminar/libID=3/listID=1/t=m/goSection=2_30

Room Based Euclidean Map

06 March 2014 - 12:59 PM

Hello all,


I have been stuck on this problem for about 2 weeks, and I think I have hit every brick wall possible, so alas  find myself here. I am currently creating a 2D rogue-like game (c++) with map elements not to dis-similar to the game Rogue Legacy. The level map is comprised of different rooms of different sizes that have entrances/exits to rooms that are adjacent. It's a little hard to explain, but hopefully this picture of Rogue Legacy which shows the game map will help.


And here is a crude paint drawing (where green arrows are entrance/exits)




Currently I am generating a map using a modified pathfinding algorithm which gives me my desired layout of rooms. 




I currently run the map generation store the rooms in a 2D array. Once all of the rooms have been generated, I then run through the array and place portals (entrance/exits) in the relevant rooms and set their destination room.


This works perfectly at the moment, where all the rooms are the same size. However adding larger rooms that can have more than the standard 4 portals (Left,Right,Up and down) is turning out to be a little tricky, as I am having trouble calculating the destination room and/or the position in that room.



Any help would be greatly appreciated, if you need anymore information just let me know :).