Jump to content
  • Advertisement

small_duck

Member
  • Content Count

    133
  • Joined

  • Last visited

Community Reputation

294 Neutral

About small_duck

  • Rank
    Member
  1. small_duck

    Fragment Shaders

    Fragment shaders work per pixel, for each interpolated pixel of the polygon which vertex were processed in the vertex shader. So, at the fragment shader level, the color, the texture coordinates, the z buffer and all other parameters correspond to the pixel.
  2. I think that a very important point for a framework like this to be accepted is to make the components mostly independent (minus a small lib of common utilities). Most of the frameworks I have tried have a bit of an everything-or-nothing approach. I want to be able to use my own network code if I want, or to make use of the music engine and skip the sound FX because I've already got a great wrapper around OpenAL. In the same way, I might like the network code on the server side, but reimplement from bare sockets on the client side, which means having the packet format well defined. This is probably what I enjoyed the most with the Boost library: a set of utilities, that I can learn and use at my rate, and that don't give me the feeling that I'm getting myself onto the thin edge of the wedge.
  3. small_duck

    Designing for multiple monitors

    I suppose that the most obvious use of multiple monitors is to separate the main display from the information display. In a RTS or in a RPG, there are often mini-maps, character descriptions, inventories / list of resources, that could all be on the second screen to keep the primary display fully for the game. Other than that, I think that management games where you need to keep an eye on many things ate once are a win there. In most trading floors, 6-screens setups are the standard, and that can go up to 8 or 10, because traders need to see tons of information at the same time. Air traffic controllers (military and civil) also have generally several screens, with for example one for the main radar display, one for the list of planes being managed, and one for general information. I suppose you could actually make some pretty neat strategy game where you would play the role of the top general, and manage several battles at once while keeping an eye on your industrial output, your spies reports, the weather forecast (can change the outcome of a battle!), and your diplomacy staff. In that case, it is probably a win to provide a very configurable display, where the player can open a number of empty windows, and fill them with the individual controls. You'd need of course to provide a default 1 screen interface, and maybe a default 2 and 3 screens interface.
  4. Why don't you use good old zlib? And there are tons of wrappers out there, if you are doing C++ you can use the Boost one, or mine (shameless plug, text is in French but code is in English and pretty much self-explanatory). Any other language generally has wrappers ready for use.
  5. small_duck

    Dual hamsters

    Pretty fast here too... This said, although I do live in London, I am not British. Does it has to do with the nationality, then?
  6. small_duck

    Good ways to improve blog readership?

    Look at Steve Yegge blog: the entries are sparse, but absolutely huge, insightful, and controversial enough as to sparkle loads of comments all around (static vs dynamic languages / type systems or native code vs virtual machines are subjects almost guaranteed to bring foam-in-the-mouth hordes of readers). I'll also strongly agree with Colin Jeanne in that "practical" posts are more sought after and commented. One of the most popular posts on my blog is a short piece of code that shows how to wrap zlib in C++. Looks like everyone is looking for that!
  7. small_duck

    funny (but useful) code

    We had a visitor pattern in production that was called "CSquirrel", that did "run" through the "CTree", and threw "XNuts" for exceptions. And I'll never forget the day I found that our memory management system had a "SeeYouLaterAllocator"... That did tend to make the code less readable, though!
  8. Is Open Scene Graph too heavyweight for you? It loads and displays in a variety of formats, but it comes with the whole scene graph with it. On the other hand, it does just that! I've used it, and I like it a lot.
  9. 1) No, there is no integer "default index" as such in a std::map. The only index you have is the one you've defined, which is std::string in that case. On the other hand, the map is sorted, so you can ask for the, say, 5th element. But if you add another element, you cannot be assured that your previous 5th element will still be 5th. In addition to that, accessing a random element this way forces you to iterate through all the map, which is inefficient because it is O(n). On the other hand, accessing an element by its index (in your case, the string) is efficient, because it is O(log n). 2) If you want to index your map with both a std::string and an integer, you either have to code it yourself (with two maps and pointers), or use boost multi-indexes: http://www.boost.org/doc/libs/1_35_0/libs/multi_index/doc/index.html 3) The map will do it for you: you can access every single element in the map. As often with C++, there are many ways of doing the same thing (beware, I did not compile those, syntax may vary): The iterators way: map<string, TemplateClass>::const_iterator it = Resources.begin(); map<string, TemplateClass>::const_iterator end = Resources.end(); for(; it != end; ++it) { (*it)->Render(); } The algorighms + boost way: std::for_each(Resources.begin(), Resources.end(), boost::bind(&TemplateClass::Render, _1)) The boost for_each way: BOOST_FOR_EACH(const TemplateClass & e, Resources) { e->Render(); } And plenty others :) I'll conclude by asking: why do you want to index by "integer index" in the first place?
  10. small_duck

    C++ Templates Question

    As ToohrVyk is saying, what about using inheritance? template <class X> class xclass : public container { X object; void disconnect(); } This way, after creating your different xclass objects, you can abstract them as a "container" class: std::vector<container *> myStuff; myStuff.push_back(new xclass<vertex *>()); myStuff.push_back(new xclass<polygon *>()); myStuff.at(0)->disconnect(); myStuff.at(1)->disconnect();
  11. small_duck

    Strategy games and emotional attachment

    I think that to make players grieve their units, they must have a way to identify and remember those specific units that did something special. This can go with giving a name to the unit or to a group of units, or keeping statistics on the heroic acts of the units (for example, the number of enemies destroyed). I suppose that it could also work by giving specific ranks to some units that have been particularly efficient in combat, so that they stand out. For example, I would feel a burst of pride, seeing the message "Destroyer Commander of the 3rd Squadron has destroyed the enemy mothership, adding the total number of killings to 138 at a total of $15B destroyed enemy value". To me, it means that the highest ranked ship (say) of a special group that I called this way after they survived an important battle, has made another kill, and has a great record of success. In the same way, loosing this ship would be a real disaster and really sadden me, more than the lost of a perfectly equivalent ship that's just been out of my factories and does not have the history attached to it. Funnily enough, I gave some names to some of my special trains in Transport Tycoon (one was the Transcontinental, going through the whole map North to South, ah, the memories...), often followed them just to admire them, and I felt real sadness when I had to upgrade the good old train that brought me so much with a newer version... that I would then regret the upgrade after :) But maybe I am too sentimental?
  12. small_duck

    Creating Static Libraries - General Advice

    Hello, I suppose that you mean #include awesome1.hpp #include awesome2.hpp #include awesome3.hpp ? If so, yes, you can definitely do that, that's how many libraries do it. For example, wxWidgets has a wx.h that includes the headers of the most used libraries, and that correspond to about 4 or 5 libs. The declaration will have no incidence on the linker keeping or not the declared stuff. If you declare it, but never call it, it is going to be cleanly discarded. The only real issue here is that you might have longer compilation times because of the huge header files to be included.
  13. small_duck

    How does an 'Exploration MMO' sound?

    Some of the concepts here remind me of the Cube movie! You had this changing universe, without clear boundaries, and with puzzles to pass from a cube to another (safely). There was teamwork involved (the mathematician girl, the mental computation guy...). Anyway, I definitely like the idea of an exploration MMO, and I'd certainly play that :)
  14. small_duck

    Alternative to global classes?

    Another reason why you should not be using globals nor singletons is unit tests! If you want to properly unit test your class, you will need to mock out correctly your logger, settings, etc. In that regards, functional programming (and referential transparency) has been a real eye opener to me. I think there is nothing wrong in having constructors that take (shared) pointers to various dependent objects. On the contrary, it makes the dependencies much more visible, and that is a winner in the long term. If the list of objects to be passed becomes too big, you have several solutions: - If the list is mostly the same all the time, have an object "context" that contains pointers to your subsystems, and pass "context" around - If the list is really big, or changes dynamically, pass a map of subsystems, and with a bit of template magic / dynamic type, get back your subsystem when you need it.
  15. small_duck

    MMOPRG database

    I've found that using an SQL database accelerates development immensely, as so many things can be done directly inside the stored procedures (I'm using postgresql, which I find truly amazing. The asynchronous commit that has just been released in 8.3 is an excellent feature for this kind of hight transaction rate usage). I've got a pool of worker threads which take jobs from a message queue, and run the corresponding query against the database, thus making usage of the multi-process capabilities of the DB. I suppose that when performances start to suffer, it must be possible to move non-critical stuff in cache.
  • 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!