load some .csv data into a array ?

Get help using Construct 2

Post » Sat Sep 21, 2013 7:08 pm

Hi everyone !
To present myself, im formerly a php developper, did some javascript / php games before, but Im mostly an artist and I must say Construct 2 is the perfect way to save some time on the basics ! Great, great and powerfull tool . Im still quite noob w/ construct 2 and so Im asking myself directions to take.

So heres my first question.

Im working on a pointnclick that includes a lot of dialog.
As a french writer, Im doing the dialog in french. But the final version will be in english (w/ french subtitles)

So the thing is that I need to have every text in a database, so I can have all the text in a document and have it for translation. In PHP, I would have make a excel form with 3 columns :
A ID name ("Welcome_Text" for example),
the french version,
and the english version.

Then I would have a function that will get the good version. Like
say("welcome_text")

In Construct 2, my first feeling is to make it with arrays, but is there a way to load something like a .csv in a array at loading ?

What would you recommand for doing what Im looking for ?

I hope Im clear enough with my question.


- - -
my other question is : do you think that a web game such as those made w/ Construct 2 can handle all the sound clips of the voices acting ? I mean, what would be a good strategy ? If the full game weight is around 200 mo, is it a bad idea to consider it as an online app ?

thanks to those who can help me.

Best
Charles
B
8
S
4
Posts: 131
Reputation: 1,205

Post » Sun Sep 22, 2013 11:18 am

So with a little more thinking I find out that XML parsing and loading shouldnt be a problem.
So im thinking about making my .csv file and a php script to XMLize it, then I would be able to load it into my game with ajax.
http://www.scirra.com/manual/107/ajax
https://www.scirra.com/tutorials/328/using-project-files-in-construct-2
https://www.scirra.com/tutorials/354/xml-parsing

Then put it into array so I can access any reference anytime.

Any "pro" advice or alternative ways on the subject welcome however
B
8
S
4
Posts: 131
Reputation: 1,205

Post » Sun Sep 22, 2013 12:04 pm

[QUOTE=c13303]my other question is : do you think that a web game such as those made w/ Construct 2 can handle all the sound clips of the voices acting ? I mean, what would be a good strategy ? If the full game weight is around 200 mo, is it a bad idea to consider it as an online app ?[/QUOTE] That's difficult to answer. Basically, all that matters is that the loading times are as short as possible. C2 does a lot to keep it short. For example, sounds are only loaded from the server when needed. But that also means, there is a delay the first time a sound is used (a delay between the action of a user and the start of the sound play). You can preload sounds, but preloading them all at once at start would make the loading of the game extremely slow (several minutes). The best compromise would be to preload sounds ahead of time, but only those that will be needed next. So you'd have to experiment at which point in your event sheets you'd use preloading orders.
There's also another problem, that could get really nasty. All audio will be decompressed to RAM. A stereo audio uses about 10 MiB/min uncompressed. Your 200 MiB compressed audio data could well represent 1 or 2 GiB uncompressed in RAM.
An alternative would be streaming audio, but C2 only streams files added to the 'music' folder. And of those you can only stream one at a time.
You see, it's really hard to tell.
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Sun Sep 22, 2013 1:51 pm

Thanks for your reply theres nice information i didnt know.

The preloading choice is good news, since we have the choice I can find a compromise. (Like preloading the sounds of the scene only)

But youre right the RAM stuff may be quite problematic so thanks for the warning. I really thought that it would play mp3 as sound clips. Voice clips may be mono (and music stereo) so I ll do some tests and, well, well see. Maybe I can hope some update in the meantime ? ^^

Regards,
Charles
B
8
S
4
Posts: 131
Reputation: 1,205


Return to How do I....?

Who is online

Users browsing this forum: Armench, Artcadev, farsen, mariusvm, TheRealDannyyy and 15 guests