Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm trying to implement a third map #81

Closed
HolySSSS opened this issue May 15, 2024 · 8 comments
Closed

I'm trying to implement a third map #81

HolySSSS opened this issue May 15, 2024 · 8 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@HolySSSS
Copy link

HolySSSS commented May 15, 2024

Hi. This issue might be like a guide for other onlookers and especially programmer newbies, if you are wondering about using this project for your own purposes. Refer to the /tools inside the app, use WSL or VM Linux to execute the .sh file and tinker with the .py files, you might have to change the script to just manually write down the file instead of parsing it. You do have to make a JSON file yourself, but it's pretty easy in principle, you just write down the X and Y value of any point by checking them with any graphical software in the map image into a new object in JSON.

So far I'm stuck after this point. I might solve it by myself, maybe not, we will see. Now let's get to the problem.

I'm trying to implement a third map for the purposes getting used to understanding someone's code by myself, but this so far stumped me.

I added a new map into the same Database, a new tile pyramid into the app and it leads to the app crashing in Android Studio.
So, there are 3 maps, 3 tile sets now in the DepNav, nothing else.
I did not do any other actions to the Database or the tile sets after creating them and putting them into the app.

изображение
изображение

I also did not add any new UI elements to represent the third map at the moment of writing this, for I am currently trying to understand how to implement one in your code.
The third map is called "Third" or "Третий" currently, as in internalName (for others, check JSONs to understand what's that) and the actual name of the map.
Thanks for any help.

Originally posted by @HolySSSS in #79 (comment)

@HolySSSS
Copy link
Author

I managed to add the UI element by creating a copy of "logo_spbu_mm" and renaming it "logo_third" and then I pasted it into folder "drawable" in the folder "res" inside the Android Studio. I pasted into "drawable", not "drawable-v24".

The problem wasn't fixed and seems to stay the same.

изображение

@HolySSSS
Copy link
Author

HolySSSS commented May 16, 2024

Currently assuming two options:
a) the app can only recognise what is already in by some specific code.
b) the app can't support 3 or more maps in a DB by it's limitations.

@HolySSSS
Copy link
Author

HolySSSS commented May 16, 2024

Addendum:
The map "Third" features 7 floors.

That's all info I can give for now,
I am gonna assume everything else is going to be too extra until someone answers.

@TimPushkin
Copy link
Owner

TimPushkin commented May 16, 2024

Hey, thank you for your interest in DepNav. The app supports an arbitrary amount of maps, I'll write instructions describing the whole process of adding a new map later today.

@TimPushkin TimPushkin added the documentation Improvements or additions to documentation label May 16, 2024
@TimPushkin TimPushkin self-assigned this May 16, 2024
@HolySSSS
Copy link
Author

HolySSSS commented May 16, 2024

As far as I can tell, I missed adding a json spbu-pf.json from this pull request #79 that was added along with a new db and the tile pyramid.

Gonna check the problem right now.

@HolySSSS
Copy link
Author

Correct, I managed to fix the problem, it is now working as intended.

@HolySSSS
Copy link
Author

HolySSSS commented May 16, 2024

You may close the issue now if you see it as fit, but here's the general gist of what someone else would need to do:

a) Make a map in a format of WebP. Use Paint.net for example.
b) Start making a JSON file by taking the X and Y values of all points for icons. Check the other JSON files to see the options.
c) Use the create_tiles.sh by using a WSL or a VM Linux, whatever you prefer, by putting the map images and the script in 1 folder.
d) Use the create_map_db.py to convert the JSON file into a sqlite3 database.
e) Integrate the new DB, the new JSON and the new tile pyramid of the map into the app.

It is up to the programmer to understand what goes where in the folders.

@TimPushkin
Copy link
Owner

I've added a wiki page describing the process of map creation and also somewhat improved the docs of development scripts.

The instruction kinda resembles what you've already found out by yourself, though I don't really understand how adding spbu-pf.json somewhere might have helped with your problem. The app does not use JSONs directly, they are just an intermediate step of creating the database because they are easier to write by hand and track through version control.

The problem in your original post was caused by the missing map's logo so it should have been fixed right after you added the logo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants