• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

roby65

Members
  • Content count

    134
  • Joined

  • Last visited

Community Reputation

154 Neutral

About roby65

  • Rank
    Member
  1. This would be my 2nd idea, but it's not reliable too: this game has a lot of versions and the user could be using one of these, so i should find the offset for every game version, and if the game gets a new update, this would break the state detection until i find the new offset. Also the uk, eu and usa version has different offsets too, so for every version i should do the offset find 3 times.   Roby
  2. Hi,   i'm working on a Smart Directx Hook that should render its things only when game is not in main menu / paused game / with console open, and i'm looking for some way to detect this knowing what directx functions are called. My first idea was to get a crc from every loaded texture, and knowing what textures are drawed i could know what was the game state. Only problem is that this method is not reliable: the game i hook ( Fallout : New Vegas / Fallout 3 ) it's a very modded game, and also the loading screens can be changed, and i want to be able to support mods without breaking the game state detection. Are there other ways to accomplish this? Google didn't help me   Roby
  3. [quote name='Lightness1024' timestamp='1346246357' post='4974414'] yes, why not with a little upscaling according to linear Z. otherwise the position of the point in 2D is: (you can use glm library) vec4 proj = mul(vec4(vec3(worldPosition), 1), viewProjectionMatrix); proj *= (1. / 2 * proj.w); proj += vec4(0.5, 0.5, 0, 0); vec2 screenPos = vec2(proj) * resolution; // resolution is a vec2. [/quote] I liked your code, but it's not working, maybe i made something wrong? [CODE] D3DXVECTOR3 worldPosition(100,100,500); D3DMATRIX viewProjectionMatrix=lastProjection; D3DXVECTOR4 proj; D3DXVec4Transform(&proj,&D3DXVECTOR4(worldPosition,1),&(D3DXMATRIX(viewProjectionMatrix))); proj *= (1. / 2 * proj.w); proj += D3DXVECTOR4(0.5, 0.5, 0, 0); D3DXVECTOR2 screenPos = D3DXVECTOR2(proj.x,proj.y) * 1680 * 1050; [/CODE]
  4. Hi Guys, i have a multiplayer game where i need to draw player names above their heads. I have Camera position/rotation and player position, and i need to calculate where to draw the 2d player name on the string. Can someone suggest me what's the best way to do it? Roby
  5. Hi guys, i managed to hook directx in a game and now i wanted to draw a text in 3d space. My code: Init: [CODE] hdc=CreateCompatibleDC(NULL); font=CreateFont(1000,0,0,0,FW_NORMAL,false,false,false,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP _DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_DONTCARE,"Arial"); SelectObject(hdc, font); D3DXCreateText(this->m_pIDirect3DDevice9,hdc,"Hello World",0.001f,0.4f,&mesh,NULL,NULL); [/CODE] Beforce EndScene: [CODE] m_pIDirect3DDevice9->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); D3DXMATRIX world_matrix; //Pre-initialized D3DXMatrixIdentity(&world_matrix); D3DXMatrixTranslation(&world_matrix,-67762,3567,8384); m_pIDirect3DDevice9->SetTransform(D3DTS_WORLD,&world_matrix); mesh->DrawSubset(0); [/CODE] My problems: The rendering appears like this: [url="http://img853.imageshack.us/img853/2884/screenshot0rh.jpg"]http://img853.images...reenshot0rh.jpg[/url] As you can see, the text is nor in 3d, nor transformed and also it seems like a "mask" of the scene. What can be the problem? Why 3d is not working,, nad the 3d text has this effect? Roby
  6. Hi, i'm developing a 2d top down shooter and i implemented collisions using rects, and everytime something moves i test collisions with all the other rects. The problem raised now that i have to add bullets to my game, my first approach was to get the points of the line of the bullet and test collision with every rect for every point of the line, but this is the worst implementation that i ever used. What's the best approach for the bullet physic? Roby
  7. Thanks for the replies! I tried to think how not to link together animation and texture manager but they are indeed linked and i cannot do in other ways. Using the first method i changed my code, but now i'm blocked again, and i can't understand how to fix this error: [QUOTE] uint cAnimationManager::CreateAnimation( std::vector< uint > Frames, Uint32 Delay) { int newid=0; cAnimation anim(m_TextureManager); for(int i=0;i<Frames.size();i++) { anim.SetTexture(Frames[i],i); anim.SetDelay(Delay,i); } newid=m_Animations.size(); m_Animations.insert(std::pair<uint, cAnimation>(newid,anim)); return newid; } [/QUOTE] I get a "no appropriate default constructor avaible" error, how to fix that? EDIT: Maybe i should switch to pointers, right?
  8. Hi guys, i'm making my own 2d engine using sdl & opengl, but i need some "suggestions"... I have everything declared using classes, but some classes needs other classes, for example cAnimation needs cTextureManager, how to accomplish this? In practice, i need to have some classess accessible from others, but i can't understand how to make this. I tried doing something like this: [QUOTE] class cTextureManager { [.....] } g_TextureManager; [/QUOTE] but naturally it gives error "class cTextureManager g_TextureManager" (?g_TextureManager@@3VcTextureManager@@A) already defined in CTextureManager.obj" Can somebody explain me how to do that? Roby
  9. Quote:Original post by AndyEsser You never clear the depth buffer either, change to this: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); Does the screen actually clear to red as you have it now? Yes. Anyway i found the problem. In case someone has the same problem, is the surface loading on a texture that doesn't work well with alpha. New code: GLuint Common_CreateTextureFromSurface(SDL_Surface *surface) { GLenum texture_format; GLuint texture; int nOfColors; nOfColors = surface->format->BytesPerPixel; if (nOfColors == 4) // contains an alpha channel { if (surface->format->Rmask == 0x000000ff) texture_format = GL_RGBA; else texture_format = GL_BGRA; } else if (nOfColors == 3) // no alpha channel { if (surface->format->Rmask == 0x000000ff) texture_format = GL_RGB; else texture_format = GL_BGR; } else { printf("warning: the image is not truecolor.. this will probably break\n"); MessageBox(0,"warning: the image is not truecolor","Common_CreateTextureFromSurface",0); // this error should not go unhandled } glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); SDL_PixelFormat *format = surface->format; if (format->Amask) { gluBuild2DMipmaps(GL_TEXTURE_2D, 4, surface->w, surface->h, texture_format, GL_UNSIGNED_BYTE, surface->pixels); } else { gluBuild2DMipmaps(GL_TEXTURE_2D, 3, surface->w, surface->h, texture_format, GL_UNSIGNED_BYTE, surface->pixels); } return texture; }
  10. Quote:Original post by AndyEsser Try changing your glClearColor() function to this: *** Source Snippet Removed *** Nope, doesn't work. Actual code: void CEngine::InitGL(int w,int h) { glEnable( GL_TEXTURE_2D ); glClearColor( 1.0f, 0.0f, 0.0f, 1.0f ); glViewport( 0, 0, 640, 480 ); glClear( GL_COLOR_BUFFER_BIT ); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); glOrtho(0.0f, w, h, 0.0f, -1.0f, 1.0f); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glEnable (GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } void Common_DrawTextureOffset(GLuint texture,int w,int h,float x,float y,float x2,float y2) { glBindTexture( GL_TEXTURE_2D, texture ); glColor4f(1.0f,1.0f,1.0f,1.0f); glBegin( GL_QUADS ); //Bottom-left vertex (corner) glTexCoord2f( x, y ); glVertex3f( 0.f, 0, 0.0f ); //Bottom-right vertex (corner) glTexCoord2f( x2, y ); glVertex3f( w, 0.f, 0.f ); //Top-right vertex (corner) glTexCoord2f( x2, y2 ); glVertex3f( w, h, 0.f ); //Top-left vertex (corner) glTexCoord2f( x, y2 ); glVertex3f( 0.f, h, 0.f ); glEnd(); } void CEngine::BlitToScreen() { SDL_GL_SwapBuffers(); glClear( GL_COLOR_BUFFER_BIT ); }
  11. Hi guys, i'm working on a game engine using sdl+opengl but i have a problem with alpha: when i enable the blend, what i see is only a black screen (everything is like having 0% alpha). This is the code....if someone can help me, i'm blocked on this problem from 3 days! Init: void CEngine::InitGL(int w,int h) { glEnable( GL_TEXTURE_2D ); glClearColor( 0.0f, 0.0f, 0.0f, 0.0f ); glViewport( 0, 0, 640, 480 ); glClear( GL_COLOR_BUFFER_BIT ); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); glOrtho(0.0f, w, h, 0.0f, -1.0f, 1.0f); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glEnable (GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } Draw: void Common_DrawTextureOffset(GLuint texture,int w,int h,float x,float y,float x2,float y2) { glBindTexture( GL_TEXTURE_2D, texture ); glColor4f(1.0f,1.0f,1.0f,1.0f); glBegin( GL_QUADS ); //Bottom-left vertex (corner) glTexCoord2f( x, y ); glVertex3f( 0.f, 0, 0.0f ); //Bottom-right vertex (corner) glTexCoord2f( x2, y ); glVertex3f( w, 0.f, 0.f ); //Top-right vertex (corner) glTexCoord2f( x2, y2 ); glVertex3f( w, h, 0.f ); //Top-left vertex (corner) glTexCoord2f( x, y2 ); glVertex3f( 0.f, h, 0.f ); glEnd(); } Roby
  12. Hi guys, i have a mod for a game that i made some years ago, now i took it in my hands again because some guys are using it but it has problems with windows vista/7. For this mod i use a proxy dll for hooking directx and in this dll i patch the IAT to hook some game functions and some dll functions. But here comes the problem: The proxy dll works perfectly, but the IAT hook it's like not working, when i try to use a hooked function it says something about an illegal memory reference....but on xp everything works fine, only on vista/seven there are some problems..... Maybe someone had the same problem and can help me? This is the code for PatchIAT: [SOURCE] DWORD WINAPI patchIAT(HMODULE hMod, PROC origFunc, PROC newFunc,char* dll) { DWORD temp=0; PIMAGE_DOS_HEADER pDosH; PIMAGE_NT_HEADERS pNTH; PIMAGE_IMPORT_DESCRIPTOR pImportDesc; PIMAGE_EXPORT_DIRECTORY pExportDir; PIMAGE_THUNK_DATA pThunk; PIMAGE_IMPORT_BY_NAME pImportName; if(!newFunc || !hMod) return 0; // Verify that the newFunc is valid if (IsBadCodePtr(newFunc)) return 0; // Get DOS Header pDosH = (PIMAGE_DOS_HEADER) hMod; // Verify that the PE is valid by checking e_magic's value and DOS Header size if(IsBadReadPtr(pDosH, sizeof(IMAGE_DOS_HEADER))) return 0; if(pDosH-&gt;e_magic != IMAGE_DOS_SIGNATURE) return 0; // Find the NT Header by using the offset of e_lfanew value from hMod pNTH = (PIMAGE_NT_HEADERS) ((DWORD) pDosH + (DWORD) pDosH-&gt;e_lfanew); // Verify that the NT Header is correct if(IsBadReadPtr(pNTH, sizeof(IMAGE_NT_HEADERS))) return 0; if(pNTH-&gt;Signature != IMAGE_NT_SIGNATURE) return 0; // iat patching pImportDesc = (PIMAGE_IMPORT_DESCRIPTOR) ((DWORD) pDosH + (DWORD) (pNTH-&gt;OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress)); if(pImportDesc == (PIMAGE_IMPORT_DESCRIPTOR) pNTH) return 0; while(pImportDesc-&gt;Name) { // pImportDesc-&gt;Name gives the name of the module, so we can find "user32.dll" char *name = (char *) ((DWORD) pDosH + (DWORD) (pImportDesc-&gt;Name)); // stricmp returns 0 if strings are equal, case insensitive if(_stricmp(name, dll) == 0) { pThunk = (PIMAGE_THUNK_DATA)((DWORD) pDosH + (DWORD) pImportDesc-&gt;FirstThunk); while(pThunk-&gt;u1.Function) { // get the pointer of the imported function and see if it matches up with the original if((DWORD) pThunk-&gt;u1.Function == (DWORD) origFunc) { MEMORY_BASIC_INFORMATION mbi; DWORD oldProt; VirtualQuery(&pThunk-&gt;u1.Function, &mbi, sizeof(MEMORY_BASIC_INFORMATION)); VirtualProtect(mbi.BaseAddress, mbi.RegionSize, PAGE_READWRITE, &oldProt); temp=(DWORD)pThunk-&gt;u1.Function; pThunk-&gt;u1.Function = (DWORD) newFunc; VirtualProtect(mbi.BaseAddress, mbi.RegionSize, oldProt, &oldProt); break; } else { ++pThunk; } } } ++pImportDesc; } return temp; } [/SOURCE]
  13. Quote:Original post by hplus0603 A "network engine" is something that lets you find and talk to other players over the network. It may contain things such as matchmaking, scoreboards, packet marshaling, asset patching/updating/streaming and lag compensation. A "data driven game world" is something different -- it's a method of designing a game world such that what happens in the world varies based on what the resources/data files/scripts tells it to. These concepts are almost orthogonal. You can write a data-driven single-player game, and you can write a good network engine, but use it on a non-data-driven multiplayer game. ok...but can you explain me why i shouldn't use a data-driven login in a multiplayer game?
  14. Hi guys, i'm posting here not because i need help, but because i just want to know if the network engine i'm coding is good/bad and why... This is the scenario: A 2d horizontal shooting game, where you can shot in every direction (mouse aiming) and you can play with friends (max 3, so the total players are 4), and there are a LOT of enemies coming from everywhere. The networking engine i wrote until now usually are most clientside, the server only synced the position with the other players. The networking engine i'm gonna write these days it's a lot different: it will have control on objects creation (like CObject, CCollision, CPlayer) and will have the "ability" to give a particular player control on what objects it wants (for example, it can give the control of a CObject to player1 so he can move it and it will be synced to other players). Also, this increases the possibility of modding maps etc. only changing something in the server without touching the client. What's your opinion about all this?
  15. Hi guys, i'm making a game "metal slug-style" using SDL as graphic engine and Box2D as physic engine, and i'm arrived at the creation of a class for the animations. My question is: what is the best way to animate a player? My idea was to give the arms to the physic engine (attaching them to the weapon and the player body) but what for the legs? Should i animate them in some way with the physic engine or is better to animate them in another way? Roby