I decided to write a comment about «Why Osana takes so long?»
somewhere and what can be done to shorten this time. It turned into a long essay. Here's TL;DR
The cost of never paying down this technical debt is clear; eventually the cost to deliver functionality will become so slow that it is easy for a well-designed competitive software product to overtake the badly-designed software in terms of features. In my experience, badly designed software can also lead to a more stressed engineering workforce, in turn leading higher staff churn (which in turn affects costs and productivity when delivering features). Additionally, due to the complexity in a given codebase, the ability to accurately estimate work will also disappear. Longer version
Junade Ali, Mastering PHP Design Patterns (2016)
: I am not sure if people here wanted an explanation from a real developer who works with C and with relatively large projects, but I am going to do it nonetheless. I am not much interested in Yandere Simulator nor in this genre in general, but this particular development has a lot to learn from for any fellow programmers and software engineers to ensure that they'll never end up in Alex's situation, especially considering that he is definitely not the first one to got himself knee-deep in the development hell (do you remember Star Citizen
?) and he is definitely not the last one.
On the one hand, people see that Alex works incredibly slowly, equivalent of, like, one hour per day, comparing it with, say, Papers, Please
, the game that was developed in nine months from start to finish by one guy. On the other hand, Alex himself most likely thinks that he works until complete exhaustion each day. In fact, I highly suspect that both those sentences are correct! Because of the mistakes made during early development stages, which are highly unlikely to be fixed due to the pressure put on the developer right now and
due to his overall approach to coding, cost to add any relatively large feature (e.g. Osana) can be pretty much comparable to the cost of creating a fan game from start to finish. Trust me, I've seen his leaked source code
(don't tell anybody about that)
and I know what I am talking about. The largest problem in Yandere Simulator right now is its super slow development. So, without further ado, let's talk about how «implementing the low hanging fruit» crippled the development and, more importantly, what would have been an ideal course of action from my point of view to get out. I'll try to explain things in the easiest terms possible.
- else if's and lack any sort of refactoring in general
The most «memey» one. I won't talk about the performance though (switch statement is not better in terms of performance, it is a myth. If compiler detects some code that can be turned into a jump table, for example, it will do it, no matter if it is a chain of if's or a switch statement. Compilers nowadays are way smarter than one might think). Just take a look here
I refactored this code for you
using C language (mixed with C++ since there's no this pointer in pure C). Take a note that else if's are still there, else if's are not the problem by itself.
The refactored code is just objectively better for one simple reason: it is shorter, while not being obscure, and now it should be able to handle, say, Trespassing and Blood case without any input from the developer due to the usage of flags
. Basically, the shorter your code, the more you can see on screen without spreading your attention too much. As a rule of thumb, the less lines there are, the easier it is for you to work with the code. Just don't overkill that, unless you are going to participate in International Obfuscated C Code Contest
. Let me reiterate:
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
Antoine de Saint-Exupéry
This is why refactoring — activity of rewriting your old code so it does the same thing, but does it quicker, in a more generic way, in less lines or simpler — is so powerful. In my experience, you can only keep one module/class/whatever in your brain if it does not exceed ~1000 lines, maybe ~1500. Splitting 17000-line-long class into smaller classes probably won't improve performance at all, but it will make working with parts of this class way easier. Is it too late now to start refactoring?
Of course NO
: better late than never.
If you think that you wrote this code, so you'll always easily remember it, I have some bad news for you: you won't. In my experience, one week and that's it. That's why comments are so crucial. It is not necessary to put a ton of comments everywhere, but just a general idea will help you out in the future. Even if you think that It Just Works™
and you'll never ever need to fix it. Time spent to write and debug one line of code almost always exceeds time to write one comment in large-scale projects. Moreover, the best code is the code that is self-evident. In the example above, what the hell does (float) 6 mean? Why not wrap it around into the constant with a good, self-descriptive name? Again, it won't affect performance, since C# compiler is smart enough to silently remove this constant from the real code and place its value into the method invocation directly. Such constants are here for you.
I rewrote my code above a little bit to illustrate this
. With those comments, you don't have to remember your code at all, since its functionality is outlined in two tiny lines of comments above it. Moreover, even a person with zero knowledge in programming will figure out the purpose of this code. It took me less than half a minute to write those comments, but it'll probably save me quite a lot of time of figuring out «what was I thinking back then» one day. Is it too late now to start adding comments?
Again, of course NO
. Don't be lazy and redirect all your typing from «debunk» page (which pretty much does the opposite of debunking, but who am I to judge you here?) into some useful comments.
- Unit testing
This is often neglected, but consider the following. You wrote some code, you ran your game, you saw a new bug. Was it introduced right now? Is it a problem in your older code which has shown up just because you have never actually used it until now? Where should you search for it? You have no idea, and you have one painful debugging session ahead. Just imagine how easier it would be if you've had some routines which automatically execute after each build and check that environment is still sane and nothing broke on a fundamental level. This is called unit testing, and yes, unit tests won't be able to catch all your bugs, but even getting 20% of bugs identified at the earlier stage is a huge boon to development speed. Is it too late now to start adding unit tests?
at the same time. Unit testing works best if it covers the majority of project's code. On the other side, a journey of a thousand miles begins with a single step. If you decide to start refactoring your code, writing a unit test before refactoring will help you to prove to yourself that you have not broken anything without the need of running the game at all.
- Static code analysis
This is basically pretty self-explanatory. You set this thing once, you forget about it. Static code analyzer is another «free estate» to speed up the development process by finding tiny little errors, mostly silly typos (do you think that you are good enough in finding them? Well, good luck catching x << 4; in place of x <<= 4; buried deep in C code by eye!). Again, this is not a silver bullet, it is another tool which will help you out with debugging a little bit along with the debugger, unit tests and other things. You need every little bit of help here. Is it too late now to hook up static code analyzer?
- Code architecture
Say, you want to build Osana, but then you decided to implement some feature, e.g. Snap Mode. By doing this you have maybe made your game a little bit better, but what you have just essentially done is complicated your life, because now you should also write Osana code for Snap Mode. The way game architecture is done right now, easter eggs code is deeply interleaved with game logic, which leads to code «spaghettifying», which in turn slows down the addition of new features, because one has to consider how this feature would work alongside each and every old feature and easter egg. Even if it is just gazing over one line per easter egg, it adds up to the mess, slowly but surely.
A lot of people mention that developer should have been doing it in object-oritented way. However, there is no silver bullet in programming. It does not matter that much if you are doing it object-oriented way or usual procedural way; you can theoretically write, say, AI routines on functional (e.g. LISP
)) or even logical language if you are brave enough (e.g. Prolog
). You can even invent your own tiny programming language
! The only thing that matters is code quality and avoiding the so-called shotgun surgery
situation, which plagues Yandere Simulator from top to bottom right now. Is there a way of adding a new feature without interfering with your older code (e.g. by creating a child class which will encapsulate all the things you need, for example)? Go for it, this feature is basically «free» for you. Otherwise you'd better think twice before doing this, because you are going into the «technical debt» territory, borrowing your time from the future by saying «I'll maybe optimize it later» and «a thousand more lines probably won't slow me down in the future that much, right?». Technical debt will incur interest on its own that you'll have to pay. Basically, the entire situation around Osana right now is just a huge tale about how just «interest» incurred by technical debt can control the entire project, like the tail wiggling the dog.
I won't elaborate here further, since it'll take me an even larger post to fully describe what's wrong about Yandere Simulator's code architecture. Is it too late to rebuild code architecture?
, although it should be possible to split Student class into descendants by using hooks for individual students. However, code architecture can be improved by a vast margin if you start removing easter eggs and features like Snap Mode that currently bloat Yandere Simulator. I know it is going to be painful, but it is the only way to improve code quality here and now. This will simplify the code, and this will make it easier for you to add the «real» features, like Osana or whatever you'd like to accomplish. If you'll ever want them back, you can track them down in Git history and re-implement them one by one, hopefully without performing the shotgun surgery this time.
- Loading times
Again, I won't be talking about the performance, since you can debug your game on 20 FPS as well as on 60 FPS, but this is a very different story. Yandere Simulator is huge. Once you fixed a bug, you want to test it, right? And your workflow right now probably looks like this:
- Fix the code (unavoidable time loss)
- Rebuild the project (can take a loooong time)
- Load your game (can take a loooong time)
- Test it (unavoidable time loss, unless another bug has popped up via unit testing, code analyzer etc.)
And you can fix it. For instance, I know that Yandere Simulator makes all the students' photos during loading. Why should that be done there? Why not either move it to project building stage by adding build hook so Unity does that for you during full project rebuild, or, even better, why not disable it completely or replace with «PLACEHOLDER» text for debug builds? Each second spent watching the loading screen will be rightfully interpreted as «son is not coding» by the community. Is it too late to reduce loading times?
Or any other continuous integration tool. «Rebuild a project» can take a long time too, and what can we do about that? Let me give you an idea. Buy a new PC. Get a 32-core Threadripper, 32 GB of fastest RAM you can afford and a cool motherboard which would support all of that (of course, Ryzen/i5/Celeron/i386/Raspberry Pi is fine too, but the faster, the better). The rest is not necessary, e.g. a barely functional second hand video card burned out by bitcoin mining is fine. You set up another PC in your room. You connect it to your network. You set up ramdisk
to speed things up even more. You properly set up Jenkins
) on this PC. From now on, Jenkins cares about the rest: tracking your Git repository, (re)building process, large and time-consuming unit tests, invoking static code analyzer, profiling, generating reports and whatever else you can and want to hook up. More importantly, you can fix another bug while Jenkins is rebuilding the project for the previous one et cetera.
In general, continuous integration is a great technology to quickly track down errors that were introduced in previous versions, attempting to avoid those kinds of bug hunting sessions
. I am highly unsure if continuous integration is needed for 10000-20000 source lines long projects, but things can be different as soon as we step into the 100k+ territory, and Yandere Simulator by now has approximately 150k+ source lines of code. I think that probably
continuous integration might be well worth it for Yandere Simulator. Is it too late to add continuous integration? NO
, albeit it is going to take some time and skills to set up.
- Stop caring about the criticism
Stop comparing Alex to Scott Cawton. IMO Alex is very similar to the person known as SgtMarkIV, the developer of Brutal Doom, who is also a notorious edgelord who, for example, also once told somebody to kill himself, just like… However, being a horrible person, SgtMarkIV does his job. He simply does not care much about public opinion. That's the difference.
- Go outside
Enough said. Your brain works slower if you only think about games and if you can't provide it with enough oxygen supply. I know that this one is probably the hardest to implement, but…
That's all, folks.
Bonus: Do you think how short this list would have been if someone just simply listened to Mike Zaimont instead of breaking down in tears
Let me start this off with this is NOT a comprehensive, end-all-be-all guide to 'how to setup a livestream.' This is simply the workflow/setup I've come to use over 4 years of on and off streaming on Twitch. Hopefully it can help some of yall out that are (finally XD) joining the livestream world. *I only stream on Twitch using OBS, so this will be specific to Twitch and OBS; I have not tried YouTube, Facebook, Instagram, or any other platform or streaming software, but the basic outline is kind of there.
Hardware: 2x 1200's, Rane TTM57sl mixer with Serato Scratch Live, Samsung laptop, Behringer Xenyx 802 USB mixer, Shure SM57 mic, Pansonic GH2 or Logitech webcam (depends on if I'm using green screen or not), and then my gaming PC is my streaming PC. For speakers, I have a Yahama receiver running a 5.1 system that I use with my gaming/streaming PC. It's not the best setup for DJ'ing necessarily, as the receiver can add quite a bit of latency, but if there is any now, I barely notice it. I run the receiver in 5 channel stereo, and turn off any signal processing that I can.
Audio setup: I run 1/4" out of the booth outputs on the TTM57 into the Behringer mixer (this is for the stream audio). Then I have RCA -> 1/8" from the aux out on the TTM57 into the aux input on my receiver for my 'monitors.' I run the mic (XLR) into the Behringer mixer as well. The Behringer connects via USB to my stream PC.
Camera setup: I either use an HDMI to USB3.0 capture card with my GH2 or a Logitech USB webcam. All it takes is plugging it into the stream PC. Easy enough.
OBS setup: There are a TON of YouTube and written tutorials to setup OBS, but they generally focus on gaming and not so much DJ'ing. I won't go into too much detail, but will point out stuff more particular for DJ'ing. This is my main OBS screen. Have everything plugged in and turned on before you open OBS to make sure it picks up your USB devices (USB mixer and camera). Should go without saying, but also make sure you have your drivers installed for the devices.
The only audio I want outputting to the stream is from the Behringer mixer, so the desktop audio and camera audio are muted. Aside from the camera and mixer, all of the other sources in my source window are optional. (If you're curious as to why Winamp is in there, I can add details on that in a later post)
Video bitrate will depend on your ISP, your upload speed, and your streaming PC hardware. I've had to drop mine down to 2500kbps from my usual 3500kbps recently. I guess with everyone at home using the interwebs, my connection seems a lot more unstable than even a month ago. I set the audio bitrate to 320kbps, but I think Twitch ends up compressing it to 192kbps for viewers. Recording settings are optional, I only recommend streaming and recording at the same time if you have a decently powerful streaming computer. Better to record just the audio in your DJ software to upload the mix later. Twitch will mute any replays with copywritten material, so I upload to Mixcloud for archiving. I run the mic through the Behringer mixer versus the mic input on my Rane mixer because I talk to chat, and it's annoying listening back to mixes with me yammering through parts. My GPU recently kicked the bucket (still works on default Windows drivers...which has caused some bottlenecks when it comes to streaming, but I can still do it) so for now I'm using software encoding, but if you have the option for hardware encoding, use it.
Leave your base canvas at 1920x1080, but you want your output at 1280x720. I haven't really noticed a difference in the various downscale filters, but bicubic is what I use. 30fps is best for your viewers, as it's less demanding than running 60fps, but that's really up to you.
Twitch takes some getting used to; whether it's the website itself or the community/culture. The music community is very welcoming (especially now), and I encounter far less trolls there than in gaming channels. There's a lot of people there now trying to figure everything out, so don't feel like you're late to the party. If you want to try to make some money, you'll want to setup a donation site. Can be a simple PayPal link, Bitcoin link, or you can use something like streamelements or streamlabs. Those two extensions add other things like chatbots, commands (ie: a viewer can type !mixcloud in my chat will send a message in chat with my Mixcloud link), followesubscribedonator notifications. All of those are customizable, but I'd recommend just using the default stuff before making custom notifications and such. It can be a bit of a time sink..but then again I guess we got nothing but time right now. After you get up and going with a few streams, set your sights on reaching affilate. It's not that difficult to get, nor do you lose it if you don't keep up with the requirements to get it. You can then make custom channel emotes (again, another time sink, or there are a ton of artists out there that can make them for you) and accept subscriptions and bits.
Twitch is owned by Amazon, so if you're a Prime member, link your Amazon account and you get a free subscription you can give to one streamer per month. It doesn't auto renew, so you can change it every month, but it is a nice 'gift' to give to streamers to help support them. Dark Sith Lord Bezos does take 50% of the $5/month cost of a base subscription (whether a Prime sub or paid for), so if you really want to help a streamer, use donations. But if you already have Prime, may as well throw the free sub around to someone.
At the end of your stream, you can 'raid' another streamer. All it is is taking your viewers and dumping them into the channel of another streamer. I generally try to find other DJ's that are playing the same/similar genre that I think my viewers would stick around for; or just other DJ's I like. Then there's 'hosting.' That is when you are offline, but your channel is playing another stream. There are auto-host settings so that you don't have to manually host channels while you're offline. Between being raided (it's pretty much random and up to other streamers; don't beg) and raiding others, it's kind of the best way to get your channel out and exposed. But, don't make it about view counts or followers. Do it because you want to mix, no other reason. The music section has all of a sudden been saturated by DJ's/record labels due to the pandemic; there's a lot of people new to Twitch who don't know there's a bunch of other DJ's in the music category, so just keep going and you'll find an audience.
I love streaming on Twitch. I've done several 6+ hour streams in my time there. If you come from only playing out live, it's a big adjustment. There's no crowd energy to work off of; sometimes chat can give that to you, but it can be hard when you're just in your room by yourself. I personally find it hard to mix heavieharder stuff for more than 30-45 minutes at a time, so a lot of my mixes have been more chill and kind of downtempo as I can stay in that vibe for longer periods. I've met a lot of really awesome DJ's in my time there, and it's great seeing so many more looking for a creative outlet now that we're on global quarantine. Hopefully after some semblance of normality is restored, people will continue to livestream and the viewers keep coming back. I know this has been a giant wall of text, so apologies, but hopefully it gives someone something to go off of. Let me know if anyone has any specific questions or needs clarification on anything. Happy streaming!
Bitcoin Core 0.20.0 Released. Bitcoin Core 0.20.0 is now available with multiple improvements. bitcoincore.org hidden service. After frequent requests, this site is now reachable as a Tor hidden service Bitcoin Core 0.19.1 Released. The Bitcoin Core 0.19.1 maintenance release is now available with bug fixes and minor improvements. Bitcoin uses: SHA256(SHA256(Block_Header)) but you have to be careful about byte-order. For example, this python code will calculate the hash of the block with the smallest hash as of June 2011, Block 125552. The header is built from the six fields described above, concatenated together as little-endian values in hex notation: >>> import hashlib >>> header_hex = ("01000000 ... For more info, check the How does Bitcoin Work page on the official Bitcoin site, and the video above. Setting Up Your Bitcoin Wallet. Before you start using Bitcoins, you'll need a Bitcoin wallet. A Bitcoin wallet is where you send and receive Bitcoins. Within every wallet, a Bitcoin user is given a unique address that can be used to send and ... That does not, however, mean that bitcoin is “legal tender” – so far, only Japan has gone as far as to give bitcoin that designation. However, just because something isn’t legal tender ... Bitcoin developers have been working to reduce transaction malleability among standard transaction types, one outcome of those efforts is BIP 141: Segregated Witness, which is supported by Bitcoin Core and was activated in August 2017. When SegWit is not being used, new transactions should not depend on previous transactions which have not been added to the block chain yet, especially if large ...
USE THIS LINK TO SIGN UP TO EOBOT: https://www.eobot.com/new.aspx?referid=911690 In this video I show you my workflow to earn crypto currencies with eobot. J... This video is unavailable. Watch Queue Queue I was commissioned by the people over at Life on Bitcoin to create this 2 min motion graphic explaining the ins and outs of Bitcoin. Mix Play all Mix - Udacity YouTube; How I ... But how does bitcoin actually work? - Duration: 26:21. 3Blue1Brown Recommended for you. 26:21. GitLab Beginner Tutorial 3 How to Fork a project ... This video is unavailable. Watch Queue Queue. Watch Queue Queue