Tippy Platform (physics test)

Blitz3D Forums/Blitz3D Programming/Tippy Platform (physics test)

Picklesworth(Posted 2006) [#1]
I may as well show something which I've been working on as I wait for hell to freeze over. (That is, either PluginHostCtrl or Internet Explorer starts obeying me).

Since causing that to happen takes long periods of time I have been working on a little game during short periods of time for the last 1.5 days. (A very long time, when you think about it!).

http://crumbsoftware.f2o.org/files/tippyplatform.zip (800 KB)

What I have here so far is a little Tokamak-powered physics test.
Press LMB to drop boxes, hold middle mouse (or LMB and RMB) to move camera, and roll middle mouse to zoom camera.

One of the many main ideas for this game is that it will be turn based, and the gameboard contains many of these little platforms of varying sizes. They can tip (and eventually sink) based on the playing pieces on top of them. Admittedly, the game has many signs of inspiration from Bontago, but this game is very different so there's no problems there :)
(I'm drawing inpiration from Go and 3d Chess as well, while adding in elements that can only be accomplished through a computer game).
The aim of the game is to capture all of the game boards (interestingly, there is actually good encouragement to do this, because if you don't you'll sink from overpopulation on your home board!) while maintaining balance so they are not tipped over. This tipping issue can also be used to your advantage in more than one way...
Of course, there's much more to it than that which shall be revealed as time goes on...


In this test, the gameboard's physics object is actually a box. This will be remedied; thankfully, the disc is already a convex object, so it can easily be made into a convex hull for Tokamak when the level loads.
Sinking is not yet implemented. Also, changing the mass of the boxes has a really interesting effect on their behaviour, but that hasn't been added to the interface. (And won't be until I actually turn the physics demo into a game).
The board is tethered to a ball joint, and every frame I keep the board from tipping too quickly by applying an extra twist to it opposite to the rotation velocity of the object (it otherwise tips over completely the moment it is off balance, which is very ugly and doesn't work well in a game).
I am trying to sort out how to achieve a nice gloss effect with the gameboard, and then I will try to give it a few more graphical tricks such as very slight alpha and reflections. There is also a bit of shape around the outside of boards in the works, which I have yet to make look nice.
If anyone has advice on how to achieve good shininess, I would be very grateful. (But I'm willing to sort it out myself if you honestly want to make me suffer).

Anyway, sorry about that long-winded introduction. Does it feel nice? Do you have any suggestions to improve how the physics behave?
Any suggestions on achieving nice light glare? My attempts here don't seem to work the way they should :(

In fact, here's the code that I used to create the board's shininess effect:
board_baseGlaze=CreateCylinder(64,1,board_base)
ScaleMesh(board_baseGlaze,8,0.05,8)
	
glare1=LoadTexture("media\gfx\glare1.png",64+2+1) ;Sphere Env. Map, Alpha, Colour
TextureBlend(glare1,5)
EntityTexture(board_baseGlaze,glare1)

As you can see, it doesn't behave properly... (The PNG is transparent, but the glare in game is a solid white thing. Also, come to thing of it, I don't think it would look right anyway).


jfk EO-11110(Posted 2006) [#2]
well a spherical map is exactly what I'd suggest too. Probably I'd use it on an additional texture layer instead, and set the alpha somewhere else (1st texture layer, or entityalpha). You may have to test several blending modes (including mode 5) and also EntityColor to mix the layers efficiently.

I'll download the demo now and try it asap. (Got to move it to my offline 3D dev machine)


big10p(Posted 2006) [#3]
Apparently, using alpha when multi-texturing isn't recommended. From the docs:

In the case of multitexturing (more than one texture applied to an entity), it is not recommended you blend textures that have been loaded with the alpha flag, as this can cause unpredictable results on a variety of different graphics cards.




Picklesworth(Posted 2006) [#4]
Aye, that it does :(

Eek!
It looks like I somehow messed up the render tweening, causing alpha to behave weirdly...
I'd better fix that.


Anyway, I've been tweeking it a little bit.
Firstly, I removed my messed up render tweening a few seconds ago in order to apply a currently imperfect entity alpha effect. (I'm hoping to eventually achieve a sort of stained glass material, I guess... There's probably a few places I could look to find out how to do it).

Also, the dropped boxes are now much smaller, have properly fitting physics objects, weigh more, and are angled to land correctly on the platform at all times. (That way they don't go out of control when the platform is barely tilted).

I'm happy with how this is going :)
The next adventure is going to be making the platform able to sink... I guess the ball joint which it's attached to will have to be applied to a rigid body which is constantly pushed upwards by a particular velocity.

Arrgh... sorry... I'm using these forums to think out loud again!

Do the camera controls feel manageable?
I'm hoping to achieve something that's easy to use but not too restrictive like all those other 3d strategy games are.


jfk EO-11110(Posted 2006) [#5]
Yeah, really very nice physics. Great. I had two MAVs, after creating (guessing) about 100 or so cubes it MAVed. Probably array index out of bounds or something.

The look could be improved of course. Even for testing only the cubes should be lit to make their position more obvious.

The platform is pretty flat, I thought it was more ellipsoid when you was talking about spherical reflection, because spherical reflection looks only good on round objects IMHO. Would it be possible to use a round platform (talking about the y axis, of course)?

Other than that, great physics base for a game. For any game imho, not only platform things. Tho I don't know exactly how well this could be used in high numbers of platforms or "things" and if a cube can act as a platform in the same time.


Picklesworth(Posted 2006) [#6]
Actually, that was 199 cubes :)
The final thing will find some way to actually not make the preset object limit a bad thing... (At least... not bad in a crashing sense!)

Thanks for the suggestions on lighting the cubes! I guess I could try a little bit of shadowing, and/or I could also give the cubes an outline effect..

A round platform would be kind of neat (in fact, I'm now tempted to do it once or twice now that you've mentioned it), but it wouldn't be totally suited to the design to have them through the whole thing.
I agree that the spheremap doesn't look right, since it just comes out as a solid colour that obscures the object (And the fact that it's completely obscured when viewing at 90° is definietly a problem, since that would probably be the most commonly used camera angle). What should I use instead of a spheremap? Should it be a cubemap, or a well-positioned sprite?