dwn

Sign in to follow this  
  • entries
    25
  • comments
    16
  • views
    18989

Minor game

Sign in to follow this  

411 views

Added #define statements around some code blocks to make them optional to compile, and now adding a method to blit the background image fullscreen, 256-color paletted, and stretched. The best part is, I can use the 1MB (inverse) z-buffer to store the background image, since this is a nonocclusional game, and reuse it during 3D segments! That gives 2048x2048 as the ideal resolution for the stretched background image - that's just the right background size for good gameplay, I'd guess! (If you like specialized functions, then this is a good example of why it is best to write your methods as you use them.)

There really is not much at all to the physics of this minigame, but still I am reading up a little to refresh on the Verlet method.

Coding game physics in general can be an all-consumptive process, so these days I'm preferring to keep my eyes on task, and to follow the game design plan. I remember assembling before me the Chris Hecker articles on rigid-body mechanics - spending so many hours figuring out what it all meant, drawing out huge matrices, putting together a general rigid-body physics simulation, setting up input files, editing LinPack, and cleaning up compile issues. At the end of the process came the realization that, try as I might, there is really no good use I could come up with for ragdoll physics in a game. This was at the same time that a certain physics engine claimed to have secret, novel, and more-stable algorithms for doing all these things in 3D. Around that time, I was deciding to eschew floats completely from my code anyway. Ever since it's been only simple wham-bam physics and completely active character control for me. If there's an inexpensive or freely available integer-based dynamics library that works well with my primitives, I will probably use it and like it, but for now I'll stay away from all general-purpose high-precision engines until given a reason to do differently. Server-side physics might enter the creative domain eventually, but hopefully not.

I should now have a solid block of two protected hours per night to work on development projects, without stealing from the sandman. I'm happy about that.
Sign in to follow this  


2 Comments


Recommended Comments

Hey, Jotaf

That is a nice lib! Thanks kindly for the info pointer. Hadn't seen Box2D, although I'd seen it referenced before. The style looks pretty clean, and I'm reading that it has been ported to integer-based methods (http://www.box2d.org/forum/viewtopic.php?f=4&t=175). I might like to put a wrapper around it, or to use it for inspiration in writing a simple physics class one of these days.

For this project, it might be overkill and might not be as efficient as simply writing my own functions. I'm noticing also that it includes glut, although I'm guessing it is separable from that library. I don't know how good the integer support is yet, also.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now