Log in

View Full Version : OT: Anyone want to help me with a small basic program?


narf poit chez BOOM
July 15th, 2004, 10:49 PM
Every other programmer in the world seems to be able to make a terrian generater. So did I. Except their's don't look like a spike pit trap after 200 uses. http://forum.shrapnelgames.com/images/smilies/rolleyes.gif I'm not entirely sure of what the finished product of what I'm doing is supposed to look like, but I'm pretty sure it's not that. Help?

Suicide Junkie
July 15th, 2004, 10:52 PM
What are the details of the project?

narf poit chez BOOM
July 15th, 2004, 11:02 PM
Details? Um...I set every point on the heightmap to -1 to differenciate between points set and points not set. then I put random heights on the heightmap from 0,0 to currently 32,32 using a for/next loop and stepping by half the map size, so 9 height points. The program then is supposed to step accross the map at half intervals, check to see if the current point is at -1, if it is, take the average of all points at the current step distance x,y or both away that aren't at -1, then input the average into it's current square. Once it completes a map, it divides both distances it's stepping by by /2 and goes again until it's done the map at 1,1 intervals. Want the source code?

[ July 15, 2004, 22:04: Message edited by: narf poit chez BOOM ]

Gandalf Parker
July 15th, 2004, 11:11 PM
Your logic sounds ok. You are getting results that are too extreme? Before I offer too much help did you mean "basic program" or a "BASIC program" (is it programmed in ansi basic?)

[ July 15, 2004, 22:12: Message edited by: Gandalf Parker ]

narf poit chez BOOM
July 15th, 2004, 11:14 PM
DarkBASIC, actually. www.darkbasicpro.com (http://www.darkbasicpro.com)

What I'm getting is spikes all over.

Gandalf Parker
July 15th, 2004, 11:28 PM
I think thats pretty compatable with mine (I use a linux basic). Send me the code if you want.

What you should be doing is placing 9 heights, then placing the hieghts midway between them (with some slight random variation for texture), then mid between those, etc etc etc until you have the terrain done. Walking across the screen would be harder Id think.

Gandalf Parker
July 15th, 2004, 11:30 PM
by the way, I think its referred to as "fractal terrain". http://www.gameprogrammer.com/fractal.html#intro
is that what you were working on?

Ed Kolis
July 15th, 2004, 11:31 PM
People actually still program in BASIC? http://forum.shrapnelgames.com/images/icons/shock.gif

(and I'm not talking Visual Basic, that's diverged so far from BASIC it's not really BASIC anymore http://forum.shrapnelgames.com/images/icons/icon12.gif )

narf poit chez BOOM
July 15th, 2004, 11:37 PM
I thought that's what I was doing?

Yeah, fractal. Well, semi-fractal, I think.

I bought a 3d space flight combat game made with darkbasic, not even the proffesional Version that had better nebulea than freespace 2 and the best evasive ai I have ever seen in a flight sim. The screenshots page: http://starwraith3dgames.home.att.net/gallery.htm

Not sure if it'd run in your compiler, there's specialized commands. But there's a 30 day demo.

Project file: http://www3.telus.net/funnybnz/WalkDemo.dbpro
Code file: http://www3.telus.net/funnybnz/WalkDemo.dba

[ July 15, 2004, 22:45: Message edited by: narf poit chez BOOM ]

DarkAnt
July 15th, 2004, 11:55 PM
wow, that is really nice. thanks for the link

narf poit chez BOOM
July 15th, 2004, 11:59 PM
Welcome.

Oh, a side note. I've got some untested code in there for automatically adjusting for a larger heightmap than the matrix command will support. Not even sure it works. Shouldn't affect anything.

Uh, does anyone know where I might find the freespace 2 demo?

[ July 15, 2004, 23:01: Message edited by: narf poit chez BOOM ]

Gandalf Parker
July 16th, 2004, 12:01 AM
Originally posted by Ed Kolis:
People actually still program in BASIC? http://forum.shrapnelgames.com/images/icons/shock.gif

(and I'm not talking Visual Basic, that's diverged so far from BASIC it's not really BASIC anymore http://forum.shrapnelgames.com/images/icons/icon12.gif ) <font size="2" face="sans-serif, arial, verdana">That didnt surprise me as much as how many of them there are. Seems like every time I talk to someone who uses basic, they are using a different one. Oh well, most of them are fairly inline with the ansi-basic rules and I can still read what they are doing. http://forum.shrapnelgames.com/images/icons/icon7.gif

Mine isnt as pretty as some of them but it was free and came with the linux OS. It lets me whip out fast scripts or CGI's to do things, it works on my linux and my winxp, compiles, and when I look at it a year later I can still read it.

So far I havent found much of a reason to switch.

narf poit chez BOOM
July 16th, 2004, 12:15 AM
This ones wacky good: http://darkbasic.thegamecreators.com/?m=showcase_view&i=135

Gandalf Parker
July 16th, 2004, 01:26 AM
Originally posted by narf poit chez BOOM:
This ones wacky good: http://darkbasic.thegamecreators.com/?m=showcase_view&i=135 <font size="2" face="sans-serif, arial, verdana">Seems good. Especially for making games. And its not priced bad.

But there are tons of free ones also. Not quite as focused on game making but good for getting quick work done.

When you get to BETA mode we can bring Shrapnel into the discussion? http://forum.shrapnelgames.com/images/icons/icon7.gif

narf poit chez BOOM
July 16th, 2004, 02:00 AM
Well, that one is just going to be a hiking demo with picturesque landscape. But I am fiddling around with a fantasy-based TBS. No promises though, I'm strictly an amature programmer. http://forum.shrapnelgames.com/images/icons/icon7.gif

I take it nothing lept out of the code as wrong?
ps: I know I'm not using the most efficient code. I wanted to be able to concentrate on different sections.
Very neat game: http://darkbasicpro.thegamecreators.com/?m=showcase_view&i=221

Taaaaaaaaaaaaaanks: http://darkbasic.thegamecreators.com/?m=showcase_view&i=115

[ July 16, 2004, 02:13: Message edited by: narf poit chez BOOM ]

Gandalf Parker
July 16th, 2004, 03:12 AM
Originally posted by narf poit chez BOOM:
I take it nothing lept out of the code as wrong?<font size="2" face="sans-serif, arial, verdana">In the morning if I look it it I might see something. I do better in the mornings. But it looks like its too "math" for me. Making math do what I want is majorly my weak point. Its why most of my programs are havily into randoms.

narf poit chez BOOM
July 16th, 2004, 03:16 AM
Thanks. I guess I'll try the darkbasic forums. Didn't get much of a responce Last time I tried, less than this.

narf poit chez BOOM
July 16th, 2004, 06:06 AM
Got a smoothing routine. http://forum.shrapnelgames.com/images/icons/icon7.gif Doesn't tell me why I'm getting spikes, though.

http://forum.thegamecreators.com/?m=forum_view&t=35291&b=1

Parasite
July 16th, 2004, 07:24 PM
Toward the end where you find the min and max of each point around it...

REM cls
REM set cursor 0,0
For tt = 0 To 8

it should be "tt = 1 to 8"

List(0,0) is never filled in and makes your average half your max every time.

Could this be causing the spikeyness???

Edit:
I don't think it steps through the map like you said it should.

[ July 16, 2004, 19:37: Message edited by: Parasite ]

narf poit chez BOOM
July 16th, 2004, 10:16 PM
No, I must have taken that out.

I'll look into the other. Thanks.