Please Test this

BlitzMax Forums/BlitzMax Programming/Please Test this

klepto2(Posted 2005) [#1]
Maybe you have seen that I'm working on an Artillery Style game before. Now I have added a land-drop technique to it and
build a little test demo.

BTW : THX to AngelDaniel for his suggestion about land-drop

In this Demo you can control the players by using this:

Key 1\2 changes angle
Key 3\4 changes power
Enter = Shoot
Space = next Player

(You can also 'draw' on the Map by pressing the left Mousebutton)

Currently there is no Gamplay in it and the Max Framerate is limited to 60 FPS. So I need to know what min Framerate you got when drawing on the Terrain or by doing an explosion.

Please download at: http://www.brsoftware.de.vu/DL/

There are two Files to Test :
For OpenGL : Test.RAR
For DX : TestDX.RAR

THX For your comments.


ImaginaryHuman(Posted 2005) [#2]
Sounds good klepto2. I can't see it unless you put up another screenshot of the dropping/drawing in action, but glad you got it working.

I saw another of this type of game recently where they did away with land-drop altogether. But to avoid having bits of land floating in the air, they just totally delete all pixels above any explosion area. Those pieces of land simply vanish before your eyes. At least it keeps things consistent I guess.

What method did you decide to go with?


klepto2(Posted 2005) [#3]
The Method :

To save FPS I have decided to create a Type for each collision that happens with all the relavent Datas (X,Y,Radius)

In the Update Function I check the Area with in the Radius of each Explosion (only x Axis ,y is checked from 0 to Maxheight of the Terrain) if the below Pixel is Transparent or not. If it is the above Pixel is set to the below Pixel and the above Pixel is set to be Transparent. Also to Speed it up abit it checks if there are Transparent Pixels below others and if not the Type is deleted.

Here is the Method (for those who are interrested):


BTW: I have gone away from the Scale Method and now I'm using a tile based Terrain.

Oh and some screenies for you AngelDaniel:





ImaginaryHuman(Posted 2005) [#4]
Looking good. Cool that you got the land to fall now.

How big is your play area?


WendellM(Posted 2005) [#5]
In both versions the rate doesn't seem to be locked for me. I get just under 400 FPS in OpenGL and just over 500 in DirectX.

When dropping terrain with the left mouse button, the frame rate briefly drops to around 17 in the GL version and around 22 in the DX version.

Whenever I press Enter to fire, it crashes (no error message in DirectX, it just goes away; it pops up the "Send Error Report" dialog in OpenGL). I've tried various settings with the 1-4 keys and it always crashes.

This is on a 1.4 GHz Athlon with 512 megs RAM, Win XP Pro SP 2, ATI Radeon 9600 Pro with 128 megs, DirectX 9.0c


klepto2(Posted 2005) [#6]
I'm simply an Idiot, It happened again. Damn.
To make it work, simply copy the 'rocket.bmp' of the root folder in the media folder.

It should work then.

BTW: Does anyone now a faster way then using the Writepixel and ReadPixel commands (maybe Raw OpenGL)


SoggyP(Posted 2005) [#7]
Hello.

Is your terrain a separate image to the background? If so all you need to do is find the first solid ground above explosion crater and do a 1 pixelwide copyrect (or BM equivalent) from that point upwards and drop that to the first solid ground beneath your explosion crater.

Will that help?

Goodbye.


WendellM(Posted 2005) [#8]
Moving the .bmp fixed it. In DirectX, minimum FPS are 22 when rocket is in flight and 17 during explosion/ground-collapse. In OpenGL they're 18 and 14.

1.4 GHz Athlon with 512 megs RAM, Win XP Pro SP 2, ATI Radeon 9600 Pro with 128 megs and Catalyst 5.4, DirectX 9.0c


klepto2(Posted 2005) [#9]
Thanks for testing so far.

The results are helping alot.

@SoggyP: Sorry but that will not work in BM as far as I know.
The only thing is i could let them set directly on the new height but that will corrupt the 'flowing sand' animation.

@Angeldaniel
Currently the size is about 2 tiles (I don't get my position formula working with more :( )


ImaginaryHuman(Posted 2005) [#10]
2 screens wide you mean?

I have seen an algorithm somewhere, not on Blitz I don't think, that described how to do a basic land-drop which involved some binary operations such as AND's and OR's, which would work on several pixels at once, but that was in the days of accessing the video memory directly with the CPU.

Like someone else said, it might be more efficient to grab verticle strips of land into images and then drop them. Bearing in mind that each image has to be minimally 64x64 pixels.

You could do better in Direct OpenGL, with a single texture for the area that is falling, and changing the texture coordinates for several vertical lines. That would be a lot faster.


SoggyP(Posted 2005) [#11]
Hello.

Klepto, check this link for BM equivalent:

http://www.blitzbasic.com/Community/posts.php?topic=47526

Goodbye.