Author Topic: Map Size  (Read 5423 times)

Jeheace

  • Seedling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 33
Map Size
« on: August 09, 2010, 07:34:35 AM »
Is there a specific script that is used to tell lua what size you want the map to be..?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Map Size
« Reply #1 on: August 09, 2010, 04:09:07 PM »
Not really, no.  The level size is decided when the game begins.  The game will crash if not all of the asteroids are within send-distance range of each other at the end of function LevelSetup.  Once LevelLogic starts they can be any distance from each other.


Use this global:

Globals.G.MaxAsteroidNeighbourDist=60000


Then this:
   Globals.Asteroids.MinSendDistance=60000
    Globals.Asteroids.MaxSendDistance=60000



At the end of your function LevelSetup, put an asteroid at 5000,55000 and set its radius to be zero.  This will be a spacer asteroid to make sure the level grows to the size we want it.

Then at the start of LevelLogic, set the send distances you actually want for all your roids.

dragoonreas

  • Seedling
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 37
  • Eufloria: Yes
Re: Map Size
« Reply #2 on: August 22, 2010, 02:48:15 AM »
Not really, no.  The level size is decided when the game begins.  The game will crash if not all of the asteroids are within send-distance range of each other at the end of function LevelSetup.  Once LevelLogic starts they can be any distance from each other.


Use this global:

Globals.G.MaxAsteroidNeighbourDist=60000


Then this:
   Globals.Asteroids.MinSendDistance=60000
    Globals.Asteroids.MaxSendDistance=60000



At the end of your function LevelSetup, put an asteroid at 5000,55000 and set its radius to be zero.  This will be a spacer asteroid to make sure the level grows to the size we want it.

Then at the start of LevelLogic, set the send distances you actually want for all your roids.

I was trying to make a function that would make sure the map was the right size when I was tinkering with your gravity engine, but it didn't really work that well.

However, after reading this and fixing a few of the logic errors I'd made in my previous attempt I seem to be getting a lot closer to creating a working method for doing this. :)

One of the problems I've come across though is not knowing how big you can make the map before Eufloria gives you the 'System.OutOfMemoryException' message.
The biggest map I've been able to make had max xy values at ±132761 units, and caused Eufloria to use over 1GB of memory!
Has anyone else made a map bigger than this?

EDIT: Added screenshot.

« Last Edit: August 22, 2010, 01:45:22 PM by dragoonreas »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Map Size
« Reply #3 on: August 25, 2010, 09:33:49 PM »
I could be wrong, but I was pretty sure I've had over 1 gig.

I had the most luck by moving asteroids very far either left, or right... but not up and down as well.  So 0,55000 as opposed to 55000,55000.


Infinity swells Eufloria to quite a size, I think that's approaching 1 gig of memory needed.

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
[OT] Oh, one more Mac gamer here :-)
« Reply #4 on: August 25, 2010, 10:06:14 PM »
@dragoonreas: I just noticed your screenshot, and that you, too, play this game on a Mac w/ Parallels Desktop.

Nice to see that I’m not the only one :)

Greetings, Tom

dragoonreas

  • Seedling
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 37
  • Eufloria: Yes
Re: Map Size
« Reply #5 on: August 26, 2010, 02:03:22 AM »
I could be wrong, but I was pretty sure I've had over 1 gig.

I had the most luck by moving asteroids very far either left, or right... but not up and down as well.  So 0,55000 as opposed to 55000,55000.


Infinity swells Eufloria to quite a size, I think that's approaching 1 gig of memory needed.

I was just randomly generating asteroids around the place to test if my map sizing function could prevent the level from crashing if they won't all within the sending distance of each other.

I'm setting my spacer asteroid along the x axis to the distance from the world origin to the furthest corner of a bounding box around a rectangle of a given width & height (the minimum size the level should be) which is then extended to encompass any asteroids outside this rectangle.
I'm also creating an asteroid at the world origin and setting it's send distance to reach the centre of the spacer asteroid (after changing the three global variables mentioned earlier in this thread to this value). The purpose of this asteroid is to have it connected to all the other asteroids in the level, as Eufloria doesn't seem to like it when all the asteroids aren't within send distance of one another when the level is created. This would mean that you could set the send distances in the level setup when using the Gravity Engine, rather than setting them in the level logic as is currently required.

I just had a quick read through the level setup for Infinity and it looks like all your asteroids are within ±54000 xy units from the world origin, and your spacer asteroid is 65000 x units away from the world origin.
I don't remember checking how much memory was used when I played Infinity, but considering that it's still just over a quarter the size of the ±132761 unit map I doubt it uses anywhere near a gig of memory.
BTW, why do you set your the spacer asteroid to be 5000 units away from the x axis?


@dragoonreas: I just noticed your screenshot, and that you, too, play this game on a Mac w/ Parallels Desktop.

Nice to see that I’m not the only one :)

Greetings, Tom
Yep.  :)
When I'm on my Mac Pro I use Parallels, but I have to use Boot Camp when I play on my MacBook Pro.

I actually designed my Recursion map in JavaScript using Apples Quartz Composer, and then ported it (manually) into Lua Script. I'm not sure how much quicker it was to develop this way rather than going straight to Lua Script and testing it in Eufloria, but I do like how I can seen any changes I make to the JavaScript in the Quartz Composition reflected in the viewer as soon as I do them. ;D

I'll attach the Quartz Composition so you can take a look if want.
« Last Edit: August 26, 2010, 07:58:03 AM by dragoonreas »

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Map Size
« Reply #6 on: August 26, 2010, 03:58:55 AM »
Hello dragoonreas, just checked your .qtz file in QartzViewer (or whatsitsname), looks VERY cool, has the <wow> effect, and the asteroid configuration in your Recursion map is clearly recognizable.