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.

Code Snippets / Blitz3D style object loading system, no DIMs - better than the last

Author
Message
Arkheii
20
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 28th Oct 2003 15:34
I tried the Blitz3D demo and I liked how it handled entities. Here's my library imitating the system. Copy then save it into a file like "obj_library_v2.dba" and include it in your main proggy. Here's an example:

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Oct 2003 15:45
Nice idea.

I think what would be a great addition though is error trapping. Say you load image function for example, how about making it so that if the file does not exist, it stores an error message in the clipboard - much nicer than DB's own error handling, esp in DBPro where your not always greeted with any error messages at all.


Van-B

Preston C
20
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 29th Oct 2003 02:22
wow, either I got an idea from someone, or you read my mind and made this, but I'm working on a library that imitates the BB3D commands and how they work. It returns a nuber to a variable (the specified name) and the last number in the string of numbers specifies what type of entity the specified entity is and handles it accordingly. I've got around 24 functions done, such as LoadMesh, PositionEntity, RotateEntity, TurnEntityLeft (not sure if its a bb3d command, just felt like putting it in there), etc. It has support for objects, lights, camera, and matrices (or, terrains by what BB3D calls them), and I'm making more functions (imitators of BB3D, or useful ones) minute by minute.


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForce FX 5200 128MB
Arkheii
20
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 29th Oct 2003 05:33
I stopped at object creation functions because the rest could be performed with standard DBC functions. I thought it up just last night and finished in half an hour because I just edited my old library.

Blitz3D looks good, but I don't think they sell it in stores. Oh, and Rich, have you tried B3D by the way?
Preston C
20
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 29th Oct 2003 13:29
Quote: "Oh, and Rich, have you tried B3D by the way? "


It's a Rival product that shouldnt even be mentioned here, shhh!!!


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForce FX 5200 128MB
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 29th Oct 2003 13:36
I'm sure he's tried it, how else are you meant to compete if you don't know what your competing with? Oh yeah, shhh !

Brains are for idiots.

Athelon XP 1600 Plus - Nvidia Geforce MX400 - 256mb RAM
KNau
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: Canada
Posted: 29th Oct 2003 17:44
I have to admit I like the style behind loading things in Blitz but is it really that hard to keep track of object numbers?

http://www.canceriannewmedia.com
WarHunterX
21
Years of Service
User Offline
Joined: 25th Mar 2003
Location:
Posted: 29th Oct 2003 22:02
How bout you just buy Blitz, instead of trying to imitate it
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 29th Oct 2003 22:11
Ummm, buy Blitz just cos you like one aspect of it? What if he likes all the other aspects of DBPro better?

Yeah, I'm using this kind of thing for my own code, except its for my own type of objects. It's handy as I don't need to separate them into groups (ie. I would refer to them as object(groupnum,objectnum)), I can store them in one long array (object(objectnum)) and return the object number to a variable when I create the object.

Brains are for idiots.

Athelon XP 1600 Plus - Nvidia Geforce MX400 - 256mb RAM
Arkheii
20
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 30th Oct 2003 02:40
I'm DBC btw. Most of this stuff is personal preference only, so it just depends on what you're doing.

KNau, yes it is hard to keep track of numbers Blitz costs too much money, US$100.
deckard
21
Years of Service
User Offline
Joined: 11th Apr 2003
Location:
Posted: 30th Oct 2003 10:03
Try this ld function. It's a real trouble to see message
"File not found" What's "not found" file name ?

Here instead of

you simply write

If file not found, then function ld prints its name and
correctly ends program. This saves a lot of debugging time.
If you want to switch off this check for "build final" version,
you change code to

(substitute little "x" to big "X")

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Oct 2003 10:59
Deckard,
Hehe, what has that got to do with the original code, that does'nt use any sort of entity system, you have to specify the number when loading for godsake! - your quicker just specifying the correct command.


Van-B

deckard
21
Years of Service
User Offline
Joined: 11th Apr 2003
Location:
Posted: 30th Oct 2003 12:38
To create "object oriented looking code" from
"classic looking code" is not enough. Code must
work better, not simply look "object oriented"
In case of original code we must define objects
such as MyPlayer,MyEnemy as global variables.
It can produce only more problems.

As to my code, you can use:

mysuperobject=RND(65535)
ld("model.x",mysuperobject,"X")
position mysuperobject,x#,y#,z#


(this is a joke)
Preston C
20
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 30th Oct 2003 12:56
Heh, when I use my entity commands, I generate a number string so the functions can determine if its an object, camera, light, or terrain and which one it is, like so:



So there is no need to set global for any entity name. Gotta put a little more effort in determining if its an object, light, camera, or terrain though.

This is my PositionEntity function:



Basically, it only has support for 9999 objects, lights, cameras, or matrices, but who's going ot use em all? It determines the type of Entity it is first, then it edits the scene accordingly.


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForce FX 5200 128MB
UnderLord
20
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 31st Oct 2003 01:46
I like DB its simple and easy for me to use i liked the way some of the B3d grapics looked but i'd rather have quanity over quality ( i know my spelling sucks! but im good at programming!)

http://www.freewebs.com/ingamers
Arkheii
20
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 31st Oct 2003 02:12
Entity system? wtf, how'd we get to that topic?

All I wanted to do was to make a function that didn't need numbers. I copied what I understood from the B3D demo, and that's it. btw, with some tweeking, most of those suggestions you said could actually be applied to the library. Except, I'm not doing that because I'm not the one in need of anything fancier

Underlord: Quantity? What do you mean? whose side are you on: DB or B3D?
DrakeX
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 2nd Nov 2003 17:23
"i'd rather have quanity over quality"

that's a sad, sad thing. you'd rather have a million commands that don't work rather than 100 commands that do.

"is it really that hard to keep track of object numbers"

it's a bit of a pain to make sure you're not using up object slots. it's much easier to simply make an object and not worry about what slot you put it in.

"I'm sure he's tried it, how else are you meant to compete if you don't know what your competing with?"

wait.. if he has tried B3D then why isn't DBP so much better..?

stop looking at me!
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 7th Nov 2003 20:02
Uh, you can't just think "I want to put this feature into DBPro" and it will pop in there, you actually have to plan it, code it, test it, fix it and test it again, then test any other features that would be affected by adding this new feature, edit them as well to fit in. It all takes time and effort, you can't just expect someone to do something and it will happen, if your so bloody ecstatic about blitz then don't post on there forums.

Do you bite your thumb at me sir?

Athelon XP 1600 Plus - Nvidia Geforce MX400 - 256mb RAM

Login to post a reply

Server time is: 2024-05-03 13:45:25
Your offset time is: 2024-05-03 13:45:25