Technical

From Elma Wiki
Jump to navigation Jump to search

Technical information for Elasto Mania files, available APIs and various development stuff.

Elasto Mania

Note: All Elasto Mania files are in little-endian format.
The type name will depend on what programming language you are working with, here's a short equivalency list between the most common ones as a reference:

Bytes C Python¹ Rust
1 char c u8/i8²
1 uchar B u8
2 short h i16
4 int i i32
4 uint I u32
4 float f f32
8 double d f64

¹ Using struct formatting [1]
² Depends on context. Assume that all chars in Elma files are ASCII and never expected to be signed, use u8. Probably?

Levels

8)

Language Examples

C/C++
wow test
Python

There is already a nice Elma Python library by sigvef that should cover most of your needs. If not, there's some nice code examples for how you can unpack/pack files if you look at the source code.

Rust
wow test

Replay files

APIs

Currently there are two online APIs available for public use.

Elma Online API 2.0

Official API for the Elma Online site. Use this API if you want to get best times for a certain level.

Battle API

Domovoy and b0ne's API that gives you current battle information in either XML or JSON format.

Example calls:

http://elma.seamy.ru:8880/current_battle XML example result:
 
 <CurrentBattle>
   <designer>DIvAn</designer>
   <file_name>D339.lev</file_name>
   <start_delta>-175</start_delta>
   <battle_type>0</battle_type>
   <battle_attrs>2050</battle_attrs>
   <duration>420</duration>
   <id>104896</id>
 </CurrentBattle>
 

http://elma.seamy.ru:8880/current_battle?json=1 JSON example result:

 { 
   "designer":"DIvAn",
   "file_name":"D339.lev",
   "start_delta":-187,
   "battle_type":0,
   "battle_attrs":2050,
   "duration":420,
   "id":104896
 }
 

Action SuperCross

Levels

Replay files