Author Topic: Gravity Engine - dev blog  (Read 43001 times)


  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Gravity Engine - dev blog
« Reply #100 on: May 29, 2010, 08:23:07 PM »
Much more AI-tinkering last night.  Now displaying Correct Behaviour™  :>
It's so close to being finished!
« Last Edit: May 29, 2010, 08:28:01 PM by annikk.exe »


  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Gravity Engine - dev blog
« Reply #101 on: May 30, 2010, 05:58:19 AM »
All the mechanics - AI included - work perfectly now.
We're doing final balancing and beta testing now, I am working closely with Smokey on this map - he has been beta testing like crazy and we have discussed the balancing of the map at length.  As I type this, he's playing the latest rebalance of the level.

Going to aim for a Medium-Hard sort of level of difficulty.  Level will be released very soon, tonight or tomorrow!


  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Gravity Engine - dev blog
« Reply #102 on: May 31, 2010, 01:59:26 AM »
So, now it's released and the first dozen or so people are playing it.

I am very tired.  I also have been neglecting my various other creative projects for a while now, and I'm about to move house...
In short, it will probably be at least a couple of months before I start work on a new map.  It would take something pretty impressive to top this one, at any rate..

Also I thought I would share with you guys, the original concept drawing for Infinity, which I sketched out late one night in MS Paint.  :>


  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Gravity Engine - dev blog
« Reply #103 on: May 31, 2010, 02:03:12 AM »
Also here is an extract from a log I kept whilst fine tuning the orbital path of the comets:

594 minimum on interaction 4 at 630 sec

it was about 240 on the wrong side.  i increased the density from 75 to 95

reduced it by 2

it was close, but didn't curve round far enough.

increased it by 3... now it's 966, up from 963.

that time it flung it too far round.

was 966, now 9659

that time it was _just_ on the wrong side

uhh..... ok, guess i'll try 9659 again

no change, new variable works good.

trying 96595

no big change.
need to try something drastic to get an idea which direction to push in.

i will try 96610

badly wrong direction.

trying drastic in the opposite direction then.  96580

no big change.  trying 96570

still no big change...weak....  trying 96550

STILL no big change... they might be a bit closer together though.
Trying 96350

oooh!! That made them collide!

Just a bit more...  trying 96330

Getting there now.  Need a little bit more tho.
Trying 96270

looking very good now.  but it's still a bit too much.
trying 96220

right, that was good.  4th interaction WORKS!!
after 2 more suns, the asteroid goes spinning up to the north-east asteroid instead of heading to the middle.
i have thought about it and reducing it further should fix this.  however, the increments must become small now.

trying 96210

ok that time they went more diagonal instead of straight up, so we are going in the right direction :>
maybe try reducing by roughly the same amount again...
so.... trying 96195

uh... i reduced it too much, i think...
trying 96205

still too much.  trying 96201

They collided!
Still too much.  96199?

Nope.  96198?

wrong side now.

trying 96208

correct side, but still far from each other.

trying 96207

still quite far from each other.  699 distance away

trying 96206

like 560 that time.  they got closer!

trying 96204

they got even closer that time, it seems.  started bending more.

trying 96203

ok they were only 100 or so away from each other that time!


nope, needs to bend further.


dude!! almost there!!!

trying 962015

looking good, that's a successful 5th interaction.  good job druids!
it comet is going the wrong way around sun #2 after the transitition, lowering a bit more to curve it around
trying 962005

that was too far - try 962014 next

they basically bounced off each other that time
14 is still bringing them too close together
so gonna try 149

trying 9620149

wrong!"!!! seedingn n00b druid

trying 96201495

trying 1520

stupid druid!!

trying 1510

nope, still landing on the wrong side of sun #2

trying 1503

ok i think i have been going in the wrong direction
now i will try 96201600

yeah i was indeed going in the wrong direction.  gradually increase the density to
bring the comets closer and closer to the first sun's corona

trying 96201675

that was good - first time with 5th interaction 2nd sun correct side!!

need to increase it slightly more
trying 96201705

today i will try 96201725

that seemed to work pretty good... but watch this one again when i wake up.
i'm not too sure whether need to increase or decrease at this point...too tired

ok.  it's morning now.  i have watched the interaction.
it sends it successfully around both suns, and into a 6th interaction!  This is
great news.  Good job druids.

Now I should set Fish Time to 1150.  that should wake me up just before the 2nd sun
prior to interaction 6.

Now, as to the value.  That time, they were slightly on the wrong side of each other
96201725 = slightly wrong side
lets try 96201721 and see if decreasing it slightly works well.

ok, that time they collided!  so that's going in the right direction, it seems.

Trying 96201713

ok, that was on the right side...but they didn't pass close enough to each other.
So I've gone a little too far.

Trying 96201717

they were close to each other that time... but need to be very slightly closer..

Trying 962017185

that produced a successful interaction.  watching the orbits...
ok it flung them a bit hard
they came a bit too close together i think


Eh, we need a new convention.
17185 before

they were being flung too hard, not getting close enough.
So i need the suns to make them cling closer, to prise them slightly further
apart during the interaction.  so i'll increase to 17188

still flings them rather hard.  lets see... yeah... he goes WAY round the first sun
he's not coming back anytime soon.

um, it's this counter-intuitive thing again... i need to decrease it
isntead of increasing it...

lets try 17182

this time they come a bit too close to the sun...
going straight through the middle of the corona, very close...
ok so i took it a bit too far.

try 171835

this curve looks more like it :>
went round the first sun nicely.  lets see how it lands on the second...

that makes it go all the way around, but they are comets fly on the wrong side
of one another on the next interaction.

lets try decreasing the value very carefully

try 171833

they were still on the wrong side from one another.  782 from the center at y = 0

trying 171838

woah.  OK.  that time they practically collided.  increasing seems the way forward !
still on the wrong side, sligthyl...
uh... setting a new fish timer of 1200
lets try 1718385

they were on the wrong side of each other by about 248

lets 1718405

that time they were over 2000 apart!
but on the right side, i think...
so lets try a much smaller increase...


ok, they were like 150 on the wrong side.

trying 1718394

ok...that time the interaction BEFORE didnt work... :S
they seemed to come on the right side, but far far too close
trying 1718388 again, just to confirm they have a successful first
interaction and come 150 on the wrong side on the second one worked as described before.  hmmmmm....

guess i will try 1718389

that time it was 209 on the RIGHT side...

trying 17183887

was a little way on the wrong side


they pass close to each other on the right side, but not close enough...


they got within 206 of each other, in the right side...

ok, so seems like im reducing too slowly.

trying 171838865

that time they were wrong side


wrong side, by like 50...


that time they were on the right side, by like...tons...

so ah... 1718387925

wrong side, by about 50... >.<


wrong side, by bugger all, again.

giving up for tonight.

read over notes.  trying 171838883
also added interaction counter
proved game pausing doesnt affect asteroid orbits

interaction 5 works
interaction 6 seems to work..
interaction 7 fails - they are on the correct side but a bit too far

ok, now should be easier to troubleshoot :>  try some new values when i
get back and lets see how we can steer it at interaction 7...

trying 171838888

interaction 6 works fine...
interaction 7

they were on the right side of each other, but 206 apart

need to find the distance after a change

trying 171838898

i have increased it by 10 basically
looking to see whether they are further apart than 206 this time
to figure out which direction to change in

....ok, that time they were 206 apart as well :/

trying 1718389

maybe i can get 1 more interaction to work...

correct side, 206 away...AGAIN

trying 171839

that causes them to be wildly too far apart, on the right side though.

so im guessing if i try 171837, which is the other side of the "most accurate
so far", it's going to be too much on the other side.

ok i haven't actually tried 171837
i guess i should try it, just to see what happens
this appears to be the very limit of the accuracy possible
good job all druids who participated in this project
we're at the end now.  lets confirm it.

Yes, I was going a bit crazy at the time.  :P


  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Gravity Engine - dev blog
« Reply #104 on: June 07, 2010, 10:23:35 AM »
Had an idea for a new level.


  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Gravity Engine - dev blog
« Reply #105 on: June 07, 2010, 04:01:58 PM »
Annik, you never stop to amaze me (amaze us, I guess). And I believe you will always have new ideas for levels and whatever else. Just take care of yourself, get your household moved well and eat and sleep and talk some to your folks, will you? And then, I think, we all will happily await what comes next from you.

Best wishes, Tom


  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Gravity Engine - dev blog
« Reply #106 on: June 12, 2010, 12:59:33 AM »
Well needless to say I am abandoning the idea I had a few days ago, as it was another idea bound by the constraints of not being able to build trees on moving asteroids.

Now that planting bug on moving asteroids has been fixed, my intention is to go straight for the most ambitious map of all - a fully procedural "big bang" style map.
It will be called "Big Bang", not "Fluffy's Big Bang", by the way :P

So I was just gonna lay out my intention for what this map will be like.

At the very start, there are no seedlings and no trees.  There are only tiny little space rocks - hundreds of them - all starting in a random location around the centre, and moving in a random direction at a random speed.

All of these will have their own individual gravitational fields, and all of them will move and be affected by gravity.

For the first 30 seconds or so, they will fly around bumping into each other.  When they touch, the two asteroids become one - they "snap together", sort of like two raindrops progressing down a car windscreen snap together when they come close enough.
The snapping effect will have an effect on their momentum.
The treecap and send distance for each asteroid are dynamically adjusted according to their current size.  The tiny initial rocks will be considered comets, and will have a treecap of 0.

After 30 seconds, this "snap together" behaviour will cease, and when they touch, they will instead bounce off each other.  The bouncing will be such that the asteroids cannot "settle" against one another, they should always bounce clear.

An asteroid that bounces off another asteroid loses one tree and a percentage of any seedlings orbiting it.

At 30 seconds of game time, a series of friendly and enemy seedlings are added.

The enemy seedlings will be - out of necessity, I suspect - controlled by the Infected AI engine, which I may or may not overhaul as part of the project.  The reason why I think it will be necessary to use the Infected engine is that I believe the original AI is not capable of recalculating traversable paths in a dynamic way during Function LevelLogic() While loops, therefore moving asteroids would completely confuse it.  I might be wrong about this... would need to do some testing.

The game then proceeds.  The player must traverse the procedurally generated galaxy, finding a way to reach all asteroids, and destroying the enemy empire wherever they lurk.  If the player owns all of the non-comet asteroids in the galaxy, they win.  If they own no asteroids, they lose.

In this way, every time you play the game, a brand new, procedurally generated universe is created, with all the asteroids in it moving and orbiting around each other in interesting ways.

This should hopefully provide a lot of replayability, and hopefully a lot of campfire-style stories about galaxy arms colliding and massive carnage will be the result... :>

However, I am currently moving house.  This massive level design project will therefore take considerable time to get underway, but I will be sure to post again when coding begins.  :>


  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Gravity Engine - dev blog
« Reply #107 on: June 12, 2010, 06:18:38 AM »



[..] and now, after recapturing a few vowels and consonants, I just want to wish you a good move and good luck with all. You’ve certainly got us all drooling for any news from annikk.exe.

Take care, Tom


  • Administrator
  • Old Oak
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 13
  • Posts: 669
  • Eufloria: Yes
Re: Gravity Engine - dev blog
« Reply #108 on: June 13, 2010, 12:04:46 AM »
All I can say is that I am happy we made the game moddable :-D


  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Gravity Engine - dev blog
« Reply #109 on: July 04, 2010, 04:13:08 AM »
Had a problem with unstable asteroids.

If you change the size of an asteroid, you get the same sort of problem as with moving asteroids. See this post for more details, particularly the picture.

Jazz Ad

  • Sapling
  • **
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 53
Re: Gravity Engine - dev blog
« Reply #110 on: July 13, 2010, 08:51:55 AM »
Next thing you know we'll have Eufloria and Osmos witihn the same game.


  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 33
Re: Gravity Engine - dev blog
« Reply #111 on: August 05, 2010, 03:52:26 PM »
Hey annikk.exe...

If you change the G at the beginning of your gravity equation to -G,

Fgx = (G * ((roidradius * roidradius) * math.pi * density) * ((roidradius[j] * roidradius[j]) * math.pi * density[j]))
Fgy = (G * ((roidradius * roidradius) * math.pi * density) * ((roidradius[j] * roidradius[j]) * math.pi * density[j]))


Fgx = (-G * ((roidradius * roidradius) * math.pi * density) * ((roidradius[j] * roidradius[j]) * math.pi * density[j]))
Fgy = (-G * ((roidradius * roidradius) * math.pi * density) * ((roidradius[j] * roidradius[j]) * math.pi * density[j]))

you get anti-graveity (though this can't co-exist with the regular G equation at the same time)

Now, I saw that you were gonna start all of the roids in random locations... but what if you started them all at the center with the anti-g set first and set HIGH, and then switched the -G to G after a few seconds, turned G down to normal, and THEN activated the code that tells them to merge on contact...

Either they'll all stay in one spot, or fly to ends of the world...

But then again, this could be an idea for a different level... or just not possible...