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 Professional Discussion / Difficult Technical Solutions

Author
Message
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Jul 2003 02:18
Since I last posted on this forum a few months ago and my return to them a day or so back I still get about 10 MSN questions every week, and I see the learning process is also very active on the forums too

Learning is part and parcel of programming but many problems we encounter are not necessarily within the skill level of individual users to grasp.

For example collision detection in some cases can be a very complicated subject, sure if you look hard enough and experiment enough you can find the solutions, but that doesn't meen everyone actually wants to do that before they start producing games.

In many cases these problems can be overcome with standard routines, and I see no reason why standard routines should not be commands in their own right.

To this effect I am considering compiling a suite of new DBPro commands and resources, covering subjects such as collision detection, encryption, massive matrixes and so forth - with the intention of 'expanding' the DBPro command set by meens of #includes (as opposed to .dll's all my commands are written in DBPro).

With this in mind, are there any subjects, tasks that you would like to be considered for such a collection?
Pneumatic Dryll
http://www.users.globalnet.co.uk/~thane/char01.jpg[/img]
Dr OcCuLt
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location: a Dark Deep Dark pit, it dark in here
Posted: 25th Jul 2003 02:29
i got a media manager #includes flie you can have.it has command like NEW_OBJECT that give you the next free object number and so on for Image,Limbs ... etc

--Dr 0--


You mean like a book?
Justin Timberlake N Sync.
On what he read this year that he most liked.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Jul 2003 05:25
I currently have a fully working polygonal collision commandset.

cameraCollide(testObject)

objectCollide(object,testObject)

collide(object)
returns sliding data into global variables: ex,ey,ez

A new input command that checks if any key combination is pressed:
ie: if keyPressed("q") and keyPressed("a") then...
This works for a-z, 1-0, f1-f12.

I've done some computer speed syncornisation code so that you can move things a speed of 1 (Move camera 1) and have them move at the same speed on all systems:
ie: move camera speed(1)
At 100fps a speed(1) is equal to a DB movement of 1.

I have a setResolution() command that sets the screen resolution to the same as the desktop for maximum framerate in Windowed-Desktop mode.

Next up i'm going to do a command set for massive matrixes.

Pneumatic Dryll
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 25th Jul 2003 13:35
Gravity...


Not up yet --> http://thecyborg.t35.com/
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Jul 2003 15:40 Edited at: 25th Jul 2003 15:40
Gravity eh? I'll see what I can do. Incidentally I forgot to list the collision parameters because it is configurable via 3 commands. I've used #constant, but global would also work. I'll explain clearer in the final docs:

#constant walkHeight 150
#constant collisionRadius 20

then either

#constant gravity 25
or to disable
#constant gravity 0
or to sync to cpu clock
global gravity as float
gravity=speed(50)

Pneumatic Dryll
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 25th Jul 2003 15:45
A little off-topic question..
Is Constants global??? (Can you use constants in functions??)


Not up yet --> http://thecyborg.t35.com/
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Jul 2003 16:09
Yes they are global, I think they will work for #include too but i've not got as far as testing that.

Pneumatic Dryll
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 25th Jul 2003 16:50
I haven't testet it but someone here on theese forums told me that Constants can be put in include files and work as they used to do...


Not up yet --> http://thecyborg.t35.com/
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Jul 2003 16:52
Just thought of another routine, placing a large object on a matrix and having it rotate to the attitude of the ground, that gets a lot of people

Still need more ideas here

Pneumatic Dryll
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Jul 2003 16:52
Range finding.

Pneumatic Dryll
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 25th Jul 2003 17:00
What is the availability of these commandsets?
How will they be distributed?

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Jul 2003 17:08
I was thinking about using the pre-processor to protect the code and charging for it (I need to live somehow), but that would only make them harder to use which would defeat the purpose.

Therefor it is my intention to just release the .dba source for use as an #include along with some simple documentation.

Much as I would love to charge a little bit of cash it just isn't practicle, so it will be free.

Pneumatic Dryll
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 25th Jul 2003 17:20
Some functions I have calculated, developed and tested myselfe...

Get distance.. Very simple, but very usefull:
2D:


3D:



Invert Image Colors:
Final image will be in imgnum2


Get the coord from a custom size circles edge at a custom degree:
NOTE: This function will return 2 coords at once (X and Y).. See how to split them into two strings in the next two functions...



Get String Before a certain string (or char):


Same as above just to get after:



Not up yet --> http://thecyborg.t35.com/
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Jul 2003 17:29
I'll greatly increase the speed of your range finding I'll have a look at the others, i'm not sure how much to put into release 1.

Pneumatic Dryll
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 25th Jul 2003 18:25
OK i've decided, most of it will be free but of course a massive matrix is useless without the ability to design the world.

Therefor the programming resource will be free but I will sell the massive matrix system along with editing tools.

I will also over time develop the editor to include my mass object culling technology so ultimately you will be able to create worlds lie my Terrascape system with tens or hundreds of thousands of terrain objects.

My plan goes something like this: today or tommorow I will release the programming resource without massive matrixes. That will be a stand alone resource and hopefully Rich will do his bit in the newsletter to link it

I will then write the massive matrix editor and a few nifty fractal generation routines to make world creation even easier, and write a code exporter to automate your world creation. That i'll sell for a few quid, not sure of price but i'll put a tag on it in accordance with the other editors out there as I don't wish to deny them their trade.

Then i'll do an update to include massive object culling technologies. The update will probably be free.

Can't say fairer than that can I ?

Pneumatic Dryll
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 27th Jul 2003 20:18
I recommend after making a faster version of my range finding code to test the results you get compared to what mine gets, Because alot of people tried to make my version shorter and/or faster, but everytime they came up with a new version it didn't get the same results as mine did... I'm 110% sure that mine gives the right distance... So be sure that yours do to before releasing it...


Not up yet --> http://thecyborg.t35.com/
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 27th Jul 2003 20:35
It's already released, and you'll find the 3D range check included is both faster and accurate.

Anyway the full commandset release thread can be found here: http://www.darkbasicpro.com/apollo/view.php?t=13923&b=5.

Pneumatic Dryll
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 27th Jul 2003 20:42
The Source box here demonstrates the difference between the two techniques. The vector method you will notice is over twice the speed despite working with real numbers

Sadly I cannot claim credit for descovering the method, but I was shown this so long ago that I forget who to thank in the credits

Pneumatic Dryll
lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 27th Jul 2003 20:44
cool idea dryll

TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 27th Jul 2003 21:06
I don't know how to use vectors so i didn't know it could be done like that..


Not up yet --> http://thecyborg.t35.com/

Login to post a reply

Server time is: 2026-07-23 02:37:53
Your offset time is: 2026-07-23 02:37:53