"Magma Mountain" Tips and Tricks

Hi, ritic here. I am continuing @TheBredMeister 's category of tips and tricks for the AI leagues:

1st of all, (optional) as of writing this, DO NOT use jump or dash, it can mess up your code, jumping and dash may seem good, but overall, it messes your code up, lets say you dash and you go over where you want to go, your bug moves ALL THE WAY to that position, wasting time.

2nd of all, TIME IS KEY losing even 1 second can interfere with your win:loss ratio

If you have more tips, please reply below :smile: And good luck!

(edit: jump and dash can be used if you have good code (thx moon) )

1 Like

My piece of advice – ignore at least half of those points :slight_smile:

1st of all, if you want to know how many tiles from 1 coordinate to another (lets say x:64 to x:70) the formula is coordinate/4 each tile is 4 coordinates

step size is 2. The lava and player size is 2m. The avatar moves for 2 steps.

2nd of all, as of writing this, DO NOT use jump or dash, it can mess up your code, jumping and dash may seem good, but overall, it messes your code up, lets say you dash and you go over where you want to go, your bug moves ALL THE WAY to that position, wasting time.

No comments here. Just think.

4 Likes

Seems like a problem you can solve if you just have good enough code…
Also, if time is key, then it’s better to dash/jump (although jump you should probably only use when there is lava blocking you)

1 Like

In my opinion dash is really useful. It makes your hero go about 12 meters, or 3 steps.

1 Like

6??? Hmm, should 12m (or 3 times from usual move)

1 Like

thanks (20 characters)

1 Like

A good trick seems to be seeking out items based on value over distance, like in the “diamond dozen” level.

1 Like

Something to keep in mind is that maintaining your health is usually the key to winning. Your total score that determines whether or not you win or lose is equal to your score plus twice your health. If your health is lower than your maxHealth, each heal item is technically worth two points instead of one.

2 Likes

As an idea – what I add a way to use abilities in any direction? It can be a non-blocking method like ‘turn’ so you can turn, shoot and move where you want. Another way to add an optional. argument in any ability to choose the. direction for them (this one can make docs more complex for newbies).

Yes turn is a wondeful idea, but will that let us move diagonally or no?

Diagonals? No. How? I suggested it just to use abilities in a direction

Why have I’ve put it here? My bad

1: NO JUMP OR DASH It can easily mess up your code even making you jump right into lava. It’s also very hard to measure distance

2: Think smaller, unless you have a really good code keep it simple. It’s easy to get top 100 with a simple code

GOOD LUCK!

1 Like

I have found that a good way to get an advantage of your average opponent is to find a way to detect their fireballs so you can dodge them.

2 Likes

HA HA! I love this! Honestly, I haven’t thought about it, however, I see how you can do it :slight_smile:

3 Likes

Hello, I’m trying to teach my kids how to code within the Magma game. Am I overlooking a repository that documents ALL methods, properties, etc? There’s obviously the middle screen with some methods (shown below), but this appears incomplete as it does not show one of the suggestions of using hero.isReady('dash') shown on the initial screen. I’ve also seen other questions, suggestions that do not appear on this list.

Assuming no documentation exists, is there a way to debug/inspect various objects, functions etc? As an example, once an object has been created (i.e. item = hero.findNearestItem()), it would be useful to know what properties item has. Even just being able to execute a logger function would be useful as I’ve seen other posts using a pos property.

Thanks. Overall this is a very fun idea.

image

image

Thanks. You are right and need to add docs.

There is a list of available methods
[
“moveLeft”,
“moveRight”,
“moveUp”,
“moveDown”,
“jump”,
“isReady”,
“dash”,
“findItems”,
“findNearestItem”,
“distanceTo”,
“getLavaMap”,
“lavaAtXY”,
“fire”,
“turn”,
“moveForward”
]

2 Likes

Properties available

[
“id”,
“color”,
“score”,
“opponent”,
“time”,
“health”,
“maxHealth”,
“speed”,
“x”,
“y”,
“direction”,
“angle”
]

2 Likes