• Welcome to Dark Bit Factory & Gravity.
 

Pretty earth and sea terrain.

Started by Pixel_Outlaw, July 01, 2008

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Pixel_Outlaw

This is a sort of quick and dirty terrain maker I made in Blitzmax.

I might add some more features, would look great in 3D for a game perhaps. Something like a 3d shooter with boats in the water and players on land. You could in theory have infinite play maps. Demo makers have really inspired me with procedural content. I think it will be a great way to make a dynamic game that never grows old.  :clap:
Challenge Trophies Won:


stormbringer

Nice!

I definitely see a remake of "Buggy Boy" mixed with some "Live and Let Die".

Regarding the code, what about replacing the "640"'s and "480"s by some symbolslike "Width" and "Height" ? that would bet better practice, especially if you have to change them. Also why use floats for indices in you arrays? Ok it may have been "fast coding" but still..

A lot of your code calculates values depending on x and y. If you look closer, you will see that you have a lot of linear functions, that can be easily replaced by accumulators to which you simply add the same fraction at every new x and every new y. This will save a lot of computations too.

Just my 2 cents.
We once had a passion
It all seemed so right
So young and so eager
No end in sight
But now we are prisoners
In our own hearts
Nothing seems real
It's all torn apart

stormbringer

Some further optimization/approximation...

you could render your map at a half or even a quarter of the current scale, which will save a lot of processing. Then scale it by a factor of 2 or 4 and apply a 3-pass box blur (you can separate the blur on x and y, i.e. rows and columns).

This would improve the rendering speed and the results are very comparable, although not quite the same. But for a game, who will see the difference?
We once had a passion
It all seemed so right
So young and so eager
No end in sight
But now we are prisoners
In our own hearts
Nothing seems real
It's all torn apart

Pixel_Outlaw

Thanks stormbringer. I'm always open to optimization. I was just excited a bit since this has been a week long project. Fasters with little loss in quality is almost always better.
Challenge Trophies Won:

benny!

@PO:

Looks very cool indeed. Also reminds me on a nice island / ship driving
game! Good job.

Btw. Concerning better coding style - it is always a good thing to check
for external files if there are available - like checking for the PNG before
trying to load it.

I know that this is a boring task and especially while prototyping it seems
not necessary - but sometimes this can help you - and external testers a
lot.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

rain_storm

Great stuff P.O. another interesting project you work on. As to what storm bringer said this would be a great time for you to start into interpolation. it would improve speeds by some magnitude without hurting quality too much to be noticed. And you will be doing basically the same thing as the simple blur

Challenge Trophies Won:

Shockwave

Looks pretty cool, if a little flourescent!
Shockwave ^ Codigos
Challenge Trophies Won: