Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5] 6 7 ... 81

Author Topic: Cloud Scream > Development on Pause  (Read 86759 times)

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #60 on: October 09, 2009, 11:48:10 am »

Gravity works! In real time! (almost)
It takes about three seconds for each rolling gravity calculation!
I'm going to have to trim the space debris before calculations, but this means it will only take around two minutes or less
to finish the gravity cycle, with results displayed in real time every step of the process.
I'm just siting here watching the mountains join together mid air (inward falling) and once they take a very raindrop-ish shape,
they come crashing down!

The far away small ones look just like meteorites!

When I get this better optimized, I'll post up a running version.

Edit:
When all is said and done, I end up with a very jagged planet, with ridiculously tall and steep mountains.
Also, because things will only fall straight inward, at the center of every axis,
there is a very long thin plate of land.
I need to think of a way to unstabilize stuff. Maybe if there is enough open space surrounding a tile,
it will also fall to the side.
I don't know, that would at least triple the time it takes to calculate each frame.
I'm thinking that pressure system needs to be put in right about now.
« Last Edit: October 09, 2009, 11:56:04 am by Outcast Orange »
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: WorldJem: Inward Direction
« Reply #61 on: October 09, 2009, 12:16:50 pm »

Sounds awesome, looking forward to it!
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #62 on: October 09, 2009, 01:17:25 pm »

Breakthrough of the day number two:

Pressure can be calculated along with gravity AT THE SAME TIME adding only a fraction of calculation time.

Here is the basic model for pressure:
A tile takes it's own pressure (default yet to be set) and adds it to the tile below.
So pressure will stack pseudo-exponentially.
High pressure tiles will actually move into any of the six surrounding available tiles if one is empty, and return to default pressure.
This way, the really high pressure bases of tall thin mountains will push out and the mountains will be much less ridiculous.

Also, if you were to poke a hole in the center of the earth (let's just assume wizards were involved)
The tiles will chain-burst along a fault and eventually gravity will pull more tiles in to fill the extra open space.

I can't wait to get this up and running.
It shouldn't take long.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: WorldJem: Inward Direction
« Reply #63 on: October 09, 2009, 01:59:33 pm »

Breakthrough of the day number two:

Pressure can be calculated along with gravity AT THE SAME TIME adding only a fraction of calculation time.

Here is the basic model for pressure:
A tile takes it's own pressure (default yet to be set) and adds it to the tile below.
So pressure will stack pseudo-exponentially.
High pressure tiles will actually move into any of the six surrounding available tiles if one is empty, and return to default pressure.
This way, the really high pressure bases of tall thin mountains will push out and the mountains will be much less ridiculous.

Also, if you were to poke a hole in the center of the earth (let's just assume wizards were involved)
The tiles will chain-burst along a fault and eventually gravity will pull more tiles in to fill the extra open space.

I can't wait to get this up and running.
It shouldn't take long.

Epic!  Make sure you include a way to see what happens when you poke a hole in the center of the earth, I want to see this...
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #64 on: October 09, 2009, 02:27:27 pm »

Okay, it didn't really add to the time between frames (only about 4 seconds per frame)
But the number of frames at least quadrupled.
I either need to make much smaller planets,
or start with more stable planets before gravity.

I'm still waiting or my FIRST planet to settle down.
It's been about ten minutes so far...

I'll probably end up refining the planet generation so there are less cave-ins at startup.
The fastest and cheapest way to do that is to limit the static generation to a much closer distance.

Personally, I'm just glad that it's running.
I made at least six non-syntax errors in my pressure testing code that would throw it into an infinite-loop.
Searching out those flaws took forever.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #65 on: October 09, 2009, 02:55:24 pm »

Wow! After watching it fail to do much of anything for probably an hour, I've figured out what I did wrong.
I set the amount of pressure required for tiles to "pop" too low.
The entire planet was basically storing up pressure,
flying to bits,
and starting all over again.

I'm going to change some parameters and see what happens.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

deadlycairn

  • Bay Watcher
    • View Profile
Re: WorldJem: Inward Direction
« Reply #66 on: October 09, 2009, 03:30:46 pm »

That creates a hilarious mental image. ;D

Also, I tried out your most recent version, and I thought it looked great!

My only request is that you have some way to reset Orange, as he can easily get stuck, and there's no way to get him out. Otherwise, everything looking awesome so far!
Logged
Quote from: Ampersand
Also, Xom finds people that chug unidentified fluids pleasing.
Quote from: Servant Corps
Ignorance of magic does not give scientists the power to resist fireballs.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #67 on: October 09, 2009, 04:30:17 pm »

I'll add that the next time orange even has the ability to be happy.
Right now, he's either getting crushed and combined with the earth's crust,
or he falls from the very top of the universe.
I will add more functionality to orange once he becomes a functioning member of the "new gravity" movement.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #68 on: October 10, 2009, 03:10:58 pm »

Okay, I've made tons of changes to the way things work, and the speed of the system overall.
The first bar is much faster, the second bar doesn't exist anymore,
and it only takes about 10 seconds for the gravity to settle.

The only problem, is that the latest change to the direction that things fall,
and the way pressure is applied, is giving me some really strange results.
I'm ending up with radio-active patterns inside of the planet, with all kinds of strange quirks.
I'm not sure why either.
Here is the code that determines the relationship between the current tile and the test tile:
Code: [Select]
            //get distances from cores
            if(currentx<centerx){distx = centerx - currentx;}
            if(currentx>centerx){distx = currentx - centerx;}
            if(currentx==centerx){distx = 0;}
            if(currenty<centery){disty = centery - currenty;}
            if(currenty>centery){disty = currenty - centery;}
            if(currenty==centery){distx = 0;}
            if(currentz<centerz){distz = centerz - currentz;}
            if(currentz>centerz){distz = currentz - centerz;}
            if(currentz==centerz){distz = 0;}

            //determine which core is most distant
            if(distx>disty&&distx>distz){//if x is distant
                if(currentx<centerx){testx = currentx + 1;}
                if(currentx>centerx){testx = currentx - 1;}
            }
            if(disty>distx&&disty>distz){//if y is distant
                if(currenty<centery){testy = currenty + 1;}
                if(currenty>centery){testy = currenty - 1;}
            }
            if(distz>distx&&distz>disty){//if z is distant
                if(currentz<centerz){testz = currentz + 1;}
                if(currentz>centerz){testz = currentz - 1;}
            }
            if(distx==disty&&distx>distz){//if x=y and both are distant
                if(currentx<centerx){testx = currentx + 1;}
                if(currentx>centerx){testx = currentx - 1;}
                if(currenty<centery){testy = currenty + 1;}
                if(currenty>centery){testy = currenty - 1;}
            }
            if(distx==disty&&distz>distx){//if x=y and z is distant
                if(currentz<centerz){testz = currentz + 1;}
                if(currentz>centerz){testz = currentz - 1;}
            }
            if(distx==distz&&distx>distz){//if x=z and both are distant
                if(currentx<centerx){testx = currentx + 1;}
                if(currentx>centerx){testx = currentx - 1;}
                if(currentz<centerz){testz = currentz + 1;}
                if(currentz>centerz){testz = currentz - 1;}

            }
            if(distx==distz&&distz>distx){//if x=z and y is distant
                if(currenty<centery){testy = currenty + 1;}
                if(currenty>centery){testy = currenty - 1;}
            }
            if(disty==distz&&disty>distx){//if y=z and both are distant
                if(currenty<centery){testy = currenty + 1;}
                if(currenty>centery){testy = currenty - 1;}
                if(currentz<centerz){testz = currentz + 1;}
                if(currentz>centerz){testz = currentz - 1;}
            }
            if(disty==distz&&distx>disty){//if y=z and x is distant
                if(currentx<centerx){testx = currentx + 1;}
                if(currentx>centerx){testx = currentx - 1;}
            }
            if(distx==disty&&disty==distz){//if all are equal distant
                if(currentx<centerx){testx = currentx + 1;}
                if(currentx>centerx){testx = currentx - 1;}
                if(currenty<centery){testy = currenty + 1;}
                if(currenty>centery){testy = currenty - 1;}
                if(currentz<centerz){testz = currentz + 1;}
                if(currentz>centerz){testz = currentz - 1;}

Basically, it determines the distance of the current tile from each of the axis/cores.
Then it makes the test tile one tile closer towards the farthest axis/core.
The test tile is supposed to represent the tile "below" or one tile closer towards the center.

I'm not sure why, but this is the result:
Spoiler (click to show/hide)

I'm going back to the drawing board with this one.
Something is about moving the tiles towards the farthest core is causing this.
Please also note that bits of land aren't even falling down, or are perhaps resting on land in other layers.
I'm going to think long and hard on this one and hope I figure out why that block of code isn't getting the job done.
« Last Edit: October 10, 2009, 03:15:54 pm by Outcast Orange »
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #69 on: October 10, 2009, 08:34:46 pm »

I'm pretty sure the problem happens somewhere in the block of code included in the post above.
I'm going to delete the lot of it and start over from scratch, hopefully realizing the problem this time around.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #70 on: October 11, 2009, 09:24:28 am »

Instead of deleting it and what-not, I've just been staring at it angrily.
The thing that ticks me off most is that tiles near the x axis fan out differently from tiles on the y axis.
Also, I don't think any gravity is even happening anymore!
Why else would tiles be floating around in spaces?
My monitor is going to burst into flame if I stare at it any harder.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

bjlong

  • Bay Watcher
  • [INVISIBLE]
    • View Profile
Re: WorldJem: Inward Direction
« Reply #71 on: October 11, 2009, 09:34:11 am »

Why not just use the pythagorean distance formula instead?

D^2=deltax^2+deltay^2+deltaz^2

Or

D= sqrt(deltax^2+deltay^2+deltaz^2)

That should simplify your code, at the expense of making this spherically symmetrical. Of course, if you've got the D, you should be able to get an expression for the gravity exerted on the particle in terms of densities and distances relatively simply.
Logged
I hesitate to click the last spoiler tag because I expect there to be Elder Gods in it or something.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #72 on: October 11, 2009, 09:47:19 am »

I've already got pythagoras working for me.
This code is not used to calculate distance.
This code is used to determine which axis is most distant.
If I just move all the points towards all three poles at once,
I get huge stacks where they all converge at the poles.
So if you graph out a big ton of points, surrounding a circle in an odd shape,
and move them to the best logical place, you will see that you always move them towards the axis that is farthest away.
All of these points already have a distance stored in an array.

Edit:
Also, every square root calculation I can avoid makes this thing run faster.
It already makes 48000000 of them BTW.
« Last Edit: October 11, 2009, 09:50:47 am by Outcast Orange »
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #73 on: October 11, 2009, 10:05:57 am »

I've smashed my fists through that code above a few times, and it looks like this now:
Code: [Select]
//get distances from cores
            if(currentx<centerx){offx = centerx - currentx;}
            if(currentx>centerx){offx = currentx - centerx;}
            if(currentx==centerx){offx = 0;}
            if(currenty<centery){offy = centery - currenty;}
            if(currenty>centery){offy = currenty - centery;}
            if(currenty==centery){offy = 0;}
            if(currentz<centerz){offz = centerz - currentz;}
            if(currentz>centerz){offz = currentz - centerz;}
            if(currentz==centerz){offz = 0;}



            //determine which core is most distant
            testbreak = 0;
            if(offx>offy&&offx>offz&&testbreak==0){//if x is distant
                if(currentx<centerx){testx = currentx + 1;}
                if(currentx>centerx){testx = currentx - 1;}
                testbreak = 1;
            }
            if(offy>offx&&offy>offz&&testbreak==0){//if y is distant
                if(currenty<centery){testy = currenty + 1;}
                if(currenty>centery){testy = currenty - 1;}
                testbreak = 1;
            }
            if(offz>offx&&offz>offy&&testbreak==0){//if z is distant
                if(currentz<centerz){testz = currentz + 1;}
                if(currentz>centerz){testz = currentz - 1;}
                testbreak = 1;
            }
            if(offx==offy&&offx>offz&&testbreak==0){//if x and y are equally distant
                if(currentx<centerx){testx = currentx + 1;}
                if(currentx>centerx){testx = currentx - 1;}
                if(currenty<centery){testy = currenty + 1;}
                if(currenty>centery){testy = currenty - 1;}
                testbreak = 1;
            }
            if(offx==offz&&offx>offz&&testbreak==0){//if x and z are equally distant
                if(currentx<centerx){testx = currentx + 1;}
                if(currentx>centerx){testx = currentx - 1;}
                if(currentz<centerz){testz = currentz + 1;}
                if(currentz>centerz){testz = currentz - 1;}
                testbreak = 1;

            }
            if(offy==offz&&offy>offx&&testbreak==0){//if y and z are equally distant
                if(currenty<centery){testy = currenty + 1;}
                if(currenty>centery){testy = currenty - 1;}
                if(currentz<centerz){testz = currentz + 1;}
                if(currentz>centerz){testz = currentz - 1;}
                testbreak = 1;
            }
            if(offx==offy&&offy==offz&&testbreak==0){//if all are equally distant
                if(currentx<centerx){testx = currentx + 1;}
                if(currentx>centerx){testx = currentx - 1;}
                if(currenty<centery){testy = currenty + 1;}
                if(currenty>centery){testy = currenty - 1;}
                if(currentz<centerz){testz = currentz + 1;}
                if(currentz>centerz){testz = currentz - 1;}
                testbreak = 1;
            }

It has the same basic flaws.
I think I've figured out where the pressures from the white sections are going.
I'm not sure why, but the code is generating crusty triangles of land outside of the planet's original field.
So basically, I think land is being created out there, saps the pressure (somehow) and then we get the strange
patterns. I've no idea what to try next, but I'm just going to keep mulling this over in my brain until I figure out why.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Inward Direction
« Reply #74 on: October 11, 2009, 10:58:00 am »

Here's the old code for getting test position:
Code: [Select]
            //old test
            if(currentx<centerx){testx = currentx + 1;}
            if(currentx>centerx){testx = currentx - 1;}
            if(currentx==centerx){testx = currentx;}
            if(currenty<centery){testy = currenty + 1;}
            if(currenty>centery){testy = currenty - 1;}
            if(currenty==centery){testy = currenty;}
            if(currentz<centerz){testz = currentz + 1;}
            if(currentz>centerz){testz = currentz - 1;}
            if(currentz==centerz){testz = currentz;}

Here is the result:
Spoiler (click to show/hide)

Basically, in an attempt to clarify what the code does:

The current position can be any position in the universe with something in it.
The test position is supposed to be one position closer towards the center of the world.

The code above pics the "one position closer" by just taking the current position,
and moving it one tile closer in all planes.
The problem with this is that all of the gravity and pressure stack up on the center of each plane.
So you end up with the image above.

I want a code that moves it more accurately towards the exact center, not just vaguely.

Any ideas?
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream
Pages: 1 ... 3 4 [5] 6 7 ... 81