PDA

View Full Version : Script language


Malekovits
4th January 2005, 03:52 PM
Because i see manygame development programs that have a script language ( C++ ) and also they have a physics engine,
can i make a simulation (a bounce ball) without the physics engine, but just with the programing language? I know some pascal language.

Dennis
4th January 2005, 07:11 PM
That depends on, for example, how you want the ball to bounce...

If you want the ball to bounce and react to collision objects (walls, floors, tables, boxes, etc), and your environment will change from time to time (someone moves the box, for example), then you'll need physics, whether you write your own physics code or use another engine/sdk (such as ODE or Tokamak). If you write your own physics code, you can make it as simple or complex as you wish, depending on the results you're after.

If you merely want to simulate a bouncing ball in a static environment, then you could do this without complex physics by manually plotting/animating the ball's path/rotation/deformation/etc. This can be painstaking work if you want good results, however, and you're pretty much locked in to whatever animations you preset (very tough to make this interactive).

Same goes for any type of falling, moving, etc objects, of course.

Bottom line --- if it's interactive, you'll likely need some type of physics. The complexity depends on what you're trying to do. If you're looking for a fully interactive 3d engine, you may need a fairly robust physics engine, depending on what you're trying to simulate --- if you're looking for animations for a simpler 2d-type video game (ala Mario Bros), you can get by with VERY simple physics simulation --- depends on your need.

Unfortunately, I know of no physics engines that support pascal or Delphi, but I wouldn't be surprised if there's one out there for Delphi, or maybe even an ODE/Tokamak port...

Good luck

Malekovits
5th January 2005, 11:15 AM
Thank's for your reply, Dennis. I want to make interactive with no animations. Just real motion. So to make a ball bounce i need physics. Is there any way to do it without a physics engine, but with very good programing (starting from zero)? I have ODE and i dont know how to install it. I 've read his manual, downloaded GNU make, and it doesn't working!

Dennis
5th January 2005, 06:18 PM
So to make a ball bounce i need physics. Is there any way to do it without a physics engine, but with very good programing (starting from zero)?

For a simple ball bounce, you can factor in the ball's weight, type of material (a rubber ball will bounce high if dropped, a marble, not as much), gravity, the force applied to the ball (is it dropped or thrown), the direction of such force, objects the ball collides against (and their respective atributes), etc.

You wouldn't need someone else's physics engine to do all of this --- you could write it yourself, including only what you need (i.e., you may not care if the ball collides with a trampoline or steel floor, even though in reality the effect may be very different for different surfaces). But it can become a fairly big job - that's why the SDKs are so popular :).

But if you're using Pascal, I'm not sure if ODE will be easy to implement --- are you using Delphi, or straight pascal? Most game programming libraries are geared toward C/C++ programmers, but I have seen more than a few ports to Delphi.

Malekovits
5th January 2005, 06:51 PM
I am now starting getting into the world of programing. For now i am using
Borland pascal for simple text programs. I have heard that i can program graphics with pascal, i thing with some kind of plug-ins, and with tmt pascal, witch is now being shipped. I dont like games that have only animations.

Dennis
6th January 2005, 10:59 AM
You can certainly program graphics for Pascal with the right plugins, libraries, or certain compilers. Delphi is a pascal-based compiler with lots of community support, and there is at least one popular OpenGL port for graphics in Delphi at www.delphi3d.net. I have no experience with TMT Pascal.

You'll find most game development libraries/sdks are based around C/C++, however. I've seen Delphi ports for C/C++ SDKs/libraries, but not for physics sdks (not that I've checked thoroughly, however). That doesn't mean you have to switch to C/C++ for independent game development --- it just means you may have a tougher time finding ready-to-use libraries.

Malekovits
6th January 2005, 02:00 PM
Thank's a lot for your replies, Dennis. I 'll try find some sdk's, but however I 'll try to make a simulation without sdk's.

monster
6th January 2005, 09:32 PM
Take a look at Newton and especially the Delphi wrapper for it;
http://newton.delphigl.de/
http://newtondynamics.com/index.html
There's loads of really cool examples. I've never used Delphi myself but Newton's great. According to the website this header "should also work with other Pascal-Compilers, like FreePascal, VirtualPascal, TMT Pascal, etc." - which is nice.

No offence, but if you can't even compile ODE don't even think about trying to write your own physics engine. Apart from anything else, it's already been done before by people who are far cleverer than you or I!

Malekovits
7th January 2005, 11:03 AM
Has anyone ODE; How do you 'install' it; i have the zip file. HELP!

Dennis
7th January 2005, 01:13 PM
Has anyone ODE; How do you 'install' it; i have the zip file. HELP!

You can download the documentation for ODE from their site and find the installation instructions within. However, I don't think there's a Pascal library/interface for ODE, so if you're using Pascal, you will not be able to call ODE functions without linking directly to the ODE libraries (can be dicey going from Pascal to libs written/compiled unser C++, at least in Windows) or writing some kind of wrapper in C/C++. These are not especially attractive options compared to either (a) switching to c/c++ as your language of choice or (b) getting your hands on a Pascal-supported physics engine.

The link monster posted to http://newton.delphigl.de/ looks much more promising for physics in Pascal -- - I'd definitely give that a try if you want to stick with Pascal-based development.

Malekovits
7th January 2005, 04:21 PM
I have the manual, I do what it says, and just I don't knoe how to instal it. It' not an exe. Also Doesnanyone know what engine Halo (1) uses, or the programs that Halo has been made of? It's avery good engine (and it doesn't take 100% the CPU).

Dennis
7th January 2005, 09:39 PM
I have the manual, I do what it says, and just I don't knoe how to instal it. It' not an exe.

When you installed it, did you use the Visual C installation, or the GNU make installation? What exactly is not working for you?

What are you looking for the sdk to do? Are you expecting an .exe you can run? The engine is a development tool, not a programming or game creation environment --- so you'll interface with it through your programming language.

You'll likely get a much better response to your questions on the forums at www.gamedev.net --- they'll have *lots* more programmers there that have actually used ODE. You'll likely find very few people on this forum that have much experience with the ODE physics engine.

Good luck

monster
10th January 2005, 02:57 AM
It's not an exe because it's a source code distribution which you have to build yourself. I assume you're following these instructions;
(1) get the GNU 'make' tool. many unix platforms come with this, although sometimes it is called 'gmake'. a version of GNU make for windows is available at: http://q12.org/ode/bin/make.exe

(2) edit the settings in the file config/user-settings. the list of supported platforms is given in that file.

(3) run 'make' to configure and build ODE and the graphical test programs. to build parts of ODE the make targets are:

make configure create configuration file include/ode/config.h
make ode-lib build the core ODE library
make drawstuff-lib build the OpenGL-based graphics library
make ode-test build some ODE tests (they need drawstuff)
make drawstuff-test build a test app for the drawstuff library

all of these targets will do an implicit 'make configure'. if the configurator screws up then you can edit the settings directly in include/ode/config.h.

(4) to install the ODE library onto your system you should copy the 'lib' and 'include' directories to a suitable place, e.g. on unix:

include/ode --> /usr/local/include/ode
lib/libode.a --> /usr/local/lib/libode.a
If so, you'll need to give a bit more details of the errors you're encountering.

I'll say this again; if you're not familiar with C (and/or C++) then forget about using ODE. Use the Delphi/Newton stuff, that's pre-compiled and allows you to use a language with which you seem to be more familiar.

Or take a look at ODF Rocket, from Novodex. That lets you play around with physics using a (relatively) simple scripting language.
http://novodex.com/downloads.html

Dunno what Halo uses, probably Havok or something equally expensive. The "programs that it's made of" will likely consist of C/C++ compilers as well as high-end modelling and art applications.

Malekovits
12th January 2005, 01:24 PM
And in witch folder i put the GNU?

monster
12th January 2005, 08:44 PM
I assume you mean the GNU 'make' tool? Put it in the root ODE folder, e.g. ode-0.5, where the Makefile is.

Malekovits
13th January 2005, 05:34 PM
Nothing is hapening...

monster
13th January 2005, 08:08 PM
Err, well you have to do something with it. You can't just stick it in the right directory and expect it to magically work.

Using my psychic abilities I sense that you're running make by double-clicking it in Windows Explorer. Don't.

Open up a command prompt and run it from there. But first you'll have to set up your MSVC environment, in the same command prompt, by running vcvars32.bat from your MSVC bin directory. And, of course, you do know how to do that don't you?

But first you'll need to have set the configuration options in config/user-settings.

Have you looked at Newton and the Delphi/Pascal headers?

Why are you so determined to use ODE? I use it, and I like it very much, but then I was at least able to compile it relatively easily.

Malekovits
14th January 2005, 05:59 PM
I 'll try to do by the command prompt. I want first to work on ODE nad after that the Newton and the Delphi headers.

monster
14th January 2005, 10:04 PM
I want first to work on ODE nad after that the Newton and the Delphi headers.
Fair enough, but why? Getting started with Newton/Delphi would at least allow you to, erm, get started. You should be able to instantly start experimenting with your own physics based demos, rather than messing around trying to compile stuff!