Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

250 Neutral

About Kuraitou

  • Rank
  1. Kuraitou

    How to get 2D texture size?

    That's definitely what I want, thanks! Is there a way to be absolutely sure that the ID3D10View resource is indeed a ID3D10Texture2D? EDIT: Nevermind, I think I got it. I need to make sure that ID3D10Resource::GetType() returns D3D10_RESOURCE_DIMENSION_TEXTURE2D. Thanks again.
  2. Hello. I'm porting some D3D9 code to D3D10 (in this instance, the code in question is a textured quad renderer) and I can't seem to figure out how to get the size of a texture. The best thing I've found is the HLSL function Texture2D.GetDimensions(), which would allow me to do this on the GPU. It seems like that would be slow - correct me if I'm wrong. Is there perhaps a way to get a D3D10_TEXTURE2D_DESC from a loaded texture that I don't know about? Currently, I'm using D3DX10CreateShaderResourceViewFromFile and passing the view to my shader. I looked at D3DX10CreateTextureFromFile but it doesn't appear to give me a way to obtain texture information either. In my old code, I would cache the texture size and calculate the texcoords of each vertex on the CPU before sending them off to be rendered. I would like to do the same thing here if possible. Many thanks!
  3. Whoops. Didn't know such a setting existed. I'm now getting this error: Direct3D9: (ERROR) :All user created stateblocks must be freed before Reset can succeed. Reset Fails. I promptly tracked this down to me not calling OnDeviceLost() and OnDeviceReset() on an ID3DXSprite object. I never knew these methods were so important; I guess you learn something new every day, huh? Thanks for a prod in the right direction, it all works as expected now!
  4. Hey all. I'm having problems getting Device.Reset() to work on my machine. Google has not been terribly helpful in telling me what is wrong, so I figured I'd give it a shot here. My setup: -Visual Studio 2010, compiling against .NET 4.0 and the prebuilt SlimDX x86 4.0 library -Direct3D9 debug libraries in use; debug output is MAX; maximum validation, break on memory leaks, break on D3D9 error, multimon debugging are ALL ENABLED. -Using Direct3D9. This is all that is in the output window during the lifetime of my application: The thread 'vshost.LoadReference' (0x7f0) has exited with code 0 (0x0). 'Circle.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and Settings\user\Desktop\Dev\Games\Circle\Circle\bin\Debug\Circle.exe', Symbols loaded. 'Circle.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. The program '[0x17B8] Circle.vshost.exe: Managed (v4.0.30319)' has exited with code -2147483645 (0x80000003). The program '[0x17B8] Circle.vshost.exe: Program Trace' has exited with code 0 (0x0). The program crashes completely on Device.Reset(), logging the message about error code 0x80000003, which seems to indicate invalid arguments, however the PP that I pass as a parameter is the same that I created at the start of the program. Here are the relevant parts of code (class is DeviceContext): public delegate void OnDeviceResetDelegate(); public event OnDeviceResetDelegate OnDeviceReset; public delegate void OnDeviceLostDelegate(); public event OnDeviceLostDelegate OnDeviceLost; private Direct3D _d3d; private Device _device; private PresentParameters _pp; // ctor. Called once after creating window. Handle is always valid; backbufferSize is always 800x600. public DeviceContext(IntPtr handle, Size backbufferSize) { _pp = new PresentParameters(); _pp.AutoDepthStencilFormat = Format.A8R8G8B8; _pp.BackBufferCount = 1; _pp.BackBufferFormat = Format.A8R8G8B8; _pp.BackBufferHeight = backbufferSize.Height; _pp.BackBufferWidth = backbufferSize.Width; _pp.DeviceWindowHandle = handle; _pp.EnableAutoDepthStencil = false; _pp.FullScreenRefreshRateInHertz = 0; _pp.Multisample = MultisampleType.None; _pp.MultisampleQuality = 0; _pp.PresentationInterval = PresentInterval.Default; _pp.PresentFlags = PresentFlags.None; _pp.SwapEffect = SwapEffect.Discard; _pp.Windowed = true; this.Initialize(); } // .................. // See above. private bool Initialize() { _d3d = new Direct3D(); // TODO: non-blanket exception; device caps check try { _device = new Device(_d3d, 0, DeviceType.Hardware, _pp.DeviceWindowHandle, CreateFlags.HardwareVertexProcessing, _pp); } catch (Exception ex) { MessageLogger.WriteLine("{0}", ex.Message); return false; } return true; } // .................. // This is called in my main loop before attempting to do any rendering. public void Validate() { Result result = _device.TestCooperativeLevel(); if (result == ResultCode.DeviceLost) { if (this.OnDeviceLost != null) { this.OnDeviceLost(); } while (true) { result = _device.TestCooperativeLevel(); // TODO: other cases so that this loop isn't totally infinite? if (result == ResultCode.DeviceNotReset) { _device.Reset(_pp); // This is where it crashes and displays the error 0x80000003 in the console if (this.OnDeviceReset != null) { this.OnDeviceReset(); } break; } System.Threading.Thread.Sleep(1000); } } } I'm skeptical of whether VS2010 plays nicely with the D3D9 debug libraries (they would crash the environment last time I tried using them with VS2010), and I think that I should be getting quite a bit more feedback from them. Any thoughts? EDIT: As a little sidenote, I've NEVER been able to get Device.Reset() to work in SlimDX before. I used to use a workaround where I would just completely recreate the device, which would work, given the same PP...I've just never bothered to try to get it working properly. Now I'd like to do so. The D3D object is valid at the point of reset. Before I turned on debug libraries in the D3D control panel, the application wouldn't crash, but the device wasn't completely reset either; instead, the device was not associated with a D3D object. Thanks for your time.
  5. Kuraitou

    Database + Interface

    It sounds like what you need is a generic application to do CRUD operations. Before that, though, you'll want to choose a database. A variant of SQL is often the choice for (MMO) game data storage, although there are others. My vote would go to Microsoft's SQL Server; there is a free version called SQL Express that imposes a few limits, but they are manageable, especially if you start drawing an income from your game so you can upgrade to enterprise edition. You can use SQL Server's management studio for a CRUD client, though I'm sure there are better ones out there. The other mainstream SQL variant is MySQL. This would probably be the fastest to get up and running, and you can use SQLyog as a CRUD client. Once again, MySQL offers a "community" edition, and to do commercial work you'll have to pay for an enterprise license. Both reach to the same languages; SQL Server only runs natively on Windows; MySQL is crossplatform; SQL Server is generally held to have higher performance (Microsoft is so sure even so as to point out that SQL Server has gone through industry standard stress tests that MySQL has not). I have used both; only recently have I made the switch to SQL Server and I must say I like it a lot better than MySQL, especially since I do a lot of database development in .NET (System.Data.SqlClient offers built-in support for SQL Server). MySQL does offer a .NET database connector as well. Really, they're both pretty much the same. SQL Server has the .NET Framework backing it up while MySQL has most of the PHP community as well as a lot of open source software behind it.
  6. Kuraitou

    Handling Device Loss?

    1.) You need to manually reload unmanaged resources. I believe that for ones that have an OnDeviceReset() call, you need to invoke it so that it'll release the resources used by that object. 2.) Present() is fine. I prefer to use TestCooperativeLevel(). Really, I don't think it makes a difference.
  7. Kuraitou

    Multiple animation

    Sounds like you should give this a read. Most relevant is the section called "Free the physics."
  8. Quote:Original post by FutureCode I create the device using D3DDEVTYPE_REF, for HAL seems to be worse, and SW fails. When you create the device with D3DDEVTYPE_HAL, are you using D3DCREATE_HARDWARE_VERTEXPROCESSING for the fourth parameter? Example: d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window.handle(), D3DCREATE_HARDWARE_VERTEXPROCESSING, &pp, &device); Reference mode is going to be slow since it uses software rendering to emulate the Direct3D standard for whatever version you're using. SW is a different story. Also, what are you doing with t2 and t1? Those alone won't give you the FPS, but subtracting t1 from t2 gives you the preferred "how much time did it take to render this frame." clock() alone may not be what you're looking for, due to varying platform implementations. It doesn't return seconds; if you want those you'll need to divide the result by CLOCKS_PER_SEC. Quote:Original post by FutureCode Now the problem is, when n is less than 50 it's all right, but if n == 100, then I can feel fps decreases a lot. My sprite is only 7 * 28. It's not supposed to act like this; What's wrong with it??? You will "feel" the choppiness if you don't interpolate moving objects using the delta time. I can't tell if you're moving your sprites at all from the code you've posted, but it's just another thing to look into if you are.
  9. Quote:Original post by lucasite But RawInput only has one keyboard event, SlimDX.RawInput.Device.KeyboardInput. How can I access the keydown/keyup events from here? Disclaimer: I'm not familiar with the RawInput namespace, so forgive me if it is a better method of retrieving input. I'm just going by what I've used in C++ (WM_KEYDOWN/WM_KEYUP). The KeyDown/KeyUp handlers I'm referencing are the normal Form events that you were using before.
  10. Use a combination of KeyDown and KeyUp. First declare an array of booleans somewhere in your code that your handlers can access. 256 elements should be enough. Then, in your KeyDown handler, do something like _keys[(int)e.KeyCode] = true; and in your KeyUp handler, do the same thing except set it to false. In this way you will have a keymap so to speak where the index 'KeyCode' is true if the key is pressed. That way you can still do things like multiple key presses very easily. I'll leave it up to you to play around with.
  11. I had this problem a while back when writing a similar game. Turns out that getch() actually consumes TWO characters when you press an arrow key: one byte with the value of 0xE0 and then the actual arrow key code. The easy solution is to do something like int key = getch(); ... switch (key) { case 0xE0: int arrow = getch(); // process arrow key here break; } The other way out is to use actual Windows console events. Look into ReadConsoleInput and INPUT_RECORD on MSDN. EDIT: I just tried setting up a little kbhit/getch project on my computer and I actually get 0xE0 instead of a null byte. I have revised my post to reflect this. [Edited by - Kuraitou on May 25, 2010 12:05:11 AM]
  12. Kuraitou

    A huge chance: should I take it?

    Quote:Original post by Telastyn Quote:Original post by Kuraitou I can assure you that my dad isn't that kind of person; as a matter of fact he stated that I'd probably be working for a different development head. He's not the person you're going to need to worry about. Working at a company involves interacting with a lot of people. Not all of them might be okay working with a 'snot nosed brat' as it were. Or there will be people who will perceive that you got the job based on familial pressure rather than merit. It's just something to consider. Hmmm, I suppose you're right. I can only hope to make a good impression. Quote:Original post by szecs For learning languages. Which languages did you learn quickly? If you can speak English, German becomes pretty easy. If you know some German, you can learn Swedish in 2 months (okay, pronunciation is very tricky in Swedish). I learn Finnish at the moment. I am pretty talented in learning languages, but Finnish is very hard for me, I'm learning it for my own (I cannot afford courses, but I'm Hungarian). Grammar is nothing, words are everything. I picked up basic grammar in weeks, but the words are so different than in any other languages, that they are extremely hard to memorize. I can learn a Swedish word by reading it 2 or 3 times (because it's so similar to German or English). But I can cram Finnish words for hours, and I simply forget half of them the next day. I guess Japanese is the same. I don't want to discourage you, I just want to say, that you have to work very hard with Japanese. I had picked up Spanish in about a month, including grammar, vocabulary, and all of those crazy [irregular] verb conjugations. I know it's sort of similar to English and therefore easier, but it's still another language. Plus, it gives me an idea of what learning a new language is about. As a personal exercise, I learned a bit of French too. Enough to survive if I had to, at least, but I sort of gave up on that because it seemed too easy and I didn't like the fact that it was nearly identical to Spanish. German...I won't bother mentioning that because you already covered it. I _did_ study a bit of Japanese. Unfortunately all I've really done is picked up some basic grammar rules and vocabulary and learn Hiragana and maybe about 30 kanji... Not much to show for it but I haven't really had all that much time to work on it lately. I will say one thing though: grammar is much more important in this language than any other I've ever taken a look at. Quote:Original post by jtagge75 If you were already living in Japan then having a very good portfolio might make it easier for you to land a job. But the chances are going to be about zero of a Japanese company hiring you from over here and moving you to Japan. You are going to be an outsider and will always be an outsider. So your skills will probably have to be very exceptional to get noticed. And being an outsider you will probably never rise above a code monkey position. Trust me, when you are young it sounds alright but you won't want to be 40 and baning out code 10 hours a day five or six days a week. Fortunately I am working on building a polished portfolio. If nothing else seemed to work, hopefully it would be able to break through the entry barrier. Also, they wouldn't hire a person from overseas right off the bat - that's right. Generally you would get a vacation visa, secure a job, and then come back on a work visa sponsored by the company that wishes to hire you. Quote:Original post by jtagge75 Make sure you want to go to Japan because you like the country and not because you have an idea its some kind of nerd fantasy land. I hate people like this, and I am aware of their presence. They give a bad name to the rest of us who are genuinely interested in Japanese culture. Many times I am grouped with them and it does hurt me, because no matter what I seem to say people think I'm just another one in denial.
  13. Kuraitou

    A huge chance: should I take it?

    Quote:Original post by Hodgman Quote:Original post by Kuraitou from what I hear, it's hard to get into the industry.It depends. If you're not capable of doing the job, then yeah, you're hoping for a lucky chance that someone is desperate enough to hire you. If you are capable of doing the job, you've just got to wait for an opening and then p[rove your stuff.Quote:I want to move to Japan sometime after I've built up experience and work for a game development studio thereYeah, definately plan for this to happen later on in your career. Hiring foreigners is always a hassle - I've only seen it happen once for a junior position - usually it's reserved for people you really want/need to hire. How much of a difference (to you specifically if you were considering hiring a foreigner whom you have slightly xenophobic thoughts toward) would portfolio work mean? If I can throw together some really amazing and unique demos and a few simple, yet extremely polished games, how much more of a chance would that give me? I hate to put you in a position like that, but I'd like your answer no matter how biased it may be. Quote:Original post by Hodgman It's even worse if you're not completely fluent in the language spoken in the studio. Lots of european studios speak english, even in non-english-speaking countries, but I wouldn't expect this at all in Japan. I am sure I will not find language learning to be a problem. I have managed to pick up a few languages quite easily; I'm not sure why, but I assume it has something to do with my learning many different programming languages and it sort of works the same way... Quote:Original post by Hodgman Quote:While it's not specifically game-related (actually, public safety) I'm sure it'll give me valuable real-world experience and would look great on my resume.For sure. While other college grads can talk about their group assignments and sharing files over USB-drives, you'll be able to talk about how well you adjusted to a team environment and your experiences with their processes, source control, etc. So... I'd definately give the job a shot, even if it only lasts you 3 months. Well then, that sort of settles it. I was borderline about the whole thing but I'm think I'm going to try to give it a shot. Quote:Original post by Hodgman Quote:I need to work Japanese studies in here somewhere, either on my own time or via classes. I realize it takes much dedicated hard work to learn a language, but I believe I have what it takes. The problem here is that some people swear that language courses simply do not work. Is this really the case?I think they're ok as long as you don't miss anything. I never paid much attention in my Japanese lessons, so after 2 years of lessons I can't go far past "where's the toilet" and can't read/write it any more (it's been 7 years since I learnt). I have friends from the same course who can still read and have basic conversions though, so it worked well enough for them. Japan is weird in that they simultaneously love European/American stuff, but are also very traditional and isolated. Be prepared to be extremely respectful and to treat your superiors like they're higher life-forms than you ;) It's notoriously hard to "get on the same level" as your superiours there, and I hear even moreso as a gaijin. I am aware of this mentality, but I don't see it a negative light. It's a shame that xenophobia has pervaded the culture throughout history, but hey. It's nothing but another challenge I can't overcome if I try. Plus, it seems to me that the nihonjinron ideology has worn off slowly (to an extent) in recent years. Quote:Original post by Ravyne First of all, and it seems to be quite common for some reason, I don't know why you think that moving to Japan should be any part of breaking into the games industry. Development is hard enough without throwing yourself into a situation where you'll be surrounded by the language barier on all sides. The real Japan, while friendly, is also very insular. You cannot expect realistically, as an outsider, to simply storm the gates and make a big impact. Further, Japan, while still a hugely important cultural region for games, isn't really the development or even technology center of gaming that it once may have been. It does apply to the theory of breaking into the industry, because I must do it in another country. I have no idea if experience here has any ground over there, so I may need to study abroad and start over... I dunno. I just want a job doing what I love, no matter how hard it is. Quote:Original post by Ravyne This is a dream that seems to be common among wannabe game developers, and while I get that its part of your passion, its also kind of an unrealistic and, to a measure, childish, daydream. Even myself, I once thought that learning to speak fluent japanese would be a necessary skill -- reading would have been better a few years ago (documentation) -- but now I can see that its not at all necessary and only a 'nice to have' in a few, select roles. I'm not at all trying to dash your dreams, but I just can't help but feeling that you're looking at this through childs' eyes, and you need to be realistic about the path you need to take to get where you want to be. It's not a problem. I get this response quite often but I never let it get me down. Quote:Original post by Tom Sloper Hello Kura, you wrote: >Tom Sloper's FAQ has helped me greatly (especially lesson 48), but I'm afraid it doesn't answer my specific questions. >-Should I attempt to secure this job? You mean, should you bother taking the application test for the summer job? Yeah, I forgot to mention that in FAQ 48. I slap my forehead and say, "chikusho!" Why not take it? If you don't get that summer job, chances that you'll be moving to Japan instead are pretty slim. You might not get the summer job, of course -- that wouldn't be the end of the world either. Even if you do get the job, you should still go to college. You should talk to your dad about whether to work and skip college or not. I wrote an article on how to make a decision. It's FAQ 70. >-What other (better) alternatives are there? Than applying for that summer job? I don't know. Some other summer job. >-Somewhat unrelated, but what course of college study would you recommend for me? You want to be a programmer, you said? View the Forum FAQ (above), and go to the For Beginners FAQ, and view that too. You should get a CS degree. You can minor in Japanese. >The problem here is that some people swear that language courses simply do not work. Is this really the case?) The problem here is that you listen to people you shouldn't listen to. How do you know we aren't some of those? Studying is actually a good way to learn things. Courses are a good way to study (you aren't a professional teacher, so you shouldn't teach yourself). But what I just said will find an argument here. Lots of GameDev regulars disagree with me on that point. That means you have to make a decision. I refer you again to my article 70. Mr. Sloper, I really appreciate your feedback! How many years of study would you recommend for a CS degree? I was previously intent on getting a whole 8 years in an attempt to receive a Ph.D., but now I am unsure if I should scrap that and simply go for a 4-year master's degree and then take the rest of my time to study abroad in Japan to immerse myself in the culture as soon as possible. That way I could solidify a bit of knowledge before I get too old to efficiently learn things any more. I'm sorry I missed #70. I will go take a look at it immediately. Quote:Original post by Trapper Zoid If it were me, if it's a summer job and looks reasonable I'd definitely strongly consider it. The main downside would be if you were missing a needed break before college after burning yourself out in final year; you'd have to make that call. For my software engineering course we all were expected to put in a few months of on-the-job experience to qualify (I think there was a loophole in that you could count the first few months of post graduation employment; I managed to find enough work between years to count regardless). As for Japan, I'd expect there to be a large amount of culture shock. I've had a few friends work in Asia for a year or so, but they were all in teaching related positions. If you are dead set in experiencing life in Japan, there's always the option to spend a study year there. My unis had the option to apply for a year studying abroad at foreign universities, and I know there were several opportunities in Japan. The final year of highschool was actually a breeze. I didn't feel pressured or anything, but it is a GREAT relief to have finished it. Quote:Original post by Telastyn Quote:Original post by Kuraitou -Should I attempt to secure this job? It depends on the situation. If you're going to get a summer internship or temp job, absolutely. If they expect you to work instead of going to college, no. If you'll get a lot of grief for the nepotism... maybe not. I can assure you that my dad isn't that kind of person; as a matter of fact he stated that I'd probably be working for a different development head. Quote:Original post by Telastyn Quote: -Somewhat unrelated, but what course of college study would you recommend for me? (Software engineering or a variation thereof, obviously, but more specifically, I need to work Japanese studies in here somewhere, either on my own time or via classes. I realize it takes much dedicated hard work to learn a language, but I believe I have what it takes. The problem here is that some people swear that language courses simply do not work. Is this really the case?) I would expect a major in Computer Science and a minor in Japanese (or a double major if you're feeling ambitious). Sure, the courses might suck and you might need to do some work on your own to learn the language/kanji properly, but at the end you have the degree to put on your resume and that goes a long way. Thank you for the input; I find it most valuable. I have not considered doing a double major, but after a little bit of research I believe I could work it into my schedule. I'll be sure to look into it further. Quote:Original post by way2lazy2care have you been to japan? You should visit it before you try to live there. It's a very different culture from most others, and you may find it doesn't mesh with you for living. I think it meshes with most people for vacations because it's a cool country, but it takes a lot to actually live there. Also keep in mind that coming back to visit your family if you get homesick is not trivial if you decide you don't like it. ... Like some above said, Japan is not nearly the video game mecca you make it out to be. You should do a little more research before making such a large decision. I have done my research and I believe that it is in my best interests to attempt to go to Japan. I genuinely love the culture and believe that I can make it work. Quote:Original post by way2lazy2care I'd take the summer job. If it's an internship level job, you should be able to get by and get plenty of relaxing in over the summer. Make a little cash, and spend some time thinking about it more. Once again, thanks for the input. ----- I believe I have come to the conclusion that I will go ahead in attempting to secure this job. Programming is extremely fun, and no matter how stressing the position might be, I think I'll learn a lot and really be able to have something to show for it.
  14. Hey. First of all, I want to say that I'm passionate about game development. Programming is a very fun and rewarding thing to do, but from what I hear, it's hard to get into the industry. Now, I have a huge plan I would like to set in motion beginning this year. I want to move to Japan sometime after I've built up experience and work for a game development studio there since I've basically grown up on games from this region of the world. To me, it seems like the modern center of game development, and I'm willing to take any risk and overcome any challenge to make my dream come true. But alas, that's quite far ahead of me. Right now, I'm applying for colleges. My last year of high school has just ended, and what I see as a potential opportunity to force my way into the software development industry in general has appeared: my dad, who works for a software development company which uses many of the technologies I have taught myself and have a concrete knowledge of, is able to get me into the company this summer as a programmer given that I pass an interview and prove myself able to handle the job. I have never had a job before and this is a very stressful thing to me; my question is, should I take this opportunity to get into the software development industry? While it's not specifically game-related (actually, public safety) I'm sure it'll give me valuable real-world experience and would look great on my resume. I'm just not sure how everything will fit together once the summer is over and I start college... I can't hold my job over that time if I take daytime classes, and I'm not sure about spending every single hour of my life either studying or trying to make ends meet to pay for college; but if that's what it takes, so be it. Tom Sloper's FAQ has helped me greatly (especially lesson 48), but I'm afraid it doesn't answer my specific questions. So, in finality, I would like to know if someone could help me figure out the answers to these questions: -Should I attempt to secure this job? -What other (better) alternatives are there? -Somewhat unrelated, but what course of college study would you recommend for me? (Software engineering or a variation thereof, obviously, but more specifically, I need to work Japanese studies in here somewhere, either on my own time or via classes. I realize it takes much dedicated hard work to learn a language, but I believe I have what it takes. The problem here is that some people swear that language courses simply do not work. Is this really the case?) Thanks for for your time and I look forward to your valued responses.
  15. Kuraitou

    Tiles sets.

    Welcome to the forums! Generally, yes, you will have a "stage" that loads in data specifying which tile goes where. The programmer usually doesn't have to place these tiles by hand, but it's not rare for a text-based format to be used and written by hand for small games. In many cases, people will make map editors do this work automatically and simplify the process greatly.
  • 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!