I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
More special effects!
Hi!
I've just finished the 2nd release of my special effects module for bitblt-based games.
It features a whole load of new stuff, like look-up tables to make it faster and 18 special effects!
You can download the sample + source in the link below. And if you use it or have any question about it, e-mail me or post here
This version works with a module, so it's a bit slow (about 60 FPS on my comp). Don't worry, I'm working on a faster DLL version
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
Yeah, sorry, but I don't have a clue as to those errors. Everything seems to be fine, they're just not supposed to be there! It's got to be VB, because I didn't use any complex APIs... anyway, it works after the 2nd time you try it. Can anyone help me fixing this?...
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
Yeah, sorry, but I don't have a clue as to those errors. Everything seems to be fine, they're just not supposed to be there! It's got to be VB, because I didn't use any complex APIs... anyway, it works after the 2nd time you try it. Can anyone help me fixing this?...
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
33 and above - so good your eyes are in sync with the video
average - 20-25, good but your eyes will tell the difference
bad - below 15, video will be very jerky and not pleasurable.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
(Just a heads-up)
I can boast a P4 1.4Ghz, and I got a 64Mb graphics, runs around 70Fps. It looks pretty good, but I hate graphics stuff hey. So much code for so little effects. AHhhh!!!!!!!
Visual Basic 6.0 Enterprise
Visual C++ 6.0 Professional
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
(Sorry, I tried to reply to this thread earlier but had some problems )
Thanks Jenk, I'd never though of that
I though that things in the Form_Load event ran before anything else! Maybe they left out some DoEvents or something in the middle of their code, because I don' have one
I'll fix it when I get home because right now I'm at school
Yes, it's open source code. Do whatever you want with it! But if you use a big part of it or the whole module, you could put my name in it if you want...
Sastraxi: As to the grayscale images problem... it's not my program, because I used VB's LoadPicture
To test it out, try this in a new form:
Code:
Private Sub Form_Load()
Form1.Picture = LoadPicture("C:\Downloaded Code Samples\Special Effects\Planet.jpg")
End Sub
(or whatever path to my JPGs you have)
Now, if the image appears grayscale on the form, it's either your VB version or your graphics card... I've heard of this kind of problems with people that had low settings. How much BPPs does your monitor have? Try to make it 16 bits or 24, that should work
And Wak, I don't know if I mentioned it in the readme.txt, but you're supposed to delete the effects you don't need to speed up loading, and maybe resize the array so these lookup tables don't use up more memory than you can spend (the whole lot of 18 effects takes about 1mb, but that shouldn't be a problem for most 32 or 64mb graphics card ).
Last edited by Jotaf98; May 3rd, 2001 at 03:10 AM.
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I've stuck it in my project - works a treat! BTW you could reduce
your blitting by 1 by setting autoredraw to false and doing a
me.refresh after blitting background + light. You wouldn't need a
back buffer blit then.
My project is called VBreeze, and is about making screensavers/games
or multimedia stuff with ease!
It's a form full of functions to do lots of hard api stuff for
you (wrapped in a single commands)
then follow the jenk links. scroll down to the bottom and pickup
the zip file. don't worry to much about the instructions to extract
it to - i've sorted that now!
I'll be realising ver 135 soon with your routine in. full credits
will be given!
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
Hehe, no need for big things, a small text in the "About..." section will do it
Glad to see my functions help someone... 'till now you're only the second person to use them (at least that I know of!)
I know I could make it faster, but anyway, the FPS was already good enough (I think), so I used a backbuffer so it looks more like a game (that's what it was made for anyway... )
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
Heh, thanks
I also have exams, and they'll not stop until July, so I won't have much time to work on these functions
It's never been tested in a game with stuff that slow down the FPS, so if it goes too slow in your game, just tell me and I'll try to optimize it a bit
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
Ok. E-mail me when you're done, I'd like to see it
It's not that hard to implement it. Just load the image and blt it with a different function. That's all
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
Oh yeah. You're right.
Here's a small list, but I'm sure you can expand it:
* Glass-like materials, like in space platforms: Translucency
* Explosions: Add (either the improved version or the old one that produces the same effects as in GTA2)
* Smoke: Subtract (same here)
* Lasers (probably Add again, since it's light)
* Lights: Add (again - you could use lights around capitol ships, or even something like 2 small flashlights in front of the player's ship for night missions)
* Sun effects: Add again (like coronas and all - camera effects)
* Wave-like weapons: one of the Weird Effects (they look quite cool, completely distorting everything that comes in their way )
* BFGs: Add (most plasma-based weapons should have lots of light effects)
* Nebulas: Translucency or Subtract (you're gonna include them in your game, right?)
* Missile trails: Subtract (since it's smoke - a trail always looks good on any missile )
Ok, I think that's big enough... and they should suit any game genre I think
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
Just thought I'd give this one a bump
BTW, I'm thinking about making a C++ DLL so it's faster
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I had a look at your "cool" special effects. I'd say you could screw the lookuptable if you want speed, you can code much more efficient algoritms with pointer aritmetics than using arrays. Here's some alphablending samples i've coded up for you, i haven't tested them, i just wrote them here:
You really should learn c++ and experimenting with graphical stuff will be much more fun, you could end up writing winamp plugins If you for some really odd reason want to have sin and cos in your graphical masterpieces, then go with a lookup table.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
oops was meant to post in the other thread, but i guess it's the same topic so nm heh
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
Hehe, no problem
Anyway, thanks Kedaman, I'll try to learn C++. But why are you using all those asterisks? I tried making the DLL and the way I was thaught was MUCH different...
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
the unary prefix operator * (which you saw most of the time deferences a pointer. The binary * is the regular multiplication operator you know from vb
type* variablename declares a pointer to a type and
type** variablename declares a pointer to a pointer to a type etc...
=* binary assignment operator does the same as * but assigns the result to the left side value.
Well that's a lot of uses of the asterixes in C++, if you compare to vb, oh one moment, /* starts a comment block and */ ends it.
btw, i found that you can optimize Alphablend50 by using shift operators instead:
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
As to my *much* earlier problem, it appears as ONE shade of gray throughout the whole thing, different shades for different effects. 20x20 BMP 24bit colour, desktop 1600x1200 32 bit colour.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
(Just a heads-up)
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
Well... hum... as to your problem... I have no idea why it's happening. It should work just fine; all I used was GetPixel and SetPixel! How could THAT not work?!
Maybe you could post a screenshot here (there may be a pattern in it or something).
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
Posts
1,457
And Kedaman, you're making me even more confused
No one ever explained that bit-shift thing to me
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
knowledge is of course power, but actually it's just illusionary, real power is confusion
Bit shifting is more or less low level programming, since data is stored binary but also in chunks of 8 bits and you can't access specifical bits with flexibility, in vb you can simulate bitshifting by dividing or multiplying with powers of the radix, but those operations are slow and inefficient, say multiplying
00010111010 with 100 makes
01011101000
you notice that the bits has just shifted left 2 positions when you multiply with 2^2=4. The << operator does this shifting as well except that the compiled machine code for it is a single instruction to the processor, which is much more efficient than multiplication. The shift operators in c++ are
a>>b returns a shifted b steps to the right
a<<b returns a shifted b steps to the left
a>>=b assigns a and returns a shifted b steps to the right
a<<=b assigns a and returns a shifted b steps to the left
so bitshifting can be efficient for radix power multiplications but also for data compression. For instance you can have 1-bit booleans and 4bit-nibbles or any user length variable stored together in a long, then to access specific parts, you shift right, AND to a bitmask. To assign you AND with another inverted bitmask, shift left and OR. Usually it's better to assign the whole long.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systemshere.
Jotaf's Theories!
"Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Originally posted by plenderj 7 of 9 style 'eh ked ?
Im starting to like you a whole lot more now
since when did you start to dislike me? btw, i don't look like 7 of 9 if that's what you thought
I don't quite remeber when i learned that at all jotaf, but thats something you get to know whenever you start learning c++, only thing is that i knew it a lot earlier.
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.