Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

112 Neutral

About Xardov

  • Rank
  1. So i'm coding some biome generation, and what happens is that a tile gets placed randomly, then checks to see if the area around is empty(doesn't contain another tile). If it is, then it generates another tile of the same type. So to test the code, I placed one tile in the middle of the map, which is a 2D array (50x30). However, after generating a few tiles (https://dl.dropbox.com/u/13907487/nowherenearbounds.png), it suddenly stops and gives me this error - https://dl.dropbox.com/u/13907487/outofBounds.png What confuses me is that the tiles are nowhere near the bounds, so why is it giving me an out of bounds error? Code here - https://gist.github.com/2959279 Strangely however, the trees you see in the image use the same code for replication. https://gist.github.com/2959318 BUT, if I don't do this if (!isInfected && (rnd.Next(0, 100) < k3) && locAvail) { Replicate(); //isInfected = true; } and do this instead in the update function Replicate(); it gives the same error as the tiles. Not sure why, but perhaps the condition of having it replicate has something to do with it? (https://gist.github.com/2959321) - replication conditions I've tried to find a solution for a long time, but the problem still evades me. =(
  2. I have a 2D array that represents the map. 0 equals no tree, 1 equals tree. I want to be able to remove a tree from the tree list at that specific location if the 1 changes to a 0.
  3. [font=arial,helvetica,sans-serif][color=#000000][1] http://pastebin.com/77vx6HZx[/font] [font=arial,helvetica,sans-serif][color=#000000]Hello! I've got some code here that places trees based on whether the position in the 2D array has a 1 or 0 occupying it. If it is a 1, it places a new Tree at the location, and if it is a 0, it should remove the tree. I have two problems though.[/font] [font=arial,helvetica,sans-serif] Because the trees are stored in a List<>, using Remove() on them will only remove the first tree in the list, and not the tree at the proper coordinates, trees[x,y]. I need to be able to remove the trees at a specific position in the array.[/font] [font=arial,helvetica,sans-serif] I also need to be able to check if a tree is already in the tile before adding a new Tree. However, I have no way to do this. In the code, it merely checks for a 1 in the array and adds a tree based on that.[/font] [font=arial,helvetica,sans-serif][color=#000000]Got any tips for me? [color=#000000]Language is C# with XNA[/font]
  4. Xardov

    2D Forest Generation

    Hmmm, I guess i'll go with this method then. Perlin noise is way too complicated. I just have one more question, you said that I could place a tree next to another tree depending on whether the terrain is flat enough, or has sufficient light. How would I calculate those values in the first place without using perlin noise? =(
  5. Xardov

    2D Forest Generation

    Yep, that's what baffles me. A lot of articles deal with implementing your generated perlin noise, but none of them explain perlin noise well enough for me to understand, nor do they show you how to create perlin noise. Wouldn't that cost a lot of speed though?
  6. Heya, i'm making a 2D game with rogue-like terrain generation, and was wondering what is the best way to generate a forest? I've looked into generation via perlin noise, but I couldn't find a good tutorial that thoroughly explained all the concepts. Is there a simpler way that creates perlin-noise like generation?
  7. [color=#526569][font=Verdana, Arial, Helvetica, sans-serif]Thanks for your reply! I think I did something pretty close to what you told me to do, but I still got an error. I created an empty DrawableGameComponent called DrawHelper, then created a variable for it in my 3DObject class. Then I proceed to use mesh = drawHelper.Game.Content.Load<Model>(modelName), but then it points to that line and says "Object reference not set to an instance of an object.". And yes, I have added the DrawHelper component to the Game before adding the 3DObject class. What am I doing wrong? [/font] [color=#526569][font=Verdana, Arial, Helvetica, sans-serif]EDIT: Here is the code for the 3DObject class. http://pastebin.com/379GnCh1 [/font]
  8. So basically, I followed this tutorial and made a bounding box. Here is the code. However, as you can see, the bounding box in that paste is a DrawableGameComponent. I would like to convert the entire thing to a standard class, and I believe that I can do so easily. However, one line of code is giving me trouble, and it is this one. mesh = Game.Content.Load<Model>(modelName); As far as I know, Game.Content.Load is only available to GameComponents. Is there any equivalent line of code that does not require extending the DrawableGameComponent, and can be used in a blank class?
  9. Xardov

    XNA Bounding Boxes

    Mm-hmm... Thanks then, I guess i'll just have to extend the content pipeline.
  10. Xardov

    XNA Bounding Boxes

    Well obviously you're going to need the positions of the model's vertices in order to determine the min/max positions. Without that information the best you could do is generate a bounding box that surrounds the bounding sphere of the model - but that will generally be too large (maybe it's good enough for your purposes though). It's difficult to get at the Model class's vertex positions at runtime. That's why most samples you see involve extending the content pipeline - because at that stage you have access to the vertex positions. [/quote] Oh, I see. What if my model didn't move at all? Say for example, a cube that is simply placed into the world, and does not move. Would it still be hard to create bounding boxes then?
  11. Xardov

    XNA Bounding Boxes

    Well, I'm having difficulty comprehending where the min and max positions should be, since I have no way to actually measure the height and width of the model.
  12. [color=#4A4A4A]So I'm following the 3D tutorial in this book: http://www.amazon.com/Learning-XNA-4-0-Development-Windows/dp/1449394620/ref=sr_1_1?ie=UTF8&qid=1328935412&sr=8-1[color=#4A4A4A]. [color=#4A4A4A] But for collision, the book uses BoundingSpheres instead of BoundingBoxes. I've done extensive Googling, but the tutorials i've found seem to overcomplicate the issue, because most of them try to extend the Content Pipeline, which I do not want to do. I would really like to know how to use BoundingBoxes, so if someone could kinda show me how? If you guys really have the time, I would also really appreciate it if you would actually implement the BoundingBoxes in the sample game.... because I kinda learn best by example. But just showing me the steps is great too. [color=#4A4A4A] http://dl.dropbox.com/u/13907487/3D%20Game.zip [color=#4A4A4A] But yeah, I hope I don't sound like an annoying noob who's begging for help, but I really want to learn to use BoundingBoxes. Thanks! [color=#4A4A4A] P.S. Also, yeah I know I posted a topic about this before, but that was in the wrong section.
  13. Xardov

    what i have to learn to develop a game ?

    If you know absolutely nothing, it would be a good idea to pick up a few beginner's books. Recommended languages are GML, C# with XNA, and AS3. You will NOT be able to program 3D games in a few months. This is a very common mistake people make; they think that programming is easy. It is not. You will have to start slow with 2D games first, then move into 3D. Here's a book for XNA: http://www.amazon.com/XNA-4-0-Game-Development-Example/dp/1849690669/ref=sr_1_1?ie=UTF8&qid=1328624828&sr=8-1 I think XNA is the best way to go, but if you know nothing about programming, I suggest you use a simpler, language, like GML or AS3. Here's a link to a really simple IDE(Integrated Development Environment) called GameMaker. It uses a language called GML. http://yoyogames.com Annnnd... if you want to develop flash games, try this: http://www.senocular.com/flash/tutorials/as3withmxmlc/ There's a LOT of flash development tutorials on the web, you just gotta look around. You also might wanna use a library with AS3, as that greatly simplifies development. Just remember, game development is not for the impatient, so if you get into this, be ready for some (or a lot) of frustration. I wish you luck with your learning!
  14. Xardov

    XNA 4.0 Bounding Boxes

    Thanks guys for your responses. So, just to clear things up, where is the origin of a model? I assume top left corner?
  15. Xardov

    Picking a Language For a Beginner

    I don't think you should start with C++, as that is one of the hardest languages, and it you'll have to build everything from the ground up if you want to make a game. Try C# with XNA 4.0 instead.
  • 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!