20150627 /answers-3/

published 27 Jun 2015

It’s time for Friday (Saturday?) Q&A again! I may be a day late, but flyte posted a nice long osu!next post fielding questions about osu! design work, so I don’t feel so bad.

This week, I asked for questions specifically about coding and the open-sourcing of osu!. I wanted to cover this area since open-sourcing osu! is one of my main focuses currently. There’s some basic stuff I want to cover that I guarantee will be asked many times over in the Q&A session (I haven’t read the questions yet, but I’m confident!).

General Coding

@ppy how does osu! deal with being multi platform and playing mp3’s? do you just have to support different libraries for different OS? –maboesanman

We use the Bass audio library, which covers mp3 playback.

@ppy Which IDE are you using for coding web related stuff? –HawKyuu

Sublime Text 3.

@ppy Since you like using SublimeText, are there any "Must have" Plugins you suggest (besides PackageControl)? –Techbot01

AlignTab, BracketHighlighter, Emmet, SublimeLinter.

@ppy Have you ever though of remaking osu completely in another programming language? If so, which one and why? –loup37

No, c#/.net works just fine.

@ppy How did you implement slider curve rendering in OpenGL? –unknownloner

Basically took what we were doing in Direct X and coded it in opengl.

@ppy I’m currently studying C# what do you think I should learn next and when should I start studying it? –NestyGs

Rather than learning something specific, try and do something you want to do. Create a project, make a goal, then learn whatever is required to make it happen.

@ppy How do you handle networking with osu & bancho (in terms of coding it)? –VirtuousNinja

I wrote everything from scratch using async .NET sockets. osu! and bancho share a common assembly which has serialisation method for each kind of packet.

@ppy I have too much questions that i have to take a photo of them. Hoping for your answer >< http://t.co/r0m7LshPav –tuong_duc_khang

Sorry but I’m not typing all these out just to answer them. Link me the raw text next time, rather than a screenshot.

@ppy What do you think your biggest coding mistake has been in building Osu? If it was using XNA then what was the next biggest mistake :). –KurtKartaltepe

XNA wasn’t a mistake. THe biggest mistake was the render hierarchy, which is what I’m currently working on fixing. One huge mindfuck of ratios and variables acting on each other.

@ppy What is your stance on using software to autocomplete typing out functions, compared to doing it all manually (when learning coding)? –Woddlez

Anything that can be automated should be.

@ppy Were there any specific resources that helped you get started with server-side stuff, or did you just learn as you went? –Limyc_

Learn as I go.

@ppy How much time do you usually devote to bug fixing? –BusterTheFox

95% of the time I spend coding is fixing bugs.

@ppy Have you found C# restrictive when it comes to performance and data locality? If so, do the productivity benefits vs C++ outweigh that? –Limyc_

No way. The performance difference isn’t even that big (can use unsafe contexts if necessary, which gives you ~= performance to c++).

@ppy What’s your opinion on Swift? –bboxxy

Better than ObjC, but they got a bit too liberal with features IMO.

@ppy how long could a slider get before you get a out of memory error? –Miterosan

No idea. Try it yourself?

@ppy how many lines/classes of code do you have? –Miterosan

I’ll have to get back to you on this.

@ppy how may big threads has osu! Or is the game one big thead? –Miterosan

Usually 4-10 threads, depending on what is happening.

@ppy how long would it theoretically take to implement a new game mode into osu? –LoLMonosphere

To get the basics working and playable, around 1 hour (if you know what you’re doing). To perfect it, probably 1-3 months.

@ppy How do you ‘start’ to get into coding? –Intelmuch

Write code.

@ppy Will you be stopping support for DirectX when Osu is fully taking advantage of OpenGL? –abe8132

DirectX isn’t supported anymore.

@ppy What was the biggest help to you while learning to code? –rrisx

Motivation.

@ppy Oh also, will open source just be graphical, gamemode, gameplay, modifications or other components as well? –Methos319

The osu! game client will be the first part.

@ppy what kind of commits do you expect when osu goes opensource? –Fredgid0

New features, bugfixes. Anything that moves osu! forward.

@ppy Will we be allowed to have private builds + bancho instances with e.g. custom multiplayer modes/mods without ranking for <10 people? –mario185

No, this won’t be covered by the licence we release under. The idea of open-sourcing osu! isn’t to have people run their own communities, but to allow contributions to the main code-base from anyone who wishes to help out.

@ppy Do you think the open sourcing will happen this year? –xasuma

Yes, that’s my aim.

@ppy How realistic would a ‘modding’ API be for osu? –VirtuousNinja

We had an API but with open source as a goal, we recently deprecated it. We plan on making skinning much more flexible, and hope that will be enough to satisfy modders. If you need code changes to make something happen, and they are reasonable, then you’re just a pull request away from getting them into the official client :).

@ppy If you go open-source, how are you going to prevent modified / hacked clients from submitting the scores? –YaLTeRz

Netcode will not be released with the client.

@ppy Obligatory when open source? Also, what will you want/refuse to change when open source eventually happens? –Yoshiap1

I plan on having a list of features/bugfixes with bounty attached. When fulfilled successfully (and correctly), the users that completed the task will be rewarded.

As for what I will accept/refuse, this is yet to be decided. As usual, I’ll still have the final call. I hope to let as much in as possible, within reason.

@ppy When osu! is eventually open sourced, will you be accepting pull requests for improvements and bug fixes that meet quality standards? –Limyc_

That’s the plan. In fact, that’s the ONLY reason we are open-sourcing. I don’t want to manage/pay a huge dev team; I’d rather have a huge dev community that are rewarded based on their precise contributions.

@ppy Do you have a roadmap to OS, or are you taking things one at a time until you feel it’s ready? Estimate for OS release? Within a year? –Limyc_

@ppy How close do you feel osu! is to becoming open source? –Kraminka

One at a time, as I always do. This year is definitely the plan.

@ppy Do Bancho or something similar will be released (in an open source way) so that we can create our own game server ? –Unennako

Bancho is getting deprecated, so the current implementation will likely never be public. The new web back-end will be open-sourced in the near future. That said, the licence will not allow for it to be used publicly (private use/testing is fine, of course).

Final Words

It will be more clear once we release the licence that will be used for all osu! open-source components, but as per my answers, the idea is not to allow custom builds of osu! to be released. To me this seems counter-productive (I want all improvements to be shared with all osu! users, rather than a subset), and I would argue that if you are looking to make your own osu! clone, starting from scratch is a much better idea.

Open-sourcing osu! is my solution to growing the development team further, allowing correct distribution of funds based on impact of contribution (not hours spend) and increasing transparency. More transparency is always a good thing. It is my solution to allowing anyone who wants to (and has the skill to) contribute to osu! development to do so.

It is also my solution to making osu! live forever – after all, who knows what may happen to me in the future. Much of the current osu! ecosystem is still reliant on me being around, so I would like to ensure that this is not the case going forward.

Obviously there will be people who ignore me and break the licence terms, but I am happy to deal with this as we go (using legal means where necessary). I am sure some of you may disagree with my thinking here, but just keep in mind that I still see osu! as my own project and I would like to see the ecosystem continue to grow as one, rather than splitting out into many smaller communities. There’s not many games that bring every country in the world into a single united community. I’d like that osu! remains this way as long as it can.

We are still working on the final licence terms (this is one of the major blockers for releasing open-source components – a few of which are ready and waiting).

comments

20150625

published 25 Jun 2015

Had to catch up on administative/accounting tasks today, but still managed to attack a part of the draw hierarchy code reform (and completely drained my brain of any extra energy in the process). Also spent some time following up the next incoming shipment of tablets, which was delayed a few days and has therefore required rescheduling at our end.

So what is this “Draw hierarchy” thing I keep mentioning? Let me try and sum it up in a way that’s easy to understand:

Until now, to sprites in osu!, you add them to a SpriteManager. This SpriteManager contains some global information like their offset position on screen (to allow for scrolling views and such), but the sprites themselves contain what we call “field” information. A sprite’s field determines what coordinate system is used for the mapping of position and scale of a sprite from input (code) to output (screen).

While this is relatively felxible, there are some very large shortcomings which I already addressed in osu!stream (which was a rewrite from scratch), namely that SpriteManagers can only contain Drawable objects, but SpriteManagers are not Drawable themselves. Fixing this is the main goal of the current restructure. It means we can move a lot of the complex calculations out of the Sprite level and also allow for more easily grouping many sprites together (think groups inside groups).

It’s an ongoing effort, and while I am working on it I’ll likely have little interesting to talk about since it’s REALLY mundane and complex stuff (if you aren’t completely familiar with the internals of osu!, reading me rant about it will mean nothing). For that reason I’m not even sure if it’s worth streaming coding this week, since I question the value of it as a form of entertainment. Let me know your thoughts.

I leave you with the most broken view of osu! you have ever seen:

comments

20150624

published 24 Jun 2015

Another mini-update!

  • Continued work on restructuring the draw hierarchy. In the process, cleaned up a lot of remaining XNA framework. We’re slowly getting to the point the remnants can completely be removed, which is an exciting prospect!

  • Made a new branch testing out visual studio shared projects. This is a necessity for moving cross-platform support forward, as each platform will need to have a different base set of compatibility code, but share the majority of the osu! code-base. Manually updating .csproj files each time a new code file is added for each platform would be a pain. Ends up looking something like this (note the different icon for the shared “osu!” project).

  • Saw osu! running under MonoMac for the first time! This is osu! running on OS X without the wine layer, and packaged into a distributable and lean ~200mb .app bundle. Pretty exciting news here for OS X users. We still have a bit of a way to go to get things ready to test publicly, but it’s another step forward in the right direction.

  • Spent some time discussing how to make the new forums feel better when scrolling upwards in a long thread (and triggering the dynamic infini-loading logic). I think we’ve come up with a solution that should feel quite a lot nicer than what you’ve seen so far.

And that’s all for today. I hope to stream some coding Thursday or Friday all going well, so keep a watch out for that!

comments

20150623

published 23 Jun 2015

Another busy day, so let’s focus on what I’ve been up to:

  • Had to visit the Australian Consulate to renew my passport. Pretty crazy looking place! I tried to sneak in a photo but the exposure was blown out to the point you can’t see crap. Sorry :(.

  • Began work on restructuring the draw hierarchy of osu!. I will probably go into this in more detail, but the premise is that we want to make Draw calls more of a hierarchy, and in the process move field changes out of GL Translate / Scale / Push / Pop commands and into a software (cpu)-based struct. This will allow for more flexibility, cleaner code and potentially new GPU-side optimisations. It is also one of the main areas I want to clean up before considering making osu! open source.

  • Fixed the admin side of the charts system for Loctav; he was bugging me a lot.

  • Fulfilled a feature request in 10 mins by adding a few mod display toggles when watching replays. You can now toggle FL, DT and HT by clicking the mod icons at the top-right corner. More mods such as HD will likely be supported in the future, but adding the implementation for them is non-trivial, so will have to wait for another day.

Finally, I’d like to add a personal warning: I know a lot of you may be spending your recent days watching a famous osu! player “play”, but I ask you to be wary and don’t jump to conclusions. There’s nothing to prove you aren’t just watching a bot or cheater playing. Also, please, don’t spam my email or twitter asking me to consider unbanning other players. Do not bother making petitions. Bans are between our team and the player in question. In this particular case I’m willing to add that the “player” sent me (personally) and the support team a series of rude emails which were both out of character of someone of their calibre, and not appropriate to even begin the appeal process. Be careful who you idolise and realise when it’s time to move on.

comments

20150622 /infra/

published 22 Jun 2015

The infrastructure supporting osu! has grown rapidly over the years to keep up with increasing demand. I’ve had quite a few requests to go into detail of how things look behind the scenes from an overall perspective.. so as they say, a picture paints a thousand words:

osu! in a nutshell

Please note that this diagram is heavily simplified. Details like the separation between the old web (osu.ppy.sh) and the new one (store.ppy.sh / jizz.ppy.sh) have been omitted.

I will be focusing on individual areas of the infrastructure over the next blog posts, so let me know what interests you guys the most in the comments.

Over the weekend I was able to meet up with Ballance - long time player and contributor of artwork. We explored the depths of Akihabara and played some Jubeat together (I lost). Nice change of pace!

comments