Everything posted by Hedgehog
- Today...
-
Tomorrow
We had a guy on our campus named Dennis who would ride around on his bike wearing short shorts and sexually harassing everyone and shouting about the apocalypse or something
- Today...
-
What are you listening to right now!?
An album that has aged surprisingly well and really slipped through the cracks: Youtube HD Video - This video will cause high CPU usage, to view the video in a lower quality, please click .
-
What are you listening to right now!?
You just have to use the video id
-
What are you listening to right now!?
The Pineapple Thief is releasing another album Youtube HD Video - This video will cause high CPU usage, to view the video in a lower quality, please click . I'm not that into it
- Today...
-
Today...
I'd steer you away from using a double to handle stacks of items. You're going to run into so many problems related to precision and it's just not going to be fun to deal with. Most databases have a type specifically for money, which is usually an 8 byte integer with 4 digits of precision. I'd strongly recommend using that As far as avoiding duplicates, do some research into idempotent transactions. Basically, you just want to ensure that inserting something twice has the same result as inserting it a single time. Probably the easiest way to accomplish this is by assigning an item a UUID when it spawns, then using that as the primary key in a (uuid, quantity, item_id, player_id) table. That would prevent the same item being picked up by two players and one player trying to pick up an item twice. If you aren't using a relational database, just use the UUID as a key in a hash or whatever you have available. Then the only other major problem is handling cases where someone tries to pick up a bunch of items at once, but only has room for some of them, but that should be easy enough for you to handle.
-
Today...
Sorry I was rushing to post that before I left the office. On the accuracy distribution: I would set the probability of hitting to between(A, D, mean: (A + D)/2, std Dev: 30ish) + 0.5. Then when A = D, you have a 50% accuracy. At around A - D = 40, you hit 100%, with a nice curve in between
-
Today...
In Runescape, the xp between levels grows exponentially according to c * 2level/n, where n is how many levels it takes for the xp between levels to double (RS uses n = 7) and c is the scaling factor (RS uses c = 75). Then the total xp required for a level is just a summation. So you should be able to throw that into a spreadsheet, then play with values of n and c. I had success using c = 250 and n = 5. Setting n to 5 makes sense since you want tiers to come every 10 levels, so you'd have to quadruple your xp to advance a tier. Setting c to 250 gets you close to the max int at level 100, but still gives you plenty of breathing room. In practice, I'd use c = 251 and n = 5.1 or something like that, just so that it doesn't feel so formulaic. For refining, I wouldn't overthink it. Just make a Necronorium bar tier 71, a Necro sword tier 72, ..., and a Necro platebody tier 75. Or you could add another exponential function to it, so a bar might be 250 * 2 level/5 + 25 * 2level/5. Both accomplish similar things, but I think the first one is more straightforward and requires less analysis. Accuracy: Runescape just rolls a number between 0 and Attack and compares it to 0 and Defense. The math is fairly straightforward calculus: if you have max attack and defense rolls A and D, and samples of these rolls a and d, then when A > D, you integrate (A - d)/(A * D) from 0 to D (or 1 to D if you can't roll a 0) and when D > A, you integrate (A - a)/(A * D) from 0 to A. This works because (A - d) is the number of rolls where d is less than A and (A * D) is the total number of rolls. If you picture it in your head (A * D) is a rectangle, and (A - d) is a triangle cut into it, so you want the area of the triangle divided by the area of the rectangle to get the probability of hitting. If d can be bigger than A, then the triangle extends below the x axis, so you calculate 1 - the chance of missing instead. This gives you something of the form 1/x, so you get diminishing returns as one value grows larger than the other. That's really nice for balancing, since a tier 100 weapon wouldn't be significantly more accurate than a tier 90 weapon against level 50 armor. However, what you're describing sounds a little like you want a normal distribution with a std deviation of 10. So you'd calculate the probability of landing outside of A and D if the std deviation is 10 and the mean is (A + D) / 2. You'll have to play around with that to get what you want, but it's a good place to start. I'd make strength normally distributed too, so that you tend to hit high and low rarely, but mostly in the middle
- Today...
- Today...
- Today...
-
What are you listening to right now!?
21st Century Breakdown has aged like fine wine in the 9 years since it was released
-
"I want a girlfriend/boyfriend", and other such relationship advice
Honestly great shoes
-
What are you listening to right now!?
Early AOTY 2018 candidate: Expectations by Hayley Kiyoko
- Today...
- Today...
- Today...
- Today...
-
Today...
Learning to write maintainable code is the most important thing and I wish it was talked about more in school. If your code is a little slow or isn't structured that well or is hard to use, there are plenty of amazing engineers in the building who can help you. There isn't much we can do though if your code is hard to read, isn't tested or documented, or if there aren't comments explaining why you made the choices you made. Understanding how to use git correctly goes a long way too.
- Today...
-
Today...
You can use the youtubehq tag, i.e. [youtubehq]Y4lnZr022M8[/youtubehq] &hl=en&ap=%2526fmt%3D18">&hl=en&ap=%2526fmt%3D18" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"> vs It's easier to just post the link and hit the button in the address bar though
- Today...
-
What are you listening to right now!?
We can all agree that the best song ever made is Best Years of Our Lives by Baha Men