Feature Requests

Blitz3D Forums/Blitz3D Programming/Feature Requests

Axel Wheeler(Posted 2010) [#1]
I'll email Mark with a request to make this a sticky. People need a place to put all their great ideas for Blitz3D, so here it is.


Ross C(Posted 2010) [#2]
CreateBone()

That's really all, oh the option to attach vertices to a bones, detailing their weights.

And a SaveMesh option, that saves a mesh, and iterates through all it's children, saving everything, including bones, vertices UV co-ords etc. I would only request a save to .b3d.

I know this will never happen, but hey, worth a shot :D


xtremegamr(Posted 2010) [#3]
And a SaveMesh option, that saves a mesh, and iterates through all it's children, saving everything, including bones, vertices UV co-ords etc. I would only request a save to .b3d.


I found these in the "Specs and Utils" section of the site.
- .b3d File Format
- Sample code for saving\loading .b3d files

You could probably take the sample code and use it to make a SaveMesh() function if you really wanted to.


Ross C(Posted 2010) [#4]
I can make a save mesh function fine, however, saving multiple textures, children, bones, animations etc is somewhat more complicated. It would be nice to have a function to save all of these. You can't do this yourself, as you have no information about bones, the ability to create them, and vertex weights.


Leon Drake(Posted 2010) [#5]
@Ross C, i have to agree, this is a sought after feature in most engine's, Ogre3d s one of the few that seems to deliver this.

For now i did find that you can get away with loading a Skeleton b3d mesh, and then loading another rigged b3d mesh and then parenting the skeleton bones to the Separate child mesh, when you animate the parent skeleton the other meshes will animate as well.


Axel Wheeler(Posted 2010) [#6]
I think there's a tendency to assume that a game engine is a consumer of media rather than a creator of it, so there is nothing to save. But programmers want to create (and share) their own tools to create things using the language they know (Blitz) rather than relying on complex third-party softare like Blender.

It might be a bit much to expect, though, to have SaveMesh() save everything. Just saving the mesh itself would be a good start.

And even though there may be code in the archives to do it, that would be true for most commands people want in a language. Also, when Mark writes it you feel like you can trust it, or at least complain about with everyone else...

I'm glad this thread is getting used. I emailed Mark about making it a sticky; we'll see!

-Pete


Axel Wheeler(Posted 2010) [#7]
In some cases there may be a well established and free third-party library of commands, which would provide great functionality without Mark having to add it to Blitz3D. In such cases, however, this website should host the .dll to ensure that it will really be available to new programmers.

For examble, this thread ...

http://www.blitzbasic.com/Community/posts.php?topic=75711

... discusses a wonderful library of useful commands by Billp that is at the moment unavailable, so of no help to anyone.

-Pete


Ross C(Posted 2010) [#8]
Well, my feature request would be simply CreateBone() and AssignVertexWeight(). I'm assuming the current commands for capturing animations wouldn't work for these, so some kind of basic capturing of frames. That way, you could practically access all information about a mesh (minus the texture scaling and rotation, but you can technically store these yourself)


MusicianKool(Posted 2010) [#9]
i would like to request deeper commands of blitz's 3d vertex core and lod. i've looked at minib3d and it seems as though all the commands im looking for are already in blitz but not as a usable part of the language. so this should be easy.


Leon Drake(Posted 2010) [#10]
on a side note also being able to create bones and set weights in the program would pave the way for streaming animated models either by a thread or just by increments on each program loop.


Yasha(Posted 2010) [#11]
i've looked at minib3d


Careful...

miniB3D isn't the same engine as Blitz3D, it was just written to provide the same interface at the user level. There's no guarantee that anything below the top-level functions works in a similar way to Blitz3D (it was written by a different person, for a start).

It's not a "proper" solution, but MikhailV's structure tables can provide you with useful information of this sort, if you really need to access it at a low level on your current project.

EDIT: Oh, I already told you that. Sorry to repeat myself, I forgot...


Axel Wheeler(Posted 2010) [#12]
Yasha: The link you posted is working but the links on that page are down. (the gifs)

What about:

-Directx9 support?

-OpenGL support?

-Compile mac/*nix versions as well as pc. (as long as you're putting in OpenGL support...)

Not that these things are particularly important to me, but others have certainly voiced their desire for them. (Tall orders all, though...).

My requests are mostly about the website and inconsistent documentation, but I've whined about that elsewhere.

-Pete


Yasha(Posted 2010) [#13]
That's a pity. I really should have taken the chance to make offline copies of those...

As for Directx9 and OpenGL support or cross-platform compiling... people are aware of BlitzMax, right?

For more advanced (DX9/OGL) 3D engines without the language support, take a look at SoftPixel, Xors3D, Leadwerks, BlitzOgre3D...

Pretty much all of the major feature requests have already been addressed by the vast array of products and addons in other parts of the forum.


Serpent(Posted 2010) [#14]
I think it's a shame that in order to get support for multiplatforming and more modern graphics that one needs to abandon the simplicity of Blitz3D for the OOP style of BlitzMAX.


GfK(Posted 2010) [#15]
I think it's a shame that in order to get support for multiplatforming and more modern graphics that one needs to abandon the simplicity of Blitz3D for the OOP style of BlitzMAX.
Its a common misconception that BlitzMax forces you to adapt to object oriented programming. In truth you can still use the procedural style if that's what you want to do.


stayne(Posted 2010) [#16]
CreateGame(mmo)


Leon Drake(Posted 2010) [#17]
>.>

<.<

i prefer OOP...
but its not a requirement to use blitzmax


Ross C(Posted 2010) [#18]
I think reasonable requests would help greatly. Your not going to get a multi-platform, openGL version of blitz. It is a shame that blitzmax, and I am liking it so far, doesn't come with a basic 3d engine. Minib3d is slower in some cases, than blitz3d, and is missing some features.

But anyway, that's by the by. CreateBone(), AssignVertexWeight() and AssignVertexBone() and commands to read these back. Come one BRL! ;)


Who was John Galt?(Posted 2010) [#19]
I think it's a shame that in order to get support for multiplatforming and more modern graphics that one needs to abandon the simplicity of Blitz3D for the OOP style of BlitzMAX.
www.blitzmax.com/Community/posts.php?topic=78064


Axel Wheeler(Posted 2010) [#20]
Well I had written an impassioned defense of B3D only to realize that:

A. It's not really appropriate for a thread about feature requests, and

B. It is a sufficient reason that B3D has not been discontinued by it's author. That means it should be receiving periodic meaningful updates. Thus, the "just use BMax" argument could be made to officially discontinue B3D, but not to fail to update it if it is officially supported.

Back to the topic; I do think collections would enhance the usage of custom types.

In a nutshell; when you create a type, you are defining the fields of that type but you are also creating a single linked list of instances of them, which you iterate through using after and before.

Collections allow you to create additional linked lists of them, something like:

type baddie
   field strength
end type

global team1.baddie=CreateCollection(baddie)
global team2.baddie=CreateCollection(baddie)
global team3.baddie=CreateCollection(baddie)


.. or something similar.

Of course, they would still be reachable in the original list; each list is independent. This would lead to:

type team
   field baddies.baddie=CreateCollection(baddie)
end type


which would create a type of teams, each of which would have it's own collection of baddies, with all the advantages thereof.

(Yes, I assume BMax has some of this. So?)

-Pete


puki(Posted 2010) [#21]
I think you could create a bone in Blitz3D. You can read vertex weights so, I assume, you can just write over them? - ie you coulde take a master bone and reproduce it and than write the values that you want over the top of the new bone - the whole entity/surface structures can be written to.

In fact, I am sure that "Yasha" did some work on this based on the prior work of "GrumpyOldMan" who possibly based his work on what "halo" and "Vertex" did at the end of 2003.


puki(Posted 2010) [#22]
I think you could create a bone in Blitz3D. You can read vertex weights so, I assume, you can just write over them? - ie you coulde take a master bone and reproduce it and than write the values that you want over the top of the new bone - the whole entity/surface structures can be written to.

In fact, I am sure that "Yasha" did some work on this based on the prior work of "GrumpyOldMan" who possibly based his work on what "halo" and "Vertex" did.


Yasha(Posted 2010) [#23]
Collections really seem like something you can create in the code directly. There are a couple of libraries in the code archives demonstrating BMax-style maps and hashtables for B3D types.

field baddies.baddie=CreateCollection(baddie)



Interestingly, the B3D parser seems quite happy with assigning default values to fields... it just doesn't seem to do anything (they might have to be constants for it to compile without error). Don't know why this was left in if it doesn't do anything... maybe it's a relic from before BMax became a separate language? (if it evolved that way, no idea)

I am sure that "Yasha" did some work on this


I made a little lib using MikhailV's FastPointer, that allowed one to create bones ex nihilo and assign vertices to them (i.e. what was being requested earlier in this thread). Nobody seemed interested! It's in the code archives... hasn't been tested under the latest B3D.

Actually this thread has given me one idea for a feature I always wanted in B3D - "unsafe" Object/Handle commands. Instead of slowly accessing a global collection, so that handles safely return Null if invalid, it would be nice to have an option to simply cast the pointer to int, so type objects could be Peeked and Poked without the speed hit of Object/Handle (assuming the author knows what they're doing and doesn't use an invalid pointer), much like you can currently pass a pointer to a DLL (but can't get it back again). Although once again, this is a core BMax feature.

I think it's a shame that in order to get support for multiplatforming and more modern graphics that one needs to abandon the simplicity of Blitz3D for the OOP style of BlitzMAX.


All four of the engines I listed above work with B3D.


puki(Posted 2010) [#24]
"Shagwana" and "Beaker" would have done work in that area in the past - mainly on Types, but Object and Handle were known hidden commands at that time. "Shagwana" did propose using a .dll.


Nike(Posted 2010) [#25]
What about createfolder or a input without waiting or a command that types a letter so you could make auto typers and things like that?


Yasha(Posted 2010) [#26]
...CreateDir(). KeyHit(). And the third sounds like a suitable project to write for oneself.


Ross C(Posted 2010) [#27]
Nice Yasha, I'll need to check that out. Could you read the information back again?


Kryzon(Posted 2010) [#28]
Could also use GetKey() for letters. Doesn't halt the execution, and returns the character's ASCII.


Who was John Galt?(Posted 2010) [#29]
B. It is a sufficient reason that B3D has not been discontinued by it's author. That means it should be receiving periodic meaningful updates. Thus, the "just use BMax" argument could be made to officially discontinue B3D, but not to fail to update it if it is officially supported.
The official line on B3D is that it is considered feature complete but it is supported in terms of bug fixes. Many of your requests amount to a complete rewrite of the product. Unlikely...


Yasha(Posted 2010) [#30]
Could you read the information back again?


You can currently read back a list of the bones attached to the mesh, and get the list IDs of the bone(s) attached to each vertex (and then get the entity handle by putting this into the function to get from the mesh list).

I didn't add a function to read the bone weights for each vertex, but it should be easy enough for me to add this (I say "should" because I haven't touched the code in months and can't remember what I actually did).

EDIT: Oh and important - because it relies on hardcoded pointer offsets, it needs to be tailored to specific Blitz3D update versions. For example, the version in the code archives works with 1.103 but not 1.101, and will cause horrible things to happen in 1.100 as it refers to entity fields that didn't exist back then. This is a big issue to bear in mind before using it.


Axel Wheeler(Posted 2010) [#31]
John: Where is this official line available to prospective buyers? Not on the homepage or the Blitz3D product description page. I think that makes it the unofficial line at best. :-)

The official line is:

- It's marketing information refers to a growing user base and people switching from other languages

- DevMaster database lists it as "Productive/Stable"
http://www.devmaster.net/engines/list.php?search_id=ce14c9b23a3cdf4e6d11b6e6523d2726

WikiPedia's list of game engines claims:
Wait a minute! None of the Blitz products are even listed there!
http://en.wikipedia.org/wiki/List_of_game_engines

They do have a page for Blitz Basic, but it's section on Blitz3D makes no mention of feature completeness.

But back to the wish list:

What about something like this:

battleField=CreateWorld()
SwitchWorld(battleField)

... call your battle function ...

SwitchWorld(gameBoard)
DeleteWorld(battleField)

(and also CopyWorld() to set up one or more scenes and just copy in the one you need)

Every entity (including lights and cameras) would be linked to a specific world, so you would no longer have to hide things out of sight, and conceptually it would be much easier to manage certain types of games. Also while the other worlds would take up memory, they needn't take up processing time, as out-of-sight entitities do (and even hidden entitities, in theory).


Leon Drake(Posted 2010) [#32]
@Axel yea i do wish that B3d had some optional SceneGraph functionality. You can basically do the same thing by parenting all the "World" objects to a pivot, then just show and hide it when you switch between worlds.


jtassinari(Posted 2010) [#33]
Hi there,

Hey, this is a nice idea!
I think that product can get better as they are required and new addons/implementations are realized.

Probably it has already been asked, but i wish B3d could have a DX8 and DX9 usage.
Mainly, i would like to have a DX import that can accept Blender3D export.
BTW, lighting/shading, shadowing would be really something great :D

cheers,

jT


ClayPigeon(Posted 2010) [#34]
Here are my ideas:
1. Allow type fields to be created on the fly per-object. (like local vars)

2. CreateSound(), SetSampleAmplitude(sound,sample,amp), etc. For sound-editing.

3. Type parenting. For example, if you have different types for each enemy, but they're still all enemies, you could create an "enemy" type then have all created enemy types be parented by it. Then you could parse through all of the enemies by doing a For Each loop on the "enemy" type.


Axel Wheeler(Posted 2010) [#35]
Yasha:


Interestingly, the B3D parser seems quite happy with assigning default values to fields...



I just got what you were saying... my point was really about declaring a collection within a type. Whether it's actually assigned then or later doesn't matter to me. But my syntax baddies.baddie would not be enough since that would only tell the compiler to create one baddie. Maybe:

type team
   field name$
   collection baddies.baddie
   field teamColor.aColor
end type


I'm thinking the Field keyword is really just for visual clarity anyway, this shouldn't cause any problems.

Then...

thisBaddie.baddie = New baddie
Add(thisBaddie,team1\baddies)

...

for each someBaddie.baddie in team(i)\baddies
   takeATurn(someBaddie)
next



ClayPigeon(Posted 2010) [#36]
Oh, also, it would be nice if when you type a custom function's name to execute it it will turn it's own color and get autocaps'd. It would just make things easier to read/edit.


Yasha(Posted 2010) [#37]
when you type a custom function's name to execute it it will turn it's own color and get autocaps'd.


http://www.fungamesfactory.com/

Seriously, don't use the default IDE.


MCP(Posted 2010) [#38]

For examble, this thread ...

http://www.blitzbasic.com/Community/posts.php?topic=75711

... discusses a wonderful library of useful commands by Billp that is at the moment unavailable, so of no help to anyone.



Leon Drake provided an alternative link at the bottom of that thread which works at the time of this writing.

Here it is again thanks to Leon :)
http://www.vigilsoft.net/Blitz3dplus.zip

*EDIT: Forgot my feature request:- I would like to see an alternative to GetMatElement which actually returns a pointer to the entity's matrix so it can
be modified directly. This would probably work best with the SDK.
SetMatElement would be a nice addition also (better for Blitz3D implimentation).


Axel Wheeler(Posted 2010) [#39]
MCP: Awesome! Thanks so much. (Still should be on this website of course...)

ClayPigeon:


2. CreateSound(), SetSampleAmplitude(sound,sample,amp), etc. For sound-editing.



Yes, yes, yes! For those like myself who prefer to create media procedurally than to load it (cuz it's cooler) sound editing would be awesome. In my current project the sounds are almost the only things I have to load. (Yes we know there are packages in the archives.)


3. Type parenting. For example, if you have different types for each enemy, but they're still all enemies, you could create an "enemy" type then have all created enemy types be parented by it. Then you could parse through all of the enemies by doing a For Each loop on the "enemy" type.



Sounds like a collection...? (discussed above)


Oh, also, it would be nice if when you type a custom function's name to execute it it will turn it's own color and get autocaps'd. It would just make things easier to read/edit.



Yasha's point is right on (prepare to be amazed by Ideal). I just wanted to add that it doesn't actually autocap; it just matches the case you put in the function declaration, which I think is what you are talking about.


_PJ_(Posted 2010) [#40]
No response collisions.

ChannelForward(SoundChannelHandle%,Milliseconds%) - Skips playback by specified number of ms from current play position
ChannelPlaytime%(SoundChannelHandle%) - Returns current play position in ms since start of sound
ChannelSoundLength%(SoundChannelHandle%) - Returns total lengfth of sound in ms
ChannelBackwards%(SoundChannelHandle%,Milliseconds%) - Skips playback by specified number of ms back from current play position


ClayPigeon(Posted 2010) [#41]
Seriously, don't use the default IDE.

Yasha's point is right on (prepare to be amazed by Ideal).

I do, in fact, already use IDEal and find it to be what I originally expected the Blitz IDE to be. I'm only trying to get the Blitz IDE improved, so eventually, there would be no need for third-party IDE's.

No response collisions.

YES. PERIOD. Enough said. XD

@Malice: Wouldn't it make more sense to combine ChannelForward and ChannelBackwards to make ChannelSeek or something? 'Cause you could just put in a negative number for backwards.


_PJ_(Posted 2010) [#42]

@Malice: Wouldn't it make more sense to combine ChannelForward and ChannelBackwards to make ChannelSeek or something? 'Cause you could just put in a negative number for backwards.


Indeed!
If a Playtime counter is impleneted, then just seeking a specific time in the track might be a lot better, the maths being done 'manually' to work out a time x ms from 'now'.


ClayPigeon(Posted 2010) [#43]
How about eliminating the PlayMusic command altogether, and add a true/false argument to LoadSound that determines whether to load the sound or cue it for streaming from the disk. Then the sound could be looped, changed, etc. and could be referred to by it's sound, as opposed to it's channel. Maybe also adding support for speaker configurations other than stereo such as surround or quadrophonic. Or a function like Graphics that inits the audio mode. Might help out with 3D sound.


SLotman(Posted 2010) [#44]
Move B3D at least to DX8 so it will work better on Vista/7? I could live without all DirectDraw stuff... the rest, is the rest.

...and no, I really don't expect anything new to B3D, unfortunately :/


Rroff(Posted 2010) [#45]
One thing I would like, ability to load any asset including sounds from a bank, theres quite a few potential uses for this. Inclusion of openAL support or similiar wouldn't go amiss either, I keep meaning to wrapper that but never get around to it.


ClayPigeon(Posted 2010) [#46]
The ability to declare a short or a double-precision float. Also, maybe a WriteBoolean command so a whole byte isn't wasted for a true/false when writing to a file.


big10p(Posted 2010) [#47]
Also, maybe a WriteBoolean command so a whole byte isn't wasted for a true/false when writing to a file.
Nothing smaller than a byte can be written to a file. Infact, if you were to write a single byte file, it'd actually take up an entire cluster, comprising many bytes (the size of which is dependant on the disks sector/cluster size).


_PJ_(Posted 2010) [#48]
Well, Boolean values actually still take up 8-Bits i.e. a single, 8-Bit Byte. Kinda wasteful, sure, but though iot's 8 * the necessary info, there's little capacity for and certainly no standards available about how to use the "excess" space.

This is ther minimum that can be written to a file (When dealing with a stream of multiple bytes, so the file + icon + header + all the other junk that gores with the file format etc. is kinda irrelevant, I think ClayPigeon was just referring to the reading and writing of data beyond the header)

A possible solution, may be to store the information along with a value you KNOW is going to be less than 7-Bits, i.e. from 0 to 127. This way, the SIGNED bit can be used to reflect the Boolean value.
However, again, this is impractical outside of individual purposes, since there's no capacity for standardisation, and of course, this still requires the "piggybacking" of a 7-bit value.

The problem with 32-Bit computing, though is evident in this manner, Blitz shows this with it's choice of only being able to write 8-Bit or 32-Bit values.
Admittedly, custom possibilities can be built from these basics (for example,
For n=0 to Size-2
    Most=ReadByte(stream,n)
    Least=ReadByte(stream,n+1)
    Sixteen=Most Shl 4 + Least ; I think?
Next


But once again, there's no standardization possible since it's solely down to the user to know whether oor not to expect an 8,16, 24 or 32-Bit value.

I did some work on this a while ago, in an attempt to optimise the reading/wrtiting some by the use of a 'Control Byte' which could contain information about the sizes, signs and so on of the following byte values

It's still a WIP and unfuinished as yet, but here's what I have so far:

; WriteInt, Float and String always use the long byte 32-Bit notation.
; However, most Strings contain the standard ASCII set which only requires 8 bits.
; Many Floats or Integers may also be in a small range, that do not require the space of 32-bits.
; However, generally, there's no guarantee of knowing how many bytes worth of information should be attributed to a particular
; value.
; WriteByte, conversely, ONLY writes a single 8-Bit byte. So it cannot alone be used to store values greater than 255.

; Consider the following integer: 42372
; This value requires at least 2 Bytes (16-bits) 

; Bits '3', '7', '8', '10', '13' And '15' are set To 1 (Note: Bit '0' =1 Bit 15 is the 16th Bit)
; 4 + 128 + 256 + 1024 + 8192 + 32768 = 42372

; If taken separately, as 8-Bit Bytes, Byte 1 (Bits '0'-'7') would appear to equal:

;Byte 1
; Bits '3' and '7' set to 1
; 4 + 128 = 132

;Byte 2
; Bits '8', '10', '13' And '15' set to 1 (or, Bits '0', '2', '5' and '7' considering Byte 2 as an 8-Bit Byte)
; 1 + 4 + 32 + 128 = 165

; So there is ambiguity. Are we looking at a 16-Bit value of 42372 
; OR
; a sequence of two 8-Bit values: 132,165

; This ambiguity is the main reason why the standard of 32-Bit notation (64-Bit values and quadwords are beond the scope of this document)
; is used, regardless of the size of the value represented, if it is accepted to always use 32-Bits, then any value in a range of (2^32)-1 (	4294967296   )
; can be represented without risk of confusion.
; so our above example of 42372 will be represented as a 4-Byte value as all 32-Bit values.
; The priority of bytes places the "Most Significant" Byte FIRST. 
; The "Most Significant Byte" will be the Byte with bits representing the HIGHEST values.
; The highest Bit value in 32-Bit notation, is Bit '31' (remember we number Bits from 0....) with a value of 2^31 (  2147483648  )
;Since our number really only utilises two of the 4-Bytes, the first 16-Bits (Bit '31' down to Bit '16') will be 0

; So, contrary to the displayed workings earlier, 42372 is shown by:

;BITS
; 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
;  0   0   0   0   0   0   0   0  0   0   0   0   0   0  0   0  1   0   0   0   0  1  0  1  1   0  0  0  1  0  0  0

; It is these first two 'wasted space' bytes that this document and the code involved attempts to save.
; However, We still need a means of identifying how many Bytes a particular value needs.
; There is no other way to do this, unless your code ALWAYS knows precisely which range of values to expect and the order
; they appear in. This is impractical for most purposes.
; Therefore, we are going to use an extra Byte to make use of its 8 bits. There is more power available to us with the extra 8-bits
; awarded, besides identifying the number of bytes that follow, Since our 32-Bit processors only cope with numbers of 32-Bits at the most,
; We know that our extra Byte only needs to use Bit '0' and Bit '1', representing the possble number of Bytes to follow from 1 to 4.
; (Since we must use at least 1 Byte, a 0 value  of all Bits set to "0" can show 1 byte to follow, meaning we only need to count 0,1,2,3 for four possible Bytes)
; This then gives us 6 more Bits to 'play with'. But what else can we use them for?
; Well, an obvious first choice would be dealing with negative integers.
; We know we can represent values from 0 to (2^32)-1 but what if we wanted just to show -1 ?
; Traditionally, Byte values are considered "signed" or "unsigned" - "signed" meaning, they contain a Bit that represents a "sign", as in the "minus sign" ( - )
; Since this Bit is used for the "sign", it can no longer be used as part of the number itself.
; Here's an example of an 8-Bit "signed" Byte compared to an  "unisgned" version:

; SIGN 64  32   16   8   4   2   1
; 128   64  32   16   8   4   2   1

;Note how the HIGHEST value (Most Significant) Bit is used for the Sign (in this case, Bit '7'  = 128)

; Despite no longer having access to values Greater Than 127, we still have 255 possible values. How so?
; Well, let's see what happens when we use the "Sign" Bit:

; SIGN 64  32   16   8   4   2   1
;    0     0   1      0   1   0   0   1	=	32 + 8 + 1 		= 41

; If The "Sign" Bit is set to 0, then it is considered Positive. However, the same Byte with the Sign Bit set to 1 gives:

; SIGN 64  32   16   8   4   2   1
;   1     0   1       0   1   0   0   1	=	-	32 + 8 + 1 	= -86

; It doesn't make sense at first sight, how can 32+8+1 = -86 ?
; The answer is that the active Bits are actually added to -127
; Allowing for addition (setting Bits ON to 1)  to Increase, and subtraction (setting Bits OFF to 0) to Decrease the value as mathematically correct.
; The range of values then, for a "Signed" 8-bit Byte, are from -127 to + 127 including 0  to give our 255 possible values.

; So we now know that our special Added Byte will have at least 3 Bits in use:

; 128		64		32		16		8		4		2		1
;										     SIGN	 # BYTES  #BYTES

; What to do with the other 5 Bits?


WaitKey()
End

f=1
While f<65536
Print f+" "+((42372 And f)=f)
f=f*2
Wend


Function WriteEfficientInt(Stream%,Integer%)
	Magnitude%=Abs(Integer%)
	If ((Magnitude%)>255)
		While (Magnitude>255)
			Magnitude%=Magnitude%/256
			WriteByte(Stream%,Magnitude%)
		Wend
	End If
	Magnitude%=Magnitude% Mod 256
	WriteByte(Stream%,Magnitude%)
End Function

Function CalculateBytes%(Magnitude%)
	Magnitude%=Abs(Magnitude%)
	Local nBytes=1
	If ((Magnitude%)>255)
		While (Magnitude>255)
			nBytes=nBytes+1
			Magnitude%=Magnitude%/256
		Wend	
	End If
	Return nBytes%
End Function



ClayPigeon(Posted 2010) [#49]
I believe you could use WriteByte to write 8 boolean values to a file using bit-shifting, as well as 4 0-3 values, or 2 1-digit hex values.


_PJ_(Posted 2010) [#50]
Yes, it's certainly possible, but without any standard of what to expect, it's really down to user preference, and so writing ones own function is readily simple enough to not warrant needing a B3D function
(Just in my opinion of course, the threads for ideas for feature requeests, so all ideas are valid I'm sure :)

Function WriteBools(stream,b1,b2,b3,b4,b5,b6,b7,b8)
WriteByte stream,(b1)And 1 Or (b2)And b2 Or (b3) And 4 Or (b4)And 8 Or (b5)And 16 Or (b6) And 32 Or(b7)And 64 Or (b8)And 128
End Function


Alternatively, to make use of nibbles (4-Bit values) You still MUST have two of these values or 4-bits of data are 'wasted'.
Combining these is equivalent to just using WriteByte again, but the maths of separating the values is done outside of the read/write:
i.e.



Byte=ReadByte(Stream)
Nibble1=Byte And 240 ;Big Endian first
Nibble2=Byte And 31 ; Little Endian


As for the Hex digits,
Whilst 2 digit Hex values may seem a lot more efficient being just 2 digits, there's no way to achieve this other than normal 8-Digit bytes, since each Hex digit can have 16 values (0-F) meaning a minimum of 4 bits to represent one digit. Two digits, then must take a whole 8-bit byte, which is what you already have with WriteByte. This is EXACTLY the same as the above Nibble example. The first Nibble is the Most significant Hex digit, the second nibble is the least significant digit.

Byte=ReadByte(Stream)
Nibble1$=Hex(Byte And 240) Shl 4;Big Endian first
Nibble2=Hex(Byte And 31); Little Endian



Axel Wheeler(Posted 2010) [#51]
I agree completely with Malice's no response collisions request. (That is, a collisions mode that doesn't move or stop the entities, it just allows the EntityCollided() command to work so we can implement our own result.) I was blown away when I realized there was no option for that.

Currently you would have to remember each unit's previous position so that if EntityCollided() is true you can then reposition it, turn off collisions, move it again, and then proceed. And then turn on collisions again. Crazy. I say "you would have to" because I don't think anyone bothers to go through this. You just write your own slower (high level) collisions code.

Actually, this could be considered a bug...

(edited to correct spelling of write... :-)


ClayPigeon(Posted 2010) [#52]
I agree. It could be set up so that the fourth argument of the Collisions command can be set to zero for no response. Polygon-to-polygon collisions would be nice as a replacement for MeshesIntersect command, but only if no response collisions are implemented.


Axel Wheeler(Posted 2010) [#53]
Here's another: An actual mirror. One that can be used as a rear view mirror in a car.

I don't know if it would be possible to set a camera as a mirror. Failing that, just the ability to set the dimensions. More like a sprite than a plane.


ClayPigeon(Posted 2010) [#54]
CreateClippingPlane().
Would help reflections, multi-pass renderings, and a truckload of other graphical feats. It could be rotated and positioned so that it could prevent reflections from a mirror to stick through to the other side, or they could be placed around the outside of a room the camera is in to speed up rendering by preventing unseen neighboring rooms from being rendered.


Rroff(Posted 2010) [#55]
For no response collision detection its pretty simple to write your own - you either have to compare against sphere (distance from origin) or bounding box which is trivial or very slowly with MeshesIntersect testing.


_PJ_(Posted 2010) [#56]
For no response collision detection its pretty simple to write your own - you either have to compare against sphere (distance from origin) or bounding box which is trivial or very slowly with MeshesIntersect testing.


That's the point, it's something horrendously cumbersome and slower when 'under-the-hood' the collision check has been done already, it's like having to write your own function to say, animate a mesh even though the Animate and UpdateWorld etc. have been called.

Here's another: An actual mirror. One that can be used as a rear view mirror in a car.
I don't know if it would be possible to set a camera as a mirror. Failing that, just the ability to set the dimensions. More like a sprite than a plane.

It would be nice yeah, to have a 'mirror', but it's kinda intensive, especially if that mirror might be moved in realtime.
It IS possible to just set another camera for things like rear-vierw mirror, which is a pretty good option. If you wanted, say a mirror that you could view from different angles, you might like to do the same but output the 2nd camera's render to a texturebuffer on a mesh entity somewhere.
The difference with mirrors and the Blitz3D 'Mirror' or a 'static-placed' Rear-View mirror is that the angle you view it from and distance away determines the scope of the reflection, meaning a lot more calculations. There's a thread on this in the B3D programming forums somewhere.


---
Whilst on the thread, and this is more of a dream ideal than a request I think would ever actually be realised, but how about if triangles could be made a kinda Pick Mode that would actually block light from passing through them. Automatic correct shadows :D


_PJ_(Posted 2010) [#57]
hrm..
BufferWidth(Buffer)
BufferHeight(Buffer) ; (Specify Buffer or Current Graphics Buffer?)

would be handy.

For example, when calling a function that reads or writes to a a buffer, you need to specify the buffer, but you don't know the width/height.
Either the function takes these as parameters, OR you oass not the buffer, but the image/texture/sprite etc. handle. But in passing the handle, your function needs to be specific to the differnt types of entity.

Consider:

Function DrawACircleOnBuffer(Buffer,H,W)
   SetBuffer Buffer
   Oval W shr 2, H Shr 2,W Shr 1, H Shr 1,1
End Function


Or

Function DrawACircleOnImage(Buffer)
   SetBuffer ImageBuffer(Buffer)
W=ImageWidth(Buffer),H=ImageWidth(Buffer)
   Oval W shr 2, H Shr 2,W Shr 1, H Shr 1,1
End Function

Function DrawACircleOnTexture(Texture)
   SetBuffer TextureBuffer(Texture)
W=TextureWidth(Texture),H=TextureWidth(Texture)
   Oval W shr 2, H Shr 2,W Shr 1, H Shr 1,1
End Function


Compared to:

Function DrawCircleOnBuffer(Buffer)
   SetBuffer Buffer
W=BufferWidth(Buffer),H=BufferWidth(Buffer)
   Oval W shr 2, H Shr 2,W Shr 1, H Shr 1,1
End Function



Axel Wheeler(Posted 2010) [#58]
Malice:


It IS possible to just set another camera for things like rear-vierw mirror, which is a pretty good option.



Well, no. For a rear-view mirror the image has to be reversed.


_PJ_(Posted 2010) [#59]
A simple inverse scaling of the camera ought to fix that?

Or rotate the camera through 180 degrees ROLL, then set the CameraZoom to negative perhaps?


ClayPigeon(Posted 2010) [#60]
Oh, how could we forget?

RENDER TO TEXTURE.

We NEED render targets! It's least Mark could do. He's starving us of the sugar needed to make our eye candy!!! :)


big10p(Posted 2010) [#61]
This entire thread is an exercise in futility. :)


_PJ_(Posted 2010) [#62]
There's no harm in discussing what could be truly useful and hopefully possible implementations, whether or not this is ever considered by Mark Sibly / BRL at least there's a chance that the most realistic and requested features are brought to light!


Axel Wheeler(Posted 2010) [#63]

A simple inverse scaling of the camera ought to fix that?


Do you mean ScaleEntity(cam,-1,0,0)?
Does nothing.

Or rotate the camera through 180 degrees ROLL, then set the CameraZoom to negative perhaps?


Clever, but just flips it back upright again. No mirror image. Thanks for the ideas though!

big10p: Perhaps, but if Mark has really given up on it then perhaps it can be sold to a company that wants to develop it, incorporate Xors3D and/or some of the other excellent adjunct packages. This list is still relevant to whomever picks up the ball and wants to continue development of the most graphically powerful non-OOP version of the most intuitive language ever created: Basic.


This:
For i = 1 to 10
  Print "Hello World"
Next


... gets people into programming.

This (approximate):
class HelloWorldApp {
   public static void main(String[] args[]) {
      For (i=1;i++;i=10) {
         Console.Writeline("Hello World")
      }
   }
}


is gibberish that has killed many a budding programming interest. I realize that BlitzMax is Basic, and is not "necessarily" OOP, which is good news, but it is said that 3D support is still poor. When native 3D in BlitzMax is as good as Blitz3D, then indeed it may make no sense to stay with Blitz3D.

In a nutshell, BlitzMax is advertised as a 2D game dev product, and it basically is, at this point.


Axel Wheeler(Posted 2010) [#64]
</tirade>

Might have gotten a little carried away there... :-)

Y'know, it's an iteresting thought... Has anyone considered buying Blitz3D from Mark? Perhaps an open source group? We'd need someone with low level programming skills, I would think.

Perhaps that is a topic for a different thread.

Anyway, consider this thread either for improvements Mark can make, or that some theoretical future owners of Blitz3d might make should he decide to sell it.

So, a feature: Would it be possible to add automatic LOD support for everything in a Blitz3d world, not just Blitz terrains? There are threads on here showing various ways of hiding off-camera entities, or just triangles, to speed things up considerably. Including that functionality natively would be excellent.

Built-in physics would be nice as well.

AddMesh() currently (i.e. last time I checked) creates a new surface each time. It should leave that as an option. (fyi: sswift has a workaround called AddMeshToSurface() in the archives)

HUD assistance a la Sprite Candy (not that fully featured necessarily, but you get my drift). Every game needs it, so why not simplify it? Especially useful would be bitmap font support and some fonts.

Several more primitives:
- Toruses (Tori?)
- Pillbox (think of a sphere extended horizontally in x and z directions, with cylinder-style endcaps at the poles)
- Capsule (cylinder with hemisphere endcaps)

These next two are not common as far as I know but I think they might be useful:
- Sheets (just a grid like a terrain but that can be morphed any old way you want - there may be a better name than sheet out there)
- partial cubes. CreateCube() could have an optional flags argument that determines which faces exist. Thus CreateCubes(0,128) = all faces exist (default), while CreateCubes(0,5) would have just two faces (1+4=5). The 1 face might be z=1 and the 4 face might be y=1, or whatever. This way people could assemble vast levels without loading anything or editing meshes directly by scaling these shapes appropriately.

If nothing else, lots of cool primitives is a great visual selling point for the product. Marketing, people, marketing!

The goal here is not just to make life easier for us, but for the beginner. The less research they have to engage in, poking around in the archives, etc., the more likely they are to stick with it.


ClayPigeon(Posted 2010) [#65]
Alpha blending in 2D, not to mention alpha mask loading in LoadImage. Would be nice. I know it might be to much to ask for realtime scaling and rotation of images, because it's probably faster to just do 2D-in-3D.

...But still! :)


*(Posted 2010) [#66]

Alpha blending in 2D, not to mention alpha mask loading in LoadImage. Would be nice. I know it might be to much to ask for realtime scaling and rotation of images, because it's probably faster to just do 2D-in-3D.



You answered your own question there, 2d-in-3d is the best way to do that in Blitz3d.


GaryV(Posted 2010) [#67]
Alpha blending in 2D,
Blitz3D uses DirectDraw 7 for 2D. DirectDraw (all versions) was killed off when DirectX 8 (which introduced new technology to emulate 2D via 3D methods) hit. There is literally nothing Mark could do to extend the 2D side of B3D short of porting all 2D & 3D rendering to a new API.


_PJ_(Posted 2010) [#68]

A simple inverse scaling of the camera ought to fix that?



Do you mean ScaleEntity(cam,-1,0,0)?
Does nothing.


Or rotate the camera through 180 degrees ROLL, then set the CameraZoom to negative perhaps?



Clever, but just flips it back upright again. No mirror image. Thanks for the ideas though!


Ach.. worth a try though. Sorry it didnt work.
Since you mentioned the mirror issue, I never actually realised the inherent problems like that :(


Axel Wheeler(Posted 2010) [#69]

Here are my ideas:
1. Allow type fields to be created on the fly per-object. (like local vars)

2. CreateSound(), SetSampleAmplitude(sound,sample,amp), etc. For sound-editing.

3. Type parenting. For example, if you have different types for each enemy, but they're still all enemies, you could create an "enemy" type then have all created enemy types be parented by it. Then you could parse through all of the enemies by doing a For Each loop on the "enemy" type.




I guess I missed these, Clay, and they are interesting. I would say 1 and 3 are closely related and 3 is basically OOP-style inheritance:

class mammal {

   float speed;

   run() {
    ... move mammal forward
   }

}

class cat : mammal {

   float purrVolume;

   purr() {
   ... cat purrs ...
   }

}


So here the cat class (i.e. type) inherits from the mammal class and so ..

fluffy.cat=new cat;


... creates a cat instance named fluffy who can purr or run and has both the purrVolume and speed fields. (Note that the syntax of the code varies language to language as well as the terminology.)

You could also loop through all mammals and run each one's run() function (known as methods in OOP. Excuuuuse me!)

You can even create a different run method in the cat class that would replace ("override") the mammal one.

All these things are cool; my only beef with OOP is mandating that everything must be done with classes, which is the essence of OOP. Thus even the program itself is a class, every entity must be an instance of a class, etc. Massive unnecessary complexity just to get the benefits of more powerful types.

My ex, already an expert in C#, is now trying to wrap her brain around objective-c to do iPhone game programming. I can't believe the maze of classes and methods she has to try to navigate through just to do simple 2d graphics. And this is with the simplified tools now available.

Anyway, enhancing types with inheritance and methods would be great, as long as it's optional!

What aboiut the reverse of methods; putting a local type within a function? Many's the time we have to create a global type just because one function needs it one time. Put the type right in the function and clear it out when the function ends.


ClayPigeon(Posted 2010) [#70]
Instead of having a CameraClsMode, just have a camera cls command:
ClsCameraColor(camera)
ClsCameraZBuffer(camera)


Also, the ability to draw polygons without having to create an entire entity. That way, you could have virtually infinite polygons because if the polygons don't need to be stored (only rendered), the only thing that is done is changing pixels in the buffer. Since the camera has a zbuffer, the depth is stored too, so it doesn't matter what order the render calls are made in. After the pixels are rendered, the information on its coords, color, texture, etc are discarded, so you won't run out of RAM storing all that entity data waiting to be all rendered at the same time.


*(Posted 2010) [#71]
render to texture can be achieved by using two camera and grabbing the image that one camera renders then hiding the camera, attaching the texture to something and then rendering the final scene. This does mean multi-pass rendering but it does work.


Axel Wheeler(Posted 2010) [#72]
Hey EdzUp, I just checked out your iSmashem Galactic; it's a ShufflePuck clone! I have one in the works as well (for Blitz3d). It's alpha at the moment but I hope to put it in the showcase soon. It's amazing that we both remember that game. I actually downloaded an amiga emulator just to run that game.

Anyway, we're not really competitors because yours is iPhone, so that's good.

Thanks for the render to texture tip.


GR(Posted 2010) [#73]
I'd love to see Blitz3D join the 21st century. DX9/10 support!

Last edited 2010


ClayPigeon(Posted 2010) [#74]
People have been asking for DX9-DX11 support for years, now. It's obvious that Mark isn't going to port Blitz3D to DX9-DX11, and I can understand that because many changes went on between DX7 and DX11. I think it would be more realistic to ask for OpenGL support. It's been integrated into BlitzMax and is cross-platform. I'm surprised it's not already the base graphics engine for Blitz3D. I vote for Blitz3D\OpenGL integration!


GaryV(Posted 2010) [#75]
Given how well received Max3D was, I would not hold my breath for a OpenGL port of B3D. :(


Kryzon(Posted 2010) [#76]
Blitz3D is dead. I stopped posting in this product's forums if not to advertise a contemporary engine which preserves at least a bit of the functionality.

Given how well received Max3D was, I would not hold my breath for an OpenGL port of B3D. :(

Meet MiniB3D :)

Last edited 2010


GaryV(Posted 2010) [#77]
Meet MiniB3D :)
Indeed, its author has done an amazing job with it.


Kryzon(Posted 2010) [#78]
Oh, now I see what you mean. An official OpenGL port, with official care being given to it for support, extension, etc.

I guess we can only look at MiniB3D as the "underground" OpenGL port (even though as previously said, its author has done an amazing job with it).


*(Posted 2010) [#79]
Axel:yup coded that in iPhone SDK as a learning experience, however now I have learned so much more now I have created a OpenGL engine called Tombstone that works perfectly on iPhone/iPod from 1st gen upwards. Now we have this created I may rewrite iSmashem Galactic in the new engine as its much much faster than using Apple UI for games.


ClayPigeon(Posted 2010) [#80]
I guess we can only look at MiniB3D as the "underground" OpenGL port

FOR BMAX!