Not sure how I wanted to do HUD for gun mechanics so I mocked something up:
[IMG]http://puu.sh/hGBtZ/3f2e35c5ab.gif[/IMG]
[img]http://puu.sh/hGOQp/16d652e270.gif[/img]
I renamed the game from Block Kingdom to Your Obliteration, and I also redid the entire thing. Hopefully it was worth it!
[video=youtube;ga43XjxERIM]http://www.youtube.com/watch?v=ga43XjxERIM[/video]
I'm having a bit of trouble coming up with an algorithm to implement [URL="https://github.com/TheBerkin/Rant/issues/59"]this feature[/URL] for Rant. Any ideas on how I could achieve this without writing something horribly slow?
[img]http://a.pomf.se/htdkhb.gif[/img]
the programmer art is real
but really: how do i do this perspective without just seeing the top of a head
[QUOTE=NixNax123;47688822][img]http://a.pomf.se/htdkhb.gif[/img]
the programmer art is real
but really: how do i do this perspective without just seeing the top of a head[/QUOTE]
It's perfect. Just imagine he's slithering across the floor on his back.
Not really related to programming, but this morning I woke up and one of my monitors was displaying a "CHECK SIGNAL" error. I checked the basics first, a different graphics card port, different DVI cable, and it was still unique to that monitor, meaning it had to have something to do with that. Having had problems with this monitor before, where the capacitors would die after a few years, I figured it might be something like that, so I picked it apart piece by piece and studied the circuit boards trying - with what limited knowledge I have of EE - to figure out if any of the parts looked broken.
After having spent 10 minutes taking it apart and staring at it for another 20, and only noticing one thing sort of out of the ordinary, that the DVI input port had shifted half a milimeter, I gave up and decided to actually google the problem...
Turns out I had hit the "SOURCE" button by accident and it was looking for analog signal this whole time. There's no real moral to the story, except maybe that just because you know about clever solutions to difficult problems doesn't mean that what you're dealing with is a difficult problem. Or maybe it's just that you should always google first v:v:v
[QUOTE=Berkin;47688827]It's perfect. Just imagine he's slithering across the floor on his back.[/QUOTE]
[url=http://tinycartridge.com/post/67483120560/heres-the-trick-behind-the-new-zeldas-tilted]Design your assets to replicate a slanted orthography.[/url]
[editline]8th May 2015[/editline]
Actually, that's not entirely true either, but it addresses the issue for the most part. If you look back at games that have this "perspective" you'll notice a few things, but mainly that it's not consistent. While buildings won't adhere to this perspective, characters will, and further more landscapes do their own thing entirely.
The best advice I have, after studying this for months to figure out how to accurately replicate it from a technical design perspective, is to just design your assets in harmony to each other until it feels right. Avoid head-on angles for the most part.
[QUOTE=andrewmcwatters;47688834][url=http://tinycartridge.com/post/67483120560/heres-the-trick-behind-the-new-zeldas-tilted]Design your assets to replicate a slanted orthography.[/url][/QUOTE]
This is really useful, thanks! So basically, it means (it 2D at least) to design from a shallow angle off the top, towards the front. Nice!
More CURSES fun! [url]https://gist.github.com/JohnnyonFlame/807ed61988d2efe774dd[/url]
[img]http://i.imgur.com/z38l6Cq.png[/img]
[QUOTE=Berkin;47688762]I'm having a bit of trouble coming up with an algorithm to implement [URL="https://github.com/TheBerkin/Rant/issues/59"]this feature[/URL] for Rant. Any ideas on how I could achieve this without writing something horribly slow?[/QUOTE]
If you can state the problem as something that doesn't require knowledge of Rant, maybe more people could try and help. I'd give it a shot.
[QUOTE=Dr Magnusson;47688831]Not really related to programming, but this morning I woke up and one of my monitors was displaying a "CHECK SIGNAL" error. I checked the basics first, a different graphics card port, different DVI cable, and it was still unique to that monitor, meaning it had to have something to do with that. Having had problems with this monitor before, where the capacitors would die after a few years, I figured it might be something like that, so I picked it apart piece by piece and studied the circuit boards trying - with what limited knowledge I have of EE - to figure out if any of the parts looked broken.
After having spent 10 minutes taking it apart and staring at it for another 20, and only noticing one thing sort of out of the ordinary, that the DVI input port had shifted half a milimeter, I gave up and decided to actually google the problem...
Turns out I had hit the "SOURCE" button by accident and it was looking for analog signal this whole time. There's no real moral to the story, except maybe that just because you know about clever solutions to difficult problems doesn't mean that what you're dealing with is a difficult problem. Or maybe it's just that you should always google first v:v:v[/QUOTE]
The part about clever solution is very real though. I know from experience that it can be too easy to assume that you have this really smart solution to this complicated problem, so you go ahead and and solve the problem in the wrong way.
I did this back when I wrote a migration system for Ubuntu 12.04.X to Ubuntu 14.04.2 (with all service configuration files migrated too, even if they had been changed). Now the problem isn't all that simple, however in an attempt to upgrade the distribution, I found that dist-upgrade kept fucking shit up, so I started doing all kinds of workarounds, wrote about 50 lines of shell script to make it do what I wanted it to.
However, after testing, it turned out that my clever solution didn't work all the time.
In reality, it wasn't very clever at all, even though I at the time believed it to be.
Turns out, that not a lot of signature keys had been changed on the repository servers (if any?), so simply changing the distro name in the /etc/apt/sources.list, and forcing a non-interactive dist-upgrade with automatic default answers let me pull it through.
This was just 3 simple lines of shell script.
I do believe that there's something about this whole complexity thing, where things that seem simple, are often about as simple as they can be. Only sometimes we look at the problems from the wrong angles, or we believe we're looking at a different problem entirely, so the solution becomes a weird product of being unable to identify what you're solving.
[QUOTE=NixNax123;47688840]This is really useful, thanks! So basically, it means (it 2D at least) to design from a shallow angle off the top, towards the front. Nice![/QUOTE]
It's really silly isn't it! But yep, that's it. I'm a big dummy, and I only adhere to this part of the time, so I guess from that point of view, the characters in VA are suppose to be comically tall or something.
[t]http://i.imgur.com/defDgHX.png[/t]
I started making shadows for the walls, almost looks right!
[IMG]http://i.imgur.com/gGE9cqV.png[/IMG]
[QUOTE=Sidneys1;47684475]It'd be cool to see this for the U.S. Primaries. Starting it early and providing long-term statistics would be unbelievably cool.[/QUOTE]
Oh yes, that's a fantastic idea. FWIW, I run Karambyte with KillerLUA.
The one for GE2015 was built in an hour or two after the polls closed and released as the first constituency results were coming in: wish we would have had the idea earlier so we could do the longer term statistics! We're from the UK, so I guess I'd better get researching into how primaries work!
My only gripe about GDB is how hard it is to see the contents of vectors. That said, I found a glaring issue with my homework, and I've now fixed it. Behold, the Dijkstra step-by-step table and link state routing forwarding table C++ application:
[IMG]http://i.imgur.com/z6TyvUK.png[/IMG]
For a homework assignment, of course. Goddamn that's a lot of number crunching. Doing Dijkstra's step by step in your head is a lot easier than in code.
Just to give you an idea of whats going on there
[video=youtube;ZHWxb5hHBJ4]http://www.youtube.com/watch?v=ZHWxb5hHBJ4[/video]
[QUOTE=Darwin226;47689422]If you can state the problem as something that doesn't require knowledge of Rant, maybe more people could try and help. I'd give it a shot.[/QUOTE]
Sure.
I'm trying to write an algorithm that keeps track of word combinations being used within a specific subset of a textual output, for example, a list of first/last names, and prevents that list from repeating any specific combination of words. It would allow for individual words to be repeated (many people could share the same last or first name), but no combination may appear more than once in the defined range.
The biggest problem I'm facing here is that the most obvious solution is rather unoptimal: I could, of course, go through all previously used combinations and perform a sequence equality check, regenerating until I get an unused one, but that would likely get exponentially slower with each added combination. I could partially optimize this by separating lists of combinations with varying length, because two combinations with different lengths are obviously never going to match. But that likely won't matter in most places I'd use this.
And that's where I'm stuck. I feel like there must be a better way to do this without checking every single used combination or recalculating the current combination over and over. I don't want to rely on an increasingly smaller random chance to get an acceptable output.
[QUOTE=Berkin;47691314]Sure.
I'm trying to write an algorithm that keeps track of word combinations being used within a specific subset of a textual output, for example, a list of first/last names, and prevents that list from repeating any specific combination of words. It would allow for individual words to be repeated (many people could share the same last or first name), but no combination may appear more than once in the defined range.
The biggest problem I'm facing here is that the most obvious solution is rather unoptimal: I could, of course, go through all previously used combinations and perform a sequence equality check, regenerating until I get an unused one, but that would likely get exponentially slower with each added combination. I could partially optimize this by separating lists of combinations with varying length, because two combinations with different lengths are obviously never going to match. But that likely won't matter in most places I'd use this.
And that's where I'm stuck. I feel like there must be a better way to do this without checking every single used combination or recalculating the current combination over and over. I don't want to rely on an increasingly smaller random chance to get an acceptable output.[/QUOTE]
-snip-
didn't read properly
[QUOTE=Protocol7;47686502][t]http://i.imgur.com/yLosUQe.png[/t]
Fuckin' Dijkstra's, man. Specifically for link state routing algorithm.
I have no idea if it's mathematically correct, but it's consistent with my teacher's example... Also could probably clean up my code a bit, it took 480 lines to calculate and write this table.
Next up is a forwarding table, but I have a data structure that stores the starting node, destination node, shortest route to the node and length of the path, so that should be fairly easy.[/QUOTE]
If you want to know if it's mathematically correct, just hit up this procedure!
[T]http://i.imgur.com/64Xh5Q5.png[/T]
[QUOTE=Berkin;47691314]Sure.
I'm trying to write an algorithm that keeps track of word combinations being used within a specific subset of a textual output, for example, a list of first/last names, and prevents that list from repeating any specific combination of words. It would allow for individual words to be repeated (many people could share the same last or first name), but no combination may appear more than once in the defined range.
The biggest problem I'm facing here is that the most obvious solution is rather unoptimal: I could, of course, go through all previously used combinations and perform a sequence equality check, regenerating until I get an unused one, but that would likely get exponentially slower with each added combination. I could partially optimize this by separating lists of combinations with varying length, because two combinations with different lengths are obviously never going to match. But that likely won't matter in most places I'd use this.
And that's where I'm stuck. I feel like there must be a better way to do this without checking every single used combination or recalculating the current combination over and over. I don't want to rely on an increasingly smaller random chance to get an acceptable output.[/QUOTE]
I might be missing something major, because it sounds like you just need to hash the full combination and throw it in a set?
I don't think the decreasing chance of getting a match would be a problem, unless of course you completely run out of combinations to try (which can be tested against by checking if the size of the set is N*M). In my mind, doing this shouldn't be more than two array lookups, a hash and a compare per try, and that shouldn't take all too long to do.
That said, I can definitely understand why you feel that is a deal-breaker.
I need a new project to work on
following this,
[quote]This simple project will essentially create a simulation of an ATM within a Windows program. Just like an ATM, the program should have at least the following features:
Check whether an input – i.e. an ATM card (here, say, a debit/credit card number) – is recorded correctly.
Verifying user by asking for a PIN number.
In case of negative verification, logging out user.
In case of positive verification, showing multiple options, including cash availability, previous five transactions, and cash withdrawal.
Give user ability to withdraw up to $1000 worth of cash in one transaction with total transactions limited to 10 per day.[/quote]
I made this
[url]https://gist.github.com/predme/29613564408074ed246e[/url]
[url]https://gist.github.com/predme/09ed2d6dea52a8f7167f[/url]
I'm not sure if I'm doing the OOP programming correctly, but it feels like a step in the right direction. of course it's most likely not the most beautiful code out there, but I'm happy I managed to finish it with the desired output. got me introduced to lists, queues and stacks so I feel like I learned something from it
[QUOTE=Berkin;47691314]Sure.
I'm trying to write an algorithm that keeps track of word combinations being used within a specific subset of a textual output, for example, a list of first/last names, and prevents that list from repeating any specific combination of words. It would allow for individual words to be repeated (many people could share the same last or first name), but no combination may appear more than once in the defined range.
The biggest problem I'm facing here is that the most obvious solution is rather unoptimal: I could, of course, go through all previously used combinations and perform a sequence equality check, regenerating until I get an unused one, but that would likely get exponentially slower with each added combination. I could partially optimize this by separating lists of combinations with varying length, because two combinations with different lengths are obviously never going to match. But that likely won't matter in most places I'd use this.
And that's where I'm stuck. I feel like there must be a better way to do this without checking every single used combination or recalculating the current combination over and over. I don't want to rely on an increasingly smaller random chance to get an acceptable output.[/QUOTE]
How about this:
Say you're generating sequences of 3 letters of the alphabet A, B,
The idea is to generate a tree of possible sequences. Initially the tree looks like
[img]http://i.imgur.com/rmJOHyM.png[/img].
Each generation of a sequence is actually a descent down this tree. Equivalently, we can identify a sequence with a leaf in the tree. We assign each leaf a weight of 1 and each parent a weight equal to the sum of weights of it's children.
Let's say the first sequence we generate is AAA. We use this information to prune the tree and update the weights. We remove the AAA path. This leaves the following arrangement.
[img]http://i.imgur.com/Ia3YRR1.png[/img]
Now, to generate the second sequence, we again pick the first, then the second, then the third letter (or branch, in this case), but we include the new weights in the random choosing process. Immediately, B is slightly more likely to be chosen as the first letter, but if A is chosen, the second letter is MUCH more likely to be B. Again if A is chosen as the second letter, B is the only choice for the third.
Now it obviously isn't viable to construct this giant tree with your dictionary sizes, but you can lazily generate only the parts you use. I definitely wouldn't call that trivial, but it should be doable.
Alternatively Berkin, you can generate every available combination to begin with, shuffle the list, and then just go through them as new ones are needed. This approach is a little more size intensive, but it guarantees that you will never have a name collision, unless you loop over it more than once.
I wrote some sample code (in C++ though), which shows what I mean:
[cpp]
const std::array<std::string, 6> first_names = {
"John",
"Jim",
"James",
"Tom",
"Tim",
"Thomas",
};
const std::array<std::string, 6> last_names = {
"Johnson",
"Smith",
"Anderson",
"Goldstein",
"Roosevelt",
"Hardy"
};
int main()
{
std::vector<std::pair<int, int>> combinations(first_names.size() * last_names.size());
// Generate all valid combinations
for (int first = 0u; first < first_names.size(); first++)
for (int last = 0u; last < last_names.size(); last++)
combinations[last_names.size() * first + last] = std::make_pair(first, last);
// Shuffle all the combinations so you don't get all the Johns first
std::random_shuffle(combinations.begin(), combinations.end());
// Print them all linearly
for (auto &name : combinations)
std::cout << first_names[name.first] << " " << last_names[name.second] << std::endl;
return 0;
}
[/cpp]
[QUOTE=proboardslol;47691413]I need a new project to work on[/QUOTE]
Planimeter just brought on [url=http://www.andrewmcwatters.com/planimeter/]two new volunteer developers recently,[/url] if you're interested in [url=https://github.com/Planimeter/grid-sdk]game dev stuff.[/url]
The contributions they made brought Grid to v1.0.0-beta just this weekend.
You could do without the weights entirely, but I'm pretty sure this would ruin the uniformity of the random generation.
[QUOTE=Berkin;47691314]Sure.
I'm trying to write an algorithm that keeps track of word combinations being used within a specific subset of a textual output, for example, a list of first/last names, and prevents that list from repeating any specific combination of words. It would allow for individual words to be repeated (many people could share the same last or first name), but no combination may appear more than once in the defined range.
The biggest problem I'm facing here is that the most obvious solution is rather unoptimal: I could, of course, go through all previously used combinations and perform a sequence equality check, regenerating until I get an unused one, but that would likely get exponentially slower with each added combination. I could partially optimize this by separating lists of combinations with varying length, because two combinations with different lengths are obviously never going to match. But that likely won't matter in most places I'd use this.
And that's where I'm stuck. I feel like there must be a better way to do this without checking every single used combination or recalculating the current combination over and over. I don't want to rely on an increasingly smaller random chance to get an acceptable output.[/QUOTE]
A constant-memory solution exists: Generate a PRNG with a period equal to your number of combinations.
Unfortunately coming up with PRNGS which have specific periods isn't very easy, and you'd be practically limited to using LCGs.
[QUOTE=NicDasomeone;47691395]If you want to know if it's mathematically correct, just hit up this procedure!
[T]http://i.imgur.com/64Xh5Q5.png[/T][/QUOTE]
Yeah, I had about a dozen different references on the algorithm I was looking at. Unfortunately not even our textbook describes how to get that table format, and my teacher is forcing us to use a certain graph structure, so it's one thing to follow the algorithm and a completely different one to implement it.
In all, 580 lines of code for Dijkstra's and output.
[QUOTE=polkm;47690653]I started making shadows for the walls, almost looks right!
[IMG]http://i.imgur.com/gGE9cqV.png[/IMG][/QUOTE]
How did you get that color shift effect?
[QUOTE=Ac!dL3ak;47692463]How did you get that color shift effect?[/QUOTE]
chromatic aberration
Sorry, you need to Log In to post a reply to this thread.