20150702 /nesting/

published 02 Jul 2015

In order to explain what we are currently doing to the osu! graphics framework, I’d like you guys to take a look at the osu!stream UI. A lot of you are probably not familiar with this iOS-only release, but I wrote it from scratch several years ago, fixing all (most of?) the mistakes I made in the PC version you are used to.

Pay special attention to the movement of groups of sprites and interface elements on the screen. Although this video isn’t 60fps nor super high-quality (sorry, couldn’t capture it nicely in a quick moment), you should be able to notice the vibrance of the tweens, which react in a way you haven’t seen yet on the PC version of osu!.

Observe how the main menu is transformed on an overall level as well as an individual per-item level; how the header and footer in song select smoothly disappear off-screen (and back on); how bounces feel… more bouncy! Honestly, osu!stream feels so much more polished than osu! (everyone in the office today agreed) even though so much less time and effort was put into it over the years.

This is what the goal of the current framework changes is. In short, the ability to have nested “drawables”. A drawable can be anything from a sprite, to a primitive, to a collection of many more drawables. Each drawable can have Position, Scale, Rotation, Colour and Clipping applied to it. As you’d expect, these transforms will apply to all children drawables, which can lead to very dynamic movement of elements on the screen.

So you may then ask: what have we been doing until now in osu!? In the most basic terms, drawables could not be nested. A SpriteManager could contain many drawables, but that’s the end of the chain. So for elements like osu!direct, Online Users, song select panels etc., the movement of groups of sprites that are related to each other has been a bit clunky and cumbersome.

There are a few more intricacies to what the current changes we are working on are changing (and fixing), but trying to explain them without going into amazingly minute detail would be quite hard. Maybe we can do that another day, if you are so inclined :).

Making these framework changes are both imperative to implementing the osu!next design and also to open-sourcing the osu! code-base. Because there’s no way I would want to expose the masses to the current state of the code!

comments

20150701

published 01 Jul 2015

  • Made some great progress today implementing what I discussed yesterday. osu! is back to rendering as it should, so I don’t have any breakage videos for you today, sorry!

  • I didn’t get around to doing a write-up on the new draw hierarchy – because I was too busy actually implementing it – but it’s planned for tomorrow’s post :).

  • Tablet shipment safely delivered after some confusion and me attempting to remotely guide the delivery man (who has no smartphone with maps) through a neighbourhood I am unfamiliar with using google maps.

Let me take a moment to again make a shout out to the new forums, which are now more-or-less in a working state as far as posting, replying, quoting and consuming. They have been getting daily updates over the last weeks based on feedback, but we aren’t planning on releasing them to the masses until we are 100% sure they are ready.

Starting this week, we moved development focus to other areas of the site, so I’d be very grateful for any feedback on the forums specifically. Anything from usability to performance issues, to anything that’s bugging you which makes them unusable over the old forums for now.

As we don’t currently have somewhere to report issues (until the github repo is opened up), you’re welcome to leave comments on this post or just tweet at me.

comments

20150630

published 30 Jun 2015

2D math.. harder than you may first expect. At some point you realise it is best to cut your losses and start implementing from scratch, rather than attempting to fix what is at hand. This was that point for me:

(this video isn’t as broken as you might think: everything is working apart from sprite-based text and non-default texture origins)

Today I enlisted the help of Echo as we went through the graphic architecture that I’m attempting to achieve. He came up with a proof-of-concept in javascript which seems to work as we need it to (and moves us closer than ever to a software reimplementation of javascript matrix logic).

In other news, while the osu!store is still in hibernation, our next batch of tablets is scheduled to arrive early tomorrow morning. While I’m not directly accepting the shipment, I am remotely managing communications between the person who is and the customs broker / delivery company. Lots of fun. Needless to say, we lasted a full tablet batch without going completely out of stock, and should also have stock for the foreseeable future. Finally figured that one out :).

comments

20150629

published 29 Jun 2015

Hello peoples of osu!, and welcome back for another week of ramblings. Hope you had a great weekend. It’s going to be another long week!

Continuing work on the draw hierarchy means I’m spending all my free time focusing on math. Math tires my brain like nothing else, so don’t expect too much by way of long posts until things settle (although I plan on attempting to explain the main issues I am working to solve in a technical post tomorrow)!

Breaking osu! in fun new ways, every day.

With that out of the way, let me touch with why I haven’t done a coding stream yet, even though I keep saying I will:

  • I know you guys say you want to watch no matter how boring I think what I am doing is, but honestly, the restructuring I’m doing right now means I regularly sit staring at the screen doing nothing for 10 minutes at a time, or am writing notes on paper to try and figure things out.

  • The code I’m currently working with isn’t exactly something I’m proud of. It’s a clusterfuck of hacks that work perfectly at a high level, but internally feel really clumsy. I feel cautious to share such code on my stream because it doesn’t set a good example.

  • I’m not really in an environment which I can use a microphone to talk while streaming. People around me can be quite noisy and I don’t want to capture that in my stream.

  • I have so many interruptions throughout the day which cannot be streamed (like attending to reports of foul-play, fixing ongoing database issues or answering emails) which I need to correctly separate to make sure they aren’t included in the stream. I had this setup well back around the time I was streaming late last year, but have since formatted and lost the degree of separation I want to achieve.

  • With these blog posts, I worry that the overhead of transparency will impede on my productivity. Streaming means dealing with extra social elements which I wouldn’t usually have to worry about. Socialising is tiring for me at times.

Honestly, coding streams work best when I am working on something fresh, rather than fixing bugs or refactoring large portions of code. I have made a mental note to stream next time I’m working on something new.

That said, I really want to stream on a more regular basis. I’ll keep striving to get to the point I can do so!

comments

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