Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

106 Neutral

About Timberl

  • Rank
  1. //The *starting* velocity of the banana is this (it will change): BananaVelX = strength * cos( angle ); BananaVelY = strength * sin( angle ); Gravity = -0.01; // dont worry about 9.81 - find what feels good Wind = 0; // now the came loop while( Your-Game-Loop ) { // apply velocity to banana position (velocity is change in place / time ) BananaX += BananaVelX; BananaY += BananaVelY; // apply acceleration to velocity - (acceleration is change in velocity/time) BananaVelY += Gravity; BananaVelX += Wind; } thats it.
  2. in very badly described physics: velocity is change in position over time acceleration is change in velocity over time force is proportional to acceleration, acceleration is change in speed over time, gravity is a constant force (at least for our purposes it is), so the change in speed is going to be a constant. Thus on every frame add on a constant to the velocity and you'll get a pretty good approximation to gravity. Have the velocity as a vector, on every game frame add on a constant (e.g. -0.1). Dont bother trying to work-out exact real-life values, or take into account mass etc. it wont buy you anything particularly. so if the velocity of the banana starts out at 45 degrees : ( 0.2, 0.2 ), add this on to the position of the banana every frame. But also subtract your gravity constant (e.g. 0.01) every frame from the velocity vector, (so in vector form, (0,-0.01) from the second element of the velocity every frame. If you use a vector for acceleration each time, you could easily add a wind-like effect by doing something like (0.01, -0.01) - then your banana well get 'blown' to the right as well as pulled down by gravity. (you could make the wind random each time a new frame starts, so the velocity will go: ( 0.2, 0.2 ) // its shooting up at 45-degrees ( 0.2, 0.19 ) ( 0.2, 0.18 ) // its gradually slowing ( 0.2, 0.17 ) ... ( 0.2, 0.01 ) ( 0.2, 0 ) // its reached the peak of its flight ( 0.2, -0.01 ) // now its falling ( 0.2, -0.02 ) ( 0.2, -0.03 ) ( 0.2, -0.04 ) // now its falling faster... If you want a firmer understanding, there should be a section on it in any basic (high school) maths book - it'll be under something like mechanics: acceleration / gravity on a free-body etc. Remember that in games you are trying to create a believable approximation to real-world behaviour, not produce a precise physical model - that is, you never need to worry about constants etc. too much, just find some that look about right, and never bother differentiating/integrating values - just accumulate or take differences between values between two successive frames etc. - its not physically accurate, but it is physically approximate, and thats good enough to give a very realistic feel.
  3. Then you would get an idea what other members don't like. If you post all over the place its hard to tell.
  4. electrical engineering at a guess. MS and Sony no doubt recruit from graduates in it.
  5. Timberl

    Simple problem in my Ray Tracer

    you've got a fish-eye effect it looks like, albeit accidentally. this is just you need to shrink the field of view - try shrinking the multiplying scalars you muliply your ray vectors by (assuming you're using any)... does that make any sense? what I mean is, if your ray range goes from -1 to 1 x-ways, (90 degrees) scale it to go from -.5 to .5 (45 degrees) or have I just made what I said even more confusing? i.e. shrink your field of view. The effect you have is just like a real-life fish-eye lense, if you make the field-of-view very small you'll get the effect of a zoom-lense.
  6. Timberl

    Turning An Artist Into A Programmer

    Quote:Original post by Glak "does 'made-up assembler' really count?" yes. The java byte code and .NET byte code are both made up machine languages. then by that argument what in computing isn't made-up? Quote:Original post by Glak In my assembly language class we used something similar, I forgot the name. Classes after mine studied java byte code. I wrote enough programs in it that I would not recommend that people start with an assembly language as their first language. Indeed. Assembler isnt usually the first language recommended to beginners. Quote:Original post by Glak I have not used C# extensively but its delegates offer more than java's anonymous inner classes do. C# is getting lambda expressions and the like soon, so it will be better at functional programming. It also allows the user to define value types (structs) which java does not, it also has operator overloading which makes doing generic programming simpler. Look I don't want to get into a java vs C# thing because really, if I haven't already, I will say something untrue due to ignorance. not sure what you mean about delegates and inner-classes - they're as far as I'm aware, not remotely related or comparable; inner-classes are handled subtely differently in C# and Java, but you need to be doing fairly dark-art stuff for the differences to be apparent (things like whether an inner class can access the insides of its parent class if the the parent is private :- i.e. not your every-day kind of stuff ;) ). delegates are basically just the notifier/subscriber pattern put into an operator, and while I admit they're very cool, java's extensive listener/notifier/handler structures that you see everywhere are the same thing (just not nearly as elegant). stuff that java doesnt have like structs (or operator overloading, or pointer as opposed to values/references) it doesnt have generally because they've deliberately tried to simplify what is available to what is absolutely needed, so you program to the problem rather than to the compiler. C# does have some cool things (properties, method pointers/delegates, but they're only conviniences, I dont think they could really be called 'paradigms'. Quote: I really can't stand when people talk about "OO" as being the be-all end-all of programming technology. The STL isn't OO. vector does not inherit from container. There is more to good programming than throwing the OO buzzword around. If you've ever made a mid-to-large sized application you would find OO indespensible. OO isn't the 'be-all and end-all' - its an extremely powerful approach that encourages you to modularise and encapsulate your code into independent and therefore easily reusable, easily maintainable and largely safe units. for a very small program, theres not much value in it, but as soon as you get beyond utility-sized programs, its really indespensible. No, the STL isnt OO, because OO incurs a small overhead, and the frequency with which these types get used they needed them to whistle along as fast as they possibly could, so avoided OO. Though you will notice they've been written as though they have been written to interfaces and could easily be modularised into inheritance chains. Its being written that way deliberately. The STL is unusal because of the intensive use expected of its structures. Quote: I found type-safety to be nothing other than a boon when I was a beginner, preventing me from mistakes that I might have made otherwise. maybe, if you can get your head round it, and in university where you're already going to be mature to a certain extent and have access to experts, like-minded people and receive direct teaching it wouldnt surprise me you can grasp it, but I would imagine myself struggling to understand it when I first started out. Quote: I have never recommended C++ based on speed. I truely enjoy it more than any other language that I have come across. It was the third (well forth if you count the pascall that I learned in high school) language that I learned, and both java and C left me feeling like I was missing something. They just didn't have the features that I needed. A beginner should be able to decide what he wants to program. figure out how to naturally express it, and then read the language documentation to find the features that he is looking for. I was surprised when I found that functions were not first class objects in java, or that you couldn't make a pointer (of course I didn't use the term pointer, as I didn't know it). On a few occasions I found myself using single element arrays so that I could have pointers in java. as far as I'm aware, but for a few base-types (int, char, double etc.) Java works almost entirly on the concept of pointers (which it confusingly refers to as references, but in the C sense, they're pointers, and nothing to do with C-references - I think they just wanted to avoid the word 'pointer') fucntions not being first-class objects is annoying. hopefully they'll add it soon, since C# has it. I personally went straight from QBasic to C++ & Assembler, and wrote many completely rubbish programs that were dogged by bugs, were unmaintainable, unexpandable and frankly its a wonder they ever worked in the first place. I think you need a mature attitude to programming to use C++ (or Assembler) effectively.
  7. Timberl

    Simple 2D animation

    Yes, just have an array of frames and a place holder to keep track of which frame in the array you're on and increment the placeholder each time. when it goes past the end of the array (in your current example, 4) set it back to zero (start of the array). hopefully this should get the idea across : psuedo-C -------- // size of frame-array int pacmanFramesSize = 4 Image pacmanFrames[] = new Image[ pacmanFramesSize ] for( i = 0 ; i < pacmanFramesSize ; i++ ) pacmanFrames[ i ] = loadPacmanFrame( "pacman" + i + ".tga" ) // in-game frame position int pacmanFramesPlace = 0 // .... // in the game loop: Frame currentFrame = pacmanFrames[ pacmanFramesPlace ]; pacmanFramePlace++; if( pacmanFramesPlace >= pacmanFramesSize ) pacmanFramePlace = 0; [Edited by - Timberl on November 21, 2005 8:07:30 AM]
  8. Timberl

    Turning An Artist Into A Programmer

    does 'made-up assembler' really count? and what 'paradigms' does c# have the java doesn't (surely java is object-oriented and structured? which cannot make it single paradigm?) - besides who talks about 'multi/single paradigm' outside of academia? much more important than 'single' or 'multi' paradigm is simply that a language provides object-oriented and structured - which nearly every serious language around these days is. you need OO for maintainability and modularity in big projects you need structured for robust and maintainable/debuggable code frankly I think that typing is a hassle beginners (I stress the word beginners) can do without. C++ is probably the hardest language to learn out of all those you listed (that said I must admit I dont know 'made up assembler'). I dont think I would have ever got into programming the way I did were it not for the easy as hell, interpretted BASICs. Compile time type checking is important for creating big systems that aren't going to cave in when something unexpected happens (and for limiting the ability of unexpected things happening), but for a beginner? with a tiny program? its proabbly not so necassary. C++ is recommended for games programming because traditionally games have needed to squeeze every last bit of speed out of a program and C++ gives you a hell of a lot of power to get close to the processor and tweak speed out of it(and a hell of a lot of rope to hang yourself with in the process). I'm not sure your experience with C# and Java, but they really are so similar as to be indistinguishable on language merits alone. (the argument of stodgy yet platform-independent java vs lean but platform specific native win32 C# is a stickier area) C#, despite what MS spin doctors might say, is really Microsoft's answer to Java - there is virtually nothing that is in one and not in the other language-wise (and when something new comes out in one rivals product, the other rushes to implement it in theirs too anyway) - they even share most of the same class & helper names. Anyway, to the original guy. Pythons probably easiest to get your head round in the beginning. C++ is probably next best for game programming. But start small and build-up if you're serious about it. Quote:Original post by Glak "Could those who know multiple languages (And know them well) and still suggested C++ please raise their hands? No one? I thought so." I know and have used: java C C++ some made up assembly language Scheme Python I also know bits about other languages I recommend: C++ or C# I would not recommend java, C, or Scheme due to their single paradigm natures. I would not recommend Python due to its lack of compile-time typing. I think that a good beginner's language should be multiparadigm and statically typed. It should also have (this is probably even more important) good error messages when you make a syntax error (see, this is why you need compile-time typesafety), the ability to get a program working without too much hassle, and strong documentation.
  9. Marvellous guys, since getting the platform SDK etc. (and then spending many hours trying to configure it) I've got it working - at bitter last. Thanks a million
  10. Quote:Original post by Michael Tanczos Gentlemen, please keep the conversation civil. Timberl, for future reference, try to ignore the trolls on the board. They just get you into trouble that you don't want to be in. --- Michael Tanczos okay
  11. Quote:Original post by TheMeatMan RTF Dox. STFU TMM do you know how sprawling the 'Dox' are for VS & dotNet - esp when you're new to a language and dont know what the problem might be? U T1T
  12. Timberl

    Working conditions

    I can honestly say :- f* any company that expects more tha 8hours a day as a matter of course. How can you have a family / g/b-friend / friends / life if you permanently have 2 hours free time a night and use your weekends to recover? I personally am contracted 8h/day and happily put in 10h/day because I enjoy the work. I dont resent it cos it is my choice. There isnt pressure to work more, and the company gets the best out of all of us. However in the past I've worked for jokers who tried to squeeze every last drop - would take holiday out of our pay, would pay beneath minimum wage (in some cases - I was one of the lucky ones that got a pay-rise) and expect stupid working hours as a matter of course. I stayed with them for a long time for the 'experience' and with the promise of more being 'moved up'. I started working 9-9 and then when I got back my mind would be so active that I wouldnt be able to sleep, then I'd be up for another 9-9 the next day, completely frazzled and produce shit work the whole day and then just basically keep doing it over and over. I couldnt stop at any point because they would have words with you if you went home at say 6pm. It went on for nearly a year before I was so burnt out I could barely work. I hated the job, and I resented the hours I had to work. By now I was so regularly stressed (because I wasn't working at my best, and I knew it, and that would stress me out, and I'd have trouble sleeping/concentrating, and that would stress me out further repeat ad nauseum) that I had insomnia, would get stress pains, heart-palpatations - all-kinds. The irony is that throughout this whole time, I probably only ever functioned at about 20% of what I'm capable of, simply because I was so worn-out all the time. By making us work for 30% longer than we should have been, they got -60% efficency out of us - since half our time was spent just undoing the crap we'd written the night before. Finally my work-output became so low that I got made redundant (they wouldn't dare fire us beacuse of the illegal working conditions they were operating in), and I nearly jumped for joy. I just wnet home and slept solidly for about a week. What I learnt from this experience is that, if your company expect stupid hours from you, its usually because they simply haven't employed enough staff - its bad management and you should avoid them like the plague. You wont get 'work experience' - you'll barely learn because you're so exhaustedand get health problems and start to hate even looking at a computer anymore (I barely even went on the internet back then because I just wanted to be away from the damn things :) ). They'll give promises of you 'moving up' in rank, and getting more responsibility and this just being a 'phase' - look, they're already understaffing - where is this vacancy going to come from? A good company is worth holding out for. and a good company is simply, a company who expect realistic hours (though of course there are times when deadlines loom that you will have to work more - but they wont need to ask you, because you'll be happy doing it for them), who allow holidays and who are prepared to advance and train you, and who will listen to your ideas (even if they dont necessarily use them) - thus build your confidence as a programmer. If you find yourself in the first category of company, all I can say is: get the hell out. book some time off, get your CV out and get to interviews and get out of there.
  13. Have just started using VC++ for the first time, bizarrely, cannot seem to include windows.h from VC++ (visual studio 2005 express edition) #include <windows.h> using namespace System; int main( array<System::String ^> ^args ) { return 0; } when I 'build solution' it says: Quote:fatal error C1083: Cannot open include file: 'windows.h': No such file or directory I thought this would one of the files that would definitely be included in any VC++ project. I've very little expreince with the vs/vc++ ide and cannot even figure out how to include a .lib file, so please spell things out to me. I'm trying to get this file because I want to use ::LoadLibrary( ) - which I think is defined in windows.h thx
  14. thanks. That worked 'objdump' in gcc unforutantely, I'm even more confused now, because the symbol tables completely empty. but thanks
  15. Are there any good .dll -viewing utilities out there? (/easy ways to view the symbol table of a .dll -- i've tried looking through the binary but its hard to know what are procedures, text, structures, variables etc.) I'd like to look through the actual symbol-table of a .dll (since I think the interface I have for it is incorrect)
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!