forum

osu! in JavaScript & HTML5

posted
Total Posts
270
show more
peppy
@Neo: I think you missed the part where html5 does not replace javascript.
Topic Starter
Clemaister
Sorry but I don't share source code for these kinds of projects
Don't worry about it, I totally understand.
Digikid13
Sounds interesting, I'll be willing to help if you need anything.
anonymous_old
ITT people who don't understand one problem.

It is currently impossible to stream audio (without Flash) (1) with reliable offsets (using <audio>/<embed>/etc.) or (2) with a small buffer size (using Mozilla's API).

Currently, Flash is just a much better tool for this job.

Clemaister wrote:

Of course, it'll be easier and faster if we had the source of osu! to have an idea more clear of structuring the program, but we know that a source is not a thing easy to give so...
A C# XNA game structure will probably not fit with a JavaScript game structure. JavaScript and C# are fundamentally different languages and deserve very different program models. But I won't bother getting into that. If you can't provide a prototype, there's no point in you even seeing the source code to osu!. And honestly, I doubt you can get a prototype running.

But good luck.
mm201
I could only see the small fragments dealing with timings, scoring, etc. being relevant.
4

WebGL seems like a better tool for the job than raster drawing to a canvas.

If you think this is going to be a good choice for low-spec machines, think again.
Topic Starter
Clemaister
It is currently impossible to stream audio (without Flash) (1) with reliable offsets (using <audio>/<embed>/etc.) or (2) with a small buffer size (using Mozilla's API).
But Javascript could call a flash containing the audio.
peppy
I can't say I've tried myself, but audio sync seems relatively possible based on http://www.thewildernessdowntown.com/
anonymous_old

peppy wrote:

I can't say I've tried myself, but audio sync seems relatively possible based on http://www.thewildernessdowntown.com/
Yes; audio cues could work. That still doesn't let you sync hit sounds, though; they'll sound 100ms off, which would be horrible for streams.
Topic Starter
Clemaister

strager wrote:

peppy wrote:

I can't say I've tried myself, but audio sync seems relatively possible based on http://www.thewildernessdowntown.com/
Yes; audio cues could work. That still doesn't let you sync hit sounds, though; they'll sound 100ms off, which would be horrible for streams.
Please check Balldroppings, you'll see that's possible.
mekadon_old

MetalMario201 wrote:

If you think this is going to be a good choice for low-spec machines, think again.
This, and

strager wrote:

Yes; audio cues could work. That still doesn't let you sync hit sounds, though; they'll sound 100ms off, which would be horrible for streams.
It might be possible to change the offsets of the music and the hitsounds amirite?
Topic Starter
Clemaister
Yeah I think it's possible, anyway it'll be ok for that.
anonymous_old

Clemaister wrote:

Please check Balldroppings, you'll see that's possible.
That uses Flash.
TheCameleon

strager wrote:

Clemaister wrote:

Please check Balldroppings, you'll see that's possible.
That uses Flash.
Yes it does ;)

Now, I can post on this forum, as Clemaister played a few beatmpa for me so as to "unlock" the forum ;)

I think you can now have a look ther > http://osu.pictuga.tk/
Now it's kindda powerful !

What works right now?

HitCircles
CircleApproach
Combos (color + number)
Clic on HitCircles

What doesn't work ?

Music (that sucks I know)
Sliders
Spinners
Everything else lol

The link for more informations > http://www.pictuga.tk/fiche-311.html
anonymous_old
What made you choose JS/canvas over AS3/Flash?
TheCameleon
The wish to make something clean, cross-platform, lightweight, use new (open) standards...
And to show that flash isn't always required (except for music)

Btw the code will be open source (GPL3), server side included
Neo Adonis
I've seen your work, and for a week, I think it's good.

You've done it well at reading .osz files! I've compared with the song, and your work at translating data is excellent! Tip: if you're downloading constantly the latest file, don't do it. You'll be wasting bandwidth. Else, download and upload to your server the file, let's say, every day or week. Just in case...

About the hit circles, why don't you try to use the sprites instead of circle drawing? The same with numbers. I'll search how to make color blend in canvas. If it's not possible, I'll say you. Or, if you can make it server-side, try coloring sprites using plugins (GD or ImageMagick if you're using PHP) and return the colored sprites.

Now only I can add the following: keep it up!
TheCameleon

Neo Adonis wrote:

I've seen your work, and for a week, I think it's good.
:)

Neo Adonis wrote:

You've done it well at reading .osz files! I've compared with the song, and your work at translating data is excellent! Tip: if you're downloading constantly the latest file, don't do it. You'll be wasting bandwidth. Else, download and upload to your server the file, let's say, every day or week. Just in case...
Right now the latest osu file is downloaded each time (from the "Grab the latest osu" link on osu website). I already coded the part which reads osz files, but it's not in use right now. The problem is that our server is free and is very limited. Thus we can't leave files over 2-4Mb on the server. And osz files are often bigger (mp3 storyboard).

We already thought to put in place a cache system.
Therefor we will have to change to anothdr free server (I know a better one but it is often down).

Neo Adonis wrote:

About the hit circles, why don't you try to use the sprites instead of circle drawing? The same with numbers. I'll search how to make color blend in canvas. If it's not possible, I'll say you. Or, if you can make it server-side, try coloring sprites using plugins (GD or ImageMagick if you're using PHP) and return the colored sprites.
Drawing circles is much faster than using images ;) And it's lightweight.
For this kind of "secondary" problems, we will see later. Right now we have bigger problems (no sliders, no music, no use of dificulty parameters...)

Neo Adonis wrote:

Now only I can add the following: keep it up!
:)
peppy
Your scaling is off; you aren't enforcing aspect ratio at all. Seems like a good start, I guess.
Rokodo
TheCameleon
Fo now, we just use the full screen size ;)

We changed to another (free) server. We now are using legtux.org's services. We no longer have that stupid file size limit ;) This will help a lot.
In the meanwhile, we took a real domain name, quicker to remember.

http://www.osu-web.tk/
Zeugziumy
Wow cool project...
I hope you get a nice work there...
And I hope there is taiko T-T

It could have flash for chat, at the Right >>>, like Kongregate
peppy

TheCameleon wrote:

Fo now, we just use the full screen size ;)
And i'm saying it's therefore horribly wrong.
Hyguys
There's much things missing.
the song.
sliders.
spinners.
and much more.
and more beatmaps.
but good job!

sry for my bad english.
RandomJibberish
You need to enforce the aspect ratio or it breaks spacing and patterns. All the squares in the map turn into fat rectangles lol

I also reccomend you make the circle sizes proportionate.
TheCameleon
Wow... the ratio breaks all my size variables :/ I'll have to fix that !
Now, I will focus on the server side as my new server is much more flexible ;) This might bring music to the game ! Please note that this include that music does require flash.

About beatmaps, right now it just takes the first one in the "ranked", and the first difficulty ;)
peppy
Using flash is a bad direction. If you use flash for the music, you should use flash for everything, as it will handle better.
TheCameleon
Flash is the only way to get the playing time ;) If I could I wouldn't use it.



Edit : Now I'm working on the server part. It's the only way to get the music ;)
First, you will only have a limited choice of beatmaps ;) I'm still having issues, like that :
You are downloading too many maps at once. Lay off for a bit.
This is what appends when trying to get osz files :/

I'll work on JavaScript later. I'll focus on music (quite easy), then sliders (quite hard).
mm201
Your best bet is to write a crawler like Bagno's to slowly copy the beatmaps over to your own server. You'll want to think about re-encoding the mp3s to something super-low-quality for the web.

Or do it by hand for the time being. =P
peppy
Crawling is bad m'kay?

Just select a few beatmaps and copy them locally to your server (manually). Don't even attempt to allow any map to be played until you have the game in a working state. We can discuss hosting at that point.
IppE

MetalMario201 wrote:

You'll want to think about re-encoding the mp3s to something super-low-quality for the web.
HE-AACv2, anyone? :D
TheCameleon
I'll download the latest beatmap (osz) through php once a day.
I will leave it as it on the server. And extract the mp3 on the server. I may extract osu files too.
That sounds good but it's just an idea. I still need to code it.
At the beginning I wont compress the mp3 file as one lonely mp3 isnt that big on a server. (but longer to load for the user) This might change later of course.

That part will be done quite soon as it's not very hard ;)
anonymous_old

peppy wrote:

Using flash is a bad direction. If you use flash for the music, you should use flash for everything, as it will handle better.
I've been trying to say this all along.

TheCameleon wrote:

Flash is the only way to get the playing time ;) If I could I wouldn't use it.
<audio> supports timing cues, IIRC, which may fit what you (think you) need.
TheCameleon

strager wrote:

peppy wrote:

Using flash is a bad direction. If you use flash for the music, you should use flash for everything, as it will handle better.
I've been trying to say this all along.

TheCameleon wrote:

Flash is the only way to get the playing time ;) If I could I wouldn't use it.
<audio> supports timing cues, IIRC, which may fit what you (think you) need.
The main problem is that right now firefox's <audio> doesn't read mp3 (only ogg - which isn't much used in beatmpaps). And firefox is one of the main <canvas>-able browser. That wouldn't be nice to make users use Chrome only for that. 

When firefox and the main browsers will be able to play mp3, <audio> will be usable. Btw, now most of the "games" (aka proof of concept) using <canvas> do use flash ;)
peppy
So use ogg?
TheCameleon
Can't convert from mp3 to ogg with php :/
peppy
Sure you can. Also, stop worrying about automatic conversion. Convert a single map and make the game work. Worry about conversion later.
TheCameleon
Conversion would use command line tools (and function such as exec() or system()), which aren't available on free servers.
I prefer to use flash and mp3 at the beginning ;)
peppy
You're doing it wrong. You're supposed to listen to advice, not ignore it.

*stops following thread*
anonymous_old
How about you abstract it enough so you can replace it when needed and so people can stop discussion shit which doesn't matter because this won't be finished anyway?
TheCameleon
Well... Thanks a lot for your help !
I won't say anything about any future updates here.

Thanks, those who were interested in this project ;) I may DM you.
show more
Please sign in to reply.

New reply