Jump to content
  • Advertisement

Fionn

Member
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Fionn

  • Rank
    Member
  1. After short looking at your code, at least this line contains unnecessary code: ((A&)(*this)) = A::operator=(bobj); You are calling a member function of your base class (since operators are also simple functions and just syntactic sugar). At the end of your base class function your return a reference to yourself. In that line above you take the reference to yourself get the address of yourself and assign the address of yourself to the this pointer (which allready contains the address of yourself). So this should be fine anyway: A::operator=(bobj); And I would say that you should never assign anything to this itself unless you really know what you are doing (but i guess even then you don't need to mess around with the this pointer). Btw, in your case even the automatically generated copy constructor and assignment operator will do the job, since you are not doing anything but a binary copy of your objects.
  2. Fionn

    foreach in C++?

    Well the direct access loop may not always be the best thing you can do. If you have a linked list container and are accessing the element by offset you may have to travel trough all elements each time you access the container. But all STL containers also give you iterators: #include <vector> #include <string> int main() { std::vector<std::string> myVector; myVector.push_back("test 1"); myVector.push_back("test 2"); typedef std::vector<std::string>::iterator MyIteratorType; MyIteratorType begin = myVector.begin(); MyIteratorType end = myVector.end(); for(; begin != end; ++begin) { //You loop as long as you are not at the "past the end" iterator std::cout << *begin << std::endl; //With *begin you access the actual element you are at } }
  3. Fionn

    Tutorial C++

    I liked the Books of Bruce Eckel "Thinking in C++" Vol1 and Vol2 back in the days of lerning C++. They are also available for free at www.mindview.net (Seems to be down currently, but go to books->download or something like that). They may not be the books for the total beginner, but the quality is very good.
  4. I allready thought about UDP but the question is if you can get the packet loss recovery better than than TCP/IP, and the advantage of TCP/IP is that the hardware (possibly) deals with the packet loss stuff. The other question here is why then many sucessful games (in the mmorpg sector WoW, Linage, ...) use only TCP connections? There it seems to work perfectly well. Also encrypting UDP traffic seems much more work than encrypting a stream of TCP/IP. An the Firewall/NAT story also seems to speak for TCP/IP (I may be wrong here, but i think a client opened TCP/IP connection is easier than a UDP two way channel - so UDP seems also to raise the support amount). An idea which i head in the last minutes is this: Use async I/O with the buffer size set to 1 or a few bytes which would trigger allways if there is some new data, and then use a nonblocking read on that socket to get maybe waiting buffered data. The question is just if this would be better than a large select/poll for performance. But I have read that this calls doesn't scale well if you have a lot of connections, which would be true for an multiplayer server/gateway. [Edited by - Fionn on December 2, 2006 6:20:45 PM]
  5. Hi, I wondered how i could minimize the latency of overlapped/async network IO operation. As far as i know the aio_read/ReadFileEx/WSPRecv read data until the supplied buffer is full and then either send an event or call a callback function. But in the scenario of an MMO e.g. where i have many connections and async I/O seems to make sense i have a little thing i am curious about: Since i have to receive the player action as fast as possible what's the best solution (preferable working with both overlapped I/O and aio_*): a) Set the input buffer size so that the min. amount of user data would generate the event/callback to be triggered. b) Some way of telling the async. I/O to return after a short amount of time when data was received. But a larger timeout would add an static amount of latency. Does anyone has some experience to share about this topic? Thanks
  6. In the last days i figured must stuff about IMEs out, but there is one thing still puzzling me: If i am inside a game, i got it working to switch the different input languages (DE->EN->JP for example), but as far as i know there are also different input modes. (I used this example http://bulldog2.redlands.edu/dept/AsianStudiesDept/Language/japanese_write.htm) So there seems to be some different input modes with each IME too (like the Direct Input and Hiragana in the sample). How would you switch this modes inside a game (or how would it be best to implement that?), everything with Hotkeys/Shortcuts? Or does a internationalized game has a sort of complex language managment bar? If you would have some screenshots of actual implementations of IMEs in games that would be great. Fionn
  7. Well this is why i hope that someone who uses it everyday can help me here, because most of the info on the net are not really useful if you have no idea how it is used in everyday usage and such things.
  8. I am searching for people used to IMEs (Input Methode/Mode Editors) used with Japanese, Chinese, .... My problem is that i want to implement support for them, but I don't fully understand how they are used because I am not able to speak/read any of those languages. Maybe someone here with a deeper understanding of this languages is willing to answer me some questions (with ICQ or such interactive messenger would be the best i think). But the first question is, in a game or application do you often switch IMEs? Like from kanji to ascii or such things. And what input mode is most expected/most standard, I found that there are at least 4 variants (on the spot, over the spot, off the spot, root window)? Thanks, Fionn
  9. Fionn

    Text and Complex Scripts

    For the rendering on Linux i know you have to use ICU or Pango together with freetype. Freetype just does the glyph rendering - nothing else. All the painfull features in the TrueType Tables most be done seperatly. @Anon Mike: So you transfer whole strings to texture memory?
  10. Fionn

    Text and Complex Scripts

    The question is with the glyph cache thing if you not loose the performance gain with not rendering the strings with the transfer of the quads, because then you have to store the location of every single glyph and transfer this glyph image every frame. And i believe that most text survives many frames (even with chat or log windows) - if you let a seperate thread do the rendering you should not have any problems i guess (for example i can also let a game run and some sort of irc client or such stuff in another window on my second screen smooth, which would be the same as running the rendering of strings in another thread). And for long living text (like Player Names etc..) only a single transfer is needed instead of one for every glyph. And if the system implements a glyph cache in it's system functions, rendering the strings would be very fast.
  11. Fionn

    Text and Complex Scripts

    @hplus0603: So you have multiple lines of text in one big texture (maybe split the texture vertical into lines of the size of on line at a particular font size)? I just thought that maybe a mixture of the quad based and the line based could do it. I tought of splitting the lines also horizontally, e.g. 20 elements in a line. And then using something like a page table in the system kernel. Just discover how many items a string would take up and find the next free sequence. If you run out of long enough seuqences you just could pack the existing texture or create a new one. Because if you just use a one item per line it would waste much room of the texture. E.g. "The quest objective is to blabla..." compared to "Open", or just simple labels on the buttons.
  12. I have done some researching about how to get text with good performance into an 3D Application, most of what I found just loaded all Glyphs of a Font into an Texture. But this doesn not seem usable if you think about i18n (internationalization) issues. Because there you got thousands of possible glyphs, complex script behaviour (right to left, glyph substitution, etc...). So i thought that i would maybe possible to render the text with OS functions (uniscribe, pango, ...) to memory and then store the text lines in textures. Is there any better approach to do this? I don't think rendering the text every frame is better. I am thinking about this in the context of an RPG where you got many text items (mob names, quest text, dialoges, tooltips, and much much more). Or does anyone know how Games like Guildwars handle that? I just seen a lot of korean, japanese and much more types of scripts there, so they got it working. Thanks, Fionn
  • 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!