Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Procedural Generation

Author
Message
oli chose123
19
Years of Service
User Offline
Joined: 18th Aug 2006
Location:
Posted: 18th Aug 2006 16:10
Since the darkbasic language is procedural(well, that's what I read), Then I suggest procedural generatio is possible.

I'd like to learn more about this logic, and maybe how to implement it in dbc games. If anybody has ever done it, could you please explain it to me? Even google didn't help me on this one

Thanks
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Aug 2006 01:43 Edited at: 19th Aug 2006 10:18
Unless I'm totally misunderstanding the context, DarkBASIC as a procedural language refers to programming based on calling procedures.

I'll take a stab at this since I like to read myself write...

DarkBASIC can operate like a procedural programming language. A procedural language basically means the whole program is broken up into "chunks" or groups of ordered operations that are often referred to as functions, methods, procedures, sub-procedures (depends on the language).

BASIC as a programming language in itself is really more sequential in design - each step in the program flow follows the previous all the way to the end. DarkBASIC is a combination of the two.

One can set up a series of user designed functions that contain blocks of code. Functions are declared, and then exist almost as an additional command that temporarily becomes part of DarkBASIC while the program is running. These functions can be called (told to run or execute) from other areas in the DarkBASIC program by referencing their name, so that recurring tasks can be handled without rewriting the code. Functions are usually designed to work on variables and optionally return a value back to whatever area in the program that originally called the function. Functions can also be saved as a library, and then reference by other DarkBASIC programs.

Procedures are similar to functions. What sets them apart is that they can be run without being called - if they are placed in the sequence of the program, they will execute as soon as they are come upon. Also, procedures do not return values in the same way as functions, though they can alter a variable's value. Procedures can also be called from elsewhere in the program with a GOSUB or GOTO and are identified by a label (a name or a number ending with a : -- ex. myprocedure: ). Procedures cannot be saved as a library, but they can exist inside of a function that can be called from a library.

Using this idea in programming DBC:

I'm keeping this brief because going into the details of programming in general can be deep; but one might use a function, per se, to calculate the distance between a player object and an enemy object. The value returned from the function might be used to determine if the enemy is close enough to attack the player. If so, the computer is directed to a procedure that will contain the code for how the enemy behaves in it's attack.

So to summarize, DarkBASIC as a procedural language means you can write blocks of code that can be referenced to perform repeating tasks.

Enjoy your day.
oli chose123
19
Years of Service
User Offline
Joined: 18th Aug 2006
Location:
Posted: 19th Aug 2006 03:09
Thanks a lot, it really helps!
I'm really interested in Will Right's game Spore and the game Infinity: The quest for Earth. Both use procedural generation to generate millions, if not billions of planets without any loading time. I'd like to achieve this on a lower scale(maybe even in 2d).
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Aug 2006 10:11
I think I was totaling talking about something else. I was talking about DarkBASIC as a procedural programming language.

I think you may be talking about generation dynamics - in which entire systems can be created using repeating methods or engines. Often organic structures use this technique, trees and plants, landscapes. Crowds can be created, marbles, planets...

Procedural Creation may be the name you're looking for.

As far as the actual techniques used, I'm not too versed on that. From my limited knowledge, the description of procedures and functions I gave earlier for DarkBASIC as a language, has some relavence to procedural generation of models. A very basic explanation is that you rely on the computer to draw your models by setting up parameters within a rendering or modeling engine environment. The computer uses the parameters and a series of iterations to create your scenes - it reduces the human involvement in drawing a 3d scene with the goal to speed up the final media creation.

Don't take my word for it because I haven't done much of anything with this.

Enjoy your day.
oli chose123
19
Years of Service
User Offline
Joined: 18th Aug 2006
Location:
Posted: 19th Aug 2006 13:54
Actually, your first post helped a lot in my researches. I made a simple "stat system" generator using some planet bmps from another game. The names for the technique are Procedural Generation or synthesis.

By using procedures, I generate different results by entering different values. This is really basic but i'm developping the concept.

In some programe, to generate something, you have to enter the parameters and a seed. I think the technique is based mostly around this "seed".
blanky
21
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 25th Aug 2006 03:48
Indeed; The seed is used as the random number generator 'seed', and procedural generation involves quite a lot of random.

It's quite fun, actually, trying to generate textures and meshes through pure code ^^. Good luck with it! A lot of 'tech demos' do a similar type of thing, especially the ones that fit into either 4k or 64k. (Kilobytes.)

-=-=- Activate asshat mode. -=-=-
Warning: This post may contain bloatage.

Login to post a reply

Server time is: 2026-07-08 12:27:16
Your offset time is: 2026-07-08 12:27:16