Author Topic: Possible to simulate colliding asteriods using current API ?  (Read 5827 times)

evoke

  • Guest
Possible to simulate colliding asteriods using current API ?
« on: February 28, 2010, 05:22:32 AM »
Hi,

Relatively new player.  Programmer by dayjob.

Imho, need to play the customs a touch and briefly read up on LUA syntax before joining the modders, but in reading forums on existing API and techniques had a question / remark.  Someone had asked if asteroids could move or collide, and elsewhere there's a technique for zeroing out or pulsar expanding their dimensions.

So I was curious if one could design a normal AI world, plus a linear arc of zero radius hops towards a normal player world, and code up for the AI world to essentially 'move' along the arc, by the tandem code manuever of zeroing out a world and enlarging the next in the arc series.  Eventually leading to progressing through the arc to be adjacent to player world, and then zeroing out the last arc world and player's world, in, effectively, a collision.

I was leaning to trying that as first level edit dabble (though feel free to borrow / do it better, ideas want to be crosspollinate), and was just curious if the veterans saw a reason that just flat out would not work.  (not that I couldn't try a 'normal' board, just that it's nice to do new angles and further the art / library of techniques)

Presumably, sketching out a level with collision arcs to several player worlds, with some build space but difficult nearby conquests, and a goal for the player to build and marshall forces to accomplish some objective before getting demolished, as an interesting win / loss angle, essentially making a distinct type of puzzle level in the incentive / constraint department.  Usually, your constraint against waiting around to mass forces is that the AI masses faster and-or attacks, and I thought a collision constraint would be a novel spice to dabble with.

« Last Edit: February 28, 2010, 05:26:31 AM by evoke »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Possible to simulate colliding asteriods using current API ?
« Reply #1 on: February 28, 2010, 07:46:36 AM »
Unfortunately it's not possible to change the position of an asteroid, which is what would be required for moving it.  There needs to be a "SetAsteroidAttribs" command or something like that - and there just isn't.  You create an asteroid with the command variable = AddAdsteroidWithAttribs(x,y,energy,strength,speed)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Possible to simulate colliding asteriods using current API ?
« Reply #2 on: February 28, 2010, 07:47:03 AM »
...but if you can figure out some hax way to do it, let me know!! :D

njursten

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
Re: Possible to simulate colliding asteriods using current API ?
« Reply #3 on: February 28, 2010, 07:10:28 PM »
But isn't his idea to have a large set of asteroids where only one is visible at a time, simulating the movement by switching which is visible?

If you'd just want to introduce the asteroid in this way, like 'warping' in the asteroid, I think it could work. Though if the player manages to send seedlings to an asteroid that is set as invisible while they are in transit it might turn visible again... I saw some problems like that on one of annikk's maps.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Possible to simulate colliding asteriods using current API ?
« Reply #4 on: February 28, 2010, 10:20:30 PM »
Ah, I see what you mean now.  Yea, I found with hiding asteroids it's fairly normal for a seed travelling past to re-expose them to the player.  I suppose you could add an OnAsteroidRevealed(ID,Owner) section at the end, and make that re-hide the asteroid.  Funny I didn't think of that when I was making Return to Fluffy Land.  :>

njursten

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
Re: Possible to simulate colliding asteriods using current API ?
« Reply #5 on: February 28, 2010, 11:46:55 PM »
Hm, right, didn't think of that reveal event function. Now the test level I created got a bit prettier. Attached a level with an orbiting asteroid.

But as you can see it's not that practical. This one uses 100 asteroids to create the orbit. I also tried 200, but then the game crashed. Though if you just want them to collide maybe you don't need as many because the movement speed would be higher.

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: Possible to simulate colliding asteriods using current API ?
« Reply #6 on: March 01, 2010, 10:50:18 PM »
Moving asteroids is something that I'd like to set up, soon.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Possible to simulate colliding asteriods using current API ?
« Reply #7 on: March 02, 2010, 02:23:29 AM »
Awesome :>  Let us know how that goes ! :D