Author Topic: My First Map- Trouble already!  (Read 5478 times)

0 Members and 1 Guest are viewing this topic.

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #45 on: August 17, 2011, 08:21:53 AM »
What about the sizes of arrays? I'm using several arrays for drawing and also doing a lot of reading/writing of the arrays. I think I read LUA can handle very large files but what about Eufloria?  Well, I'll try reducing the map scale, too. Right now, the largest send distance is slightly over 20,000. Fortunately, I have a scaling variable so I can easily adjust that.  The center of my map is very close to 0,0. I'll experiment and figure it out!

So, is there a limit on the amount of memory the game can use, or is that a limit of my hardware?

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 904
  • Eufloria: Yes
Re: My First Map- Trouble already!
« Reply #46 on: August 17, 2011, 08:30:44 AM »
You could try setting the priority for Eufloria to High/Realtime in taskmanager (You did say you have Windows?). That may have an effect, though...

"The threads of a real-time priority class process preempt the threads of all other processes, including operating system processes performing important tasks. For example, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive."

That may not have an effect on the memory usage though.

I think this function, if run after creating your asteroids, will shift every asteroid so that the center of your map is on (0,0).
Code: [Select]
function Centralise()
topID = -1

--Calculates highest asteroid ID
for i = 0,math.huge do
if GetAsteroid(i) ~= nil then
topID = topID + 1
else
break
end
coroutine.yield()
end

farR = 0
farL = 0
FarU = 0
farD = 0

for i=0,topID do
if GetAsteroid(i).position.x + GetAsteroid(i).SendDistance > farR then
farR = GetAsteroid(i).position.x + GetAsteroid(i).SendDistance
end
coroutine.yield()
end

for i=0,topID do
if GetAsteroid(i).position.x - GetAsteroid(i).SendDistance < farL then
farL = GetAsteroid(i).position.x - GetAsteroid(i).SendDistance
end
end

for i=0,topID do
if GetAsteroid(i).position.y + GetAsteroid(i).SendDistance < farU then
farU = GetAsteroid(i).position.y + GetAsteroid(i).SendDistance
end
end

for i=0,topID do
if GetAsteroid(i).position.y - GetAsteroid(i).SendDistance < farD then
farD = GetAsteroid(i).position.y - GetAsteroid(i).SendDistance
end
end

avgX = (farR - farL)/2
avgY = (farU - farD)/2

for i=0,topID do
GetAsteroid(i).position.x = GetAsteroid(i).position.x - avgX
GetAsteroid(i).position.y = GetAsteroid(i).position.y - avgY
end

farR = nil
farL = nil
farU = nil
farD = nil
avgX = nil
avgY = nil
topID = nil
end
« Last Edit: August 17, 2011, 09:04:34 AM by Pilchard123 »

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #47 on: August 17, 2011, 10:47:07 AM »
WELL! Using my map-scaling variable, I decreased the scale incrementally and finally was able to get one of the asteroid pairs working properly! After further reduction, I was able to get the other pair working as well. What a relief! Pilchard, my map was already centered so I didn't need to use your great solution. Now I need to see if I can duplicate the memory-error message by adding more asteroids. Funny, but I had resigned myself to the limitations and actually was starting to be satisfied with the balance, so I guess a lot more tweaking is now in order.

This writing-code stuff and trouble-shooting is somewhat addictive. I'm starting to dream about it- when I can drag myself away and get to bed on time!

Thanks to all for your continued knowledge-sharing. :D

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: My First Map- Trouble already!
« Reply #48 on: August 17, 2011, 04:39:05 PM »
This writing-code stuff and trouble-shooting is somewhat addictive. I'm starting to dream about it- when I can drag myself away and get to bed on time!

I know exactly what you mean!  It's incredibly exciting when you make a massive breakthrough..

Glad to hear things are going well.  :>

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 21
  • Posts: 1,492
  • They'll eat you next!
  • Eufloria: Yes
Re: My First Map- Trouble already!
« Reply #49 on: August 17, 2011, 04:50:21 PM »
Yeah, like when I solved the IO problem and my personal question of how to find the Angle difference between  two points, I was mega happy!

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #50 on: August 22, 2011, 04:29:47 AM »
I need someone to Beta-test a new map who is willing to provide more feedback than - "I won" or "nice map". At this point, I'm mainly interested in tweaking the difficulty level. Apparently, I am completely incompetent at judging map difficulty or am just plain terrible at this game. My last two maps I judged to be hard, but the Beta-tester says that they breezed through as if there was no opposition whatsoever. I find this astonishing, frankly. So, I am looking for more volunteers who can provide a meaningful evaluation and analyze strengths and weaknesses in the map layout, asteroid strengths, etc., or at least describe their play-through experience in a way which would allow me to determine what I need to do to make the map harder or easier as the case may be. Any map-designer or player willing to help out in this regard, or know of someone who fits that description?

Following those thoughts, it occurs to me that it would be nice if there were a cadre of volunteers willing to Beta-test new maps prior to public release- people who are able to articulate specifics dependent on what the map-designer is looking for. When someone develops a new map and would like it Beta-tested, they would have a list of committed testers available to choose from rather than depending on someone who only wants to try out something out of boredom, and who then fails to provide any feedback. I'd like to see a separate post consisting of a list of volunteers. Does anyone think that is possible, or a good idea? There seem to be a lot of members of this forum , but just a tiny percentage ever post any comments.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 904
  • Eufloria: Yes
Re: My First Map- Trouble already!
« Reply #51 on: August 22, 2011, 09:23:09 AM »
I won, nice map. :P

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #52 on: August 22, 2011, 09:51:31 AM »
Yeah! Alright...

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #53 on: September 25, 2011, 03:19:55 AM »
Is there any way to convert text in a table array into a string?

For example:


Starting array is :         a ={[1] = "x", [2] = "y", [3] = "z",}

then eventually apply a command like -

print(a)

with the result of

"xyz"

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 904
  • Eufloria: Yes
Re: My First Map- Trouble already!
« Reply #54 on: September 25, 2011, 08:42:02 AM »
I'd prolly use something like

a={"x", "y", "z", "1", "2", "3"}

for i in ipairs(a) do
    toprint = toprint + a[ i] --no space in index box, this is just to avoid bbcode fails
end

print(toprint)

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #55 on: September 26, 2011, 02:55:03 AM »
Hmmm. I may be in over my head on this one. However, you've given me an idea of another solution to try if I can't figure this out. I'll let you know. I'm still trying to make heads or tails of polyplates!

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 904
  • Eufloria: Yes
Re: My First Map- Trouble already!
« Reply #56 on: September 26, 2011, 08:19:59 PM »
Polyplates didn't really work, I don't think. I might go back and make it better, I might not.

The ipairs() thing is fairly simple; it just iterates over an array until it hits a nil element. It's not perfect, but it's plenty good enough for most things.

The example I posted up there will itreate of the array a until the first nil element. The output should be xyz123   .

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #57 on: September 27, 2011, 12:54:01 PM »
Well that is simple, then. It won't work for my needs, but you still gave me an idea to try as soon as I finish up elsewhere.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 904
  • Eufloria: Yes
Re: My First Map- Trouble already!
« Reply #58 on: September 27, 2011, 08:21:01 PM »
You can also use table.getn(a) to iterate until the last element, regardless of whether there any nils.

for i = 0, table.getn(a) do
...
...
...
end

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #59 on: September 28, 2011, 11:49:22 AM »
Oh that looks promising. I test it out. Thanks.