Jump to content
  • Advertisement

AhmedCoeia

Member
  • Content Count

    174
  • Joined

  • Last visited

Everything posted by AhmedCoeia

  1. AhmedCoeia

    Improving skills

    Hi All,   I would like to enhance my programming skills. I have done few projects like space invader, and atari asteroids as games. I was doing 3D game programming but was fired due to my lack of skills. When I back home from work, I have plenty of time.. I want to invest it to enhance my programming skills.. So Would you suggest projects or some stuff that I can do in my spare time ? I'm most of the time reading data structure and algorithms but I never practice them.. for example of the things that I focus on.    I lost the confidence in my self, and I need to restore it.. but don't know how..   btw, here is a list of some of the projects that I have done https://www.youtube.com/user/ahmedragia21
  2. AhmedCoeia

    Improving skills

    it seems you wrote about me here  http://bryanwagstaff.com/index.php/life-advice-about-changing-careers-depression-and-games/ I never want to make games anymore, its very hard for me.. but I just want to practice them, so I need advice, because writing games can teach you a lot in CS.    I also written that wrapper or you can call it a 2D game engine, https://code.google.com/p/directxgameengine   am I still a bad coder or can't get coding ? 
  3. AhmedCoeia

    Improving skills

    Frob, thanks so much for your help, I really appreciate it, I'm controlling my bipolar disorder.  By the way I quit the game job this month, and I will do pure programming stuff, that are not games. That's why I want to practice some suggested projects or some games.    For education, I'm 28 and I'm immigrant in Austria and I have to work, there is no possibility to study CS :(.   I have managed to get the barrier working    Frob, I have managed to finish some software before, you made me feel that I suck and I shouldn't do software, your reply made me feel depressed more . I just want to improve.
  4. Hi All, I'm trying to clone space invader of atari and I have problem with bounding rect calculations.. the rect is not correctly bounded.. maybe I have problem with the transformations  void Barrier::Render() { if (mBarrierImage) { CIwFMat2D Transform; // Build transform Transform.SetIdentity(); Transform.SetRot(0); Transform.ScaleRot(1); Transform.SetTrans(Position); Iw2DSetTransformMatrix(Transform); Iw2DSetColour(0xffffffff); CIwFVec2 pos = Transform.t; BoundingRect.x = Position.x; BoundingRect.y = Position.y; BoundingRect.w = (float)mBarrierImage->GetWidth(); BoundingRect.h = (float)mBarrierImage->GetHeight(); Iw2DSetColour(0xff0000ff); // Set red Iw2DDrawRect(CIwFVec2(pos.x, pos.y), CIwFVec2(mBarrierImage->GetWidth(), mBarrierImage->GetHeight())); // Draw red outline }
  5. AhmedCoeia

    Game programming is hard

    Hi, I worked last year into 3d games and participated into two titles sports simulation, did some stuff like sounds, skid marks,..etc. I'm into the way of getting fired soon, tasks getting hard and I couldn't do them...  I lost the confidences at all, however I have doing programming for 7 years, but worked on business applications,..etc. Game programming is really different and it needs a lot of algorithms and imagination..    Now I lost the confidence at all after failure in two tasks, I even want to be a taxi driver and leave the programming career...  my education is electronics engineer and never studied programming in the university, I taught myself everything... which basically is nothing    How would I restore my confidence :S ?  
  6. Hi All I'm trying to clone a space invader    I'm currently doing the bullets that hit the green barriers. Currently I can get the pixels of the green image, and I also found the intersect rectangle between both the bullet when it hits the green barrier.    But right now I stopped and I don't know how to proceed further with the algorithm ?
  7. AhmedCoeia

    Game programming is hard

    I have mental sickness bipolar disorder :). and I'm thinking to be hospitalized again ( I was last two months ) .    Frob, what do you recommend to improve my programming skills ?    I have made that software alone https://vimeo.com/52915105 I was the lead. My skills are getting down and down since I was hospitalized :S    I need a guide and I will follow it, like do those projects to restore ur self confidence... Now I'm working on space invader and I can't finish. 
  8. I adjusted the bounding box's y size to be the difference between current position and last position.   Now for the algorithm that you posted earlier, there is a chance that the bullet intersects with the bounding rect, and there is black, but in the next frame, there is green and the bullet misses that part that it should hit, because the intersection test  is tested once... how do I fix that ?
  9. AhmedCoeia

    Game programming is hard

    he threated me last employee appraisal of getting fired if my performance won't be better. I lost the confidence in software development in general. I suck :S    I looked at your project its very nice. Can I work with you ? Maybe I learn more ? 
  10. What I understand is, the bullet is so fast and sometimes the collision doesn't work, and it skips, but why ? I don't know.. the cpu should be fast enough to process collision that fast.    I tried to record the prevposition of the bullet and use it in the calculation, as shown:   void Bullet::Update(float dt) { Position.y -= 0.50 * dt; Vel = (Position - prevPosition).GetNormalised(); if (Position.y < 0) { IsDestroyed = true; } else IsDestroyed = false; prevPosition = Position; } and for intersection    if (IntersectsWith((*it)->BoundingRect, barrierRect)) { cRect bounding = Intersection((*it)->BoundingRect, barrierRect); // subtract (*it) bullet position from barrrier's rect  int normX = (*it)->prevPosition.x + (*it)->Vel.x - barrierRect.x; int normY = (*it)->prevPosition.y + (*it)->Vel.y - barrierRect.y; // barrier image pixels  uint32* ptr = (uint32*)pixels; // height of the barrier int pixelOffset = normY*51 + normX; unsigned int color = ptr[pixelOffset]; // look up the color if its not black, it should be green if (color != 0xFF000000) { // delete the bullet Bullet *bullet = *it; it = ship->Bullets->erase(it); delete bullet; ship->Canfire = true; isCollision = true; // blast a circle around that bullet hit position int radius = 9; for (int y = -radius; y <= radius; y++) { for (int x = -radius; x <= radius; x++) { if (x*x + y*y <= radius*radius) { int j = x + normX; int i = y + normY; int pixelOffset = i*51  + j; ptr[pixelOffset] = 0xff000000; } } } } but I still gets in-accurate collision detection and blasting circles :S    
  11. when I made the bullet slower, everything works fine actually.. so should I store its previous position and use it in the calculation ?
  12. is the calculation correct ?  normX =  bulletXpos - barrierRect.X ? and the same for you ?   What you mean is should I record previous position of the bullet ? and use that in the calculation ?
  13. I've been struggling with implementing the space invader bullet to barriers. I wanted right now to blast a circle around, when the bullet hits the barrier and modifies the circle. As shown in the video, the algorithm looks wrong,  I have tried my best to debug it, but I've failed. here is the algorithm: // if there is intersection if (IntersectsWith((*it)->BoundingRect, barrierRect)) { // subtract (*it) bullet position from barrrier's rect int normX = (*it)->Position.x - barrierRect.x; int normY = (*it)->Position.y - barrierRect.y; // barrier image pixels uint32* ptr = (uint32*)pixels; // height of the barrier int y = 31; for (int i = 0; i < 31; i++) { int pixelOffset = y + normX * 51; int color = ptr[pixelOffset]; // look up the color if its not black, it should be green if (color != 0xFF000000) { // delete the bullet Bullet *bullet = *it; it = ship->Bullets->erase(it); delete bullet; ship->Canfire = true; isCollision = true; // blast a circle around that bullet hit position int radius = 9; for (int y = -radius; y <= radius; y++) { for (int x = -radius; x <= radius; x++) { if (x*x + y*y <= radius*radius) { int j = x + normX; int i = y + normY; int pixelOffset = j + i * 51; ptr[pixelOffset] = 0xff000000; } } } break; } // go up y--; }  
  14. AhmedCoeia

    Employee appraisal

    Hi All, I have been working 3D game programming for a year now, and that is my first job in industry. Today I had employee appraisal and my manager told me that I don't work independently and I ask for help and two guys (seniors) they are tutoring me for the last year and I'm wasting their time. However I have worked on a lot of tasks dependently too, but for tasks that are beyond my knowledge, yes I ask them.  I asked him what if the situation won't be improved, he said I won't be in the team..however he asked me to be patient with another team member that is causing a lot of troubles to other team members and he is still in the company for a long of years!    I have already another offer from a company that is doing augmented reality, do you think should I wait to be fired or listen to my boss and do better or leave and keep my dignity untouched, in case getting fired? 
  15. I've been struggling with implementing the space invader bullet to barriers. I wanted right now to blast a circle around, when the bullet hits the barrier and modifies the circle. As shown in the video, the algorithm looks wrong,  I have tried my best to debug it, but I've failed. here is the algorithm: // if there is intersection if (IntersectsWith((*it)->BoundingRect, barrierRect)) { // subtract (*it) bullet position from barrrier's rect int normX = (*it)->Position.x - barrierRect.x; int normY = (*it)->Position.y - barrierRect.y; // barrier image pixels uint32* ptr = (uint32*)pixels; // height of the barrier int y = 31; for (int i = 0; i < 31; i++) { int pixelOffset = y + normX * 51; int color = ptr[pixelOffset]; // look up the color if its not black, it should be green if (color != 0xFF000000) { // delete the bullet Bullet *bullet = *it; it = ship->Bullets->erase(it); delete bullet; ship->Canfire = true; isCollision = true; // blast a circle around that bullet hit position int radius = 9; for (int y = -radius; y <= radius; y++) { for (int x = -radius; x <= radius; x++) { if (x*x + y*y <= radius*radius) { int j = x + normX; int i = y + normY; int pixelOffset = j + i * 51; ptr[pixelOffset] = 0xff000000; } } } break; } // go up y--; }  
  16. AhmedCoeia

    Employee appraisal

    it was am mixture feeling of please don't do this (work independently ) and when I stressed If not, he said in 3 months to 6 months, we will evaluate, then I said, if not, he said you won't be in the team.  he also said you need to learn much in client programming, so what ? is it bad that I ask colleagues  and learn ? what's wrong with him ?  he said I'm wasting their time, but to be honest it just occurred one time that a guy asked for per programming for the whole year. and I did a lot of tasks independently, he even didn't know about them, because he is a server side programmer, and the client manager who hired me left the company after three months of my employment   Why it's bad if I'm learning but I'm doing the task ? I have never left a task not done since the whole year! no one single task 
  17. AhmedCoeia

    Employee appraisal

    What can I do then? He said sorry for that ( when he said you won't be in the team), that he needs quality of the product to be high,..etc of none sense reasons.    I wanna dig into the industry, but looks like there are no junior or entry level jobs at all. For example I was asking my colleagues yes about some areas which I'm not expert in! or have no clue to solve them. For example an imposter, a friend told me an algorithm then I implemented it and made it work. what's wrong with that ?!!! what's wrong if my colleague give me advises in how to approach a problem 
  18. Thanks so much for your suggestion and your help. But would you tell me what's the problem with the above code?  At least explaining to me the problem above would give me hints to work on simpler game. Because for example in a pong game, I will still have to use bounding boxes,..etc 
  19. Hi All, I'm trying to clone space invader, collision with the green barriers. Right now I have access to the pixels of the green barrier I would like to draw a solid black circle around the collision point of the bullet, right now I'm using the following code, but it spread random pixels, not solid black circle and it's center the hitting point   int radius = 44; for (int y = -radius; y <= radius; y++) { for (int x = -radius; x <= radius; x++) { if (x*x + y*y <= radius*radius) { int j = y + bullet.x; int i = x + bullet.y; uint8 pixelOffset = j*4 + i*pitch; ptr += pixelOffset; *ptr = 0xff000000; } } }
  20. AhmedCoeia

    blast a solid black circle

    @Frob, There are no builtin draw circle function, I tried to search but couldn't find it ?   I have also second problem, I'm very confused about marmalade Transform and draw image functions.  I wanna set a correct bounding box for all my IW2DImages and it's always wrong.    Can someone show me how would I do it  ? 
  21. I'm trying to know the math of building a topology like that from a set of vertices P1,P2,P3, and get the desired indices for those triangles. Currently I'm just making a plane but I don't take account of vertices P1, P2 or make the first triangle and the last one. public static void CreatePlane(int width, int height, Transform transform, int segmentsWidth, int segmentsHeight) { int ix, iy, widthHalf = width / 2, heightHalf = height / 2, gridX = segmentsWidth, gridY = segmentsHeight, gridX1 = gridX + 1, gridY1 = gridY + 1, segmentWidth = width / gridX, segmentHeight = height / gridY; Vector3 normal = new Vector3(0, 0, 1); List<Vector3> vertices = new List<Vector3>(); List<Vector3> vertexNormals = new List<Vector3>(); List<int> faces = new List<int>(); List<Vector2> faceVertexUvs = new List<Vector2>(); int cnt = 0; for (iy = 0; iy < gridY1; iy++) { for (ix = 0; ix < gridX1; ix++) { float x = ix * segmentWidth - widthHalf; float y = iy * segmentHeight - heightHalf; vertices.Add(new Vector3(x, -y, 0)); } } for (iy = 0; iy < gridY; iy++) { for (ix = 0; ix < gridX; ix++) { int a = ix + gridX1 * iy; int b = ix + gridX1 * (iy + 1); int c = (ix + 1) + gridX1 * (iy + 1); int d = (ix + 1) + gridX1 * iy; faces.Add(a); faces.Add(b); faces.Add(c); faces.Add(d); faceVertexUvs.Add(new Vector2(ix / gridX, iy / gridY)); faceVertexUvs.Add(new Vector2(ix / gridX, (iy + 1) / gridY)); faceVertexUvs.Add(new Vector2((ix + 1) / gridX, (iy + 1) / gridY)); faceVertexUvs.Add(new Vector2((ix + 1) / gridX, iy / gridY)); } } // create mesh GameObject plane = new GameObject("TreePlane"); plane.transform.position = transform.position; plane.transform.rotation = transform.transform.rotation; MeshFilter mf = (MeshFilter)plane.AddComponent(typeof(MeshFilter)); Mesh m = mf.mesh; m.vertices = vertices.ToArray(); m.SetIndices(faces.ToArray(), MeshTopology.Quads, 0); m.uv = faceVertexUvs.ToArray(); MeshRenderer renderer = plane.AddComponent(typeof(MeshRenderer)) as MeshRenderer; Material material = (Material)Resources.Load("Red", typeof(Material)); if (renderer != null) { renderer.sharedMaterial = material; } m.RecalculateBounds(); m.RecalculateNormals(); }
  22. pixels, are the pointer to the pixels of a test barrier image.. sorry about the confusion there
  23. Hi, I'm trying to implement spaceinvader atari collision where the barriers are hit, there are blasting black pixels around the barrier when they are hit.   Right now I subtract the rectangle of the bullet from the rectangle of the barrier, then I try to draw a solid filled circle of black, but the result is a random pixels that are set into the bitmap. I don't know why... bool CheckCollisionNewBarriers(Ship *ship, vector<Barrier*> *barriers, CIwTexture *tex, uint8*pixels, uint32 pitch, Resources *gameResources) { bool isCollision = false; for (vector<Barrier*>::iterator itBarrier = barriers->begin(); itBarrier != barriers->end();) { for (list<Bullet*>::iterator it = ship->Bullets->begin(); it != ship->Bullets->end();) { if (IntersectsWith((*it)->BoundingRect, (*itBarrier)->BoundingRect)) { //cRect bounding = Intersection((*it)->BoundingRect, (*itBarrier)->BoundingRect); int normX = (*it)->BoundingRect.x - (*itBarrier)->BoundingRect.x; int normY = (*it)->BoundingRect.y - (*itBarrier)->BoundingRect.y; uint32* ptr = (uint32*)pixels; int radius = 4; for (int y = -radius; y <= radius; y++) { for (int x = -radius; x <= radius; x++) { if (x*x + y*y <= radius*radius) { int j = normY + y; int i = normX + x; uint8 pixelOffset = j + i*pitch; ptr += pixelOffset; *ptr = 0xff000000; } } }
  24. AhmedCoeia

    is anybody psycho here?

    Hi All, I'm diagnosed with bipolar disorder.. is anybody here doing gamedev professionally and taking antipsychotics, antidepressants? 
  25. I'm trying to clone space invader, especially the part where you hit the green barriers and there is a small black blasting explosion that occur.  I have problem in the algorithm and I can't figure it out.. First I check if collision occurs, then I first subtract the bounding box's, then I try to blast pixels, but the shape of the pixels are wrong, currently they are drawn over the whole green barrier not only in the place where the bullet is hit.. for (vector<Barrier*>::iterator itBarrier = barriers->begin(); itBarrier != barriers->end();) { for (list<Bullet*>::iterator it = ship->Bullets->begin(); it != ship->Bullets->end();) { if (IntersectsWith((*it)->BoundingRect, (*itBarrier)->BoundingRect)) { Iw2DDrawRect(CIwFVec2(bounding.x, bounding.y), CIwFVec2(20, 20)); int normX = (*it)->BoundingRect.x - (*itBarrier)->BoundingRect.x; int y = 35; for (int i = 0; i < 35; i++) { uint8 pixelOffset = normX * 4 + y*pitch; if (pixels[pixelOffset] != 0xff000000) { uint32* ptr = (uint32*)pixels; for (int i = normX - 16; i <= normX + 16; i++) { for (int j = y - 16; j <= y + 16; j++) if (i >= 0 && i < 51 && j > 0 && j < 35) { uint8 pixelOffset = i * 4 + j*pitch; ptr += pixelOffset; *ptr = 0xff000000; } } break; } y--; }  
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!