We love Katamari Damacy_remake (question: relative orienta..

Show what you made with Bullet Physics SDK: Games, Demos, Integrations with a graphics engine, modeler or any other application
abaraba
Posts: 56
Joined: Thu Jun 19, 2008 7:54 am

We love Katamari Damacy_remake (question: relative orienta..

Post by abaraba »

hi,

i just discovered this fantastic game called "Katamari Damacy" for PS2, and its already on the top on my list, right next to MetalGear and ShadowOfTheColossus... it is that good, so if you dont know about it - go play!

alternatively you may try this little remake...

DOWNLOAD (glut source code & Linux binary):
http://www.geocities.com/ze_aks/Katamari-v0.01.tar.bz2
(this should compile easily on Windows as well... unpack archive to "../bullet*/Demos" folder, so structure looks like this: "../bullet*/Demos/Katamari-v0.01/main.cpp")

Windows binary:
http://www.geocities.com/ze_aks/Katamar ... indows.zip


i was mostly inspired with "gingerbread house" stage where you roll Katamari through chocolate walls and other sweet, sweet parts of the house until it gets big enough to demolish larger parts, then roof falls down and you roll up the whole house eventually... what a great game!

apparently,
its very easy to remake Katamary "game engine" with BulletPhysics by writing minimal amount of code... basically i only had to collect funky, but interestingly handled on PS2 user input and translate that to some Linear/Angular velocities and and let Bullet handle the rest... of course, heavily utilizing 'KatamariShape' aka btCompundShape

this is very simple piece of code built on top of my 3rd BoiledDown Demo, so even absolute beginners should be able to figure out what this program does, and here are the links to previous BoiledDown demos, so you can see/follow how this game came to be out of simple "HelloWorld":

*beginners* - Boiled Down 'HelloWorld' demo with OpenGL
http://www.bulletphysics.com/Bullet/php ... =17&t=2277
'Simplified BulletDinoDemo and how to compile it on Linux'
http://www.bulletphysics.com/Bullet/php ... f=9&t=2274



..i hope everyone here loves Katamari too,
and would like to invite all to spend some time with this simple source code, maybe make some improvements... i hope you will have have fun playing the game, collecting chocolate cubes... enough fun actually that you would want to add something new to this game... roll something of your own, thats what katamari is all about



QUESTIONS:
1.)
relative orientations, relative angles and positions.. how to rewrite parts of code using Bullet's transformations, matrices and/or quaternions rather than ...whatever is that i did, so can this bit of code be rewritten better using some Bullet functionality?

Code: Select all

float angle = HEADING;
  float dx = sin((angle - 90)*M_PI/180) * SPEED_LINEAR;
  float dy = cos((angle - 90)*M_PI/180) * SPEED_LINEAR;

  float rx = sin((angle)*M_PI/180) * SPEED_ANGULAR;
  float ry = cos((angle)*M_PI/180) * SPEED_ANGULAR;

float freeFall=  box2->getLinearVelocity().z(); 
   box2->setLinearVelocity( btVector3(dx, dy, freeFall) ); 
   box2->setAngularVelocity( btVector3(-rx, -ry, 0) ); 
(btw, thats the half of the whole "game engine" right there in these few lines, as i mentioned earlier)

2.)
- is this little remake fun to play.. or is it just me?
- if you played the game on PS2, do you think controls translate well on keyboard?
- if you didnt play the game, what you think about controls?
(btw, two players can play it, just as on PS2 co-op mode)

- worth making it into further game?
(not commercial, just for fun - free game for Linux/Open Source... basically i'd like to add destruction aspect as in 'gingerbread house' stage and more sweets, lots of little gummyBears to roll on, similar to rubberyBunny in Bullet demos, but more ...edible)

3.)
how to go about building stages, stage editor... Blender and Collada?

4.)
when adding to compound shape new shape does not seem to be "recognized" until after some time or something happens, so i used ugly way to sort that out:

Code: Select all

cmpd_shape->addChildShape(coll_t[i], shape);
  dynamicsWorld->removeRigidBody(box2);  <-- need to throw it out and get it back for change to take effect?
  dynamicsWorld->addRigidBody(box2);   <-- need to throw it out and get it back for change to take effect?
..same when translating, looks like im missing some update/refresh function or some better place to call this

Code: Select all

dynamicsWorld->removeRigidBody(world_mesh);  <-- need to throw it out and get it back for change to take effect?
world_mesh->translate(btVector3(0,0, -45)); 
dynamicsWorld->addRigidBody(world_mesh);  <-- need to throw it out and get it back for change to take effect?

thanks for your time,
http://www.geocities.com/ze_aks/myos.html

Image
Image
Last edited by abaraba on Wed Aug 20, 2008 6:44 am, edited 2 times in total.
z8000
Posts: 24
Joined: Mon Aug 04, 2008 3:54 pm

Re: We love Katamari Damacy_remake (question: relative orienta..

Post by z8000 »

screenshot and/or movie would be great ...

thanks for sharing the code though :)
abaraba
Posts: 56
Joined: Thu Jun 19, 2008 7:54 am

Re: We love Katamari Damacy_remake (question: relative orienta..

Post by abaraba »

added few screenshots,
suppose you're running Windows, since Linux binary didnt do it for you, but all the same this is very simple GLUT/OpenGL application and should compile easily on any system as it is... as long as there is Bullet library installed

is there any problem preventing it to compile from the sources?


edit:
ok, heres EXE, windows binary:
http://www.geocities.com/ze_aks/Katamar ... indows.zip

to compile it with VC6 i had to #define M_PI 3.14159265, remove word "int" from "for(int i=.." and do something about main() returning or not some value, thats it... tho on my winXP, for some strange reason, it runs quite slow
z8000
Posts: 24
Joined: Mon Aug 04, 2008 3:54 pm

Re: We love Katamari Damacy_remake (question: relative orienta..

Post by z8000 »

cool, thanks.. No, I'm on a Mac but I was just being lazy :)