• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


  • Content count

  • Joined

  • Last visited

Community Reputation

132 Neutral

About belgreth

  • Rank
  1. Hm, writing to a MemoryStream then sending that off sounds like a solution, thanks hplus. As far as world data, it's split into cells and players can change most aspects of it so I have to save everything, at least the active cells. You bring up a good point about item duplication...but I'm not at that hurdle yet. My server/client is small scale (think minecraft). It's aimed for 2-8+ people to play together in a persistent world. I'm trying to stay away from having to deal with databases like mySQL as I'm mostly illiterate in that area. If I can just keep everything saved in binary, that would be ideal.
  2. I'm not too sure how to go about this. I'd like to have the server save the game world and client data every so often but how would I do this while server is running and clients are connected to the server? Currently everything is saved in binary which I hope to keep doing. The world file + clients is roughly 160mb currently. I'd rather try to spin off a thread to slowly save everything instead of stopping everything for a few seconds for it to do its thing, however I'm not sure if that's the best way or how I can do this without adding locks around every code that changes client/world data. Any tips?
  3. I don't believe so. Isn't that what SpriteSortMode.Deferred means? No z sorting, just draw everything on top of each other in draw call order? Plus I'm not specifying a depth when drawing any element i.e. [source lang="csharp"]sb.Draw(mapBiomeColorTexture, mapRect, new Color(1, 1, 1, 0.2f)); [/source]
  4. I'm stumped on how to fix this issue. I draw the map using a scissor rect during spriteBatch and later I draw my paperdoll however the scissor rect for the map is cutting off the paperdoll model somehow. Here's an example of it: [url="http://imageshack.us/photo/my-images/842/scissor1.jpg/"]http://imageshack.us...2/scissor1.jpg/[/url] [url="http://imageshack.us/photo/my-images/543/scissor2.jpg/"]http://imageshack.us...3/scissor2.jpg/[/url] I'm drawing part of the map via: [source lang="csharp"]sb.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearWrap, DepthStencilState.None, scissorRS); scissorRect.X = mapElementRect.X; scissorRect.Y = mapElementRect.Y; scissorRect.Width = mapElementRect.Width; scissorRect.Height = mapElementRect.Height; // Make sure rect doesn't go out of bounds of screen if (scissorRect.X + scissorRect.Width > screenWidth - 1) scissorRect.Width = screenWidth - scissorRect.X; if (scissorRect.Y + scissorRect.Height > screenHeight - 1) scissorRect.Height = screenHeight - scissorRect.Y; sb.GraphicsDevice.ScissorRectangle = scissorRect;[/source] The paperdoll is drawn after the map. I believe it has to do with depth as setting device.DepthStencilState to none draws the model fully but of course it's inside out at that point. However I set depth to none when drawing the map. Any ideas? [b]EDIT :[/b] Ok I feel silly. After combing my code for the past two hours there was one line when drawing the map outline that was setting DepthStencilState to Default during spritebatch.Begin() that I kept missing. Case closed!
  5. I decided to put the received message processing back into the main thread. I am unsure why I originally had a separate thread that only processed incoming messages from the server. I'm also unsure what I was thinking when I put the whole draw call into the lock when I could've just held the lock long enough to copy the world variable into a temp matrix and then call draw... I already have 2 threads for networking, one that only listens, and stuffs the packet into a list and immediately goes back to listening and another thread that just decodes the packets into messages. My locks for those things seem to be working as I haven't had any race conditions or out of index errors yet. In fact there's no need for the second thread as well, I can stuff that into the main thread too. I agree, keeping it simple is best. I am not aware of polling so I'll definitely be looking into that. Thanks for the reply rip-off. EDIT: Well after putting the message processor in the main thread I was still having the same issue so apparently the locks weren't the problem to begin with! The direction wasn't getting normalized for the player when calling unitContainer.otherPlayers[index].Direction.Normalize(); It works when I did: unitContainer.otherplayers[index].Direction = Vector3.Normalize(unitContainer.otherplayers[index].Direction); If anyone has any idea why the first one didn't work I'd love to know.
  6. I was fairly sure I had my locks correct until I had my network thread update the direction of players during state changes. So whenever players turn they get distorted for a bit when changing directions. My setup is briefly as follows: [source lang="csharp"]public class UnitContainer { public static readonly object OtherPlayersLocker = new object(); // i tried non-static as well List<Player> otherPlayers; // ... }[/source] I pass the unitContainer to all the classes that contain threads so they can access the player list and any time a thread accesses and/or modifies player data they call the lock (such as) [source lang="csharp"]lock (UnitContainer.OtherPlayersLocker) { unitContainer.otherPlayers[index].Direction = msg.messageList[i].direction; unitContainer.otherPlayers[index].Direction.Normalize(); }[/source] The problem goes away when I normalize the direction before setting it to the otherplayer. But regardless, the way I have it set up, it shouldn't matter if I do or not. My guess is either the Draw call is drawing while the world variable is being updated, or the world variable is being updated after direction was set but before it was normalized. However if everything is in that lock (including draw call)..how are the two threads modifying/accessing the player data at the same time?
  7. Thanks for the replies jeffery, that might actually fit my needs. I dont need elevation, more symbolic than anything topographic-wise. I'll try generating a low rez version of the world and use an orthographic camera and see how that works out. This'll even let me do some lighting so it's not plain looking.
  8. [quote name='jefferytitan' timestamp='1342143924' post='4958619'] Depending upon the technology used, I would think you could just render the map using a separate camera facing down in orthographic mode with low resolution, low LOD, skip animated models and most effects turned off. You could put a mask in a texture for a shader to do fog of war. [/quote] Hm, that won't work for viewing the whole world (as it would be too much to draw) however I do like that idea for a local 'radar' type map *adds to todo list*. I'm looking for a decent looking full world map that can be zoomed and scrolled around and possibly have highlightable icons on it. The icons and zooming/scrolling I can figure out, I just need something that isn't plain and boring to look at.
  9. I'm having difficulty searching for any sort of tutorial for drawing interactive in-game maps as any search with "map" usually comes up with terrain and game level stuff. As the game world is procedurally generated I can't pre-fab maps so they'll have to be created during world generation. Currently I just have a boring biome map being generated but I'm hoping for something with more pizzazz. [url="http://www.imageshack.us/photo/my-images/254/biomemap.png/"]http://www.imageshack.us/photo/my-images/254/biomemap.png/[/url] (Tried to make an image link but didn't seem to work) Eventually other markers such as towns and forts would need to be drawn on the map as well. The map will start out with a fog-of-war and will fill in as the player moves around in the world. Does anyone know of any popular techniques/shaders for drawing in-game maps?
  10. Thanks for the responses guys, I'll just stick with UDP only then and keep it simple. hplus, your answer is great but it also makes me go "[b]Now why didn't I think of that!?[/b]", especially considering the terrain generation is still on the client side as I was testing it there to get it all working first... ugh [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]! samoth - I guess I was first looking for an easier answer to trying to send all that data instead of creating a way to handle breaking the cells into parts and getting them all to the receiver and reassembling them. Thus my first thought was TCP since I can just pack the cell in one large array, stream it and let TCP handle the breaking and re-assembly and at receiving end just expect a certain size. Plus that's good advice about players hanging close together, I'll be keeping that in mind. Thanks again everyone.
  11. To learn both protocols I had recently made two server/client models each using the UPD/TCP to practice interpolating movement and chat message packet handling. Now that I understand both protocols more I'm curious how best to go about my actual game server architecture. The server generates the world procedurally and will need to send large chunks of data: when a player first logs in, or when a player moves to a new cell and needs that cell's height for vertices, and static models, etc. (Cells will be saved on client's computer once downloaded) While making the two test server/clients I came to really like UDP more however I can't just stuff 80k+ worth of data into a single packet and I need reliablity for the packets. So I figured instead of trying to implement a layer over UDP to make sure I get several packets' worth of data for a single cell, I could use TCP for those packets and just stream the data. However, I prefer UDP for movement and other details that are time sensitive so my question is - Can't I just use two separate ports, one for TCP traffic and one for UDP traffic? Have the client send requests for cell data on TCP port, and clients/server communicate over UDP for position, action responses, etc? Is there some none-obvious hurdles I might come across?
  12. Hello everyone! I've run into a big problem and had no idea how bad it was until I started tackling the GC. I have my terrain in chunks and I load in new chunks as the player walks around in another thread. During the loading, and I've narrowed it down to when using binaryreader, I see massive amounts of boxing. This causes the GC to be called about 16 times in a row. This problem only exists on the XBOX and when testing it on my PC, my PC and CLR profiler doesn't show any problems. My google fu has failed me as I can't find much anyone else talking about using binaryreader with xbox. I tried using xml earlier in the development but the files ended up being huge. I have to really crunch the data down so it'll all fit. Anyone got any ideas or leads? Appreciate your time! (Btw, pic of remote performer during the 3-5 seconds when loading data, and a link to a portion of my loading method if anyone is curious) [url="http://imageshack.us/photo/my-images/829/snapshotsq.jpg/"][img]http://img829.imageshack.us/img829/4241/snapshotsq.jpg[/img][/url] [url="http://pastebin.com/cTUvaUA8"]http://pastebin.com/cTUvaUA8[/url]
  13. Hi everyone, I have all my game data in binary format and as the player moves around the world, the game will load in chunks for the terrain. Now, the loading is in a separate thread but the game can stutter due to the garbage collector being called numerous times while I'm loading in the new data. The gc is apparently being called when I do : [font="Courier New"]using (FileStream inFile = File.Open(filename, FileMode.Open, FileAccess.Read)) { using (BinaryReader br = new BinaryReader(inFile))[/font] { etc. } } I've located all other instances of when the gc is being called and got rid of all but 2 of them and when I'm not crossing chunks gc is only called around every 15 - 20 seconds. Is there a way to load the data when needed without having the gc called? I'd love to just have everything loaded during the whole game but I believe the terrain data alone will exceed the xbox's memory eventually.
  14. [quote name='NEXUSKill' timestamp='1306270157' post='4815302'] How you store your vertices is pretty much irrelevant, use VertexBuffer and IndexBuffer to represent each mesh, the vertices transformation or positional data should be in the coordinate space of the object they represent, that object should have its own transformation in world cell space, and the world cell should have a transformation relative to an absolute world, however like I said, that last transformation should be transformed to camera space to reduce precision loss. Look up nested transformations and coordinate spaces. [/quote] I think I got it! My character's face no longer has cracks in it. You're correct, I didn't have to touch the original positions of my terrain. In case anyone was curious, all I did was: Create view matrix with position zero instead of absolute position so camera is zero point. Then when drawing my terrain/models, i created a transform by Matrix.CreateTranslation(Vector3.Zero - camera_abs_pos); and passed that along to the shader as the world. That was a lot easier than I was anticipating. Thanks for your help Nexuskill!
  15. Wow thanks for the replies guys! Radikalism - I have the terrain scaled by 5 so I guess that'd be 5units for 1 meter? I'm really trying to figure out how to scale everything that works best. Each terrain chunk has a coord with coord 0,0 being at the 0,0xz absolute position. I only stay in the positive quadrant just to make data managment easier. So I was putting my character in an arbitrary far bottom right corner to see how things worked. Currently, I just take my character's absolute position, figure out which coord the character is in, that ends up being the center chunk and i draw 8 chunks around that chunk. Everything is in absolute positions. braincell - That chart is pretty awesome. I did notice pushing the near plane up to 6 or 7 really helped the z-fighting but at that point, my camera would start clipping through the terrain and I could see through the terrain. I guess I could increase the distance the camera could get to the ground but it already seemed big enough. (Camera freely rotated around the player's character) nexuxskill - I think that's what I was trying to figure out how to do. You are right on how I set up each chunk's vertices. Instead of using the center of each chunk, could I use the upper left (0) vertex of each chunk? (The vertices aren't stored in a 2d array, just a single array) I'm having trouble mentally figuring how to set this up. Currently the vertex positions are in absolute. I would need to instead just set their positions to "local" position based on the upper left vertex? Which would make the position for vertices in every chunk the same actually. So then, if I'm correct so far, I need to determine the transformation matrix for each chunk based on that chunk's 0,0 position to the camera's position? I'm using XNA so would that be something like: Matrix transform = Matrix.CreateTranslation(chunk's_upper_left_abs_pos - camera_abs_pos); And when sending the "World" effect parameter just send that transform instead of Matrix.Identity ? Would that be correct? Again, thanks for the replies guys, gave me some mental food to munch on.