Jump to content
Eternal Lands Official Forums
Domino

Android client

Recommended Posts

Hi,

 

I started to write a client for android. I thought it would be cool to play EL from my phone and to make my own client:). So far it can chat and eat/drink items. The next step is to make it able to harvest, so for this i need to make it walk on the map, harvest and use the storage.

 

I need some help to implement the walking because i don't know how to get the data from the map files. So far i know that i have to implement the walking part on the client and that the map is an .elm file. What i have in mind is to make a matrix of 0 (can walk) and 1(can't walk) and run dijkstra on it. I know not all the maps are all flat and you can climb up and down, but I'll just block those paths for the sake of simplicity. Later on instead of 1 i might have id's of the items i can harvest, but I'll think more about that at the right time.

 

So I'll be most grateful if someone can tell me the format of the .elm files or tell me what exactly i have to do:)

 

Thank you.

Share this post


Link to post
Share on other sites

I like the idea that you're are doing this. I read a thread about producing a android client for EL.

 

Just a heads up though. In the rules here: http://www.eternal-lands.com/forum/index.php?showtopic=14582

 

there is a section that says:

20. No Illegal Clients.

When modifying the Eternal Lands client you must abide to the license given, and may not distribute copies of illegally made clients. All patches or unofficial clients must first be approved by an Eternal Lands owner (namely Entropy) before use.

 

I am just mentioning it so you not get in any trouble for your client.

 

Best of luck to you :)

Share this post


Link to post
Share on other sites

Yes, of course. I have talked with with Entropy about this and he knows what i'm working on. I only run my client on the test server and i will only release it or use it myself when Entropy will approve it.

Thanks for the heads up:)

Edited by Domino

Share this post


Link to post
Share on other sites

if you can make a successful android client, i will name my second born after you.

first born is gonna be the 4th since im passing my name down.

 

i been wanting to buy an android tablet for the longest but if i cant play EL on it then its just a waste of money.

Share this post


Link to post
Share on other sites

I got an android galaxy 2 tablet and would love to be able to use that to play occasionally (very good idea imo).

Shud bring alot more new players to the game also if EL android client was available straight from the app store.

If u need some more android users to test it out send me a /mercator msg or pm be more than happy to help where i can =]

 

also best of luck

Share this post


Link to post
Share on other sites

First 4 bytes are not interesting, then you got 4 four-bytes integers: x and y dimensions in tiles (one tile is 6 steps so you have to multiply those numbers by 6 to get heightmap dimensions), tilemap offset and heightmap offset in map file. Each "square" on the heightmap is one byte, 0 is unwalkable tile (-2.2m). Best way to understand that stuff is just making a simple map using Eternal Lands map editor and then browsing created file using any hexeitor. Good luck with your project ;).

Share this post


Link to post
Share on other sites

After you manage to read the height map from the map files, you will need to take care of walking paths.

 

If you write your own, it may be trouble, but maybe a google for "path finding algorithm" might help.

 

You might be able to look at some bot code or the EL client code to find something you can copy and modify. I suggest you ask permission and give credit where due and consider what changes it might make to client licensing requirements (GPL, EL's custom license, etc). Sorry to scare you with licensing crap....just a habbit.

 

There is a maximum number of steps that the near-walk command can do. I don't remember if it is 6 or 10 or what. You will want to consider that and perhaps mark points for your client to walk through if you write your own code. Other people's code may already have this. You may also want to consider a "stall" check to see if your character is still walking when it is supposed to be and resume after a short period.

Share this post


Link to post
Share on other sites

Thanks for your post. I have been playing with the maps files and i found out there are 3 matrices: titles matrix, height matrix and another one i suppose is for the items on the map. If i got it all right I should have a path finder algorithm implemented by saturday. I was going to throw a dijkstra with min heap or fibb heap, but i took your advice and google about path finder. Seems like A* is much better and not hard to implement either. I'll see what i'll get.

 

This was thrilling. I haven't been reading bytes in hexa since collage when i was implementing des, aes or rsa:)

Edited by Domino

Share this post


Link to post
Share on other sites

Hello,

 

I have done implementing the walking. It's good, but there is still a lot to do just to make it a good client for harvesting. I hope tomorrow (by this hour) to post a video with what i have and any feedback will be appreciated. :)

 

I have a little dilemma regarding the map images. They are huge and i want to reduce them. First i think i should reduce the size to 480x480. Than to change the format from bmp. DDS doesn't work, png have about 500kb, jpg 200-300kb and gif around 100kb. Suggestions?

 

I hope by the end of the week i will implement a person view(2D) and make it able to harvest. I think the character will be just a bullet and i will place the image of whatever there is to harvest around.

 

Thanks

Share this post


Link to post
Share on other sites

I can't seem to view video :( could you put a link in that post to it?

Share this post


Link to post
Share on other sites

I can't seem to view video :( could you put a link in that post to it?

 

http://www.youtube.com/watch?v=ID91MUkDWT0

<- took a couple of edits \o/

 

Seems like you're making some impressive progress in a relatively short time. When finished, will it run on any version of android?

Edited by tork_unib

Share this post


Link to post
Share on other sites

Seems like you're making some impressive progress in a relatively short time. When finished, will it run on any version of android?

 

android 2.1 minimum. so it's almost any device.

Share this post


Link to post
Share on other sites

Ok, little idea from watching... make you able to zoom into map. On Isla Prima, you may be fine, but think White Stone and Idaloran... you want to go the a very specific place (Lottery, for instance), and zoomed out, that'll be difficult. So zoomable maps \o/

 

My two pence ;)

Share this post


Link to post
Share on other sites

I have a little dilemma regarding the map images. They are huge and i want to reduce them. First i think i should reduce the size to 480x480. Than to change the format from bmp. DDS doesn't work, png have about 500kb, jpg 200-300kb and gif around 100kb. Suggestions?

What color depth do you have for the PNG? That file size seems a bit high for PNG, so I am thinking you are using true-color. Try 256 color indexed PNG's if you use PNG. JPEG files and GIF often encode images with alot of color changes better than PNG files do.

 

With GIF, you have an added bonus of being able to store multiple layers which could give you storage of 2.5D images in one single file as opposed to multiple. 2.5D could be done by either having an image for each of the 8 compass directions (and perhaps top down) or by having multiple levels (so you can shift the layers based on what direction you are faced) or a height map so you can put in the hills/houses or whatever.

Share this post


Link to post
Share on other sites

Ok, little idea from watching... make you able to zoom into map. On Isla Prima, you may be fine, but think White Stone and Idaloran... you want to go the a very specific place (Lottery, for instance), and zoomed out, that'll be difficult. So zoomable maps \o/

 

My two pence ;)

 

Thanks for responding. I am planning to make the zoom-able. I hoped i wouldn't have to, but after i implemented and run it on my phone it was obvious i'll need to do it. First i need to make it a good client for at least harvesting and storing stuff. After that i expect more things to need improvement.

Edited by Domino

Share this post


Link to post
Share on other sites

What color depth do you have for the PNG? That file size seems a bit high for PNG, so I am thinking you are using true-color

 

Yes, true color. I'll go with 256 and see what i get. Thanks.

 

As for the 2.5D honestly i will implement (for the beginning at least) a 2D view of the near area. Like seen from the top. But i didn't knew you can do that with gif images(i knew they have more layers). When i made 2.5D graphics i used png files with 8 views of the object in it:)

Share this post


Link to post
Share on other sites

FYI i like to turn my phone sideways and slide our my keyboard since i have big man hands.

if you can keep that in mind for screen rotate and slideable keyboards that be awesome.

 

if you have the powers of a dark wizard, make cords clickable in chat and auto walk to XD

 

let me know when you have a test client ready, best buy is 15 mins away and i can test on multiable tablets.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×