# Visual Basic > Games and Graphics Programming > Game Demos >  VB: The Matrix [Exe+Source]

## Fox

This is a matrix program I recently made, enojoy!

*System needs*
- DirectX 8.1 or higher
- Geforce2 MX or higher

*Keys*
- Right-click for options
- Use +/- to accelerate or break.
- Press F1/F2 to speed up or slow down the matrix.
- Hold shift and use Left-click to look around (experimental).
- Type any text and press Enter to make text appear in the matrix
- Note: Please restart the program after changing the "Fly through" option

*Want it as screensaver?*
- Run the program first and setup the matrix as you like it (right-click during play)
- Rename matrix.exe to matrix.scr
- Copy all 3 files to c:\windows\system32
- You can now choose it as a windows screensaver.

*Download*
- Get (0.2.9) Program 
- Get (0.2.9) Source

*Hope you like it!*

- Web: http://vbfx.yhoko.com
- Mail: fox@yhoko.com

----------


## Electroman

Nice, how come it goes behind everything else though  :Confused:

----------


## Arie

> _Originally posted by Electroman_ 
> *Nice, how come it goes behind everything else though *


Yeah, very interesting.. how it's only on the desktop??
Very Cool!!!!  :Thumb:   :Thumb:   :Thumb:  

Arie.

----------


## D-Lyrium

That is so completely badass....

It would be even better if you could get it behind desktop icons too, but even so, it rocks  :Wink:

----------


## Fox

Well I started making a desktop replacement but in the middle I changed my mind and continued making the matrix. That's why it goes behind everything. Unfortunately you can't put it behind the icons.

----------


## duc

Dude thats amazing. Nice job on it. How long did that take you to do?

----------


## Fox

About 2 hours.. As mentioned before it was supposed to become a desktop replacement but I soon recognized the matrix-style in it and then changed my plans.

----------


## RealisticGraphics

Absolutely awesome!

----------


## Arc

Pretty cool indeed. Is there anyway you could make it so the desktop icons still show up?

----------


## Pc_Madness

Whoa that is brillant!  :EEK!:  

Today Fox is a god. :yay:

I guess you can't make it not take up 100% CPU usage? (thats just a directx thing though isn't it? :dunno: ) And a pity about the ads in it, otherwise I might have kept it as a wallpaper.  :Frown:

----------


## cyborg

Wow!

----------


## Fox

- It takes 100% CPU because of the loop. This was fixed in 0.2.0
- There's no way to get it behind the icons
- You can deactivate the ads in the menu (0.2.0)

----------


## Electroman

What ads are you talking about? I don't remember seeing any  :Confused: .

----------


## Fox

When starting some ad-texts appear. You may have a sooner version that doesn't contain the ads but also doesn't support some new features (smooth color changing, keyboard-input, optimized textures, etc.)

----------


## Pc_Madness

I had one appear after the program was running for a while as well.  :Frown:

----------


## Fox

I just uploaded a new version (download from first posting in this thread). Changes in this version:

- New option to deactivate the ads (menu)
- New option to deactivate 'stay in background'
- It doesn't take up 100% CPU time anymore
- Try entering some text followed by <enter>

And *@electroman*: Why did you change the subject to 'C++' ? This was written in VB6.

----------


## Electroman

> _Posted by Fox_ 
> *And @electroman: Why did you change the subject to 'C++' ? This was written in VB6.*


 Ow it was just a guess, I noticed you'd missed it off and I guessed C++ cos you seem to have been using C++ in your recent questions, soz.

----------


## Electroman

I just sent it to a mate and it gives him a Subscript out of range error  :Confused: . Any ideas how this is happening for him? He is using his laptop so maybe the graphics card isn't that good, I wouldn't think that would give a Subscript out of range though? What you think?

----------


## Fox

It needs a 3d accelerated gfx card and enough memory for the 16-bit depth buffer.

Well the error message should say what function's wrong, can you ask him for details plz? And I'd need to know when the error happened, eg. after running it a long time?

----------


## Electroman

When he runs it the background goes black then a error message apears saying:

Error in cdevice.settexture
subscript out of range

----------


## Fox

Then it must be the graphic card... can't do anything on that.

----------


## cyborg

Why not make a stereo-3d render mode?

----------


## Fox

Coz I don't own one of these cool glasses :P

----------


## cyborg

That's too bad! It is awesome with stereo-3d!
You could make a red-blue/red-green stereo-3d, and just make your own glasses.

Have you ever tried stereo-3d?

----------


## Fox

Nope. I'll try it as soon as you don't need to wear glasses any longer ^^' since I'm wearing normal glasses already.

----------


## KingArthur

/Me stares with his mouth open for 3 minutes before he notices that the webcam with his girlfriend on the other end is still running.

It's the very best EXE animation I ever saw. any chance you'll make it a screenserver? pleeeeeeeaaaaaaaaaaase?

Completly  :Eek Boom:  Awsome

----------


## cyborg

You don't need to wear glasses, but then you'll need a special monitor.

Once I made a starfield (like the screensaver) in stereo-3d and it was awesome! It would be really cool in your program cuz it is already awesome!

----------


## Fox

For those with the "error in setTexture" problem: Did you extract the texture into the same directory before running? This is a way to cause this error.

Erm screensaver, why not... here you go (still don't forget the texture). To make it work as a screensaver you need to:

- download ver 0.2.2 from above and extract to a new folder
- run it and set up the matrix as you wish
- activate 'screen saver mode' from the settings menu and exit
- rename matrix.exe to *matrix.scr*
- copy all 3 files (not the folder) to your c:\windows\ folder directly

Enjoy ^^'

----------


## Pc_Madness

Ok, those of us with Duel screens, can you save us at all. Only appears on 1 monitor.?  :Frown: 

Secondly are you doing checks for multiple instances? As I think it can really bugger it up when you do preview in the Display Properties (once its already running in the background), since it jumps straight to the background when you view it, rather than previewing in the little preview window thingie. *doh*

----------


## ice_531

0wnt.  :Smilie:   :Thumb:  


Wondering how you could impliment this into a background of a program and would it take up as much resources lol

id love to have the steel look chars. as moving bkground on an app  :Roll Eyes (Sarcastic):

----------


## Fox

Thanks for the tip, checking for multis is now implemented (0.2.3).

Since I have no dualscreen I have no idea how to fix this problem. Basically the program takes Screen.Width and Height...

And no, there's no plugin or so ^^'

----------


## Fox

Another small update (0.2.4), the cursor will hide now in screen saver mode and there's a new option to select the number of "leaders" (white letters falling down). Enjoy.

----------


## Fox

*Upgrade!* The final version 0.2.5 now even supports "horizontal falling chars" to come along with part 2 and 3 of the movie. There was also a little bugfix that caused the letters to move up when they were falling too fast. Source is updated, too.¨

Latest screenshot:
- Reloaded

----------


## Tekken

I have an idea for how you might be able to make it a background replacement. Have the program change the bg color of the screen to a solid color (preferably a rare one) then tell dx to replace all of that color with the program. Not entirely sure how you'd do it, but thats how its done for winamp's milkdrop (they use an offblack I think...)

----------


## Fox

Very good idea!

I'll check out this tutorial to see how it works.

Hm not that easy to translate this into VB...

----------


## Fox

I'm still looking for a overlay surfaces demo..

Well in the meantime I optimized the whole thing a little. There's no more flickering when "stay in background" is active because I removed subclassing.

Updated source, too.

----------


## Fox

Updated soruce to 0.2.8. I added a new feature "Random movement" (disabled by default). Only recommended when "flying through". It makes the camera bouncing and rotating randomly like seen once in the movies.

----------


## VBfang

Is the source atachment the source for version 2.8 or 2.5? Because it still says 2.5

P.S. regardless, it is quite possably the coolest *.exe i have seen in a long time.  :Thumb:

----------


## Jacob123

Amazing

----------


## wossname

Not bad.

Not bad at all.

Very not bad in fact  :Big Grin:

----------


## drjombei

Hey man this is sweet! I did try to set it as my screen saver as directed and when my screen saver is coming up I get this error:

Error in cDevice.Initialize
Automation Error

I cannot seem to figure out what the heck it is talking about... Any ideas?

----------


## Fox

Looks like it cannot initialize DirectX for drawing. Didn't face that problem yet, for me it works fine.

Does it work when you try the 'test screensaver' button from windows?

----------


## drjombei

Yeah it previews just fine...  I forgot to add after myfirst post that after the initial error I click 'ok' and get the following error:

DirectX error: D3DERR_DRIVERINTERNALERROR

Is this something that I would need to fix on my end?

----------


## Fox

Hm no idea, really. When it works by doubleclicking it should also work as a screensaver. Coz that's nothing more than a program started by windows. But the error message gives you a internal driver error - maybe your computer is shutting down devices on screensaver activation? Eg. hard drives, screen or graphics card?

----------


## drjombei

Ah well... I will just start pokin' around on my machine and if I happen to come across the problem I will certainly let you know just in case anyone else has the problem.

----------


## Fox

That's be nice, thanks.

----------


## VipeR801

Works great on my computer (ATI 9600 pro), very very nice job.

----------


## Porsche944

Simply amazing. Here is an idea how to get the desktop to appear. Take all the files located on the desktop and create icons on your program that will show up above the animation in sence the windows desktop is behind the anamation but you have taken all the links from the desktop and recreated a little sprite that you can click on with the mouse that will run the correct shortcut on the windows desktop.

----------


## Fox

Changed URL and updated latest source (no changes though)

Remember that VBfx is now located on http://fox.yhoko.com

----------


## NoteMe

I have totaly forgotten to rate this project. It is absolutely ratable. Keep it up Fox.


- ØØ -


[edit]Hehe..I rated the wrong post in the wrong thread..but you get the message.. :Big Grin: 


- ØØ -

----------


## Fox

*lol* Thanks anyways ;-)

Actually I stopped working on it ages ago, but I took my experiences out of it. That is, creating a Matrix in any environment for example.
If some of you played the Hack-game Yhoko presented... stay tuned for HackV2 - we're doing it together and it will have some Matrix inside (first released screenshot)

----------


## NoteMe

Looking sweat, but the letters are very pixelized...hmm..but sweet..have to admitt that...


- ØØ -

----------


## Fox

You won't notice the pixels while it's animated ;-) Besides, I prefer those nice pixels instead of smooth-a-lot unreadable chars... The matrix is build upon my DXText engine, thus running without texture filter (otherwise you couldn't read most of the texts).

Here's another impression

Edit: Woah, new avatar? o.O

----------


## NoteMe

Yeah I am a changed person...no longer a mod here either..: :Wink: 



The screen shot looks nice. Looking forward to see the finished product. BTW did you know her from before? Or is this the first time you are talking togheter?


- ØØ -

----------


## Fox

I see... welcome to the users guild then ;-)

Ya, she's my g/f ... not *sigh* - but we're sharing the same place

----------


## NoteMe

Jammy git... :Smilie: 



Well good luck on the project. Looking forward to see the finished product.

See you around.
- ØØ -

----------


## Fox

Thanks, me too *hehe* It's yet only playing around with DX and stuff, we're not yet sure how the game will be. But since people did not find together in HackV1 (some played over network but not many) I guess we'll set up a server and have it running like massive multiplayer games. But aah you'll see ;-)

----------


## Hiroshi

how do you rename it to matrix.scr
when i tried it it didnt work 
i theres the matrix config, tex, and Matrix
when i rename it it changes to say Matrix.scr right on the icon
i dont know like how to change the type

----------


## Hiroshi

in other words it won't show up in my screensaver window

----------


## Fox

For your own sake.. Activate "show file extensions" in your explorer settings.

----------


## MarcoNovaro

Hey! This screensaver is Amazing!!
Really, it's one of the best Matrix screensavers I've ever seen, even compared to "commercial" versions.
Congratulations.   :Big Grin:  

Nonetheless: I've got the same problem as drjombei: the screensaver runs fine as an exe, but when launched as a screensaver, I got the error:

DirectX error: D3DERR_DRIVERINTERNALERROR

...any idea on this?
 :wave:

----------


## Fox

Unfortunately I did not yet happen to see the problem on my computers... But people seem not to have any problems with my other screensavers (which use Yhoko's YDK), please try one of them and tell me if you get into the same problem:

http://res.yhoko.com/starfield.zip
http://res.yhoko.com/snow.zip

----------


## MarcoNovaro

Ok, I downloaded both of them and tried.

Both gives me the following error when starting (either as a screen saver or renamed as .exe):

"d3derr_invalidcall"

and then the following one:

"Directx: video device not available! (S_OK) The application will now exit"

The matrix screensaver instead works as an exe (and works also in the preview window of Windows), but gives the error when starting as a screensaver (i.e. when the configured "timeout" expires).

Thanks for the reply.
 :wave:

----------


## NoteMe

What GPU do you have, and what version of DX?

----------


## MarcoNovaro

I have a Celeron processor, 1.4GHz
I downloaded the Dx version 9.0.

----------


## NoteMe

GPU, not CPU....graphics card... :Wink:

----------


## MarcoNovaro

Sorry...   :big yellow:  

My graphics card is this one:

Mobile Intel® 915GM/GMS, 910GML Express Chipset Family

----------


## NoteMe

I am not going to check out the code, since I am in Solaris right now, but make sure it doesn't try to use too low resolution like 640*480. Laptops seldom like that...

and other thing, try to download the latest drivers for your GPU:
http://downloadfinder.intel.com/scri...ProductID=1862

in theory you should be able to use DX9, not with all kinds of shaders though. So it depends if he is using any shaders.

Ohhh and congratulations on a GPU that can barely walk.. :Big Grin:

----------


## MarcoNovaro

> Ohhh and congratulations on a GPU that can barely walk..


  :Frown:   :Mad:

----------


## Fox

Intel Cards with shared memory can be really annoying... I heard the latest YDK versions do support them (using software vertex processing and/or software renderer) but it's really weird that you can run it as .exe and not as .scr - basically there's no difference between them.

I shall announce it when I happen to stumble upon a solution.

----------


## JQuinn

Microsoft AntiSpyware seems to think the Matrix file is a trojan when you set it to the same extension as a screensaver (matrix.scr).  Question is... why?   :Ehh:

----------


## sevenhalo

Microsoft anti-virus thinks Symantec is a trojan also 

I wouldn't over think it.  It sounds like the anti-virus software has been having some problems.

----------


## Fox

It probably doesn't like the renaming from executable to screensaver.. as screensavers are often used in virus mails. *shrugs*

----------


## thelocaluk

Is it possible in a future update to have user input text repeat as part of the screen saver??

----------


## Fox

The source is avaible, you can add a dumb Timer that creates the text in intervals...

----------


## ganeshmoorthy

Hi, its really amazing and wonderful, what else no words to define it...really simply superb....nice job...

----------


## MrGTI

> Error in cDevice.Initialize
> Automation Error


I get the same error when i try to run the EXE on a Dell machine with a built in "Intel 82815 Graphics Controller".

However it does run fine on other machines.

----------


## Fox

As mentioned before there are several problems with Intel controllers that use shared video memory... Think of the matrix needing a 'real' 3d-accelerated graphics card. I don't think this will be solved in the near future, sorry  :Frown:

----------


## arf_shl

:Thumb:   :Thumb:   :Thumb:  

Great job Man BRAVO BRAVO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

----------


## lord_cedrich

Very nice excwllwnt work

----------


## Kal_Torak

lmao @ wossy

----------


## Fox

*Finally!*

Finally I had the time to take care about the screensaver problem (the Matrix didn't start when used as screensaver). The problem was mostly Windows, because it started the app minimized (only any only when it's automatically run as a screensaver - in preview mode or when starting the exe/scr manually everything worked fine). The solution was rather dirty but it works fine: A timer that waits a short period of time before initializing DirectX and stuff.

Download attached to this post or see first posting. Explanations and help in the first posting, too.

*Fox*

----------


## cptHotkeys

Verry good,  its a shame its just images not real random text thaugh, it would be good to see this with no dependancies, not that one image is an issue, it would just be a nice touch to something already nice.

----------


## K-PRO

why dont u compile the project and make a package using the vb6 package and deployment wizard so it copies the refrences used automatically

zip it n attach it

thanx

----------


## Jim Davis

awesome job, and idea.. i like it so much  :Smilie: 

Ive found a little improvement. Youve forgot to remove the meshes that behind the cam. So you can see only a few of them, but not all, because theses arent two sided meshes..

so.. just place a line at the sub Animate(), right after the If .Active line. Like this:



```
            If .Active Then
                If .Y > Camera.GetY Then ResetGroup A
```

So if the cam is fly thru a line, then its going to behind the cam, its just reset the line. So you get a 30-50% improvement on the gfx, because you can always see the lines.

Anyway. thanks for sharing this superb code, i love it!
 :Thumb:

----------


## K-PRO

can u include the source code for the latest version plz

thanx

----------


## Underworld1020

Great program. :Smilie:

----------


## Jabber

Good job
This is awesome

----------


## feneck

Wow, this is really awesome. I'm using it as a screensaver on my server, lol

What would be even cooler tho, is that if you continued to develop it and add new things... just an idea

----------


## alihan1988

Amazing, verry good. Thanks

----------


## break4seduction

is there any chance of getting this source??
i would love to add horizontal lines with different (multi choice) texts.

----------


## Fox

Of course, I just fixed the download links.
See the first message in this thread.

----------


## Krato

Can someone translate to .Net ?

I've try but get 40 errors, jejej

Thanks

----------


## minitech

I think you can get it behind the icons using the SetParent API, I saw that once online. I can't find it though.

----------


## lwred

Hi all members,

First of all, thanks Fox for this amazing code. I have added a timer to do a little script fonction.
I will fix it in a .ini file in order to let each one make a scenario with the text.

It seems tha the 0.2.9 of the source don't have the rotation and the bounce fonctions.
Someone to reup the sources with these 2 fonctions ?

I try to learn the camera rotation but the cCamera class is empty for this subject.

The exe has the fonctionnality.

Thanks a lot.

LwRed

----------

