Author Topic: Level design/ Code questions from a beginner  (Read 16060 times)

0 Members and 2 Guests are viewing this topic.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Level design/ Code questions from a beginner
« Reply #45 on: May 09, 2010, 07:44:22 PM »
Am trying to figure it out also.  I thought perhaps it was because you are treating player 0 as an AI player, but I changed all the references to player 0 and his asteroids to player 3, and it still crashes.

It seems to crash shortly after the grace timer is up, I'd estimate about 400 seconds in.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Level design/ Code questions from a beginner
« Reply #46 on: May 09, 2010, 07:56:37 PM »
Bizarrely, it seems to be some of the asteroids in LevelSetup() causing the problem...


The first 5 are fine.  Going to check the others now


Edit - wait, nope... still crashes with only the first 5 asteroids.

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Level design/ Code questions from a beginner
« Reply #47 on: May 09, 2010, 08:02:41 PM »
see..i also suspected the grace timer might have been the issue.
i changed it to 1024 (which i think equates to 17mins real time) and am running the game as i type. it seems to be at least part of the issue because its been going for a long time, longer than usual.
this might be it...

...

EDIT - game still running, after at least 15mins....am waiting for the crash but its not happening.
HAHA...just as i typed that, it crashes!!! ::)
SO, my conclusion is that its the grace timer. that change made a difference but it still crashed after the 17mins.
i will comment it out and see if it goes all the way....

...
« Last Edit: May 09, 2010, 08:10:36 PM by AWS »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Level design/ Code questions from a beginner
« Reply #48 on: May 09, 2010, 08:07:33 PM »
I think it has something to do with your globals.

I've changed them to this:


Code: [Select]
   -- Set Global Values
   Globals.G.Asteroids=(0)
   Globals.G.EnemyFactionsMin=(1)
   Globals.G.EnemyFactionsMax=(1)
--   Globals.Asteroids.SpawnCap=88
--   Globals.Asteroids.SeedlingCap=3333
--   Globals.Asteroids.MinSendDistance=0.5
--   Globals.Asteroids.MaxSendDistance=0.5
   Globals.AI.GraceTimer=(360)
   Globals.Structures.FlowerProbability=(0.07)
--   Globals.Mines.GrowTime=(0.59)
--   Globals.StructuresDefense.MaxDamage=1
--   Globals.StructuresDefense.MinDamage=0.5
   Globals.Asteroids.MinCoreHealth=50
   Globals.Asteroids.MaxCoreHealth=500


No crash yet.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Level design/ Code questions from a beginner
« Reply #49 on: May 09, 2010, 08:11:34 PM »
Also this bit is wrong:

Code: [Select]
   -- Asteroid 13 - 3rd West north
   b = AddAsteroidWithAttribs(-5200,-2750, 0.5,5,0.5)


annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Level design/ Code questions from a beginner
« Reply #50 on: May 09, 2010, 08:13:00 PM »
Just completed the map.

Pretty sure it's the globals.  Not sure which one though.

Is the seed cap set too high maybe..?  (3333)
Is the Mine Grow Time global the cause of the problem?  (perhaps its bugged command?)

I know not.
« Last Edit: May 09, 2010, 08:16:19 PM by annikk.exe »

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Level design/ Code questions from a beginner
« Reply #51 on: May 09, 2010, 08:15:23 PM »
well...
the 5 Strength attribute is changed now!!
you completed it??? already?? blimey....
so, after editing those things out, and not the grace timer, it worked?
hm....
im not sure the Mine Grow timer is bad because i changed it to 10 and it took longer to grow than what i had it on before.. 0.59.


annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: Level design/ Code questions from a beginner
« Reply #52 on: May 09, 2010, 08:16:59 PM »
Comment them out one at a time until you figure out which one is causing the trouble.  :>

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Level design/ Code questions from a beginner
« Reply #53 on: May 09, 2010, 08:18:32 PM »
ok...im editing out the grace timer just by itself first. all others left in.
ill check back in a mo...

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Level design/ Code questions from a beginner
« Reply #54 on: May 09, 2010, 08:26:06 PM »
interesting, with the grace timer edited out, it still crashed after usual time frame.
ill edit out the first inyour list of edits, the spawn cap... (which, when not specifically defined, defaults to a cap of 40)

NOPE. crashed.

next is seedling cap...
NO. took longer to crash this time.

next is mine grow time. (ive skipped the min and max send distances for now as i dont believe they are responsible for it. but if i have to, ill do them at the end)...
NO. crashed.

next is max and min defense damage. ive edited this out together...
« Last Edit: May 09, 2010, 09:14:43 PM by AWS »

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Level design/ Code questions from a beginner
« Reply #55 on: May 09, 2010, 09:56:24 PM »
on a side note...how would i code the following script...

the flower probability can only begin to be applied once the roid has been maxed out. ie, no flowers before all trees are planted.

?

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Level design/ Code questions from a beginner
« Reply #56 on: May 09, 2010, 10:13:46 PM »
well, after editing out the min and max defense values...the game has been going for over 30mins just fine...ill confirm upon completion of game.

fingers crossed

 :P

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Level design/ Code questions from a beginner
« Reply #57 on: May 09, 2010, 11:03:40 PM »
hurray!
it turned out to just be those 2 values.
Code: [Select]
--Globals.StructuresDefense.MaxDamage=1
--Globals.StructuresDefense.MinDamage=0.5

interesting. i dont know why that should happen but there it is.

now, seeing as the level developed into being way way too easy...lots more adjustment is needed. feels good to the first proper run through done though.

thanks for taking a look annikk. invaluable as always.

 ;D

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 77
  • -Receive: 8
  • Posts: 629
  • Was born, still alive.
    • German Mac Mailing Lists
  • Eufloria: Yes
Re: Level design/ Code questions from a beginner
« Reply #58 on: May 10, 2010, 01:51:31 AM »
[..] as the level developed into being way way too easy [..]

Heh, then it must be just right for me :D

You guys continue to baffle me. Though I'm not a programmer, eons ago when in uiversity I took a few initial lessons in several programming languages and thus I can understand just a few teeny weeny little bits of those code snippets in your dev threads which I nevertheless read with interest as to understand the thinking behind your levels and well, I guess the philosophy of this language and programming.

Thank you.
Google+
Do you play Go? (aka iGo aka Baduk aka Weiqi)

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 274
Re: Level design/ Code questions from a beginner
« Reply #59 on: May 10, 2010, 02:59:33 AM »
[..] as the level developed into being way way too easy [..]

Heh, then it must be just right for me :D

You guys continue to baffle me. Though I'm not a programmer, eons ago when in uiversity I took a few initial lessons in several programming languages and thus I can understand just a few teeny weeny little bits of those code snippets in your dev threads which I nevertheless read with interest as to understand the thinking behind your levels and well, I guess the philosophy of this language and programming.

Thank you.
:)
i assure you bonobo that i know very little of the real technical stuff behind all this coding. i kind of wish i did a bit more. i once took a 10-week web desgin course a few years ago and we touched on some basic coding (Flash, javasrcipt, css, html etc) but you only have to look at one of annikk's clear and legible explanations of a question asked to see the real knowledge. great to see and wonderful to have some access to.
when his gravity engine is finally finished, one hallowed day from now, it will be amazing to behold.
im still yet to feel confident enough to start lifting some of his AI code from his current levels. but i would like to start incorporating some of it soon. i like the thought of being able to tweak it to suit my needs.
hehe...we'll see eh...

 8)