Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rain_storm

Pages: 1 2 3 4 5 [6] 7 8 9 10 11 12 13 ... 69
101
It's definitely getting there, first pic took a moment te register but I recognised the second at a glance

102
The only PS3 game I own is Gran Turismo 5, haven't had time to play it much since I bought it ages ago. I modify games and spend a lot of time working on Vagrant Story and Metal Gear Solid (Tactical Espionage Action). Wouldn't call it playing though it's more debugging.

103
Projects / Re: Voxel Engine
« on: June 22, 2011 »
This is some duct tape programming but hey it works, and I can't think of an elegant solution that doesn't require rewriting half the code. See first post for the fix

The voxel games will come, just as soon as the majority of the market all have genaral purpose graphic processors. At the moment you really need that level of processing power to outshine the ploygon based engines. Although Minecraft is a great example of what the current mid range PC is capable of.


104
Projects / Re: Voxel Engine
« on: June 22, 2011 »
@Kirl
What's been holding voxels back? In my opinion it was a combination of memory footprint, processing power and lack of support from Graphic card vendors.

Nowadays theres more than enough processing power, the above engine is completely software rendered but there are raycasters implemented entirely on the GPU with an order of magnitude in increased power.

Memory footprint is no longer an issue. The sparse octree traversal algorithm is like the google search engine of voxel traversal. Only a tiny subset of the world needs to be physically defined. Any vast empty regions become compressed into a single integer. On the other hand any vast regions entirely made up of a single colour are also compressed into a single integer. This leaves a lot of room for fine detail where its needed. Traversal is also an order of magnitude faster than the meathod I used here. So you have massive terrains with a level of detail not possible with polygons, using an algorithm that runs at real time on todays hardware.

There's nothing holding it back anymore.

@Peeps who are having render issues
The problem is that the initial quadtree subdivision is performed according to the aspect ratio, which forces each block to be a perfect square...

Code: [Select]
    // quadtree subdivision...
    int S = Canvas.Width / max(Screen.AspectX, 1);
    for (int y = 0; y < Screen.AspectY; y++)
    for (int x = 0; x < Screen.AspectX; x++) QuadTree(x*S, y*S, S);

While further quadtree subdivisions are always into 4x4 squares. Which gives a loss in precision if the initial squares are not powers of two...

Code: [Select]
    s = s/2;
    QuadTree(x,   y,   s);
    QuadTree(x+s, y,   s);
    QuadTree(x,   y+s, s);
    QuadTree(x+s, y+s, s);

I think the solution is something like this...

Code: [Select]
    temp = s/2;
    if (temp*2 == s) {
        s = s/2;
        QuadTree(x,   y,   s);
        QuadTree(x+s, y,   s);
        QuadTree(x,   y+s, s);
        QuadTree(x+s, y+s, s);
    } else {
        // sub divide properly...
    }
but its not that easy. The method I use for subdividing requires getting the greatest common divisor of the width and the height. But these are perfect squares. The greatest common divisor is the same as the size. Besides this is an important recursive function I would rather perform the extra overhead outside of this. And ensure that the initial squares are always powers of two. Anybody know how to do that?

105
Projects / Re: Voxel Engine
« on: June 21, 2011 »
I get the same results only when I set the screen resolution to 800x600. Perhaps this is an issue with StretchDIBits at certain resolutions? For some weird reason clearing the pixel buffer seems to help, why is beyond me as the engine writes a colour to every single pixel each frame. Anyways I have an OpenGL workaround using glDrawPixel that might fix the issue...

WARNING : DO NOT RUN FROM INSIDE THE ZIP, EXTRACT IT FIRST!
the program searches for a file named world.bin in the current directory, if it is not found the program generates a world and writes it to disk. This causes a hang if its being run from within the zip file.


Edit - Attachment removed it didn't fix the issue. First post updated with the proper fix

106
Projects / Voxel Engine
« on: June 21, 2011 »
I'm releasing the source code for my voxel engine. It currently uses quadtree subsampling to reduce the number of rays being cast, and the fast voxel traversal algorithm to accelerate those rays which are cast. I'm planning to take on the sparse voxel octree traversal approach if I can manage to pull it off. I'm fairly happy with this as it stands, there are a few things not yet implemented correctly, such as texture mapping in such a way so as to take advantage of the quadtree subsampling, and a proper link list that would allow shapes other than spheres. Still I would like to share the source with others who have some interest in voxels. Voxels are the future make no doubt about it. Polygons have had their day.

Edit - Texture mapping now works better, managed to increase the resolution with no loss in speed. Maximum number of shapes increased to 256. Limited support for discs, capsules and cylinders.

107
Yabasic / Re: TEXT SIZING
« on: June 16, 2011 »
Sweet, now it looks awesome

108
General chat / Re: Secret messages thread
« on: June 13, 2011 »
IPuho NmF kg3 uw1 Ubv1J, ZUs. z4 rQO EuJcC 1pX kfjVfD iv 56t4M ljsxfi?

109
General chat / Re: Secret messages thread
« on: June 13, 2011 »
3 eXk42 v'Py xC7 1i.

110
Yabasic / Re: TEXT SIZING
« on: June 11, 2011 »
The ascii character 1 is a clear smiley ascii character 2 is a filled smiley. Change the first line of the smiley character data to this
Code: [Select]
data 1, 28 // was "^" now its asc(smiley)

To use this character you need to embed the smiley character in the string
Code: [Select]
a$ = "The quick brown fox " + chr$(1) + " jumps over the lazy dog"

111
Projects / Re: Some of my old PS2 stuff
« on: June 11, 2011 »
Thats truely awesome.

112
Yabasic / Re: TEXT SIZING
« on: June 11, 2011 »
I tried "smiley" instead of "^" and the 's' was replaced with the characters of 'smiley'.
Is it possible to have the characters disappear?

I'm not sure whether you mean disappear from the screen or disappear from memory. If you mean from memory then the answer is yes and no. The drawing lines can become inaccessible. But they remain in memory.

Code: [Select]
dim x1(1), y1(1), x2(1), y2(1) // array of line drawing co-ordinates
^The four arrays that hold the drawing line co-ordinates. The co-ordinates for all drawing lines are kept together in a single array. These arrays are grown to accomodate new lines as we find them. There's a variable "TotalLines" that keeps a running count of all drawing lines defined so far. TotalLines is used to resize these arrays just before reading the values of the co-ordinates into the newly added array elements...
Code: [Select]
redim x1(TotalLines), y1(TotalLines)
redim x2(TotalLines), y2(TotalLines)
read x1(TotalLines), y1(TotalLines)
read x2(TotalLines), y2(TotalLines)
TotalLines = TotalLines + 1
We access these co-ordinates be taking note of the value of TotalLines before we grow the array. The value of TotalLines becomes the current index so we know exactly where our new lines will be stored:
Code: [Select]
read Ascii$ // the character to use
read NumLines // the number of lines to draw
Ascii = asc(mid$(Ascii$, 1, 1))
Start(Ascii) = TotalLines
Count(Ascii) = NumLines
Here we use the string character as an index to store the current value of TotalLines and the number of drawing lines used for the string character. If you reassign new values to a string character the co-ordinates that were previously assigned to that character will become inaccessible. The old co-ordinates remain in memory.

113
Yabasic / Re: TEXT SIZING
« on: June 10, 2011 »
Real nice, its great that you added in the lowercase characters.

114
Yabasic / Re: TEXT SIZING
« on: June 06, 2011 »
oops sorry I missed the part where the scale is applied to the letters.

At first you had the data embedded inside the code, this is called hard coding and is considered bad practise. Now the data and code have been separated. The data is organised into structures and you can view each letter on its own without having to read through lines of code. You don't have all that code clouding things up. You can make changes directly to the data without touching any of the code that processes your data.

In fact the code that processes the data can now be considered a black box. You can just assume that the code will always process valid input correctly. You dont need to know how the gears within this black box operate. But your fix has introduced dependancy between the code issuing the call and the code within the black box, This is not good. What you want is a black box that operates in "Fire and Forget" mode. You should feed the black box everything that it needs to know, and no more. Also the code outside of the black box should not have access to intimate knowledge about how that black box works. Like "open window" its a black box that works. no one (except Jim) knows how it does its magic, but we're all greatful that it does it the same way, every time.

Code: [Select]
before - line x+x1(i), y+y1(i) to x+x2(i), y+y2(i)
after - line m+x+x1(i)*s, y+y1(i)*s to m+x+x2(i)*s, y+y2(i)*s

m and s are defined by your implentation. s is absolutely required. the function cannot draw the text properly if it doesn't know how big it should be so you need to make s an input to the subroutine...

Code: [Select]
sub PrintCharacter(char$, x, y, s)
    ch = asc(mid$(char$,1,1))
    for i=Start(ch) to Start(ch)+Count(ch)-1
        line x+x1(i)*s, y+y1(i)*s to x+x2(i)*s, y+y2(i)*s
    next i
end sub

Now you dont have to worry about moddifying s in you code. It wont break the function because the function now has its own copy of s.

m on the other hand is implementation specific, not all of the code that uses this function will need it to scroll, So m belongs in the code that calls the function:

Code: [Select]
PrintCharacter(mid$(a$,a,1), x+m, y, s)

The thing I'm trying to point out is that you should always make your code modular. Take the big problem apart by subdiving it into ever smaller pieces. If you solve all the small pieces, the big problem has also been solved. But for this too work you must keep each piece self contained. A small change should effect only the piece of the puzzle you are changing, it should have no effect on any of the other pieces.

The human mind (especially men) is not good at multi tasking. But when we see what needs to be done we can do anything. Dont have the information that you need to know spinkled throughout the code have it all together in one place, right next to where its being used if possible. Make it easier for yourself.

115
Yabasic / Re: TEXT SIZING
« on: June 05, 2011 »
Lovely vector font. bikemadness. But all those if statements makes it more difficult than it needs to be if you want to reuse this wonderful code in other projects. I think a table driven approach, with predefined subroutines for loading and displaying characters, would suit this much better. It means less code to type for ever project that reuses this font, and it makes it much easier to update when you need to add in things like grammer, or extend the font to include the entire ascii character set:


Code: [Select]
a$="once upon a time there was a king and queen,"
a$=a$+" and they lived happily ever after."
LoadFont()
s = 1
open window 640,512
repeat
    setdrawbuf vm
    vm=1-vm
    setdispbuf vm
    clear window
    c=peek("port1")
    if c=16 s=s+.01
    if c=64 s=s-.01
    x=20*s
    y=60*s
    for a=1 to len(a$)
        PrintCharacter(mid$(a$,a,1), x, y)
        x=x+(CharacterWidth*s)
        if x>500 and mid$(a$,a,1)=" " then
            y=y+(CharacterHeight*s)
            x=CharacterWidth*s
        endif
    next a
until (1=0)





// ==================
// Binary Data Format
// ==================
//
// data NumCharacters
// data CharacterWidth
// data CharacterHeight
// for (NumCharacters) {
//     data ascii, NumLines
//     for (NumLines) {
//          data x1, y1, x2, y2
//     }
// }
sub LoadFont()
    MAX_CHARACTERS = 256
    dim Start(MAX_CHARACTERS) // holds first line number to index
    dim Count(MAX_CHARACTERS) // holds the number of lines to draw
    dim x1(1), y1(1), x2(1), y2(1) // array of lines
    read NumCharacters
    read CharacterWidth
    read CharacterHeight
    TotalLines = 1
    for ch = 1 to NumCharacters
        read Ascii$   // the character to use
        read NumLines // the number of lines to draw
        Ascii = asc(lower$(Ascii$))
        Start(Ascii) = TotalLines
        Count(Ascii) = NumLines
        for l = 1 to NumLines
            redim x1(TotalLines), y1(TotalLines)
            redim x2(TotalLines), y2(TotalLines)
            read x1(TotalLines), y1(TotalLines)
            read x2(TotalLines), y2(TotalLines)
            TotalLines = TotalLines + 1
        next l
    next ch
end sub

sub PrintCharacter(char$, x, y)
    ch = asc(mid$(char$,1,1))
    for i=Start(ch) to Start(ch)+Count(ch)-1
        line x+x1(i), y+y1(i) to x+x2(i), y+y2(i)
    next i
end sub

// ==================
// Binary Data Format
// ==================
//
// data NumCharacters
// data CharacterWidth
// data CharacterHeight
// for (NumCharacters) {
//     data ascii, NumLines
//     for (NumLines) {
//          data x1, y1, x2, y2
//     }
// }

data 26 // NumCharacters
data 40 // CharacterWidth
data 60 // CharacterHeight

data "a", 3
data -18, 00, 00,-40
data  00,-40, 18, 00
data -13,-11, 13,-11

data "b", 10
data -17, 00, -17,-40
data -17, 00,  07, 00
data -17,-20,  07,-20
data -17,-40,  07,-40
data  12,-35,  12,-25
data  12,-15,  12,-05
data  07,-40,  12,-35
data  07,-20,  12,-25
data  07,-20,  12,-15
data  07, 00,  12,-05

data "c", 7
data -15,-05, -15,-35
data -10, 00,  10, 00
data -10,-40,  10,-40
data -15,-35, -10,-40
data -15,-05, -10, 00
data  10,-40,  15,-35
data  10, 00,  15,-05

data "d", 6
data -15,-40, -15, 00
data -15,-40,  07,-40
data -15, 00,  07, 00
data  12,-35,  12,-05
data  07,-40,  12,-35
data  07, 00,  12,-05

data "e", 4
data -17, 00, -17,-40
data -17,-40,  15,-40
data -17, 00,  15, 00
data -17,-20,  12,-20

data "f", 3
data -17, 00, -17,-40
data -17,-40,  17,-40
data -17,-20,  10,-20

data "g", 10
data -17,-35, -17,-05
data -12,-40,  12,-40
data -12, 00,  12, 00
data  17,-05,  17,-20
data  17,-35,  17,-30
data  17,-20,  07,-20
data -17,-35, -12,-40
data -17,-05, -12, 00
data  12,-40,  17,-35
data  12, 00,  17,-05

data "h", 3
data -15, 00, -15,-40
data  15, 00,  15,-40
data -15,-20,  15,-20

data "i", 3
data  00, 00,  00,-40
data -10, 00,  10, 00
data -10,-40,  10,-40

data "j", 5
data  00,-40,  00,-05
data -10,-40,  10,-40
data -17,-05, -12, 00
data  00,-05, -05, 00
data -05, 00, -12, 00

data "k", 3
data -15, 00, -15,-40
data  15,-40, -15,-15
data  15, 00, -10,-18

data "l", 2
data -15, 00, -15,-40
data -15, 00,  10, 00

data "m", 4
data -17, 00, -17,-40
data  17, 00,  17,-40
data -17,-40,  00, 00
data  17,-40,  00, 00

data "n", 3
data -15, 00, -15,-40
data -15,-40,  15, 00
data  15, 00,  15,-40

data "o", 8
data -15,-05, -15,-35
data  15,-05,  15,-35
data -10,-40,  10,-40
data -10, 00,  10, 00
data -15,-35, -10,-40
data -15,-05, -10, 00
data  15,-35,  10,-40
data  15,-05,  10, 00

data "p", 6
data -17, 00, -17,-40
data -17,-40,  10,-40
data -17,-15,  10,-15
data  15,-35,  15,-20
data  10,-40,  15,-35
data  10,-15,  15,-20

data "q", 9
data -15,-05, -15,-35
data  15,-05,  15,-35
data -10,-40,  10,-40
data -10, 00,  10, 00
data -15,-35, -10,-40
data -15,-05, -10, 00
data  15,-35,  10,-40
data  15,-05,  10, 00
data  15, 00,  05,-10

data "r", 7
data -17, 00, -17,-40
data -17,-40,  10,-40
data -17,-15,  10,-15
data  15,-35,  15,-20
data  10,-40,  15,-35
data  10,-15,  15,-20
data  17, 00,  05,-15

data "s", 11
data -12, 00,  12, 00
data -12,-20,  12,-20
data -12,-40,  12,-40
data -17,-25, -17,-35
data  17,-05,  17,-15
data -17,-35, -12,-40
data -17,-05, -12, 00
data  17,-35,  12,-40
data  17,-05,  12, 00
data -17,-25, -12,-20
data  17,-15,  12,-20

data "t", 2
data  00, 00,  00,-40
data -15,-40,  15,-40

data "u", 5
data -15,-40, -15,-05
data -15,-05, -10, 00
data -10, 00,  10, 00
data  10, 00,  15,-05
data  15,-05,  15,-40

data "v", 2
data -17,-40,  00, 00
data  00, 00,  17,-40

data "w", 4
data -20,-40, -10, 00
data -10, 00,  00,-40
data  00,-40,  10, 00
data  10, 00,  20,-40

data "x", 2
data -15,-40,  15, 00
data -15, 00,  15,-40

data "y", 3
data -15,-40, 00,-15
data  15,-40, 00,-15
data  00,-15, 00, 00

data "z", 3
data -15,-40,  15,-40
data  15,-40, -15, 00
data -15, 00,  15, 00

[/font]

116
Closed source, Open source.
Another aspect of closed source is the pure driver hell it has caused me with setting up Linux on various machines. The same things always cripple a system and take hours to solve at all (when possible). The companies that produce drivers for wifi, graphics, and sound are always causing problems with my Linux OSs.
Without those closed source Binary Blobs being injected into your "Open Source" Linux kernel, your Distro's hardware compatibility would suck even worse then it already does. True all those high end Graphics Cards could be forced to run in VGA / VESA mode. But with WiFi there is no standard Legacy Mode, each vender defines their own protocols.

Closed source works only for small(ish) projects. Anything up to the size of a competative Web Browser or a mature compiler is suited to be purely open source. Anything as large as an Operating System would only be held back if the developers would to go purist on the Open Source philosophy.

117
Very well designed, the music, the colours, the visuals, they all flow smoothly. Yep this entry definately works for me. Well done benny.

118
Yabasic / Re: YABASIC 3
« on: May 31, 2011 »
There was a topic regarding this before
http://www.dbfinteractive.com/forum/index.php?topic=3184.0

I had talked with the developer and when I asked him if he would consider including support for ps2yabasic, he stated that he wants to focus on the Win32 flavour of yabasic. Still its great to see someone is still developinc yabasic, the official project is dead.

119
An excellent piece of code. But I think you guys are taking an excessive liberty by not considering ':' as a line break, these symbols are treated as such by the compiler. That takes all the fun out of the exercise   ;)
One trick I use in ps2Yabasic for defining variable values was this...
Code: [Select]
data 0,1,2,3,4,5,6,7,8,9
read a,b,c,d,e,f,g,h,i,j
[/font]
eliminates line breaks, if you can do such things in FB.

120
Hey Joe,
This sounds like a know issue that only occurs when source colouring is enabled. It use to happen to me when I start programming on the PC but since I fixed the problem it hasn't happened at all in like the last 4 or 5 years. The picture shows how to fix the problem. The one on the left is the broken configuration the one on the right is the solution, try this out and also make sure that your drivers are up to date, wouldn't hurt to get the latest DirectX installed too.

Pages: 1 2 3 4 5 [6] 7 8 9 10 11 12 13 ... 69