Jump to content


lump

Member Since 31 Mar 2012
Offline Last Active Nov 16 2012 07:55 PM

Posts I've Made

In Topic: MINECRAFT lighting options

31 July 2012 - 02:31 AM

Ah ha. You use looping. ;) With the 3D array system I invented for GameMaker, you do not need to loop through things, it is very fast, and can store infinite n dimensional arrays! I will not tell the GMC how I do it until after my project is released, but I may tell you in a PM in return for your cooperation. It is the looping-through-the-array part that takes all the CPU power... the algorithm itself is actually very fast.

Zesterer


I know looping is bad but for now it is the only way, thats why i set up this thread to figure out better ways of lighting ;)

In Topic: MINECRAFT lighting options

30 July 2012 - 11:06 AM

Do not use GameMakers default lighting system. It is slow, and not suited to your project at all. Calculate lighting with a 3D array, storing a value to 1-15 in each index, which holds the light level. When a light is placed, assign a lighting update to the block. Make it update any adjacent block that has a lower light level than it. When each of these has an update, do the same, but set the light level of that block to the highest surrounding light level -1. Then send updates to any blocks darker than it that surround it adjacently as before, but ONLY if the block has changed light level since the beginning of the lighting update.

As to drawing lights, draw the textures normally, but assign a color from white to black for each block vertex that defines the light level of the block (in the 3D lighting array) it is in.

As to 3D arrays, they are very easy in GM. I can make infinite n dimensional arrays, with no index limit what so ever, without a DLL, extension, or other external function. They are also fast. I shall tell the GMC my method once I have released my project that follows similar intentions, albeit very different to minecraft in terms of gameplay, but still using a cube-based voxel-to-polygon meshing system.

I hope the above information solves your problem (I have sent you a PM with more details),

Zesterer

EDIT: If you do not believe that my method works, rest assured that I have made a simple 2D replica to test speed and the theory. It is the 'lighting system Notch doesnt want you to know too much about' ;) Its very fast, works perfectly and without glitches (well, Notch couldnt help himself but add a few in there when he built it, right?)


you do realise thats what i do already, and i use a 3d array already to.
the problem is that to find updated blocks i would have to loop throught the array 15 times wich is just a waste!

if the was a ds_grid_get_xn(id,x,y,x2,y2,n) "where n is the ocurance of the value

becuse right now ds_grid_get_x() only gets the first ocuranse of it.

In Topic: perlin noise ifinite problem

19 July 2012 - 03:02 PM

just to let you know perlin noise is theoreticly infinite, thats why there is no height or width argument, i also knew minecraft had a limit, the once mighy "farlands", i guess i will just maer a ridiculaslly large perlin noise map say 300,000 lots of chunks each directon.

But my question (wich i will word better)is still not answered, but it probably doesn't matter now as i have fix.

"how would i get a number by dividing by infinity?"

although i was more of asking

"how could i tile perlin noise so cordinates 1 on one chunk = cordinates 0 on the next"

and i dont mean tilable as in jobo's way i mean tilable as in "the next chunk will fit in with the previous and so on"

(i do know infinity isn't comprahencible by coputer or man, although man can at least comprahend the uncomprahencibleness of it"

In Topic: terrain lighting problem and texture problem.

18 July 2012 - 07:08 AM

Actually we are discussing about this not because i dont know what marching cubes are, but because you misread what i said.
I did never wanted to use voxels, i was just replying to lump cuz he asked me if i used marching cubes or not, and i said that IM NOT using them because are way too laggy for GM's d3d with a insanely big terrain (if you dont want to limit the view to the next 2-3 chunks in your direction).
So all the last replies was off-topic.


just so you know game makers drawing functions fine, it can handle 1,280,000 blocks in veiw with no lag on a terribad computer LATITUDE D505, it can see a whole 10 chunks infront of it but i agree, your method will allow for MUCH more to be seen as there are a LOT less vertcies being drawn than my one. :thumbsup:

In Topic: MINECRAFT lighting options

18 July 2012 - 07:02 AM

i would use game maker's lighting. i would ray trace all the model vertices and if the ray trace didn't hit anything then i would colorize that vertex darker.


See now you get me, and it would only have to raytrace to 14 blocks whenever the blocks updated.
simple.

plus it would look nice. and the day night cycle youl be easy, ambient lighting. :happy:

On another note i'm adding Infinite terrian soon so yay.