How can i Read text faster

Just started using Construct 2? Post your questions here

Post » Tue Apr 22, 2014 6:37 am

I'm making a big MMORPG online game
many many npc chat word need to store about 10000line
i tried Dictionary&listbox
but its very slow!
about 10sec

please may i ask any good idea about store 10000+line text?
the best way i wish to store the file in RAM
but i don't know how to

thankyou :roll:
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Tue Apr 22, 2014 7:10 am

Project files and XML and/or array probably can help.

Nevertheless what exactly is slow ?
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Tue Apr 22, 2014 2:00 pm

Kyatric wrote:Project files and XML and/or array probably can help.

Nevertheless what exactly is slow ?

sorry tried
slow Meaning when i read some text
eg:browser.alert(array.x) or browser.alert(Dictionary.get("npc_1_31")
when i run that
game will stop about 3sec to read file
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Tue Apr 22, 2014 2:06 pm

Have you thought about trying to split the text up a little?
Also browser alerts for text probably aren't the best idea.
Image ImageImage
B
169
S
50
G
170
Posts: 8,292
Reputation: 108,728

Post » Tue Apr 22, 2014 2:12 pm

fongka2 wrote:I'm making a big MMORPG online game
many many npc chat word need to store about 10000line
i tried Dictionary&listbox
but its very slow!
about 10sec

please may i ask any good idea about store 10000+line text?
the best way i wish to store the file in RAM
but i don't know how to

thankyou :roll:


Use project files as guys say. And just instead of one massive file make smaller ones per area,location or city. Once in the area, just load it in to array. And you don't need to do it all at once ( since player still has some time to get to location with npc's I assume ), just several lines of code every x seconds (ms). Be gentle :)
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Tue Apr 22, 2014 2:26 pm

megatronx wrote:
fongka2 wrote:I'm making a big MMORPG online game
many many npc chat word need to store about 10000line
i tried Dictionary&listbox
but its very slow!
about 10sec

please may i ask any good idea about store 10000+line text?
the best way i wish to store the file in RAM
but i don't know how to

thankyou :roll:


Use project files as guys say. And just instead of one massive file make smaller ones per area,location or city. Once in the area, just load it in to array. And you don't need to do it all at once ( since player still has some time to get to location with npc's I assume ), just several lines of code every x seconds (ms). Be gentle :)

guess no one Understand my suck english
my all of NPC chat text == local project file
not read from server
if you wanna to know what i'm talking about
You should try to write your own 10,000*100-word at array/Dictionary
and read it
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Tue Apr 22, 2014 2:31 pm

fongka2 wrote:
megatronx wrote:
fongka2 wrote:I'm making a big MMORPG online game
many many npc chat word need to store about 10000line
i tried Dictionary&listbox
but its very slow!
about 10sec

please may i ask any good idea about store 10000+line text?
the best way i wish to store the file in RAM
but i don't know how to

thankyou :roll:


Use project files as guys say. And just instead of one massive file make smaller ones per area,location or city. Once in the area, just load it in to array. And you don't need to do it all at once ( since player still has some time to get to location with npc's I assume ), just several lines of code every x seconds (ms). Be gentle :)

guess no one Understand my suck english
my all of NPC chat text == local project file
not read from server
if you wanna to know what i'm talking about
You should try to write your own 10,000*100-word at array/Dictionary
and read it


I think we do. ;) I'm telling you, you got to make more but smaller files. Instead of "all of NPC chat text == local project file" make many files for "only current area NPCs chat text == current area local project file"
And you make files: area1, area2, area3, area 4 etc. If area have loads of npc's then make zones within it. For example: City Zone1 txt, City Zone 2 txt, etc. Load them on entering area/zone replacing the old data. You only need one small array. You can go even further and keep each npc's dialog in separate array within the text file. Just separate those arrays with tokens, and give you npc numerical variable that will be used to call the appropriate array trough tokenat. And this will make array that holds that data even smaller.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests