Jump to content
  • Advertisement

Gl2eenDl2agon

Member
  • Content Count

    125
  • Joined

  • Last visited

Community Reputation

496 Neutral

About Gl2eenDl2agon

  • Rank
    Member
  1. Gl2eenDl2agon

    when to use concurrency in video games

        That's now how it works. All memory is available to all threads in a process. This means that any code you write can read and write to any part of memory at the same time. The volatile keyword is really just a hint that may cause what you write into that memory location to be flushed to ram from the CPU cache (heavy emphasis on may, volatile is poorly supported).   To share memory between two threads you need to protect it with a mutex (mutual exclusion). A mutex is basically a varable that you use library functions on to lock it and unlock it. You have to be sure to lock it before you mess with your other variable. This means when your second thread tries to lock it to also mess with that variable it will block until the first thread unlocks that mutex. This is a big bottleneck so make sure you share the bare minimum amount of memory to accomplish the task and don't share very often. This is usually accomplished by having separate working copies of data and syncing them when other tasks are done as well as other ways.   One programming pattern that I like to use enforces the locking and unlocking of the mutex. You create the main object and make everything protected. Then you have a "lock" method that creates a locked version of that object (another object that contains a reference to the first object and has all of the same methods made public and they simply wrap the methods of the first object). When the locked version is deleted it calls the method on the first object that unlocks the mutex.
  2. Would it be feasible to implement a rudimentary weather sim in game and have it interactive?   By interactive I mean that the wind  and rain affects gameplay. You can fly up and through the clouds. You can be randomly struck by lightning. Or maybe in a sandbox type or RTS game, player actions such as industry or heavy resource harvesting could affect weather.   Sounds like a good idea or perhaps just a gimmick?
  3. Gl2eenDl2agon

    Multiple server architecture

    I would favor having the client connect to the chat server and the game server rather than have the game server redirect to the chat server. You want to cut down on the total number of sockets that will be open on the servers at all times (use only bare minimum # of open connections to achieve desired result). You can even have game servers, and then have zone servers that belong to the game server but handle things like hit detection, combat, etc at the local level where the game server just keeps up with what zone you are in and your inventory, etc. The client could simply just open a connection to all necessary servers. The login server would tell the client which game server to connect to. The game server would tell the client which zone server to connect to based upon stored player position data.
  4.   I would probably refrain from passing text. Its a novice mistake to see the function declaration for send() and see char *buffer and assume that you must pass in a string.   You could just pass opcodes and have a switch statement which will execute faster.  Your network message would be like unsigned short opcode (uint16_t) (there could be an opcode for moving, or other actions etc) signed int x, y, z (or float) relative movement   You allocate a buffer, copy the bytes into it. Then send() will take the pointer to the buffer and its size. When you recv you check the opcode. If its the move position opcode, then you read the rest of the buffer as you wrote to it.
  5.   However, where do we draw the line? For example, I find the quoted statement both racist and sexist. Its like you are suggesting that white men are worth less than other demographics to the industry. I strongly disagree that the white male demographic should be discriminated against to meet some quota. A person should be treated equally regardless of race or gender.     You remind me of the challenges I had growing up as a extremely poor white male. For example, there was this one time during my undergraduate where an error caused by government red tape withheld my GI bill funds. I couldn't get a scholarship when I graduated high school so I had to wait until I was 24 basically. I had joined the army to earn my GI bill. I went to the financial aid office and asked for assistance. The lady there was a black woman. She refused to help me. She at one point became so angry that she threw here pen at the wall and yelled "A little white boy like you doesn't need financial aid! Why don't you have your parents pay for it!" (yes, she actually said that) By then I have been back and forth with the veterans office and the financial aid office probably 6 times. I left the room reduced to tears. My parents are so poor that they couldn't even afford to drive to my graduation. When I graduated (a few times), there was nobody there to take pictures with. Yet at the same time students with affirmative action scholarships had parents show up in brand new Mercedes. There were even times when I had to send what money I had back to my parents so they could not have their electricity shut off. I have been fighting an uphill battle against racial and sexual discrimination my entire adult life. Am I less of a human being because I have a penis? ..because my skin is white? Are my skills and abilities not important to you?       I strongly disagree with censorship, especially when its being used to uphold the political ideology of the staff. Moderation only works when its neutral. When you use moderation as a form of political censorship, that's when you have become unprofessional. In order to ban threads that disagree with affirmative action, you would also have to ban thread that describe gender inequality and a need for affirmative action.      
  6.   This is kind of annoying. I pretty much do everything here in one swift batch with multiple tabs and then I might not be back for hours. This site is one of the places I go during my quick breaks between productivity outbursts.
  7. Gl2eenDl2agon

    How to start on game programming properly

    Can you make pong?   If yes, then move onto 2D platformers.   If you use java, you can use something like java3d or jogl.   You won't make anything that closely resembles a fully featured game for some time. Don't sweat it.
  8. Gl2eenDl2agon

    Misuse of downvotes

      Downvotes are supposed to be a way to keep spam in check. This doesn't work when people use downvotes as a form of censorship. (this is why reddit is a joke, its a site full of areas of people who are all in 100% agreement with each other so no productive debate of any kind can be had because you'll be downvoted until your account is hidden if you aren't in 100% agreement with everyone in that subreddit)   I downvote anyone who downvotes me, as well as anyone who downvotes newbs. I upvote almost anyone who replies to a topic I start as long as its not completely wrong.
  9. Gl2eenDl2agon

    Skeletal animation is hella slow

      You can't really slerp matricies. I said that I calculated the matricies recursively (so that parents move children). The matricies are computed by the rotation quaternions and translations. Typically most game ready 3d meshes don't have tons of joints/bones so you are really only redoing maybe up to 20x2 matricies once per frame per mesh. When I compute the rotation and translation I do it only at intervals and not every frame. I compute start and end rotation+translations for every joint/bone and then use the current time to interop between them. For me it seemed that traversing the running animations, handling masking and blending etc was a bit much to do every frame. Heck, I even put that in another thread to itself.
  10.   I still have to argue with people who think that bitmaps can't have transparency.   There are alot of features of bitmaps that nobody supports though. For example Microsoft allows for PNG and JPEG compression, but most of their software doesn't support it in a file (its used for GDI only). Its kind of funny how those two modes work, they have basically an entire complete PNG or JPEG file where the pixel data should be. (you can read in a JPEG file, stick it inside of a bitmap container in memory, and send it to GDI and it will render it)
  11. Gl2eenDl2agon

    Skeletal animation is hella slow

    I would prefer this:   At constant intervals iterate through all animations and do the required logic to determine which keyframes you are on etc. Then iterate through each bone and iterate through the small list of only currently playing animations and accumulate the transforms for that bone (if any) and store it with the bone. Then go through all bones and recursively caculate the parents' matrix and then that bone's matrix using some flag to prevent redudant calculation. Upload the results per bone to your shader.   I suppose you could find a way to even do that in a shader, but I tend to just use C++ to get-er done.
  12. First:   Bitmaps are stored BGR and not RGB.   Second:   Bitmaps are 4 byte aligned. This means that each horizontal line comes out to a multiple of 4 bytes. Typically this is called "scanline size". This means that ( y * w + x ) *3 doesn't work. You will have to find the scanline size by finding the smallest multiple of 4 larger than the width in bytes. Like for( int scansize = 0; scansize < w_bytes; scansize += 4); will work (but not the best way). You will need to allocate a buffer of (height * scanline_size) bytes and find the offset for each pixel by ( y * scaline_size + x * bytes_per_pixel). In other words a generic 2d array wont work unless you can be sure that the scanline size is the same as (width * bytes per pixel).     Oh.... also bitmaps are stored upside down. This means that the first pixel in the file is actually the first pixel on the last scanline.
  13. I'm not sure where this concept of Unity being easier than Unreal came from... They are very similar. Both are going to be really hard for someone who almost knows just one programming language. Unreal even has a visual script builder called "blueprint" so that you can make an entire game without writing any code.
  14.   The files I import from typically store the keyframes inside of the joints where not every joint is present in every keyframe and its assumed you interop for the missing keyframes (each keyframe stores absolute translation and rotation and not deltas). I convert that into my format that requires that every keyframe has every joint that moves (missing joints are assumed to be at original position) to make it easier to copy and paste frames or to play in reverse.   Anyways, as long as the rendering framerate is less than the animation framerate everything works normally. If you turn up the speed on the animation, then things start to look bad as keyframes are skipped over when using the traditional interop between frame before current time and frame after (or use the frame that is equal to current time). This is because there are alot of intermediate keyframes that were created by the artist and the keyframe that stores the largest motion that most accuratly represents the essence of that animation tends to be skipped over.     True, but if you need to playback the animation at increased speed then just increasing the rendering framerate won't be viable. (like adjusting the speed of the running animation to reflect a run speed increase spell etc) There may also be times when the model is far away from the camera and I want to turn down the refresh rate for animations on those model instances (basically skipping frames) without the animations looking too bad.       Apparently mine does I just though it might work and tried it. So far it looks OK. Its mostly for when I turn up the animation playback speed and not for low FPS, but it also works in those situations.   I mostly buy 3D assets since I'm not much of an artist myself. The 3DRT dragon had an insane amount of keyframes (like 70MB of them) so I modified my importer to use a process similar to what I'm doing above to "condense" keyframes to like only 30fps. That particular model would sometimes crash blender when I imported the Ms3d variant.
  15. Gl2eenDl2agon

    Should I use OpenGL or Directx

      I disagree. Learning to write shaders (the right way) for me was harder than everything else about 3D combined. Upconverting from GL 1.x to 2.0+ isn't very hard either. I typically protoype in GL1.x to get more work done since I don't have to concern myself with the actual work of rendering. Then I tend to adapt some older GL3.0 code and throw it in there later on.         First part isn't that hard and for most people they just keep copy-pasting the same code they wrote 5 years ago... or just use SDL.   Typically only the features added after a major version are extensions. If you want to use pretty much every feature of a DX10 graphics card you would use GL3.0 for example. You really don't need the extensions if you aim for the major GL version that has those features baked in. If your name is Carmack, then you use extensions because he is like the Chuck Norris of the 3D world.
  • 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!