• Content count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About jimmynelson

  • Rank
  1. Normals problem

    This something you can set in DirectX whether is uses CCW or CW. I think CCW is the common one. So if you set of points use both, you need to fix that. Also once you have then all corrected the normal (or simple triangle normal) can be calculated using just 2 of the vectors the make up the triangles edges normal = (v1 - v2) cross (v2 - v3); I believe that will do it for CCW, you can see how this would be reversed for CW, but rather than thinking if I'm rock there do it the other way, in which you (v2 - v3) corss (v1 - v2). Crossing creates a vector perpendicular to the plain the triangle creates. Also if you want you set Directx to not backface cull. Which is what you are looking for. If you set to no lighting or full ambient lighting and set to no backface culling both sides of the triangle will be rendered.
  2. Networking Question

    There is a few simple things to know about threads and networking. Threads are switched between based on priority, so if one never sleeps and it has same priority as the other, the OS thinks it is just as important and will give it the same ammount of time. Also setting priority can change this however, I prefer to give them both high priority but setup intelligent sleeping for a thread that is not doing anything (maybe in between reading messages give it a sleep(10) or sleep(1) to inform the OS, "Hey, I'm not so busy anymore."). As for networking I don't know what language that is you are using as I haven't seen "DataInputStream.readInt", I assume it is Visual Basic or Java (which will always give you less than optimal framerates due to their managed environments). But I imagine they still can use something calls blocking calls (they will halt the thread until they can read and int). Usually you check to see if they is any data to be read and then read it, cause winsock has the ability to read at anytime and it will simply wait until something can be read and lock in the function until it does. Either way read up on the functions to see if they are blocking or not, sleep some in the networking thread, and soon enough you are on your way to decent networking. However, this is a little more painful to know. If you are wanting a real time game it gets alot more complex. First you will want UDP, and some sort of message priority and lossful and lossless message sending. Second, you want an intelligent priority message queing system. Thirdly, well there is more than three things and they continue. I recommend looking at a networking API called Raknet. It is middleware built up on winsock and can be found through google very easily. Good stuff.
  3. I currently am busy with other things although I likely will extend it to a small mutiplayer client/server example to give others a bit of networking knowledge. If someone however wants to make a little game with it I can help with most things.
  4. Your best bet to start game programming isn't to just dive in but start with a book on C++. "C++ for Dummies" is actually a pretty decent book from what I've heard. Also I usually don't recommend starting with a lesser managed language (java, c#, etc.), but if you just wanna make a quick little game it may be best to look at those first. At 14 it is hard to graps most of the computer languages, and more importantly being efficient at them is even more difficult.
  5. 2d SDL DevC++ Engine and Sample Code

    Cool no problem, I would use a standard port buy my ISP blocks normal http ports to prevent webservers. Also if anyone downloads it and finds it useful please post and I will leave it up for a bit, else I will take it down in the next couple days.
  6. Engine resources management

    Haha the singleton class is funny, mostly since it both adds junk to a class which could both be instances and allow singleton access via a function. //////////////// // header //////////////// class TextureManager { //no singleton junk, allow this to be used in instances as well }; TextureManager &MAIN_TEXT_MANAGER(); //////////////// // source //////////////// TextureManager &MAIN_TEXT_MANAGER() { static TextureManager sO; return sO; }; Thereby using MAIN_TEXT_MANAGER() will return you a singleton of that class using a function without crapping up a class.
  7. 2d SDL DevC++ Engine and Sample Code

    I am pretty sure the link does work I just VNC'ed outside my network and downloaded it. Anyone else have this problem? Also the other post was on the Alternative Game Libraries which likely far more people deal with SDL on that. I wasn't aware there was double post police. Also the link may not work since it is passing through port 9066 so for whatever reason your ISP or school may block that port. another way would be using this link which specifies the port http://daveyboy.no-ip.org:9066/SimpleEngineFull.zip
  8. I posted this on the game programming forum but may be more useful to someone reading this forum. http://www.gamedev.net/community/forums/topic.asp?topic_id=285550 It talks about and has a link to a little 2d game engine using all free compilers and libs.
  9. I've worked on a little 2d engine awhile back using some big games framework and structure and probably will never finish this little engine. I decided to setup the project using everything free (compiler, SDL, and whatever libs along the way). The sample is very generic but it shows how to load textures based on a file, keyboard input, an actor/scene system, a quick z sorting hash table setup, basic collisions, great timer, config file, logfile, basic time based animations loaded from a file, and a font lib from Diego Billi. Either way I may continue to work on it now and then, but for now I will just release the source. It include all the binaries and source, however you need the SDL SDK and DevC++ of course to rebuild it. SDL I used was version 1.2.7 DevC++ was . Also I had problems with the newest DevC++ beta that was improperly compiling the source. http://dmoney.no-ip.org/SimpleEngineFull.zip EDIT: I forgot to mention if you run the little test the arrow keys move the joust bird and the space bar fires his little spear gun...
  10. macros to the rescue to cover all your bases for conversion #define NUMTOSTRING(x,y) std::string NumToString(x valueIn) { char NumberOut[32]; sprintf(NumberOut, "%" #y, valueIn); return NumberOut; }; NUMTOSTRING(unsigned __int32, lu); NUMTOSTRING(unsigned __int16, u); NUMTOSTRING(unsigned __int8, hu); NUMTOSTRING(__int32, ld); NUMTOSTRING(__int16, d); NUMTOSTRING(__int8, hd); NUMTOSTRING(float, f); //and so on //in main unsigned __int32 test1 = 54; unsigned __int16 test2 = 435; unsigned __int8 test3 = 32; __int32 test4 = -34444; __int16 test5 = -334; __int8 test6 = -13; float test7=110.324f; printf("%s \n", NumToString(test1).c_str()); printf("%s \n", NumToString(test2).c_str()); printf("%s \n", NumToString(test3).c_str()); printf("%s \n", NumToString(test4).c_str()); printf("%s \n", NumToString(test5).c_str()); printf("%s \n", NumToString(test6).c_str()); printf("%s \n", NumToString(test7).c_str());
  11. game programming courses

    As for game programming advice in school I see that most US state universities have relatively similiar computer science degrees. They cover some assembler, data structures, a form of digital logic, a programming language (you are gonna wanna pick C/C++ for this), linear algebra, discrete mathematics, calc., physics I/II, and a few others. Despite none of these being related to games they all end up playing a large role. I have never been a fan on a school specifically for making computer games. They being a technical type school you lose out on a broader ammount of information. Also if you can ace all the courses I described above 90% of all game programming problems are a joke. However, the only problem I see is most schools have some half ass programming courses which are beyond useless. So other than a lack of programming you will have most of the tools at a decent state university. Also! while you go to school program and program so more, even if you games are like pong and suck ass contiously program them until you have such a deep understanding of c/c++ (or whatever language you want) and you, yourself could be a reference manual.
  12. Game Engine Advice?

    Use tokamak it is fast and efficient, that guy either hasn't used it or used it incorrectly. How long do you plan to build this engine? I see how you already have planned out what API's you are using, which definitely makes it easier than an API independent engine. But it still requires some structure designing for how each component will work together and the overall integration into the engine. When alot of people work on it sometimes it is better just to "wrap" these objects. For instance, someone could be implementing directsound, while someone is integrating into the engine. Using a set of polymorphic classes and some callbacks you can do this fairly easy. If you need an example I have a little site on tutorials in which it is setup to render opengl or DX without the engine even knowing which one is used (it just clears a buffer and render black, but it is structures themselves which are useful). http://dmoney.no-ip.org/tutorials.php
  13. I am currently setting up some info to show how to wrap some classes and some design pointers. It currently shows you how to make your engine have no actual reference of the windows message loop. http://dmoney.no-ip.org/tutorials.php I am currently zipping up a solution in which I use both opengl and directx as wrappers and depending upon a single comment you can decide which one you use. It is a pretty good example of wrapping. It should be on it once anyone reads this.
  14. Do the pros use D3DX

    Once I find some gamedev members who are pro's I will ask them and let you know. Also Carmack being a powerful game developer himself doesn't always know whats best to use. For instance those terrible stencil shadows in Doom 3 gave me a stomach ache and I was forced to send him a letter insisting he send some paper towels.
  15. My DirectX class design problems

    A common system if these things will only be one instance at a time you can do... //in h class stuff { static otherclass* m_pOtherClass; }; //in Cpp static otherclass* stuff::m_pOtherClass = NULL; I believe it is that way in the C++, it really is just doing the right syntax, since the class won't directly create a static value you have to in a cpp file. The above example is sometimes good for putting a value inside a class that all class instance will be tied together through it. You use it like normal, but that var will be the same mem in each class instance. another way //h class Stuff { public: //shit in class int x; }; Stuff &GET_STUFF(); //cpp Stuff &GET_STUFF() { static Stuff staticOut; return staticOut; }; That is an easy way to always get a class if you plan on only using one instance of that class. Which is common for a rendering device. use it like... GET_STUFF().x = 10; With C++ it is knowing your tools and using them right. If you just want a pointer you can also do about anything you want and set it any way. You could even put it as public and get it that way. Or make a macro for each class to return a pointer. //assumes x is already a pointer #define GET_P(x,y, z) z* ##y() { return x; }; works this way class Stuff { private: int *wha; public: GET_P(wha, GetWha, int) }; Stuff tempStuff; int *ahh = tempStuff.GetWha(); All about knowing your tools... Also intellisense somtimes misses macro's, stupid intellisense piece of crap.