get a new simulation by selecting "file" -> "new". Set the desired size and click "ok". The editor window should resize to accomodate a white panel. This is the simulation.

To add a new body into the simulation, select the "Armour" tool and left click on the white panel where you want the vertices of your body to be. A green outline will show your progress so far. When you've added all the vertices you want, finish the body with a right-click. The green outline should become black. NB: you must have at least 3 vertices. and you should avoid self-intersecting shapes.

If you are not happy with the position of your body or it's vertices, you can drag them around with the "grabber" tool.

You now have an unstructured body that will flop around uselessly. To make it more interesting, add some structure to it using the "stick", "bumper", "rope" and "spring" tools by dragging between two vertices of the same body. A black line should appear showing the constraint. The shortcut to a rigid body is simply to right-click on it and select "rigidify". You can view any constraints of a particular type by selecting the appropriate tool. They will appear as black lines.

You should now have a rigid body. Make the simulation more interesting by increasing the gravity and perhaps raising the water level from the environment control panel, accessible from the "Simulator" menu

The body options panel on the main editor window allows you to set the attributes of any new bodies you create. You can alter the attributes of existing bodies by right-clicking on them and selcting "Options".

When you are done editing your simulation, you can run it with "Simulator" -> "Run Simulation" and save it with "File" -> "save".

Hm, the more often and the harder I try, the more successful I am! Meanwhile I managed to set green points (sometimes with a fast doubleclick, sometime with singleclick) that even appear near to the mouse position, estimated 30pixels to the upper left

Right, there's a new version up now that shouldn't have that ArrayOutOfBounds exception. It would only have appeared if you had all of your points in a line, but it shouldn't have slipped through the testing net.

Thinking about it a bit more, it might be the VolatileImage code that is exhibiting platform dependent behaviour, since there's all that "possible loss of image contents" kafuffle on Windows. I thought that copying the code from the VolatileImage API docs would cover me on both platforms, but apparently not. So in reality (possibly) you are creating points, you just can't see them. Which is unhelpful. Thus, next on the bug-fix list is moving back to nice, dependable BufferedImages.

Quote

30pixels to the upper left

There's a "Snap to grid" option in the File menu that's on by default

thanks for your time Herkules, I promise that there's somthing fairly cool at the other end of this compatability hell.

I'll download JDK 1.4 for win98 when I get home. If anything can break my code, it'll be good old 98.

I don't know what to be more disappointed with, Windows or Java... :-/

Ok, there's a new jar up at the above address that might be more successful on windows platforms. The drawing was about 60% slower :-/ when i tested it, but nevermind. It will also print out information on stdout about mouse events, so i you are clicking on the simulation panel and nothing comes up on stdout, let me know. If you do see the mouseClicked events appearing and still no green points, I'm not sure i want to know , but tell me anyway.

As far as i can see, that covers the only two bits that could be in any way platorm specific.

Maybe I've catched the problem. It seems that NO point is set when mousePressed and mouseReleased occur not exactly on the same mouseposition? This is a hard restriction bc. pressing or releasing the button often moves the mouse as well (esp. with high-res optical mice we have today).

Taking this as an hypothesis, WinKinetix.jar and Kinetix.jar behave identical.

I am, mouseClicked is used to add new points to an armour or to bring up the context menus.

mousePressed and mouseReleased are used for adding constraints or dragging objects and vertices around.

Unfortunately, it seems that a mouseClicked event is not generated if the corresponding mousePressed and mouseReleased events do not occur in the same place. Developing with a touchpad never exposed this limitation.

Good to know about the display though. VolatileImages, all is forgiven. BufferedImages, don't show your slow-as-hell face around here ever again, or at least until i want direct pixel access.

There we are, the new version only uses mousePressed and mouseReleased, so those of us with nice hi-res mice and monitors can now have full functionality without entering a zen-like trance of absolute muscle control.

By the way, it seems that mouseClicked events are only generated when the mouse is pressed and released on the exact same pixel. Which seems a bit harsh to me. Ah well, it's all a learning experience...

I can isolate a planar slice of my 3d world ... I can protect my girl & the ping-ball from cross winds ... I can reduce the 3d problem space of the ping-pong ball to a 2d problem space. I can do all that ...

so can your software handle the 2d Physics of the ping-pong ball traveling through the 2d planar suface of it's trajectory ?

Hitting the table is still a 2-d problem ( or is by definition of the implementor )

It's only when the ball is struck by a player's paddle that the 3d has to re-emerge, and I could compute the translation between the old 2d plane & the new one.

The ping-pong game was chosen for a good reasons,

It should be easy, and Sun already provides a simple demo.

The game can be contrained so the players can't hit the ball until it passes through a plane parallel to the end of table end ( one for each player )

So once a ball is hit, it is out of action, until a known interval of time has passed, and you know where its terminal position will be, and when, so you can go away and do other things until that time arrives.

Make games hard for the player, make life simple for yourself.

- - - - - -

I haven't tried your program yet, but it definately on my " to do " list.

Yeah, it wouldn't be hard to write an applet that will bring up the editor window, but this would preclude the possibility of loading and saving simulations.The editor is not really an end in itself, but simply a framework to demonstrate the simulation technology. As such i can't really be arsed messing around with servlets and such to let people use it seamlessly over the web. The jar file is all self contained, so installation involves nothing more than saving the jar and running "java -jar Kinetix.jar".

Back to ping-pong...

I don't really feel that this engine is the best fit for your problem. Ping-pong is just interactions between spheres and planes, which is quite simple to model

Off the top of my head:

whenever the center of the ball gets to within the ball's radius of a plane, invert the component of the ball's motion that is perpendicular to the plane.

This will model interactions between the ball and table, you'll need too add something more to simulate moving planes (bats).

You can model this quite easily in 3D, with no messy slicing into 2D necessary.

I use Mandrake, for no other reason than my flatmate had the installation disks, although i am jealous of debian's "apt-get" loveliness.

ahhh... I can't hold it inside of me anymore.... But I will try to be civil...

Vrml_Java_AnimatorFirst of all, no nude womens on these forums. Even if women's are the most beutiful things on this universe (and I am not taking about a j3d univerise with vrml loaders). These forums are about Java Gaming (no nude women forum yet, but if such is added feel free to post your porn collection there).

Also you must start to learn to respect people other than yourself. Most people learn this in an early age, but it seams like you missed that part.

Have you noticed that I am NOT using any large fonts, no extra spaces and still you can read this? amazing isn't it! So please, cut down your post by not repeating what you already said and try to use the same font in your posts (that is use the standard font).

This is my third complete rewrite of this post, the first started with to many hard words so I couldn't bare myself to post it. The second was abit better but still had references to mental institutions. The third, the one you are reading now, is how post should look like. A polite try to get you to understand that personal attacks, ugly post and other inmaturity isn't appreciated here. So please stop with this and try to act as a normal mature man. Please!

Deftly trying to resurrect this after its been tainted by our resident internet kook, I'm interested in using this in my own project..

How would I go about actually adding it to my own work? You've described it as an 'engine' so i'm assuming you've designed it with reuse and flexibility in mind (and the demo does seem pretty powerful ).

What about only applying the physics to a subset of my game objects? I'm thinking about mixing custom behaviour and the Kinetix physics, so things like bullets, players etc. can be controlled by simple rules but interact with the rest of the objects in a realistic way..

I think that the crazy-radiation levels that impregnated this thread have decayed to background norms, so...

Before i start, i should say that the version i left on the web is now somewhat out of date, having languished due to the lack of apparent interest ( mumblemumblebastardsmumble ). The latest version has some useful improvements: - automatic rigidification is now vastly more intelligent, uses less constraints and generates more stable bodies - an architectural tweak that allows clouds of unconstrained particles, ideal for use as bullets - you can now query constraints in order to assess how much strain they are under, useful for calculating damage to objects

These were all prompted when i stopped living in clean-design-world, and attempted to actually use the bloody thing. I'll upload the newest version and the "game" i made later on tonight.

Quote

How would I go about actually adding it to my own work?

The two approaches that i can think of are...

1) subclassing the Kinetix entities so that your game objects are Bodies and your bullets are Particles etc.

This is good because their physical behaviour will just happen naturally, and any additional behaviour can be added in the subclassing.

This is bad because you game objects will have to live and move entirely in the Kinetix environment, so you would have to be careful about how you make your game entities move about. Simply setting their positions would introduce arbitrarily large forces into the simulation. For example, in the game i made, instead of simply setting the ship's angle every frame, i had to simulate the action of the ship's engines by giving the ship a rotational acceleration. This made controlling the ship extremely difficult, so i then had to add the steering arrow and let the game decide which way to accelerate.

2) Run the simulation seperately from your game, and have some kind of linkage layer between the two that reflects events in one side onto the other. For example, if the game component decides that a rock has been hit by a bullet, the linking layer would then apply an appropriate force to the body representing the rock in the Kinetix simualtion. Conversely, the Kinetix component would then update the game component with the position of the rock in every frame.

This is good because it allows for applying the simulation to a subset of game objects. You could also swap out the Kinetix component for another physics engine (as if you'd want to! ) without too much hassle.

This is bad because of the added overhead of the linking layer, and it's not a particularly tidy solution. You also have to be careful about synchronizing the states of the two components, making sure each entity is properly matched with it's peer, etc.

Perhaps that's enough to be going on with for now, what kind of game were you thinking about doing?

Basically I'm working on a 2d game engine, with the emphasis on some heavy customisation via scripting. Ideally I don't want to spend ages on the collision detection and reaction for solid object, and focus on the reactions when non-solid objects interact (like players hitting door triggers, bullets shattering glass etc.).

Bear in mind i'm after something game-independant (as far as possible). Something like pong could be done totally with the rigid body interactions, but for something like a platform game you need a much more arcade-y feel to the player controls.

Is there some way I can 'drive' the simulation from my own app? Like create a mirror of the game level in Kinetix, and tell it to update its positions every game frame? Then i could pull out the data again and use it for actual rendering and any other game events that would be affected by it.The subclassing idea sounds possible but could introduce all sorts of headaches. Can objects not be set via code in an absolute way (as in, ignore physics and just set the position/angle/etc. straight off?)

Absolutely. Once the simulation has been set up all you need to do is call simulation.runTime( millis ), and kinetix will go off and run the appropriate number of iterations internally to update the the simulation with respect to time.

Quote

create a mirror of the game level in Kinetix, and tell it to update its positions every game frame? Then i could pull out the data again and use it for actual rendering and any other game events that would be affected by it.

Yeah, that's what i was trying to convey with aproach number 2 above, and it seems the best way forward for your purposes.

The subclassing approach is kind of a masochistic way to make a game, but appropriate for the idea i had.

Quote

Can objects not be set via code in an absolute way

There's no real problem with this, you just have to be a bit careful about collisions occuring when you do it. Setting the position of bodies explicitly is somewhat analogous to, in the real world, the Hand Of God(tm) reaching down and playing catch with a mountain. Sure, the mountain is going to be moved, but innocent bystanders are hoping that the almighty isn't careless as millions of tonnes of rock and a few startled goats flick past overhead.

I'll put the game up when i get home and net access is cheap.

Kinetix was developed as part of my final year project, so i'll also put up the report i wrote on it, which should gives some more background. It'll take a few minutes as i regnerate all the image postscripts.

Edit : actually, scrap that. The university has just updated the system and so inevitably what was once easy has become nigh-on impossible. Useful latex compilers and dvi viewers have disappeared for now it seems :-/ So for now, no report.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org