Jump to content
  • Advertisement

Squirm

Member
  • Content Count

    582
  • Joined

  • Last visited

Community Reputation

481 Neutral

About Squirm

  • Rank
    Advanced Member
  1. Squirm

    Please enlighten a noob

    Can I add Irrlicht and Lightfeather to the list of engines worth looking at? Both free, both quite similar, both very easy to get going with if you know C++.
  2. We had one of those never ending "singletons are evil" discussions in #gamedev last night, in which I argued in favour of the use of a singleton for the logger class which handles debug output, warnings, errors, etc. I want one, I only want one, Having two would be detrimental to its purpose, I want it everywhere, and I want it everywhere for a good reason, not because of a poor design. Washu, of course, pounced upon the term "singleton" like a rabid mongoose, and then asked why I didn't use a monostate. 15 minutes googling later, I feel I have a good grasp of what people think a monostate is. I also have no idea why it is in anyway preferable to a singleton in this case. I'm not trying to start a flamewar, I'm just asking for an explanation of why I would want to use a monostate in this case. One page went so far as to claim order of destruction was a problem with singletons, and then went on to completely fail to explain how a monostate improved on that, so my best guess so far is some sort of reference counting? [edit: please don't bother to reply with an "I love singletons" post - that's not the question I'm asking ;)]
  3. Squirm

    Using "delete" before "new"

    Decide, the instant you allocate that memory, precisely what owns it. That thing is responsible for deleting it. Anyone else deleting it is a programming error. Any circumstance in which it can fail to delete it is a programming error. You can pass ownership, but it can never not be owned and it can never be owned by more than one object. you may find auto_ptr and boost::shared_ptr help with that, especially if you are new to the general problem :)
  4. Squirm

    level file

    Quote:I'm trying to make a C++ program that reads text (.txt) files. The text files are meant to represent the various things found in a game level (map). I need: We need: You to tell us what you actually want to do... There are plenty of tutorials out there on reading files - what exactly is causing you problems?
  5. Perlin noise gives great results, doesn't it? But don't restrict yourself... :) Your procedural world consists of any number of "fields" added together, with octaves of perlin noise being one option. Because I want to simplify this post, I'm going to be using a water level of 0. So, we want the edge to always be below 0, so let us have a field which is 0 for a large centered square, and near the edge drops in a gradient to -4. We want a general kind of island shape, so add an octave of very low frequency perlin noise with values between -2 and 2. We want a good random edge and rocky look, so add a load more perlin noise octaves at much higher frequencies, with a total possible range between, say, -1 and 1 (this is, in fact, the image you already have, being used as a detail map). Now, the maximum range you have is -3 to 3 for the islands, so in most of the map it goes from -3 to 3, and near the edges drops away to between -7 and -1. An island near the edge will probably end in a cliff, but there's not much you can do about that really - the restriction is fairly arbitrary ;)
  6. tuxracer beta is open source, runs on both windows and linux, and can be downloaded from, erm, sourceforge, I think... And I'd say it's entirely up to you how many pixels you want to use for what, but tux uses exactly one pixel of exactly one particular colour
  7. Squirm

    Problem with noise generation function.

    I find it easiest to generate all the octaves between -1 and 1, then scale them, so that when they are added together it doesn't matter how many of them there are, the result still has the same average. Then divide the result by the maximum size it could possibly have reached, then multiply by half the range you want it to reach, then add the average you want. In your case a range of 1.0 and an average of 0.5
  8. Tuxracer does what you suggested yourself for positioning trees - a simple bitmap file (it uses TGA), with green pixels on a black map, each pixel being a tree. It also has rocks and bushes and flags entered the same way, so the map editor is basically any paint program. Don't let them all put you off procedural placement though - procedural stuff is cool if you get it right, and while you can spend endless months adding clever stuff to it, a basic and reasonable algorithm is usually pretty easy, and in your case, it sounds like exactly the route you should be taking. Quote:I made a program that outputs random numbers between 1-50, and then I put those in for the posistion and it came out nice, but I cant do that x48; why not?
  9. I'd suggest you break the world up into groups of polygons, and treat each as a separate object. However, two objects hitting the same thing at the same time should work fine, so if I was you I'd worry about fixing that first, and then worry about breaking it up if it's not fast enough.
  10. Squirm

    Where Do I begin, GUI programming?

    unresolved external symbol usually means you included the header file but didn't link with the library.
  11. Squirm

    How fast does force propagate?

    staaf is right - a wave will be formed which will travel at the speed of sound. Infact, it is a sound wave. The fact that it is an extremely high wavelength / low frequency sound is beside the point :) The equation for the speed is here if you want it: http://online.cctt.org/physicslab/content/Phy1HON/lessonnotes/waves/stringtension.asp After reading that, consider what happens if the wire being waved get's thinner as you go towards the end . . . this is the basic principle behind cracking a whip, which behaves a similar way, although it's a different kind of wave
  12. Squirm

    homeing to a certain point

    I suppose I am ... except without all the hassle of the sin and cos functions :) Basically, I stay in cartesian space, instead of converting from cartesian into polar (finding the angle with atan2) and then converting back again (with sin and cos).
  13. Squirm

    homeing to a certain point

    A little bit of vector maths sneaking in here ;) The 'distance' 'vector' is the line going from you to the target, so it is pointing towards the target and its length is the distance between you and the target. The 'direction' vector is the line pointing towards the target which has a length of 1. This is useful because this unit length is what means you can multiply by speed to get velocity, multiply by thrust to get acceleration, etc. Basically it allows you to convert a single number value, like speed (a scalar) into a two or three value number, like velocity (a vector). In your case you want to convert spaceship speed into an x speed and y speed, so it is perfect. To get the direction from the distance vector, you can just divide the x and y components of the distance by the total distance, which explains the second two lines you quoted. The first line you quoted is from pythagoras' theorem (I might have spelled his name wrong there) - the length of the line which goes X to the right and Y up is sqrt(x*x + y*y)
  14. Squirm

    Poor speed in Lua?

    Skeleton was pretty much there. The thing you want eventually is "lua_pcall". Isn't the syntax in lua itself this though: function DoStuff() ... end ?
  15. Squirm

    Poor speed in Lua?

    DoFile every frame? DoString every frame? Isn't it better to put the lua code you want to run in a function, load it once, and then call the function every frame?
  • 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!