Curious about recording input on harddrive for later access in game loop
I'm currently having a blast programming right now. This is the first time i've ever done what I consider real programming and it sure is fantastic. I'm using fixed time steps right now, and my input function is seperate from my logic and renderer. I need a way for my input and text strings to later communicate with my game logic and the renderer. I was reading somewhere that saving the input and text logic to the harddrive for quick access later on the game loop is a really great system for my current programming paradigm. Have any of you tried this? How many ms does it take to read and write to the harddrive? We're not talking War and Peace here, probably just an average of a byte or two. Spikes of 100 or 200 bytes when chatting is going on. Also it seems very flexible if later I want to add the feature of a user recalling old text. and stuff. Thanks for any help or ideas. Creating Games rox!
*Sorry for any grammatical, spelling, or otherwise sloppy errors. Programming and school is replacing sleep, and caffinee is effecting my dexterity. This is a good thing when I'm coding of course :] 120+ wpm! Oh and the brain is a little.. Non-Linear at times.*
Saving to the hard drive for later use in the loop? That seems like a lot of extra work and a potential performance problem. How about using a standard queue in memory?
That's what I think would be the most effecient method as well. But I'm still curious to hear what other people have tried with this, or just their ideas.
disk I/O sloooooooow. memory big. use a dynamic memory structure like the std::queue mentioned before. writing to a file will make your app run like molasses.
-me
-me
What I do (which probably isn't the best way) is set up a seperate input class in my games. I then make various event duch as KeyUp, MouseRightDown, MouseMove, etc. I then use my driver class (Form1) to collect these messages then send them to the appropriate classes on the next render loop (mainly the camera class). These classes will then handle the input however they need to. I like this method because it is easy to set up (at least in .NET/MDX) and it runs fairly efficiently.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement