[QUOTE=jA_cOp;20098994]Nevermind, I found that it is guaranteed. Nice. However, it may have problems if the destructor of a statically allocated global object refers to the singleton, as the order of destruction is of course not guaranteed. I wonder if this is worth it for supporting obscure operating systems that may not fully clean up dynamically allocated memory. I wonder if there is a solution that handles both construction and destruction order...[/QUOTE]
Couldn't you use atexit() ? You'd just have to maybe create a wrapper class that handles the destruction of the singletons in the right order, and also maybe bind to pass a function pointer from that class.
[QUOTE=gparent;20101703]Couldn't you use atexit() ? You'd just have to maybe create a wrapper class that handles the destruction of the singletons in the right order, and also maybe bind to pass a function pointer from that class.[/QUOTE]
Ah, that's a good idea. Since it would add the cleanup function to atexit before main, it would be one of the last atexit functions to be called, too, meaning any atexit-hooked function set after entering main could also safely use the factory class.
[QUOTE=nullsquared;20098688]Relax smart guy, where's your multi-colored fractal renderer? No need to explain the obvious. My target for the little thing wasn't to make pretty pictures, it was to play with zooming into an arbitrary rectangle, and I did just that.
[/QUOTE]
[url]http://www.kylegar.net/stuff/mandel.zip[/url]
Good luck getting it to work, I made it ~8 years ago, and the source code is long gone. I know it wont work on 64bit computers, but it does zoom...and it has colors
[QUOTE=Kylegar;20102061][url]http://www.kylegar.net/stuff/mandel.zip[/url]
Good luck getting it to work, I made it ~8 years ago, and the source code is long gone. I know it wont work on 64bit computers, but it does zoom...and it has colors[/QUOTE]
How dare you comment on his works? Blasphemy!
[QUOTE=majorlazer;20084034][img]http://i49.tinypic.com/fas8ht.gif[/img][/QUOTE]
[img]http://owain.slashingedge.co.uk/anim2.gif[/img]
d = abs(255*sin(time*((x*x)+(y*y)-x-y)))
Not quite the effect I was going for but [highlight]RAVE BREAK![/highlight]
Are we making cool patterns now
[img]http://i50.tinypic.com/t678n5.png[/img]
(cos(x+cos(time)*time)*time) + (sin(y+sin(time)*time)*time))*10
Wrapped in range 255
I'll look into making a gif
What library are you guys using to make these patterns?
I would'nt even know how to start :(
Actually I'd rather have a RTS with good lighting/effects and Physics.
Any graphics libary will do, like SDL or SFML.
I just spent the last 2 hours wondering why my program wouldn't compile and why the compiler thought the constructer had a return type. Spot the big fat obvious error:
[QUOTE]BaseEntity(/*Args*/)
{
// Stuff
}[/QUOTE]
[QUOTE=Robber;20101015]UDK? /caps[/QUOTE]
Holy crap, That's perfect. And loads of games have been made on previous Unreal engines.
Intellisense is such a slow piece of shit uurgh.
[QUOTE=iPope;20103800]Any graphics libary will do, like SDL or SFML.
I just spent the last 2 hours wondering why my program wouldn't compile and why the compiler thought the constructer had a return type. Spot the big fat obvious error:[/QUOTE]
If that's the constructor, I'm assuming it's because you haven't qualified it with the class and :: ?
Well I'm planing on an RTS/FPS, not sure yet thought because quite a few or all even, have failed.
[QUOTE=Ferret++;20103805]Half life 1.[/QUOTE]
That would be (based on the) [URL="http://en.wikipedia.org/wiki/Quake_engine"]Quake engine[/URL], not Unreal.
Edit: this is dumb how? Unreal and goldsrc are two similar engines with completely different backgrounds, only somewhat related in functionality and release dates.
(That and UE3's way different than UE1)
[QUOTE=Kylegar;20102061][url]http://www.kylegar.net/stuff/mandel.zip[/url]
Good luck getting it to work, I made it ~8 years ago, and the source code is long gone. I know it wont work on 64bit computers, but it does zoom...and it has colors[/QUOTE]
If there was still a Zing rating, this would be one of the few times I would use it; top dollar!
[QUOTE=xxxkiller;20103344]What library are you guys using to make these patterns?
I would'nt even know how to start :([/QUOTE]
This. How do you guys manage to make these patterns?
[QUOTE=xxxkiller;20103344]What library are you guys using to make these patterns?
I would'nt even know how to start :([/QUOTE]
In python:
[code]import pygame, math
from pygame.locals import *
pygame.display.init()
# Configuration
screenRes = (96,96)
# Init shit
xr = range(0,screenRes[0]) # get width
yr = range(0,screenRes[1]) # get height
# The function
def trippyShit():
pixel = screen
sin = math.sin
pxarray = pygame.PixelArray(pixel)
for x in xr: # go column by column
for y in yr: # and row by row
color = abs(255*sin(time*((x*x)+(y*y)-x-y)))
pxarray[x][y] = color,0,0 # and change the value of each pixel individually
if __name__=='__main__':
screen = pygame.display.set_mode(screenRes, 0, 8) # the last number is the colour depth, I have it set to 8bpp to speed shit up
time = 0
trippyShit()
while 1:
time += 0.001
trippyShit()
pygame.event.poll() # stop pygame window from going unresponsive
pygame.display.update()[/code]
It ain't difficult to make these patterns on most graphics frameworks, you can do it on a per-pixel basis. Doing it in Python using pygame is easy as hell, but it's nowhere near as fast as using SFML on C.
[QUOTE=BMCHa;20103955]That would be (based on the) [URL="http://en.wikipedia.org/wiki/Quake_engine"]Quake engine[/URL], not Unreal.[/QUOTE]
Close enough.
[img]http://i49.tinypic.com/34e2be1.jpg[/img]
tan(x*y)
Doesn't get any simpler than that.
[img]http://i45.tinypic.com/2r7r5vn.jpg[/img]
tan(x) * tan(y)
[img]http://i50.tinypic.com/33c29zt.jpg[/img]
tan(x*x) * tan(y*y)
I'll stop now lol.
I used pygame as well
[img]http://i45.tinypic.com/jf9dp4.gif[/img]
The noise is just gif compression
No-one else's algorithms work for me >:C
I always get ZeroDivisionError or ValueError or the unhelpful 'sequence size mismatch' error, even when I tried tan(x*y).
How to wrap the range between 0 and 255 properly? I just divided 255 by the number the calculation gives inside of an abs() function, but obviously that gives weird numbers with e.g. tan(x*y), since I'm getting numbers like 1788.88940062.
[QUOTE=TehDoomCat;20104628]No-one else's algorithms work for me >:C
I always get ZeroDivisionError or ValueError or the unhelpful 'sequence size mismatch' error, even when I tried tan(x*y).
How to wrap the range between 0 and 255 properly? I just divided 255 by the number the calculation gives inside of an abs() function, but obviously that gives weird numbers with e.g. tan(x*y), since I'm getting numbers like 1788.88940062.[/QUOTE]
number % 255
Oh, and start at pixel 0 on the x and y axis to prevent /0
[QUOTE=TehDoomCat;20104628]No-one else's algorithms work for me >:C
I always get ZeroDivisionError or ValueError or the unhelpful 'sequence size mismatch' error, even when I tried tan(x*y).
How to wrap the range between 0 and 255 properly? I just divided 255 by the number the calculation gives inside of an abs() function, but obviously that gives weird numbers with e.g. tan(x*y), since I'm getting numbers like 1788.88940062.[/QUOTE]
I have a hunch my 255 wrapping isn't working like it should, but it does produce patterns
In python
[code]
def wrap_255(value):
ret = math.fabs(value)
while ret > 255:
ret -= 255
return ret
[/code]
Edit: Now that I think about it it should have been pretty obvious that I can just use modulo
Edit: My pattern looks a lot better now
Also I forgot to mention my function also multiplies by Pi before sending to the trig functions
[QUOTE=xxxkiller;20103344]What library are you guys using to make these patterns?
I would'nt even know how to start :([/QUOTE]
You can use my program for non animated patterns: [url]http://dl.dropbox.com/u/1106779/DisplayFormula.jar[/url]
If you want to code it yourself anything that can draw pixels should work.
[QUOTE=TheKnife;20104713]I have a hunch my 255 wrapping isn't working like it should, but it does produce patterns
In python
Edit: Now that I think about it it should have been pretty obvious that I can just use modulo[/QUOTE]
Yeah I just got it ranging to 255 just doing this:
[code]try: color = abs(255/int(color))
except ZeroDivisionError: color = 0[/code]
[QUOTE=Kylegar;20102061][url]http://www.kylegar.net/stuff/mandel.zip[/url]
Good luck getting it to work, I made it ~8 years ago, and the source code is long gone. I know it wont work on 64bit computers, but it does zoom...and it has colors[/QUOTE]
It also looks like complete shit. I, too, can assign an ugly ass color to a range of iterations and pretend I'm the pro of mandelbrots. Except instead of doing that, I simply followed my own task, which was to zoom into an arbitrary rectangle, not into a point with a predefined zoom factor.
Alright guys, reality check.
It seems reasonable to limit my pathfinder to 3000*3000 in order to cut my memory usage by half, right?
[QUOTE=nullsquared;20105484]It also looks like complete shit. I, too, can assign an ugly ass color to a range of iterations and pretend I'm the pro of mandelbrots. Except instead of doing that, I simply followed my own task, which was to zoom into an arbitrary rectangle, not into a point with a predefined zoom factor.[/QUOTE]
Way to blow everything out of proportion, the guy simply posted a mandelbrot he'd made [b]8 years ago[/b] and your criticizing it. He never said he was pro of mandelbrots either. Jesus christ man.
[QUOTE=nullsquared;20105484]It also looks like complete shit. I, too, can assign an ugly ass color to a range of iterations and pretend I'm the pro of mandelbrots. Except instead of doing that, I simply followed my own task, which was to zoom into an arbitrary rectangle, not into a point with a predefined zoom factor.[/QUOTE]
You merely asked him for colors. He provided, and now you change the rules to something that can be completely subjective. You also put words in his mouth.
I'm planning on making a base game, the planet is about to be consmed by it's sun and players(It will be co-op online) have a nearly top down view, there's going to be classes. A class for gathering resources then a class for making the items and attackers, and the teams will be on a race to build a rocket, there will be destructible environment and buildings and the others teams rocket will twist and bend if they lose while the winners zoom off into space.
Good?
Sorry, you need to Log In to post a reply to this thread.