About Store Forum Documentation Contact



Post Reply 
New SimpleVehicle class
Author Message
Esenthel Offline
Administrator

Post: #1
New SimpleVehicle class
Because current Vehicle class works only on PhysX, and there is no PhysX on iOS yet, I've decided to make my own physics-engine-independent vehicle class.
After a week of heavy work you can say hello to "SimpleVehicle" class, which works on all physics engines, it's very lightweight (small amount of computations per vehicle), has enjoyable and realistic driving experience, suspension, working collisions, allows for cool drifting, it has no gears though.
Available in next release.

Also: In the video you can see a scene of some of models that I've bought online, for the purpose of making another small mobile game. It's a sci-fi oriented shooter, with view from the top. I had the idea for this game since many months. It's a bit like Death Rally, but with less racing, and more about completing missions, trading, bounty hunting, harvesting, travelling across the planet, and not just one but to other planets as well (you will have bikes, cars and space ships as well).



04-11-2013 08:35 PM
Find all posts by this user Quote this message in a reply
xzessmedia Offline
Member

Post: #2
RE: New SimpleVehicle class
yeah man, this looks impressive.

can't wait to play with it
04-11-2013 09:03 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #3
RE: New SimpleVehicle class
Really nice work! Another great addition to the engine grin
04-11-2013 09:28 PM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #4
RE: New SimpleVehicle class
Haha love it. Looks like a lot of fun. Great work Esenthel.
04-11-2013 09:51 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #5
RE: New SimpleVehicle class
Sounds very neat and advanced. smile

Is it planned to be a tech demo, source for licensees, or just a personal project? pfft
04-11-2013 11:12 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: New SimpleVehicle class
Thanks for the comments everyone smile
The 'SimpleVehicle' is a new class built into the engine as alternative to 'Vehicle', and can be used by everyone, starting next engine release.
But the game itself is my side project, just like Esenthel RTS, though I'm not thinking of selling source code for this one just yet (I've barely started working on it).
04-11-2013 11:17 PM
Find all posts by this user Quote this message in a reply
gwald Offline
Member

Post: #7
RE: New SimpleVehicle class
Hi Esenthel,
That's pretty cool!
You impress me with your mastery!
I have a question, not sure why you still make silent video's?
It doesn't help communicate your point (wiggling the mouse?).
I've heard you speak english on other videos, so I don't know why you don't.
Or maybe speak Polish and enable youtube translation (poorly but better then nothing).

Oh, and something that I've always wanted to know is, why not just port Bullet Physics Library to all platforms?
I think you have all but windows and instead use PhysX.

My Blog
http://www.esenthel.com/community/showthread.php?tid=6043

I hang out at Esenthel IRC Channel
http://webchat.freenode.net/?channels=#Esenthel
04-12-2013 08:13 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Scarlet Thread Offline
Member

Post: #8
RE: New SimpleVehicle class
Looks pretty nice.

My only concern from the video is that when he hits the front bumper it doesn't slide out but catched on the ground. Though it is a WIP so for a WIP it looks awesome.
04-12-2013 09:57 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #9
RE: New SimpleVehicle class
(04-12-2013 08:13 AM)gwald Wrote:  I have a question, not sure why you still make silent video's?
Generally I like my voice, but when I hear it recorded on a Esenthel video, somehow I feel it doesn't fit, and my accent is terrible wink
Quote:Oh, and something that I've always wanted to know is, why not just port Bullet Physics Library to all platforms?
Bullet is great library, but from my tests:
PhysX loads phys bodies/actors faster, calculates simulations faster (especially with background thread processing), simulations are more stable, API is more cleaner. Also I have not yet implemented clothing wrapper for Bullet (didn't yet checked if it's supported there).
Currently only Esenthel for iOS uses Bullet, all other platforms use PhysX.

Scarlet Thread Wrote:My only concern from the video is that when he hits the front bumper it doesn't slide out but catched on the ground. Though it is a WIP so for a WIP it looks awesome.
Thankssmile
The bumper is not managed by 'SimpleVehicle' class itself, but by regular Actor/Physics collision system. You can easily adjust sliding ability by adjusting PhysMtrl parameters of that Actor (reduce bounciness, reduce frictions)
04-12-2013 12:17 PM
Find all posts by this user Quote this message in a reply
gwald Offline
Member

Post: #10
RE: New SimpleVehicle class
Hey,
Thanks for the reply smile
I don't think your audience is critical about your voice or accent.
But would value very much any information you do say.

Thanks for the info on the physics engine, I guess you will be dropping Bullet from iOS after porting PhysX?

Your vehicle physics engine looks heaps of fun and thanks sharing it with us smile

My Blog
http://www.esenthel.com/community/showthread.php?tid=6043

I hang out at Esenthel IRC Channel
http://webchat.freenode.net/?channels=#Esenthel
04-12-2013 03:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #11
RE: New SimpleVehicle class
Looks great!


... now someone should make a RC Racing / Rock'n'Roll Racing revival for iOS with it. Classical topdown 16bit fun, but in full 3d, how awesome is that? smile


Keep the updates coming, Greg.
04-12-2013 05:44 PM
Find all posts by this user Quote this message in a reply
TheElk Offline
Member

Post: #12
RE: New SimpleVehicle class
Esenthel

Let me say I was the same way when I started recording videos but its better to have
a voice there than nothing at all and if anyone says different.....well thats there problem.

and by the way Keep up the great work.

ThankYou
TheElk

Home of battle of the Juggernauts & Killer Raceway
http://www.kurschnerent.com/
04-12-2013 07:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Ezequel Offline
Member

Post: #13
RE: New SimpleVehicle class
This looks very cool! Will there be a tutorial for this?
When the vehicle flips over, will it always flip back on its wheels like in the video?
04-12-2013 10:25 PM
Find all posts by this user Quote this message in a reply
para Offline
Member

Post: #14
RE: New SimpleVehicle class
That's great Esenthel!

I'm already playing with this, but i'm not able to push other physical bodies around, if I just use vehicle.mass() and set it to some non 0 value the vehicle simulation breaks.
04-12-2013 11:01 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #15
RE: New SimpleVehicle class
(04-12-2013 10:25 PM)Ezequel Wrote:  Will there be a tutorial for this?

This will be in next release:
Code:
/******************************************************************************/
Memc<Actor>   actors;
SimpleVehicle vehicle;
/******************************************************************************/
void InitPre()
{
   EE_INIT();
   App.flag=APP_RESIZABLE|APP_MINIMIZABLE|APP_MAXIMIZABLE|APP_WORK_IN_BACKGROUND|AP​P_FULL_TOGGLE;
#ifdef DEBUG
   App.flag|=APP_MEM_LEAKS|APP_BREAKPOINT_ON_ERROR;
#endif
   Cam.dist=10;
   Cam.pitch=-0.4;
   D.viewFov(DegToRad(60)).mode(App.desktopW()*0.8, App.desktopH()*0.8);
}
/******************************************************************************/
bool Init()
{
   Physics.create(EE_PHYSX_DLL_PATH);

   actors.New().create(Plane(Vec(0, -1, 0), Vec(0, 1, 0))); // create ground

   SimpleVehicle.Params params; // setup vehicle params
   flt x=0.9, y=-0.5, z=1.8;
   params.wheel[WHEEL_LEFT_FRONT ].pos.set(-x, y,  z);
   params.wheel[WHEEL_RIGHT_FRONT].pos.set( x, y,  z);
   params.wheel[WHEEL_LEFT_REAR  ].pos.set(-x, y, -z);
   params.wheel[WHEEL_RIGHT_REAR ].pos.set( x, y, -z);
   PhysBody body; body.parts.New().create(Box(2, 1, 4)); body.setBox(); // create vehicle body
   vehicle.create(body, params, 1, 1); // create vehicle

   return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
bool Update()
{
   if(Kb.bp(KB_ESC))return false;
   Physics.startSimulation().stopSimulation(); // update physics

   // set vehicle input
   flt forward=Kb.b(KB_W),
       back   =Kb.b(KB_S),
       angle  =Kb.b(KB_D)-Kb.b(KB_A);

   flt accel, brake;
   if(vehicle.speed()<=1 && back>forward) // if moving at slow speed and want to go backward
   {
      accel=-back   ; // set negative acceleration
      brake= forward; // set braking
   }else
   {
      accel=forward;
      brake=back;
   }

   vehicle.angle(angle).accel(accel).brake(brake);

   // setup camera
   Cam.at =vehicle.pos();
   Cam.yaw=Angle(vehicle.matrix().z.xz())-PI_2;
   Cam.setSpherical().updateVelocities(CAM_ATTACH_ACTOR).set();

   return true;
}
/******************************************************************************/
void Draw()
{
   D.clear(TURQ);
   Physics.draw();
  
   // draw wheels
   SetMatrix();
   REP(WHEEL_NUM)
   {
      WHEEL_TYPE wheel =WHEEL_TYPE(i);
      Matrix     matrix=vehicle.wheelMatrix(wheel); matrix.draw();
      Tube(vehicle.wheelRadius(wheel), 0.2, matrix.pos, matrix.x).draw();
   }
}
/******************************************************************************/

Quote:When the vehicle flips over, will it always flip back on its wheels like in the video?

That's not guaranteed.

Quote:I'm already playing with this, but i'm not able to push other physical bodies around
Please insert into above tutorial code this line to the Init function
Code:
actors.New().create(Box(1, 1, 1, Vec(0, 0, 2)));
for me it works fine.

Quote:if I just use vehicle.mass() and set it to some non 0 value the vehicle simulation breaks.
I recommend controlling vehicle mass through density parameter in the 'create' method.
However I've tried changing its mass during the simulation with
Code:
if(Kb.bp(KB_LCTRL))vehicle.mass(vehicle.mass()*2);
and it works fine, perhaps you've set the mass too big or too small somehow.
04-13-2013 12:09 PM
Find all posts by this user Quote this message in a reply
Post Reply