EvilTesla-RG

Members
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

114 Neutral

About EvilTesla-RG

  • Rank
    Member
  1. Staying connected in case of disaster

    I'd think if the west coast got wiped out, you'd have more to worry about than internet and cell phones...
  2. First off, it is generaly considered bad practice to modify a loop inside of itself. It tends to produce unpredictable results.
  3. I beginning work in my first serious game, and I want to include multiplayer support. I've been working with ZoidCom, which is a great library. So far I can do networking across a LAN very easily. But networking across the internet sounds like it would be alot more involved. So I'm thinking, how well would it work if I just wrote my game to work across a LAN, and multiplayer across internet can be achieved with some VPN such GameRanger, Hamachi, tinc or SameView VLAN? thanks, EvilTesla-RG
  4. What to do next?

    Given your lack of experience, perhaps it would be better if you started with some simpler games and programs and worked your way up.
  5. Open Source games?

    Thanks for the replies! I guess it is still too early to be thinking about making money off my work. And I guess that I need to look over what kind of licencing there is as well.
  6. I've never gotten into scripting. My work simply doesn't need it. Instead I go the Sins of A Solar Empire approach, where all my content is stored in txt files that anyone can edit. My program has a parser that can easily read the text files and load the information. If I want my campain to have an extra level, I just add a new text file to the game that defines the new level. Same for a new race, new ship, new special ability. I really like this approach as it doesn't require my developers to learn a coding languege. They can just look at the text files and know very quickly what needs to be edited. Also I don't have the overhead of running an interpreter. Though it isn't as flexable as a full scripting languege. Personaly, I am not an artist. I am a coder. I write code, not art. Thus I belive that the art and code should be seperate, as they do differnt things. This goes for the content files as well as for audio and visual. Scripting, be it by .txt or by .py allows me to seperate the art and the code. I don't even want to work on the development side, I'd be happy if I just stuck to the game engine. I have developers who can do they artsy stuff. And I DON'T want them bugging me every five minutes to add a silly little new feature (that could be easily added with scripting) when I'm right in the middle of trying to get my OpenGL engine to optimize mipmapping (or some other complex task). Just my two cents.
  7. Open Source games?

    Over the last year and a half I've been learning computer programing: flash, python and C++; and have been trying to get into developing my own games with SDL and OpenGL as a hobby. I have written a few small programs and games, but nothing very big. Now, however, I feel that I'm poised such that I can finaly start seriously working on my first big project. (I'll probably write a post looking for artists eventully once I have something to show.) I've also recently met a friend who is dead set on Open source games. His primary argument is that if someone copies my code, then I still don't lose anything. I'd never even know if I didn't have copyright protection in place. He also has a number of pragmatic reasons as well (big linux user). Now I'm leaning towards making my games open source, but I also want to make a little money off of them. (This is just a hobby, so I don't intend to make alot. Just enough to fuel the creative juices so to speak.) So I am curious, what are everyones thoughts on open source games? Has anyone tried it? How has it worked out? One way I know to profit on open source games is to make the game content closed source and sell that. However I'm working with a group of people that belive in moddability (they are all modders, I am the only real game developer). And Sins of A Solar Empire has shown that moddability is a big factor in game succses. As such, close sourced resources would put a serious krimp on modding, as any modder would have to develop the resources by themselves. Anouther model is to only release the source code after a designated time after release. (Say, one year). Anyone who wants to play the game during that year needs to buy it. This model seems like it would work to me, but I don't know how it would work in the real world. Furthermore, since I'm using SDL and OpenGL, my games SHOULD be able to work on multiple platforms. However, I know that I will not have the resources to develop my game on anything but windows. If I make the game open source (and it is a good game), then someone is bound to port it to linux and mac. Which even if I don't see a penny, it would at least give me happy to know that more people are playing my game. Thanks, EvilTesla
  8. Can't render 2 textures

    I havn't done alot with VBO's (working on fixing that), but shouldn't you be sending the uniforms before drawing your first texture?
  9. I've recently written a simple program that uses OpenGL shaders, which works fine on my computer. (Windows 7, HTI Mobility Radeon HD 5800) However, when I try it out on a differnt computer (Windows 7, Nvidia GeForce 220), the shader gives an error that I am haveing trouble understanding. (apologies, for some reason, "insert code snipet" seems to work for me as well as this shader does, (that is, not at all)) Error: Vertex info ----------- Internal error: assembly compile error for vertex shader at offset 0: -- error message -- line 1, column 1: error: program type not supported on this hardware -- internal assembly text -- !!NVvp4.1 # cgc version 2.1.0000, build date Jul 8 2009 # command line args: #vendor NVIDIA Corporation #version 2.1.0.0 #profile gp4_1vp #program main #semantic gl_ModelViewProjectionMatrixTranspose : state.matrix.mvp #var float4 gl_Position : $vout.POSITION : HPOS : -1 : 1 #var float4 gl_TexCoord[0] : : : -1 : 0 #var float4 gl_TexCoord[1] : : : -1 : 0 #var float4 gl_TexCoord[2] : : : -1 : 0 #var float4 gl_TexCoord[3] : : : -1 : 0 #var float4 gl_TexCoord[4] : : : -1 : 0 #var float4 gl_TexCoord[5] : : : -1 : 0 #var float4 gl_TexCoord[6] : : : -1 : 0 #var float4 gl_TexCoord[7] : : : -1 : 0 #var float4 gl_MultiTexCoord0 : $vin.TEXCOORD0 : ATTR8 : -1 : 0 #var float4x4 gl_ModelViewProjectionMatrixTranspose : state.matrix.mvp : c[0], 4 : -1 : 1 #var float4 gl_Ve Vertex info ----------- Internal error: assembly compile error for vertex shader at offset 0: -- error message -- line 1, column 1: error: program type not supported on this hardware -- internal assembly text -- !!NVvp4.1 # cgc version 2.1.0000, build date Jul 8 2009 # command line args: #vendor NVIDIA Corporation #version 2.1.0.0 #profile gp4_1vp #program main #semantic gl_NormalMatrix : state.matrix.modelview.inverse #semantic gl_ModelViewMatrix : state.matrix.modelview.transpose #semantic gl_LightSource : state.light #semantic gl_ModelViewProjectionMatrixTranspose : state.matrix.mvp #var float4 gl_Position : $vout.POSITION : HPOS : -1 : 1 #var float4 gl_TexCoord[0] : : : -1 : 0 #var float4 gl_TexCoord[1] : : : -1 : 0 #var float4 gl_TexCoord[2] : : : -1 : 0 #var float4 gl_TexCoord[3] : : : -1 : 0 #var float4 gl_TexCoord[4] : : : -1 : 0 #var float4 gl_TexCoord[5] : : : -1 : 0 #var float4 gl_TexCoord[6] : : : -1 : 0 #var float4 gl_TexCoord[7] : : : -1 : 0 #var floa Vertex info ----------- Internal error: assembly compile error for vertex shader at offset 0: -- error message -- line 1, column 1: error: program type not supported on this hardware -- internal assembly text -- !!NVvp4.1 # cgc version 2.1.0000, build date Jul 8 2009 # command line args: #vendor NVIDIA Corporation #version 2.1.0.0 #profile gp4_1vp #program main #semantic gl_ModelViewMatrix : state.matrix.modelview.transpose #semantic height #semantic width #var float4 gl_Position : $vout.POSITION : HPOS : -1 : 1 #var float4 gl_Vertex : $vin.POSITION : ATTR0 : -1 : 1 #var float4x4 gl_ModelViewMatrix : state.matrix.modelview.transpose : c[0], 4 : -1 : 1 #var float4 gl_TexCoord[0] : : : -1 : 0 #var float4 gl_TexCoord[1] : : : -1 : 0 #var float4 gl_TexCoord[2] : : : -1 : 0 #var float4 gl_TexCoord[3] : : : -1 : 0 #var float4 gl_TexCoord[4] : : : -1 : 0 #var float4 gl_TexCoord[5] : : : -1 : 0 #var float4 gl_TexCoord[6] : : : -1 : 0 #var float4 gl_TexCoord[7] : : : -1 : 0 Here is the vertex shader I think it is erroring on. I use a couple shaders, But I am fairly sure this is the one. Also, I know it is not good practice to compute the matrix inside the shader. I need to refractor my code for OpenGL 4.1 anyway: vertex Shader: uniform float height; uniform float width; void main(void) { vec4 rowA=vec4(2.0/width, 0.0, 0.0, 0.0); vec4 rowB=vec4(0.0, -2.0/height,0.0, 0.0); vec4 rowC=vec4(0.0, 0.0, -1.0, 0.0); vec4 rowD=vec4(-1.0, 1.0, 0.0, 1.0); mat4 Ortho= mat4(rowA, rowB, rowC, rowD); gl_Position=Ortho*gl_ModelViewMatrix*gl_Vertex; gl_TexCoord[0]=gl_MultiTexCoord0; }
  10. Fun With Vectors & Matrices

    [quote name='jamesleighe' timestamp='1310137879' post='4832804'] Given two 3d vectors, A & B, how can I construct a matrix that when applied to vector A will rotate it into vector B? [/quote] You just want a rotation? I'd just use trig functions to find the angles about XYZ, then create a rotation matrix with those three angles. (Or do you only need two of those angles?)
  11. [SDL] SDL_SetVideoMode with OpenGL and fullscreen

    Actully, you're probably right. I just re-wrote my previous program to put all the OpenGL stuff in a differnt function, and now it works. Great, now I have to find what isn't reloading in my big program. Will be a pain, as it isn't a small program. Thanks Re-written code: [code] //#include <iostream> #include <SDL/SDL.h> #include <SDL/SDL_image.h> #include <SDL/SDL_opengl.h> #include <gl/gl.h> #include <iostream> #include "OGL_setup.h" using namespace std; #if SDL_BYTEORDER == SDL_BIG_ENDIAN Uint32 rmask = 0xff000000; Uint32 gmask = 0x00ff0000; Uint32 bmask = 0x0000ff00; Uint32 amask = 0x000000ff; #else Uint32 rmask = 0x000000ff; Uint32 gmask = 0x0000ff00; Uint32 bmask = 0x00ff0000; Uint32 amask = 0xff000000; #endif GLuint setOpenGL() { //enable openGL setupExtensions(); glViewport(0, 0, 640, 480); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0f, 640, 480, 0.0f, -1.0f, 1.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); //load white square texture SDL_Surface* surf=SDL_CreateRGBSurface(SDL_SRCALPHA, 15, 18, 32, rmask, gmask, bmask, amask); Uint32 color=SDL_MapRGBA(surf->format,255,255,255,255); SDL_FillRect(surf, NULL, color); GLuint texture; glGenTextures( 1, &texture ); glBindTexture( GL_TEXTURE_2D, texture ); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surf->w, surf->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, surf->pixels); GLuint GLcalllist=glGenLists(1); glNewList(GLcalllist, GL_COMPILE); glBegin( GL_QUADS ); //Bottom-left vertex (corner) glMultiTexCoord2fARB(GL_TEXTURE0, 0, 0); glVertex2f( 0.f, 0.f); //Bottom-right vertex (corner) glMultiTexCoord2fARB(GL_TEXTURE0, 1, 0); glVertex2f( 15, 0.f ); //Top-right vertex (corner) glMultiTexCoord2fARB(GL_TEXTURE0, 1, 1); glVertex2f( 15, 18 ); //Top-left vertex (corner) glMultiTexCoord2fARB(GL_TEXTURE0, 0, 1); glVertex2f( 0.f, 18 ); glEnd(); glEndList(); return GLcalllist; } int main(int argc, char *argv[]) { //enable SDL SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 0 ); SDL_SetVideoMode(640, 480, 0, SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE | SDL_FULLSCREEN); //note that if SDL_FULLSCREEN is removed (both here and in event handeling), then this works //OpenGL GLuint GLcalllist=setOpenGL(); //Down to buisness while(true) { //handel events SDL_Event event; while(SDL_PollEvent(&event)) { switch(event.type) { case SDL_KEYDOWN: if(event.key.keysym.sym==SDLK_ESCAPE) return(0); else if(event.key.keysym.sym==SDLK_a) //resize screen SDL_SetVideoMode(760, 480, 0, SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE | SDL_FULLSCREEN); GLcalllist=setOpenGL(); cout<<"reset"<<endl; break; case SDL_QUIT: return(0); break; } } //render square at mouse position int pos[2]={0,0}; SDL_GetMouseState(&pos[0], &pos[1]); glLoadIdentity(); glTranslatef(pos[0], pos[1], 0); glCallList(GLcalllist); SDL_GL_SwapBuffers(); } return(0); } [/code]
  12. [SDL] SDL_SetVideoMode with OpenGL and fullscreen

    I don't think that's the problem. As my larger program does completely reload OpenGL and all the textures, and it has the same problems. Furthermore, it works if I run it in windowed mode. It only doesn't work if it is in fullscreen.
  13. [SDL] SDL_SetVideoMode with OpenGL and fullscreen

    I was wrong, the short program I wrote isn't working, and I can't figure out why. I have attached a code::blocks project with all the code [attachment=3968:MS test.zip] It simply a program that uses SDL and OpenGL, and creates a white block that follows the mouse. If you press the 'a' key, then the program will call SDL_SetVideoMode with a differnt resolution. You will notice that the white box no longer follows the mouse. It does the same thing no matter what the resolution is (same or differnt for each SDL_SetVideoMode call). But if fullscreen is removed, than the program works. Here is the main file [code] //#include <iostream> #include <SDL/SDL.h> #include <SDL/SDL_image.h> #include <SDL/SDL_opengl.h> #include <gl/gl.h> #include "OGL_setup.h" using namespace std; #if SDL_BYTEORDER == SDL_BIG_ENDIAN Uint32 rmask = 0xff000000; Uint32 gmask = 0x00ff0000; Uint32 bmask = 0x0000ff00; Uint32 amask = 0x000000ff; #else Uint32 rmask = 0x000000ff; Uint32 gmask = 0x0000ff00; Uint32 bmask = 0x00ff0000; Uint32 amask = 0xff000000; #endif int main(int argc, char *argv[]) { //enable SDL SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 0 ); SDL_SetVideoMode(640, 480, 0, SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE | SDL_FULLSCREEN); //note that if SDL_FULLSCREEN is removed (both here and in event handeling), then this works //enable openGL setupExtensions(); glViewport(0, 0, 640, 480); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0f, 640, 480, 0.0f, -1.0f, 1.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); //load white square texture SDL_Surface* surf=SDL_CreateRGBSurface(SDL_SRCALPHA, 15, 18, 32, rmask, gmask, bmask, amask); Uint32 color=SDL_MapRGBA(surf->format,255,255,255,255); SDL_FillRect(surf, NULL, color); GLuint texture; glGenTextures( 1, &texture ); glBindTexture( GL_TEXTURE_2D, texture ); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surf->w, surf->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, surf->pixels); GLuint GLcalllist=glGenLists(1); glNewList(GLcalllist, GL_COMPILE); glBegin( GL_QUADS ); //Bottom-left vertex (corner) glMultiTexCoord2fARB(GL_TEXTURE0, 0, 0); glVertex2f( 0.f, 0.f); //Bottom-right vertex (corner) glMultiTexCoord2fARB(GL_TEXTURE0, 1, 0); glVertex2f( 15, 0.f ); //Top-right vertex (corner) glMultiTexCoord2fARB(GL_TEXTURE0, 1, 1); glVertex2f( 15, 18 ); //Top-left vertex (corner) glMultiTexCoord2fARB(GL_TEXTURE0, 0, 1); glVertex2f( 0.f, 18 ); glEnd(); glEndList(); //Down to buisness while(true) { //handel events SDL_Event event; while(SDL_PollEvent(&event)) { switch(event.type) { case SDL_KEYDOWN: if(event.key.keysym.sym==SDLK_ESCAPE) return(0); else if(event.key.keysym.sym==SDLK_a) //resize screen SDL_SetVideoMode(760, 480, 0, SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE | SDL_FULLSCREEN); break; case SDL_QUIT: return(0); break; } } //render square at mouse position int pos[2]={0,0}; SDL_GetMouseState(&pos[0], &pos[1]); glLoadIdentity(); glTranslatef(pos[0], pos[1], 0); glCallList(GLcalllist); SDL_GL_SwapBuffers(); } return(0); } [/code] Thanks [attachment=3968:MS test.zip]
  14. [SDL] SDL_SetVideoMode with OpenGL and fullscreen

    alright, I wrote a simple program that calls SDL_SetVideoMode twice, and it works just fine. Guess I'll just make a copy of my current project and start deconstructing it untill I can find the issue. Thanks for helping