Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

223 Neutral

About CoMaNdore

  • Rank
  1. CoMaNdore

    combining 2 random numbers.

    Hey Me and a m8 are having a argument over the result of combining 2 random numbers. Say you have a rand() that returns a 16bit uint. Now you will have a and b that are returned from rand() after each other. Can you make a 32 bit random number by bit shifting the first number 16bits, and replace the first 16bits with number b. Or rather what would the quality would the "randomness" 32bit number be?
  2. Hey Me and some folks are currently doing a project thats required to compile under both linux and windows. We are using visual studio for windows and code:blocks for linux. Now the problem we have gotten is the different ways these two IDE's manage precompiled headers. In VS I would have a #include "stdafx.h" even if stdafx.h (the precompiled header) is in another directory. For CB I have to specify the path as: #include "../stdafx.h". Now the question is: does anyone know a option or trickery that will make one of the IDE's confirm to the others wishes? ( So its either just "stdafx.h" or relative path the entire time). cheers Sondre
  3. Hey I'm in the middle of trying out some glsl shaders. Now I got multiple shaders that each work when they are the only one being tested. The problem comes when I try to use more of them in the same frame. Say I want to render mesh-A with shader-A, and mesh-B with shader-B and so on. Right now I just load all the shaders in the start. Keep the program-ID. ( from glCreateProgram() ). And when I want to use it I just do glUseProgram( programId ); Now this don't work when I try multiple shaders, like this: glUseProgram( shader-A ); modelA->Draw(); glUseProgram( shader-B ); modelB->Draw(); glUseProgram( shader-C ); modelC->Draw(); So the question is, what is needed to perform this? Do I need to link each shader before its used everytime?(note: tried it and it dint work for me.. ) Or should I call glUseProgram(0) after each finished model? (note: this dont work either). cheers, Sondre
  4. Hey all. I decided that I needed a hobby programing project again ;) So I started reading up on shaders and was left with a question when it comes to multiple shaders. Say I have 2 materials Ma and Mb, now in my scene I want to have pp-lights as well as using Ma and Mb, (The light shader can be called ML) Do I need to just copy-paste the lightcode so that they both contains the same code + there unique characteristics. (Ma + ML) Or is there someway to link more shaders (and have them running) at the same time, or is it normal to have some kind of code generator that generate these shaders runtime so that they contain the light code as well? cheers
  5. CoMaNdore

    C++ Game, Java server

    You will find out that in practice it also require a bit of work to port any large scale java application. C++ still takes a bit time but if you code with some consideration you will probly be fine in C++ as well.
  6. How will you handle chat with this system? Create a 'chatmsg' object and make sure its synced? The system looks pretty neat as you dont have to handle some packets diffrent. In fact, its pretty tempting to adopt this system :) Are you using one "super class" for all events or some kind of template class that you typedef? like: typedef EventObject<int> IntEvent; class SomeClassThatNeedsEvents: ... protected: IntEvent m_TeamRequest; // in .cpp m_TeamRequest.SetValue( 2 ); // fire a request a change to team '2' to the server // and have a interface like: m_TeeamRequest.Status() // returns a enum, { EVENT_PENDING, EVENT_GRANTED, EVENT_DENIED } Or do you just extend ClientRequests to have a lot of events that you delta compress?
  7. Quote:Original post by oliii So, the code would take more of state-based approach rather than the typical event based interactions (although you can move to locally events and notifications by detecting changes in states). For example, a red player captured a spawn point. Typically, you would send a reliable "Player XXX captured spawn point" notification to all. It gets received, and you play a sound effect and show blip the HUD. So how would you notify the spawn point being captured without reliable messages and just relying on states? Funny that you would mention this, as this is atm the thing im having most problem with. And I just cant quite wrap my head around and find a way to do this that I like. What im aiming for now is kinda a system where I just create a event message and send them ontop of regular packets, and continue to do so until a packet that contained the event get ack'ed. Have you tried the state based approach?
  8. CoMaNdore

    MSGs & streaming data

    (f) How "mysterious routing mechanism" alerts the appropriate app to start reading? This depends on how you have setup your sockets. Normaly (just using plain 'old tcp sockets) they will not notify you in anyway. You will have to use select() to poll the os for data stored for your spesific socket. You can also ofc use read() to get the data but that will cause your application to block until it get som data. (Can be set to noblocking mode tho ). Basicly that means that the os will buffer incoming data for you and you have to make sure that you poll for it. If the buffer get overflowed you will start to loose data, and that is something most people look upon as bad. If your willing to go out of cross platform portability and bind yourself to windows you can always use FD_READ and the like under windows. That will provide you with even based networking. hope that helps some cheers, Sondre
  9. Well, then I will implement it and see how it goes :) And oliii, thanks for the links, read tru most of them beforehand, but the Latency_Compensating_Methods was new, and a good read :) What problems have you (oliii) had with this kind of implementation, any things I need to watch out for?
  10. Hey Im in the process of desiding how to implement network into my game. The game is a fast-phased 3d isometric perspetive coop game. (The view is somewhat like diablo). After some reading I have grown found of the quake3 way of handling netcode. ie. Let everything be unreliable. In my mind I have figured that I will use a test on the server to see what entities that might be visible the next N frames ( around 2-5 I guess ). And send a list of these to the client. The client will be dumb, and just send its input to the server. The server will rollback the movement from the client and make sure its in sequence. The client will be performing a somewhat simple client side prediction, and will act immediately on input for its own avatar, and later rollback the servers position for the avatar. (Only the players avatar get predicted I think. ) To hide the effect of lag somwhat I figured i will always render behind what the client actually got in terms of data. So I can interpolate up to the newest data set, and if no updates arives from the server - extrapolate. Does this layout seems reasonable? What are the problems I might bump into, and are there other options that I should consider? cheers, Sondre
  11. CoMaNdore

    Battle System Solution

    Could you not add another variable into the equation called initative. Each unit will have an unique number ( called initative from now on ). That will represent in what order each unit will "fire". Say you have 100 archers with initative 4 vs 10 dragons with initative 9 Its obvius that the dragons should win, but still the archers get to fire first. (since the lower initiative the earlier they "fire"). They take out 2 dragons. Now the 8 dragons left get to fire, they kill 120 archers. This prosses is repeted until A - you run out of achers, B - you run out of dragson C - somebody flees or a simular action. This is how my "armybased" mud worked back in the days at least :)
  12. CoMaNdore

    boost Python - deep copy

    How does deepcopy intergrate with boost python? Do they work hand in hand? or ...?
  13. Hey During my search on the net, I have yet to find out how to solve this problem. Say I exposed my Vector3 class to python. and run the following pice of code: a = mymodeule.Vector3( 13, 3, 7 ) calc_something( a ) def calc_something( vec ): ... does something to vec here Now what I want is to expose my copy constructor ore somesuch so I can make the assigment operator create deep copies everytime I say vector A = vector B as Im tierd of using my hack'ish code: vector A = vector B + vector( 0,0,0 ) to force this effect. Any idea how to wrap Vector3 so this happen? Or at least point me to something more python-ish way of doing deep copy since a = b + Vector3( 0,0,0 ) seems kinda weird to me.. - cheers
  14. CoMaNdore

    OS dev - startup help

    thanks for all the help guys :) Started reading myself tru all the links you posted. Looks like a nice challenge tbh.
  15. Hey Im currently taking a uni course in OS's. And the lecturer hinted that it was possible (and smart), to try and write your own os, to get a more firm picture on what was going on under the hood. This is ofc for learning purposes only, and is in NO WAY my intention of creating more than a very small almost usable (in shell ofc) os. I am pretty fluent in C/C++ and have done quite a bit of assembly programing. Tho never on a x86 platform. Now the big question. Where do I start? And also what can I expect to get done in say 2-3months of work, will I have time to even get anything on the screen? I would prefer to write as much as pos from scratch. Any advises, links, and so on would be helpful. - cheers and thanks in advance
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!