• Content count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About Intrawebs

  • Rank
  1. Sharing Windows XNA Games?

    Once you have used the debug menu in visual studio to clean the solution and package your game you can do something similar to what I just did for my first game. Post about it on your blog, frap it and share the video, and offer up the source code as well.
  2. XNA Quicks - My First Game

    Quote:Original post by EJH Looks pretty good. =) I'd suggest: (1) different color pieces and (2) sound effects when you spin a piece, when a piece hits bottom, and when you clear a line Feedback on user actions is everything in games, and sound is probably 50% of what provides good feedback. I started with different color pieces and it looked odd. Great feedback on the sound effects that are needed, didn't even think of those. Thanks!
  3. I finished my first game. It's a Tetris kind of thing, but with limited time to get the high score. Think of this as the highest 5 levels on Tetris one can normally get to. Anyway, I had a blast making it, the source code and installer are all at my blog. Feedback welcomed. The only bug that I know of is the spacebar doesn't work well on level 5, however, you wont be using it at the level anyway lol. :) Here is the source code and video. PS. The source code is horrible, not all best practice stuff there.
  4. Quote:Original post by Michael_B Ah yes, that obviously works. I thought you were trying to implement an auto-repeat feature. That's were RepeatRateHz comes in. I might do that for the down key press, so your contribution is still valued. :)
  5. Quote:Original post by Michael_B To solve the problem you need, like Moe said, a snapshot of the keyboard state from the previous frame. This snapshot is needed to detect freshly pressed keys. Im really hitting myself now. In the XNA documentation it describes exactly how to get keyboard input and compare to a previous state. When I did that (long before I made this thread) I was setting the gaming timing manually as I described earlier and this prevented any input from happening. Now, by just comparing the state I don't need to use your RepeatRate to slow down the input checks. The code below works PERFECTLY now. Thanks everyone. protected override void Update(GameTime gameTime) { UpdateInput(); if (!_gameStarted) { NewGame(); _gameStarted = true; _startTime = gameTime.TotalGameTime; } else if (gameTime.TotalGameTime.TotalSeconds - _startTime.TotalSeconds > 1) { Move(0, 1); _startTime = gameTime.TotalGameTime; } base.Update(gameTime); } private void UpdateInput() { KeyboardState newState = Keyboard.GetState(); if (newState.IsKeyDown(Keys.Escape) && !oldState.IsKeyDown(Keys.Escape)) { UnloadContent(); this.Exit(); } else if (newState.IsKeyDown(Keys.Down) && !oldState.IsKeyDown(Keys.Down)) Move(0, 1); else if (newState.IsKeyDown(Keys.Up) && !oldState.IsKeyDown(Keys.Up)) RotateBlock(); else if (newState.IsKeyDown(Keys.Left) && !oldState.IsKeyDown(Keys.Left)) Move(-1, 0); else if (newState.IsKeyDown(Keys.Right) && !oldState.IsKeyDown(Keys.Right)) Move(1, 0); oldState = newState; }
  6. Quote:Original post by Michael_B However, the default setting would be much too fast for your Tetris. You should slow it down to say 20 Hz. 20 was still too fast, 10 is much better, but, see below.... So, my original problem was caused by a hidden line of code, my fault "TargetElapsedTime = new TimeSpan(0, 0, 1);" (I'm hidding in a corner now lol). However, the problem Michael_B thought I had I actually do have. See below for whats happening now. Basically, I think XNA is missing my keypress's. PROBLEM: A .1 second TimeSpan between checks of a keypress does prevent the problem of a single keypress moving a tetris piece at light speed, however, it seems to miss a keypress very eaisly. Also, Setting the TimeSpan between checks of a keypress to .08 of a second instead of .1 is too fast as UpdateInput() gets called too often for a single key press, making the piece move too fast. No matter what, it just cant come close as the key press causes the piece to move too fast, or, miss too many key press's. I know it sounds nit picky, but, a tetris piece move should respond instantly without a noticable delay to the user. private const double RepeatRateHz = 1000 / 10; private double _keyRepeatRate = RepeatRateHz; protected override void Update(GameTime gameTime) { double elapsedTime = gameTime.ElapsedGameTime.TotalMilliseconds; _keyRepeatRate -= elapsedTime; //get keypresses for moving a block left,right,down and up for rotate shape if (_keyRepeatRate < 0) { _keyRepeatRate = RepeatRateHz; UpdateInput(); } //setup the game if (!_gameStarted) { NewGame(); _gameStarted = true; _startTime = gameTime.TotalGameTime; } //standard tetris "move a block down every 1 second" else if (gameTime.TotalGameTime.TotalSeconds - _startTime.TotalSeconds > 1) { Move(0, 1); _startTime = gameTime.TotalGameTime; } base.Update(gameTime); }
  7. Quote:Original post by Michael_B The Update method is the correct place for your input handler. I don't understand your question completely. Holding the key down to move the shape is standard Tetris behavior. What do you mean with simply pressing it? When I press the left arrow, nothing happens. I have to hold it down for at least 1 second before IsKeyDown(Keys.Left) becomes TRUE. It's as if the Keyboard state isn't changing/updating at the same rate or faster than Update is being called.
  8. I have the following code for my Tetris game within the Update method. I read that this method gets called 60 times/sec as a default. However, it seems I have to actually hold down the key vs. simply pressing it to get my game block to move. Should I be getting input in some other way? KeyboardState newState = Keyboard.GetState(); if (newState.IsKeyDown(Keys.Escape)) { UnloadContent(); this.Exit(); } if (newState.IsKeyDown(Keys.Down)) Move(0, 1); if (newState.IsKeyDown(Keys.Up)) RotateBlock(); if (newState.IsKeyDown(Keys.Left)) Move(-1, 0); if (newState.IsKeyDown(Keys.Right)) Move(1, 0);
  9. Browser turn based games. How?

    Quote:Original post by DrPepperCorn ...projectrockstar. I then got to thinking on how you would go about making something like this. Are there any books on this kind of thing what languages (im assuming java script, asp (dont know this)) Any sites out there exploring this Books, I doubt it. It's just a website. So books on website development (CRUD) would be a start. The only difference is some persistant game logic that runs at a set interval. Languages? Correct, javascript, and SQL. Essentially you need something on the client side (or not if you want to keep it real simple), then something on the server side for the web app, and something for the database. Research LAMP or and MS SQL Server. Any sites out there? Not sure, I would be specific in your Google searches on this, you might find something. "Persistent game world over http", "turn based http game technology (or framework)" The tricky thing with this is making sure it scales. CRUD is easy....but the time necessary for the RU in the CRUD in the context of your game needing to update every x minutes is directly related to the quantity of players and the algorithms at run time. Make sure you have enough CPU/RAM on your game logic server, and make that an actual seperate server from the one serving the website. The gamelogic server needs to retrieve the entire gamestate for everyone from the DB and essentially run a "turn" for the gamestate, and then update the DB. So you can see where that could be a long running task for the CPU and DB and of course you want it to finish quick enough where the players can still play the game before the next turn occurs. I documented the hell out of a game like this I was going to build once, but never built it.
  10. Quote:Original post by Kalagaraz The card information has to be on the server side for use with calculations. If a card does 4 damage I need to have access to that when applying damage to enemy. Also skill paths have to be server-side as well to make sure character meets proper requirements so user can't add skill points to skills he/she doesn't have access to. This should be stored on the cache of the webserver. application cache for example. Put it in the client app as well if it's needed there and make sure the client app can fetch the latest version from the web server application cache. Think of the application cache as a store for objects that persist for the life cycle of that web application (until it's restarted). Quote:Original post by Kalagaraz What I'm having difficulty is more how to design the skill "paths" so to speak. Like having it so Increased Defense cannot be learned untill Increase Health is learned. I'm not sure how to design that relation between the 2 skills in the database. Same, put all the objects (skills) with the required upgrade values (properties) in the web app cache. The game can then either run on the web server and check these values before querying the DB, or, run on the client and make a request back to web server app cache. Basically, you are running a web app and want to keep the requests to the DB to a minimum, and then requests to the web app to a minimum. You can even have FLASH use javascript to fire off a quick AJAX request to fetch data from the web server cache, and then cache the result in javascript on the response...lots of ways to approach this. I just wanted to also add is a huge payoff doing parallel programming on the game server. The more cores the better here since you are simply just crunching numbers. .net Framework 4.0 makes parallel programming a breeze with c#, one simple keyword turns a for loop into a parallel one across each core. [Edited by - Intrawebs on March 9, 2009 10:46:24 PM]
  11. Quote:Original post by MJP Learning how to be a 1337 C++ programmer and learning how to program a game are two rather orthogonal topics. The important bits of game programming utilize data structures, patterns, and techniques that are largely the same no matter what underlying language you program them in. The difference is that in a certain languages most of them can be implemented more quickly, thus allowing you to learn how to use them more quickly. Very true. I read your article just now on undo/redo. Trying to do your original solution in c++ vs. c# would take you twice as long (xml serialize/deserialize).
  12. Quote:Original post by capn_midnight Your boredom is a function of who you work for and what projects you're working on, not what language you're doing them in. Exactly....the projects I'm working on are boring, as well as who I'm working for. Hence once again wanting to do game dev. And once again needing to learn c++ to be truly marketable. I'm I totally missing something here or are some people not really reading what I post?
  13. Quote:Original post by capn_midnight I don't even consider myself very wide in my knowledge of languages. If all you're worried about is learning C++, you are seriously behind the curve. Behind? At or ahead I would say. I've done all that you have mentioned, and I'm bored and getting little/no challenge at work (C# and MOSS 2007). Anyway, it's not just learning "C++", it's learning "game dev with c++". I did C++ 7 years ago at uni and sold out to MS as well, and it paid off as well. My heart isn't behind it currently, hence moving to gamedev and wanting to be marketable.
  14. While I should probably let this thread die, I just found this excellent article on Gamasutra, a survey of many game dev execs and what middleware they choose and why/what they use for prototyping. Tons of good info here and it relates to this thread quite a bit. For the second to the last graph he states the following... "...Several people noted that are using their previous engine versions to create prototypes for the next game. But what do new studios use? It looks like they probably create one-off C++ applications, sketch things out on paper, or use Flash or Lua. I had suspected that more developers would be using C#/XNA due to the ease of quickly knocking out quick test applications with it, but only 5% of the responders said they are using this for prototype development. (However, 76% of developers are using C#/XNA for tool building.)..."
  15. Quote:Original post by Promit It's actually pretty funny. The people talking loudest about what game industry professionals use are the ones who have never been in that industry. Very good point, I wasn't aware of that. Thanks. Quote:Original post by Drilian My suggestion is to get the basics of a game loop and graphics down in a language that you already know (i.e. C#). Getting a full game running is hard enough without also throwing in a language that you're unfamiliar with. Great suggestion, I may modify my approach than from a few posts ago and start with SlimDX (havent heard of that) or XNA so I can understand the abstract necessities of whats required to get a game running etc. Then move to c++ shortly after and not have to struggle with basic game dev and c++ at the same time. Regardless, I will post my efforts on my blog overtime and keep in touch with this community. Thanks again for the help.