Deleting parties

BE WARNED! This version will delete all parties, characters and the explored map, it will reset the game.

I added an old version, so if you have a lot of parties and you want to continue testing with them please don’t load the normal link, instead load this one:

https://dl.dropboxusercontent.com/u/195129959/Dungeons_of_Orroth_oldVersion/Dungeons_of_Orroth.html

This old version has deleting of parties implemented too, but it’s very very slow…

So I had to redo the whole deleting system.

The problem is that on webplayer, deleting works fine(if you have a lot of parties it will be slower, but acceptable), but on android it took over 60 seconds to delete a party…

Unitys PlayerPrefs is very very slow. I tried to copy every party beneath the deleted one, by shifting them 1 slot, but reading and writing thousands of data is just impossible with PlayerPrefs.

So I had to come up with a solution to delete just the current party:

– I made another array in PlayerPrefs which holds the true numbering of parties, let the old party numbering to increase, and link these 2 arrays together

– Example:

– real party numbering: 1 2 3 4 5

– old party numbering:  1 2 3 4 5

– after removing party 3 and 4, and adding another 2 parties:

– real party numbering: 1 2 3 4 5

– old party numbering:  1 2 5 6 7

This way I only delete the selected party. In case you wonder why didn’t I just delete the current party from start, it is because the PlayerPrefs loading system, it needs to have an array of numbers that are incremented only by 1 (for example: 1, 2, 5, 6 is bad)

 

I thought I would do deleting pretty fast but sometimes coding is a pain 🙂

Anyway I’ll implement the adding of characters to the current party, I hope this will go faster.

 

The new links to alpha version demo:

Webplayer:

https://dl.dropboxusercontent.com/u/195129959/Dungeons_of_Orroth/Dungeons_of_Orroth.html

 

Android:

https://dl.dropboxusercontent.com/u/195129959/Dungeons_of_Orroth_Android/Dungeons_of_Orroth.apk

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s