|
This thread is locked; no one can reply to it. |
1
2
|
Hypnotic backgrounds |
Kikaru
Member #7,616
August 2006
|
Well, the game I am currently working has... mesmerizing gameplay . But, it doesn't have a background yet. Anyone have advice on creating hypnotic backgrounds that don't burn your eyes out of their sockets? |
Johan Halmén
Member #1,550
September 2001
|
Depends on the game. If it is a side scroller, try the attached image (or a similar but better quality, this one is jpg) and use parallax scrolling. If the front game field is very pixelsharp, the effect is at its best very hypnotic. Even when the background doesn't scroll, it seems to "live" or something. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest. |
Hard Rock
Member #1,547
September 2001
|
Why dont you apply a demo scene type effect to the background? Such as plamsa, fractal renderer etc. They wont add to file size, but they will look cool and definetly qualify for hypnotic, albiet very distracting. _________________________________________________ |
Kikaru
Member #7,616
August 2006
|
JH: Thanks for the background, but it doesn't quite fit. I attached a screenshot of the game with a placeholder backround (placeholder character and blocks, too) so you can see the type of game it is. P.S. it does not scroll HR: and how might I do these "demo effects"? |
Hard Rock
Member #1,547
September 2001
|
There are tons of tutorials on them, in varying languages, each one is different, and will require learning some lines of code. The good news is that since most of these effects are incredibly old someone will have found some way to optimize it incredibly so it runs lightning quick on say a 486. Some example tutorials: Plasma fractal: Also theres tons of other effects, fire. Look around the demo scene and youll see what i mean, the tunel effect etc. _________________________________________________ |
Kikaru
Member #7,616
August 2006
|
Most of those effects don't work to well with this game... I was wondering if I could use an image, tile it, and make it scroll diagonally or something. Would that work? |
Erkle
Member #3,493
May 2003
|
I would probably do something similar to Worms' floating particle background.
If the writing above has offended you, you've read it wrong.....fool. |
Kikaru
Member #7,616
August 2006
|
Do you have a screenshot of that? I don't remember exactly what it looked like. |
Audric
Member #907
January 2001
|
Judging from the screenshot, are you sure "hypnotic" is the way to go? |
Johan Halmén
Member #1,550
September 2001
|
If you want the hypnotic background where you have the blue sky now, you can indeed put my image there (not my image, nor my avatar. The attachment!) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest. |
James Stanley
Member #7,275
May 2006
|
You could just place a random coloured pixel at a random place on the background every frame. That could look quite cool. EDIT:
|
LennyLen
Member #5,313
December 2004
|
Quote: I don't know if there are any random number routines in C, I've never found any, but: So you've never found them, yet you use one of them in your code... interesting. [edit]Oh, and I didn't test it, but your code won't compile unless you include <stdlib.h>
|
James Stanley
Member #7,275
May 2006
|
Compiled fine on my machine. By my statement about random numbers, I meant I didn't know of any as simple to use as my 'randnum'. randnum is out of my 'useful.cpp', a bunch of functions to reduce the amount of typing I need to do. |
Audric
Member #907
January 2001
|
The X / (Y / Z) has me worried because it's integer arithmetics. Quote: return rand()/(int)(((unsigned)RAND_MAX + 1) / (num+1));
With a low RAND_MAX and a high num, you wouldn't get numbers in the [0 - num[ range. Quote: In the GNU library, it is 2147483647, which is the largest signed integer representable in 32 bits. In other libraries, it may be as low as 32767. So maybe I'm over-paranoid (being paranoid is ok for programmers) edit: "google msvc RAND_MAX" says MSVC has 32767. no comment! |
Jonatan Hedborg
Member #4,886
July 2004
|
My mingw32 stdlib.h says: #define RAND_MAX 0x7FFF
Ie, 32767
|
LennyLen
Member #5,313
December 2004
|
Quote: Compiled fine on my machine. This is because you were including allegro.h, which in turn includes stdlib.h Try compiling the following (first with the comment, then after uncommenting the line):
Quote: I meant I didn't know of any as simple to use as my 'randnum'. The reason for this is simple (and it's why C doesn't have a double_number() or halve_number() function). If they were to implement a function for every trivial task that people wanted to perform, the language would become too bloated. Instead they give you the tools to make such functions yourself. And a simpler way of writing your function is: int randnum(int num) { return rand() % (num+1); }
Quote: randnum is out of my 'useful.cpp' I'm guessing you didn't try compiling your previous code with a C++ compiler then, since C++ doesn't allow implicit declarations. Though, if you compiled it with just a C compiler, it should have still warned you about doing this.
|
Audric
Member #907
January 2001
|
Jonatan Hedborg: indeed LennyLen: Your code is not merely "a simpler way of writing (your) function": it is better, but the algorithm is quite different. And sorry for the off-topic. |
Jonatan Hedborg
Member #4,886
July 2004
|
return rand() % (num+1); Doesent that favor lower results unless MAX_RAND max is evenly divisible by (num+1)? If num+1 is, say, 256; Of course, the difference is small enough to ignore. If i've done any mistakes, please correct them.. EDIT:
|
James Stanley
Member #7,275
May 2006
|
Well, surely, if Allegro includes stdlib.h there's no need for me to include it? I've never had any problems with my randnum function. The 'algorithm' I was using is just something I found somewhere on the internet. I should really have declared randnum before main, I forgot about that, I wonder why it still ran. EDIT: EDIT2: |
LennyLen
Member #5,313
December 2004
|
Quote: Well, surely, if Allegro includes stdlib.h there's no need for me to include it? That depends on whether or not you intend to use allegro with every program you ever write. [edit] Quote: I should really have declared randnum before main, I forgot about that, I wonder why it still ran.
Because C does allow implicit declaration of functions. Quote: I was using a C compiler, and it didn't give me any warnings. Then you should have the warnings turned on. They exist for a reason. Quote: I don't care about most of the errors since it was just a demonstration of my effect. Great attitude.
|
Audric
Member #907
January 2001
|
Just a word to defend James as he took the trouble to write code: the program is a clear explaination of the effect he had in mind, and the only bad effect of rand() is a few pixels darker than average, and a few more drawn offscreen. Nothing worth losing sleep over. |
LennyLen
Member #5,313
December 2004
|
Quote: Nothing worth losing sleep over. The problems with the code aren't, no. Admitting you don't care if there are errors in the code your trying to show someone is though.
|
Andrei Ellman
Member #3,434
April 2003
|
There's some source for a plasma-effect in ChromaPlas. Although applying the plasma to the 8-bit pixel-value (add a palette-changing effect for added goodness) or one of the R,G, or B values does not take up much CPU-time, applying it to values in the HSV or HLS colour-spaces could risk grinding your game to a halt. AE. -- |
Kikaru
Member #7,616
August 2006
|
Wow, I never expected so much... discusson about this. Anyway, my brother is doing the backround now, as well as the characters and blocks, so my problem is solved for now. (He's really good at art. ) |
Steve Terry
Member #1,989
March 2002
|
You can do some pretty nifty psychedelic backgrounds using the good 'ol 8-bit mode and cycling the palette ___________________________________ |
|
1
2
|